diff options
Diffstat (limited to 'winsup/CVSChangeLogs.old')
32 files changed, 88573 insertions, 0 deletions
diff --git a/winsup/CVSChangeLogs.old/ChangeLog-2015 b/winsup/CVSChangeLogs.old/ChangeLog-2015 new file mode 100644 index 000000000..4756573aa --- /dev/null +++ b/winsup/CVSChangeLogs.old/ChangeLog-2015 @@ -0,0 +1,635 @@ +2014-11-13 Corinna Vinschen <corinna@vinschen.de> + + * configure.ac: Convert to new AC_INIT style. + * configure: Regenerate. + +2014-08-07 Yaakov Selkowitz <yselkowi@redhat.com> + + * Makefile.common (COMPILE.cc): Add -fno-use-cxa-atexit. + +2014-02-18 Christopher Faylor <me.cygwin2014@cgf.cx> + + * Makefile.in: Ignore errors on doc install. + +2013-01-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common: Don't drop -gFOO switches when filtering CFLAGS + and CXXFLAGS. + +2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * Makefile.in: Properly cd to directory sans install_ prefix. Report + on errors on doc install. Only 'all' is special. + +2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * configure.ac: Detect windows headers/libs after we've figured out the + C compiler. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * configure.cygwin: Default to '.' if can't find a winsup directory. + +2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * Makefile.in: Reinstate ignoring of errors for doc target. + +2013-06-18 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common: Add rule to build assembler code. + (.SUFFIXES): Add .S. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in (Makefile): Rely on 'configure' not 'configure.in'. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.ac: Rename from configure.in. + * configure.in: Delete. + * configure: Regenerate. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * ccwrap: Don't drop mingw header file paths unless we've specified + them with --with-windows-headers. + +2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.common: Revamp for new configury. Add default compilation + targets, include .E processing. Add magic for allowing "CFLAGS" to + control optimization options in "CXXFLAGS". + * configure.cygwin: New include for Cygwin configure.in's. + * acinclude.m4: Delete old definitions. Implement AC_WINDOWS_HEADERS, + AC_WINDOWS_LIBS, AC_CYGWIN_INCLUDES, target_builddir, winsup_srcdir. + * aclocal.m4: Regenerate. + * autogen.sh: New file. + * ccwrap: New script. + * c++wrap: New script. + * config.guess: New script. + * config.sub: New script. + * configure: Regenerate. + * configure.in: Eliminate LIB_AC_PROG_* calls in favor of standard. + Delete ancient target test. + * install-sh: New script. + +2012-11-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * mingw: Delete obsolete directory. + * w32api: Ditto. + +2012-11-07 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common (zlib_source): Remove. + (zlib_build): Remove. + (bz2lib_source): Remove. + (bz2lib_build): Remove. + (w32api_source): Remove. + (w32api_build): Remove. + (w32api_lib): Remove. + (mingw_build): Remove. + (mingw_source): Remove. + ($(w32api_lib)/%.a): Remove rule. + * Makefile.in (ZLIB): Remove. + ($(SUBDIRS)): Drop mingw check. + (mingw): Remove rule. + (install_mingw): Ditto. + * configure.in: Remove support for mingw as build target. + * configure: Regenerate. + +2012-10-24 Kai Tietz <ktietz70@googlemail.com> + Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + Corinna Vinschen <corinna@vinschen.de> + + * configure.in [cygwin*]: Always build cygserver, lsaauth, + utils, and doc. Do not build mingw or w32api. + [mingw*]: Build w32api if present. + * configure: Regenerate. + * Makefile.common: Remove references to mingw and w32api + directories. + (MINGW_LDFLAGS): Redefine as -static to force static linking + with libgcc and libstdc++. + * Makefile.in: Remove references to mingw and w32api directories + from Cygwin targets. + +2012-07-30 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.common (CFLAGS_COMMON): Add temporary define to work around + w32api problem. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common (ALL_CFLAGS): Change := to = to allow overriding in + dependent Makefiles. + +2012-01-09 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common (MINGW_LDFLAGS): Correctly use -L rather than -B here. + +2011-04-19 Corinna Vinschen <corinna@vinschen.de> + + * COPYING: Replace with the GPLv3 definition. + * CYGWIN_LICENSE: Move Cygwin to GPLv3+. Align text to FSF speak. + +2011-01-28 Peter Foley <jpfoley2@verizon.net> + + * configure.in: Configure winsup/cygserver regardless of cross_host. + * configure: Regenerate. + +2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com> + + * Makefile.common (COMPILE_CXX): Add support for per-file overrides + to exclude $(nostdinc) and $(nostdincxx) from compiler flags. + (COMPILE_CC): Likewise for $(nostdinc). + +2009-02-23 Sjors Gielen <mailinglist@dazjorz.com> + + * Makefile.in: Add DESTDIR functionality. + +2009-01-21 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Remove --enable-server option. Allways add the + cygserver directory to $SUBDIRS. + * configure: Regenerate. + +2008-10-12 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Revert erroneous checkin. + * Makefile.common: Tweak to work better with new utils/mingw front-end. + +2008-10-11 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Tweak to work better with new utils/mingw front-end. + +2008-05-16 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (install-license): Install COPYING file as well. + +2008-05-16 Corinna Vinschen <corinna@vinschen.de> + + * CYGWIN_LICENSE: New text. + +2007-08-31 Christopher Faylor <me+cygwin@cgf.cx> + + * configure: Regenerate. + +2007-07-06 Corinna Vinschen <corinna@vinschen.de> + + * CYGWIN_LICENSE: Fix URL to world-wide offices. + +2007-07-06 Corinna Vinschen <corinna@vinschen.de> + + * CYGWIN_LICENSE: Fix URL to open source definition. + +2006-12-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (subauth): Drop rule. + * configure.in: Remove subauth related check. + * configure: Regenerate. + +2006-11-27 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add dependencies for lsaauth. + * configure.in: Disable building subauth. Add building lsaauth. + * configure: Regenerate. + +2006-08-30 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Make install-license .PHONY. Make sure that doc + directory is created before copying to it. + +2006-08-30 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Make installation of CYGWIN_LICENSE configurable. + * aclocal.m4: Regenerate. + * configure.in: Add GCC_NO_EXECUTABLES call. Add configuration for + INSTALL_LICENSE. Make cygwin subdirectory optional. Add sanity + check for cygwin resp. mingw subdirectories dependent of the target. + * configure: Regenerate. + +2006-08-02 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (subauth): Add dependency on mingw. + +2006-07-23 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Update copyright. Fix 'check' target so that it will + once-again create a working testsuite directory. Add a comment this + time to explain the unusual behavior. + +2006-07-14 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Reenable building the subauth subdir. + * configure: Regenerate. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * configure.in: Update to newer autoconf. + (thanks to Steve Ellcey) + * Makefile.in: Ditto. + * configure: Regenerate. + * acinclude.m4: New file. + * aclocal.m4: Ditto. + +2006-01-29 Christopher Faylor <cgf@timesys.com> + + * CYGWIN_LICENSE: Restrict to v2. + * COPYING: Add. + +2006-01-16 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add AC_PROG_INSTALL handling. + * configure: Regenerate. + * Makefile.in (install): Install CYGWIN_LICENSE. + +2006-01-16 Corinna Vinschen <corinna@vinschen.de> + + * CYGWIN_LICENSE: Fix contact information. + +2005-10-11 Christopher Faylor <cgf@timesys.com> + + * Makefile.common (CFLAGS_COMMON): Add -Wstrict-aliasing. + +2005-03-22 Christopher Faylor <cgf@timesys.com> + + * Makefile.common: Add -dD to options when creating preprocess files. + +2003-11-23 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Make cygserver depending on cygwin. + +2003-11-20 Christopher Faylor <cgf@redhat.com> + + * configure.in: Make --use-server the default. + * configure: Regenerate. + +2003-08-05 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Hmm. Older compilers seem to need -nostdinc. + +2003-08-05 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Don't use -nostdinc with g++. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Only use localhost when building mingw with distcc or + gcc won't be able to find .exp files on other hosts. + +2003-07-18 Vaclav Haisman <V.Haisman@sh.cvut.cz> + + * Makefile.common (CFLAGS_COMMON): Remove -march=i386. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * configure.in: Add --enable-server option. + * configure: Regenerate. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.common (CFLAGS_COMMON): Remove -Winline since it is too + noisy on newer versions of gcc. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * configure.in: Add cygserver subdir. + * Makefile.in: Ditto. + * configure: Regenerate. + + * Makefile.common: Remove debugging statements. + +2003-05-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common: Remove newlib_sys_include and + newlib_sys_include_include entirely. Set CRT0 to cygwin/crt0.o. + +2003-04-18 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Reorganize to try to allow lack of mingw/w32api to work. + +2003-04-11 Christopher Faylor <cgf@redhat.com> + + * Makefile.common (w32api_lib): Fix w32api detection. + +2003-03-28 Christopher Faylor <cgf@redhat.com> + + * Makefile.common (ALL_CXXFLAGS): Make normal '=' type variable so that + CXXFLAGS is properly interpreted. + +2003-03-17 Christopher Faylor <cgf@redhat.com> + + * Makefile.common (w32api_lib): Default to system w32api directory if + w32api is missing from source. + +2003-03-17 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Fix typo from previous checkin. + +2003-03-17 Christopher Faylor <cgf@redhat.com> + + * configure.in: w32api directory was already optional. Semi-revert + 2003-02-06 change. + * configure: Regenerate. + * Makefile.common: Don't specific -nostdinc if there is no w32api + directory. + +2003-03-09 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Avoid double slashes in GCC_INCLUDE. + +2003-02-12 Christopher Faylor <cgf@redhat.com> + + * MAINTAINERS: Remove out-of-date file. + +2003-02-06 Christopher Faylor <cgf@redhat.com> + + * configure.in: Make w32api directory optional. + * configure: Regenerate. + +2003-01-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common (MINGW_LDFLAGS): Add mingw/mingwex builddir. + +2002-12-21 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Don't attempt to pretty-print c++ errors. + +2002-12-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common: Define MINGW_LDFLAGS. + * configure.in: Reorder SUBDIRS to have mingw before cygwin. + * configure: Regenerate from configure.in. + +2002-09-27 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (check): Be more defensive when creating testsuite + config.status. + +2002-08-16 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Change COMPILE_C* definitions. + +2002-08-10 Earnie Boyd <earnie@users.sf.net> + + * w32sdk: New winsup module. + +2002-07-06 Christopher Faylor <cgf@redhat.com> + + * Makefile.common (MINGW_INCLUDES): Simplify. + (MINGW_CFLAGS): New. + (MINGW_CXXFLAGS): Ditto. + +2002-06-02 Christopher Faylor <cgf@redhat.com> + + * configure.in: Complain about lack of w32api directory. + * configure: Regenerate. + +2002-04-25 Christopher Faylor <cgf@redhat.com> + + * configure.in: Remove cinstall target. + * Makefile.in: Ditto. + * configure: Regenerate. + +2002-02-19 Christopher Faylor <cgf@redhat.com> + + * configure.in: Avoid building w32api or mingw if they don't exist. + * configure: Regenerate. + +2001-12-18 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Don't attempt to use zlib directory as a dependency if + it doesn't exist. + +2001-12-14 Christopher Faylor <cgf@redhat.com> + + * configure.in: Detect zlib subdirectory. + * configure: Regenerate + * Makefile.in: Exit immediately if a sub-make fails. + * Makefile.common: Add automatic rules for bz2lib and zlib. + +2001-11-04 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Force configure in testsuite directory if config.status + does not exist. + +2001-11-03 Christopher Faylor <cgf@redhat.com> + + * configure.in: Disable subauth directory test. + * configure: Regenerate. + * Makefile.in: Use MAKE variable in directory builds. + +2001-11-03 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add directory dependencies to ensure ordering when using + 'make -jN'. + +2001-11-03 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Remove preferred-stack-boundary setting since gcc + 2.95.3 doesn't work well with it. + +2001-11-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Add some stuff to common CFLAGS. + +2001-10-29 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Propagate 'clean' to subdirs properly. + +2001-10-26 Corinna Vinschen <corinna@vinschen.de> + + * configure: Regenerate, removing erroneous SUBDIRS substitution. + +2001-10-24 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Only build testsuite directory on first 'make check'. + * configure.in: Remove testsuite from SUBDIRS. + * configure: Regenerate. + +2001-10-12 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add -nostdinc to CXXFLAGS. + +2001-10-12 Christopher Faylor <cgf@redhat.com> + + * Makefile.common: Perform more include file testing trickery. + +Sun Oct 7 23:08:46 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Avoid adding -I options to compile if they already + exist in CC or C*FLAGS. This prevents warnings from newer versions of + gcc. + +Tue May 15 01:09:56 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Change method for finding current directory. + +Sat May 5 00:14:03 2001 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Fix typo. + * configure: Regenerate. + +Fri May 4 11:24:53 2001 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Make subauth configuration optional. + * configure: Regenerate. + +Fri May 4 15:06:00 Corinna Vinschen <corinna@vinschen.de> + + * subauth: New subdirectory. + * configure.in: Add subauth to the list of subdirectories. + * configure: Regenerated from configure.in. + +Wed Apr 18 18:45:07 2001 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Add bz2lib. + +2001-03-19 DJ Delorie <dj@redhat.com> + + * configure: fix regeneration bug. + +Thu Feb 22 13:36:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common: Revert previous change. + +Wed Feb 21 22:41:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.common: Add `-fvtable-thunks' to COMPILE_CXX. + +Sun Dec 3 00:21:31 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Eliminate checks for libgcc.a and libstdc++.a. Use + CXX for g++ compiles. + * configure.in: Find correct c++ compiler. + * configure: Regenerate. + +Mon Oct 23 00:50:02 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common (LIBGCC): Acommodate older gcc's that don't need + libstdc++.a. + +Sat Oct 21 18:01:22 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common (LIBGCC): Find libstdc++.a as well as libc.a since + builtin functions are in this library in newer gcc's. + +Sun Oct 1 22:02:38 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Extend VERBOSE default. + * Makefile.in: Don't clean the testsuite separately. It's already part + of CLEAN_SUBDIRS. + +2000-09-30 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Default to VERBOSE when part of overall source + tree build. + +2000-09-02 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Add new goal "check" + * configure.in: When doing native build do configure in + testsuite subdirectory + * configure: Regenerate. + +Fri Sep 1 10:15:37 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: More normalization. + +Thu Aug 31 16:37:31 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Normalize 'pwd' based on location of winsup. + +Thu Aug 24 15:02:26 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Add bupdir2 to reference above the i686-pc-cygwin + directory. + +Thu Jun 22 18:28:06 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add dummy info targets. + +Tue Jun 20 13:36:23 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Bow to necessity and build w32api before anything else. + * configure: Regenerate. + +Sat Jun 17 13:50:04 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Detect "cross-hosting" situation and add a subset of + directories to SUBDIRS. + * configure: Regenerate. + +Thu May 25 18:39:24 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Don't assume that cinstall directory exists. + * configure: Regenerate + +2000-05-24 DJ Delorie <dj@cygnus.com> + + * Makefile.common (%.o): further simplify, add "..." to make it obvious + it's an abbreviated command line. + +Thu May 18 14:33:05 2000 Christopher Faylor <cgf@cygnus.com> + + * MAINTAINERS: Add Corinna to general list. + +2000-04-17 DJ Delorie <dj@cygnus.com> + + * Makefile.common (srcdir): remove dependence on where pwd is + +Sun Apr 9 23:47:45 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Resolve srcdir to absolute path or it will confuse + usages when passed to submakes. Eliminate vestigal use of + MAKEOVERRIDES. + +Sun Apr 9 02:06:49 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Work around MAKEOVERRIDES problem with older versions + of make. + * Makefile.common: Ditto. + +Fri Apr 7 17:04:02 Ron Parker <rdparker@sourceware.cygnus.com> + + * configure.in: Added cinstall to the list of subdirs. + * configure: Regenerate. + +Thu Mar 30 23:45:00 2000 Christopher Faylor <cgf@cygnus.com> + + * MAINTAINERS: Add Ron Parker as maintainer of cinstall stuff. + +Sun Feb 6 18:15:44 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Do the standard CC/CFLAGS stuff for propagation to + sub-configures. + * configure: Regenerate. + +2000-01-26 DJ Delorie <dj@cygnus.com> + + * doc/Makefile.in: fix doctool -d options + +Fri Jan 21 12:51:32 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: No need to rerun Makefile if config.status changes. + That should happen automatically. + * Makefile.in: Ditto. + +Sat Jan 8 14:40:01 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Remove cygwin DLL specific stuff. Make Makefile + target PRECIOUS. + * Makefile.in: Make Makefile target PRECIOUS. + +Fri Jan 7 21:00:49 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.common: Remove cygwin DLL specific stuff. Correctly deal + with updir stuff when building in the same directory as the source. + +Thu Jan 6 19:04:35 2000 Christopher Faylor <cgf@cygnus.com> + + Create new directory structure + * Makefile.in: New file. + * configure.in: New file. + * configure: New file. + * Makefile.common: New file. + * cygwin: New directory. + * w32api: New directory. diff --git a/winsup/CVSChangeLogs.old/cygserver/ChangeLog-2015 b/winsup/CVSChangeLogs.old/cygserver/ChangeLog-2015 new file mode 100644 index 000000000..f0d6219a4 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygserver/ChangeLog-2015 @@ -0,0 +1,833 @@ +2015-02-23 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.cc: Handle default fetch_user_arg_type_t in switches + throughout to silence compiler. + +2015-01-28 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Simplify rule to build dependencies from cygwin dir. + +2015-01-19 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.h: Throughout, convert "struct thread" to "class thread". + * bsd_mutex.cc (_msleep): Fetch signal_arrived handle from thread's + ipcblk. + * process.h (class process): Drop _signal_arrived and align methods. + (process_cache::process): Drop signal_arrived parameter. + * process.cc (process::process): Ditto. Drop related code. + (process::~process): Drop closing signal_arrived handle. + (process_cache::process): Drop signal_arrived parameter in call to + process::process. + (thread::dup_signal_arrived): New method duplicating thread's + signal_arrived handle. + (thread::close_signal_arrived): New method closing thread's + signal_arrived handle. + * msg.cc (client_request_msg::serve): Drop signal_arrived parameter from + call to process_cache::process. Use thread constructor to initialize td. + * sem.cc (client_request_sem::serve): Ditto. + * shm.cc (client_request_shm::serve): Ditto. + +2014-11-06 Florian Friesdorf <flo@chaoflow.net> + + * cygserver-config: Add -N option to allow different service name. + +2014-08-15 Corinna Vinschen <corinna@vinschen.de> + + * configure.ac: Convert to new AC_INIT style. + * configure: Regenerate. + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (ipcexit_creat_hookthread): Delete shs in another error + case to make Coverity really happy (CID 59993). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * client.cc: Throughout, fix debug output of signed byte count value. + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (msleep_sync_array::~msleep_sync_array): New destructor + to make Coverity happy (CID 59838). + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (ipcexit_creat_hookthread): Delete shs to make + Coverity happy (CID 59993). + * transport_pipes.cc (transport_layer_pipes::listen): Make listen_pipe + and connect_pipe statics to make Coverity happy (CID 60010/60011). + +2014-04-16 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.cc (client_request_pwdgrp::pwd_serve): Add 1 to the message + length to account for the trailing NUL. + +2014-04-16 Corinna Vinschen <corinna@vinschen.de> + + * cygserver-config: Use numeric id 18 instead of "system" in chown. + +2014-04-07 Corinna Vinschen <corinna@vinschen.de> + + * process.cc (process::process): Only notice that signal_arrived is + NULL in debug output. + +2014-03-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (OBJS): Add pwdgrp.o. + * client.cc (client_request::handle_request): Handle + CYGSERVER_REQUEST_PWDGRP message. + * pwdgrp.cc: New file implementing CYGSERVER_REQUEST_PWDGRP. + +2014-03-12 Corinna Vinschen <corinna@vinschen.de> + + * Throughout, fix format specifiers in debug statements to accommodate + x86_64. + +2014-03-06 Corinna Vinschen <corinna@vinschen.de> + + * setpwd.cc (client_request_setpwd::serve): Use RtlSecureZeroMemory to + delete password from memory. + +2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * configure.ac: Detect windows headers/libs after we've figured out the + C compiler. + * configure: Regenerate. + * aclocal.m4: Regenerate. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details. + +2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Remove old from CFLAGS and move C*FLAGS so that they can + be manipulated by Makefile.common. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.ac: Rename from configure.in. + * configure.in: Delete. + * configure: Regenerate. + +2012-11-26 Corinna Vinschen <corinna@vinschen.de> + + * transport_pipes.cc (pipe_instance_lock_once): Remove. + (pipe_instance_lock): Remove. + (pipe_instance): Remove. + (initialise_pipe_instance_lock): Remove. + (transport_layer_pipes::accept): Drop entire pipe_instance handling. + (transport_layer_pipes::close): Ditto. + +2012-11-23 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.cc (main): Call listen right after creating the + transport. + * transport_pipes.cc (transport_layer_pipes::listen): Create + first instance of the named pipe here. Connect the client side + to block it for further use by the system. + (transport_layer_pipes::accept): Don't handle first pipe instance + here. Change debug output accordingly. + +2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Use /bin/mkdir to make install directories. + +2012-11-23 Corinna Vinschen <corinna@vinschen.de> + + * sysv_sem.cc (semundo_clear): Move condition to break from + inner loop to the right spot. + +2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Revamp for new configury. + * configure.in: Revamp for new configury. + * aclocal.m4: Regenerate. + * configure: Ditto. + * autogen.sh: New script. + +2012-10-25 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (adjust_identity_info): Fix typo in log message. + +2012-07-19 Corinna Vinschen <corinna@vinschen.de> + + * woutsup.h: Just include winlean.h. + +2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * client.cc: Revert sigproc.h inclusion since it was fixed elsewhere. + +2012-03-19 Corinna Vinschen <corinna@vinschen.de> + + * client.cc: Include sigproc.h if __INSIDE_CYGWIN__ is defined. + +2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * client.cc: Remove unneeded #include "sigproc.h". + +2012-02-14 Corinna Vinschen <corinna@vinschen.de> + + * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes): + Always use cygwin_internal to fetch installation key. + +2011-10-10 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.cc (print_usage): Align output to utilities in utils + directory. + (print_version): Ditto. + +2011-08-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * sysv_shm.cc (ACCESSPERMS): Remove to fix redefined warning, as + this is now defined in <sys/stat.h>. + +2011-02-07 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Remove AC_ALLOCA test and test for __builtin_memset. + * configure: Regenerate. + +2010-04-19 Christopher Faylor <me+cygwin@cgf.cx> + + * transport_pipes.cc: Include ntdef.h to accommodate cygerrno.h. + +2009-11-16 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygserver.exe): Link with -static to avoid linking + against cygstdc++-6.dll due to references to __cxa_pure_virtual. + +2009-11-06 Corinna Vinschen <corinna@vinschen.de> + + * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes): + Check cygwin_internal for returning 0 rather than for != 0. + (transport_layer_pipes::accept): Add debug output. + (transport_layer_pipes::connect): Ditto. + +2009-10-31 Corinna Vinschen <corinna@vinschen.de> + + * transport_pipes.h (PIPE_NAME_PREFIX): New define. + (PIPE_NAME_SUFFIX): Ditto. + (class transport_layer_pipes): Convert _pipe_name from char pointer + to wchar_t array. + * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes): + Accommodate the fact that _pipe_name is a wchar_t array, rather than + a char pointer. + (transport_layer_pipes::transport_layer_pipes): Initialize _pipe_name + with variable pipe name based in installation key fetched from Cygwin + DLL. + (transport_layer_pipes::accept): Call CreateNamedPipeW explicitely. + (transport_layer_pipes::connect): Call CreateFileW and WaitNamedPipeW + explicitely. + +2009-08-18 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (CXXFLAGS): Allow override. + +2009-03-26 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * README: Remove "How to use" section, as CYGWIN="server" is + no longer required. + +2009-03-20 Corinna Vinschen <corinna@vinschen.de> + + * cygserver-config: Remove misleading text describing the + "CYGWIN=server" setting for the client. + +2009-02-23 Sjors Gielen <mailinglist@dazjorz.com> + + * Makefile.in: Add DESTDIR functionality. + +2009-01-21 Corinna Vinschen <corinna@vinschen.de> + + * client.cc (allow_server): Remove variable. + (client_request_get_version::client_request_get_version): Drop checking + allow_server. + +2009-01-03 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (CFLAGS): Look in cygwin's build directory for header + files. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * setpwd.cc (client_request_setpwd::serve): Don't treat removing + non-existant private data as error. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * setpwd.cc (client_request_setpwd::serve): Explicitely erase password + buffer content after usage. + +2008-11-26 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (OBJS): Add setpwd.o. + * README: Explain new service to store passwords in the LSA registry + area. + * bsd_helper.cc (get_token_info): Make externally available. + * bsd_helper.h (get_token_info): Declare. + * client.cc (client_request::handle_request): Add case for + CYGSERVER_REQUEST_SETPWD request. + * setpwd.cc: New file implementing the CYGSERVER_REQUEST_SETPWD + request. + +2008-10-30 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Use -static-libgcc when creating cygserver.exe. + +2008-04-30 Corinna Vinschen <corinna@vinschen.de> + + * sysv_msg.cc: Add fix from upstream version 1.65. + (msgsnd): Call msleep with timeout value. Handle EWOULDBLOCK. Make + sure it's clear from where msleep has been called in debug output. + (msgrcv): Make sure it's clear from where msleep has been called in + debug output. + +2008-02-06 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc: Replace %E __small_printf format specifier with %lu + and call to GetLastError throughout. + * bsd_mutex.cc: Ditto. + * sysv_sem.cc (semget): Replace %X __small_printf format specifier + with %llx. + +2008-02-06 Corinna Vinschen <corinna@vinschen.de> + + Remove dependency from Cygwin internal code. + * Makefile.in (CYGWIN_OBJS): Remove smallprint.o. + (cygserver.exe): Remove strfuncs.o + (strfuncs.o): Drop rule. + * bsd_log.cc (_vlog): Use snprintf/vsnprintf instead of + __small_sprintf/__small_vsprintf. + * sysv_sem.cc (seminit): Use sys_malloc instead of malloc. Use + snprintf instead of __small_sprintf. + (semunload): Free the above allocated sema_mtx names here. + +2008-02-03 Brian Dessent <brian@dessent.net> + + * Makefile.in: Don't link strfuncs.o from the Cygwin build dir. + Build it again with __OUTSIDE_CYGWIN__ defined. + +2007-11-05 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (tunable_params): Add kern.ipc.shm_allow_removed as + bool parameter. + * cygserver.conf: Add a description for the kern.ipc.shm_allow_removed + parameter. + * sysv_shm.cc (shminit): Set shm_allow_removed variable according to + kern.ipc.shm_allow_removed setting. + +2007-08-02 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.c: Remove. + +2007-08-02 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Add -lntdll to link line. + (CYGWIN_OBJS): Include strfuncs.o. + +2007-08-02 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.c: New file. + * Makefile.in (OBJS): Add smallprint.o. + (CYGWIN_OBJS): Remove smallprint.o from Cygwin dir. + +2007-07-21 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc: Drop unnecessary security.h include. + +2007-02-23 Corinna Vinschen <corinna@vinschen.de> + + Throughout remove using wincap. + * Makefile.in (OBJS): Remove wincap.o. + * README: Don't mention 9x. + * bsd_mutex.cc (_mtx_unlock): Drop checking for 9x error codes. + * cygserver.cc (server_submission_loop::request_loop): Add FIXME + comment. + * wincap.cc: Remove. + * wincap.h: Remove. + * woutsup.h: Don't include wincap.h. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (OBJS): Drop transport_sockets.o. + * sysv_shm.cc (shmget_allocate_segment): Remove spurious cast. + * transport.cc: Don't include transport_sockets.h. + (create_server_transport): Always create transport_layer_pipes. + * transport_sockets.cc: Remove. + * transport_sockets.h: Remove. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * configure.in: Update to newer autoconf. + (thanks to Steve Ellcey) + * configure: Regenerate. + * aclocal.m4: New file. + +2006-01-12 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc: New file. + * wincap.h: New file. + * Makefile.in: Accomodate having our own wincap implementation now. + +2006-01-09 Corinna Vinschen <corinna@vinschen.de> + + Check FreeBSD upstream changes and apply important patches. + * sysv_sem.cc (__semctl): Check copyin return value (from 1.76). + * sysv_shm.cc (shminit): Actually use the iterating variable in the + for loop when trying to avoid overflow (from 1.102). + +2005-11-10 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (securityinit): New function. Move initialization + of security related variables from ipcinit here. + * bsd_helper.h (securityinit): Add prototype. + * cygserver.cc (main): Call securityinit right after wincap.init. + +2005-11-10 Corinna Vinschen <corinna@vinschen.de> + + * bsd_log.cc (_vpanic): LOG_EMERG is overkill, use LOG_CRIT. + +2005-11-09 Corinna Vinschen <corinna@vinschen.de> + + * process.cc (process_cache::process): Fix maximum process condition. + +2005-10-24 Corinna Vinschen <corinna@vinschen.de> + + * README: Add description for new -p/--process-cache option. + * bsd_helper.cc (default_tun_check): Add kern.srv.process_cache_size + entry to tunable_params. Set max value of kern.srv.request_threads + to 310. + * cygserver.cc (SERVER_VERSION): Set to 1.20. + (print_usage): Print usage of new parameter -p. + (main): Add process cache parameter handling. Accomodate new max + value of request threads. + * cygserver.conf: Add kern.srv.process_cache_size tunable parameter. + Accomodate new max value of kern.srv.request_threads. + * process.cc: Fix a comment. + (process_cache::process_cache): Add max process cache size parameter. + Change _cache_add_trigger to manual reset event. + (struct pcache_wait_t): New struct used as parameter to + pcache_wait_thread. + (pcache_wait_thread): New thread function used for threaded process + cache. + (process_cache::wait_for_processes): Use threaded waiting if number + of processes to wait for is bigger than 62. Always check all processes + to avoid race under heavy load. + (process_cache::sync_wait_array): Remove useless assert. Reset + _cache_add_trigger right at the start since it's manual reset now. + Accomodate threaded waiting. + * process.h (process_cache::process_cache): Add max_procs parameter. + (process_cache::_max_process_count): New member. + (process_cache::_wait_array: Raise to allow up to 5 wait threads. + (process_cache::_process_array): Ditto. + +2005-08-08 Christopher Faylor <cgf@timesys.com> + + * cygserver.cc (main): Call wincap.init() earlier to avoid a NULL + dereference. + +2005-06-14 Corinna Vinschen <corinna@vinschen.de> + + * sysv_sem.cc (semu_list): Define static to avoid gcc 4.x compiler + warning. + +2005-04-08 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (msleep_cnt): Remove. + (msleep_max_cnt): Remove. + (msleep_arr): Remove. + (class msleep_sync_array): New class to encapsulate msleep/wakeup + thread synchronization. + (msleep_sync): New object pointer. + (msleep_init): Initialize new msleep_sync object. + (_mutex): Just call msleep_sync->enter() and msleep_sync->leave() for + thread synchronization. Improve debug output a bit more. + (wakeup): Just call msleep_sync->wakeup(). + (wakeup_all): Whitespace fix. + +2005-04-06 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (ipcexit_hookthread): Fix whitespace and handle leak. + * bsd_mutex.cc: Include stdlib.h, sys/msg.h and sys/sem.h. + (mtx_init): Initialize lock counter to 0. + (_mtx_lock): Increment and log mutex lock counter. + (mtx_owned): Add winpid argument. Return true only if mutex is + actually owned by process winpid. + (_mtx_assert): Add winpid argument accordingly. + (_mtx_unlock): Log owner and lock count. + (MSLEEP_MUTEX): Remove. + (MSLEEP_SEM): Ditto. + (MSLEEP_EVENT): Ditto. + (msleep_event_name): Ditto. + (msleep_cs): New global critical section. + (msleep_cnt): New global variable indicating msleep record usage. + (msleep_max_cnt): New global variable indicating msleep record size. + (msleep_arr): New global pointer to msleep records. + (msleep_init): Initialize msleep_cs. Allocate msleep_arr array. + (_msleep): Rewrite using new msleep_cs/msleep_arr based thread + synchronization. Don't be shy with debug output. + (wakeup): Rewrite using new msleep_cs/msleep_arr based thread + synchronization. + * bsd_mutex.h (struct mtx): Add lock counter for better debugging. + (mtx_owned): Declare with winpid argument. + (_mtx_assert): Ditto. + (mtx_assert): Define with winpid argument. + * cygserver.cc (version): Remove. + (SERVER_VERSION): New define, decoupling server version information + from source code control system. + (print_version): Simplify printing server version. + * process.cc (process::process): Fix wrong bracketing (and handle leak). + (process::~process): Only try to close _signal_arrived if valid. + * sysv_sem.cc: Include sys/smallprint.h. + (semundo_clear): Define with additional struct thread pointer argument. + Accomodate throughout. + (SEMUNDO_LOCKASSERT): Define with winpid argument. Accomodate + throughout. + (struct sem_undo): Define un_proc as pid_t on Cygwin. Accomodate + throughout. + (seminit): Improve debugging by adding the semid to the mutex name. + (semget): Correctly print key value as 64 bit hex value in debug + output. + (semexit_myhook): Remove Cygwin specific unlocking of mutexes owned + by exiting process. Keep semaphore global lock throughout whole + function to avoid races. + * sysv_shm.cc (GIANT_REQUIRED): Define empty on Cygwin. We know that + Giant is locked. + +2005-04-01 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (_msleep): Whitespace fix. + * process.cc (process::process): Handle invalid signal_arrived values + more gracefully. + +2004-12-30 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc: Include limits.h. + (MSLEEP_MUTEX): New define for third parameter to msleep_event_name. + (MSLEEP_SEM): Ditto. + (MSLEEP_EVENT): Ditto. + (msleep_event_name): Add third parameter to allow multiple + synchronization objects per ident. + (_msleep): Implement new synchronization technique to make sure + that all threads have been woken up by a corresponding wakeup call. + (wakeup): Ditto. + +2004-10-18 Corinna Vinschen <corinna@vinschen.de> + + * sysv_sem.cc: Redefine offsetof to circumvent build problems with + gcc 3.4. + +2004-10-04 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (_msleep): Simplify event creation. Revert change from + 2004-08-24. It should be unnecessary now. + * msg.cc (client_request_msg::serve): Release process critical + section as early as possible. + * sem.cc (client_request_sem::serve): Ditto. + * shm.cc (client_request_shm::serve): Ditto. + * process.cc: Use hold and release method calls instead of + EnterCriticalSection/LeaveCriticalSection calls throughout. + * process.h (_hold): Rename from hold. Take filename and linenumber + parameter for logging. Define matching hold macro. + (release): Ditto. + +2004-10-01 Corinna Vinschen <corinna@vinschen.de> + + * sysv_sem.cc: Update to FreeBSD version 1.69. + 1.68: Reduce the overhead of semop() by using the kernel stack + instead of malloc'd memory to store the operations array if it + is small enough to fit. + 1.69: Adjust the number of processes waiting on a semaphore properly + if we're woken up in the middle of sleeping. + +2004-09-23 Corinna Vinschen <corinna@vinschen.de> + + * sysv_shm.cc (kern_shmat): Avoid compiler warning. + +2004-09-21 Corinna Vinschen <corinna@vinschen.de> + + * sysv_shm.cc (vm_object_reference): remove Cygwin specific define. + (vm_map_find): Ditto. + (vm_map_inherit): Ditto. + (kern_shmat): On Cygwin, take shmaddr just as is. Don't call vm + system calls on Cygwin. Add comment. + +2004-09-15 Corinna Vinschen <corinna@vinschen.de> + + Fix copyright throughout. + Eliminate use of _impure_ptr outside Cygwin. + * bsd_helper.cc: Include errno.h instead of cygerrno.h. + * bsd_mutex.cc : Ditto. + * client.cc: Ditto. + * cygserver.cc: Ditto. + * process.cc: Don't build functions inside Cygwin. Don't include + cygerrno.h. Don't set errno. + * transport_pipes.cc (SET_ERRNO): New define. Use througout. + * transport_sockets.cc (SET_ERRNO): Ditto. + (GET_ERRNO): Ditto. + +2004-09-06 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (_msleep): Disable resetting event object for now. + +2004-08-31 Corinna Vinschen <corinna@vinschen.de> + + * sysv_shm.cc (kern_shmat): Add debug_printf's. + +2004-08-24 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (_msleep): Release process object while waiting. + +2004-08-03 Corinna Vinschen <corinna@vinschen.de> + + * transport.cc (transport_layer_base::~transport_layer_base): Resurrect. + * transport.h (transport_layer_base::~transport_layer_base): Ditto. + +2004-07-30 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (_msleep): Reset event object and close it before + entering mutex. Turn order of conditional for better readability. + +2004-07-26 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.conf: Describe relation between shmmaxpgs and SHMMAX. + +2004-07-20 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc: Whitespace fixes. + * bsd_mutex.cc: Ditto. + +2004-07-19 Corinna Vinschen <corinna@vinschen.de> + + * transport.cc (transport_layer_base::~transport_layer_base): Remove. + * transport.h (transport_layer_base::~transport_layer_base): Ditto. + +2004-07-19 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (win_priority): Actually calculate p from priority. + +2004-06-03 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (shmget): Explicitely set td_retval[0] to -1 on error. + +2004-03-30 Corinna Vinschen <corinna@vinschen.de> + + * sysv_shm.cc (shmget): Allow to retrieve shared memory segments + by shmid when IPC_KEY_IS_SHMID is set. + +2004-03-02 Corinna Vinschen <corinna@vinschen.de> + + * sysv_sem.cc (semundo_adjust): Check for process id instead of + process struct pointer, which isn't fixed under Cygwin. + (semexit_myhook): Ditto. Adjust debug print statements to print + Cygwin and Windows PIDs instead of process pointer under Cygwin. + +2004-02-07 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (win_priority): Move to msleep helper function section. + (set_priority): Ditto. Fix formatting. + (_msleep): Cleanup obj formatting. Rearrange obj order. + +2004-02-06 Corinna Vinschen <corinna@vinschen.de> + + * bsd_mutex.cc (_msleep): Handle PCATCH using signal_arrived event. + * client.cc: Include sigproc.h. + * msg.cc (client_request_msg::serve): Accomodate third parameter to + process::process. + * sem.cc (client_request_sem::serve): Ditto. + * shm.cc (client_request_shm::serve): Ditto. + * process.cc (process::process): Duplicate signal_arrived into + Cygserver process space. + (process::~process): Close _signal_arrived handle. + (process_cache::process): Add signal_arrived handling. + * process.h (process::process): Add signal_arrived parameter. + (process:signal_arrived): New read accessor. + (process:_signal_arrived): New member. + (process_cache::process): Add signal_arrived parameter. + +2004-01-16 Corinna Vinschen <corinna@vinschen.de> + + * process.h (cleanup_routine::~cleanup_routine): Make pure virtual + function to avoid miscompilation with certain versions of gcc. + * process.cc (cleanup_routine::~cleanup_routine): Remove. + +2003-12-26 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (CFLAGS, CXXFLAGS): Remove unneeded include. + (CYGWIN_LIB): Delete. + (cygserver.exe target): Add -L$(cygwin_build) to the link line to force + linker to use build tree version of the library. Remove specific + inclusion of libcygwin.a from the link line. + +2003-12-16 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (tunable_params): Add entries for kern.ipc.msgmnb and + kern.ipc.msgtql. Raise max value for kern.ipc.msgseg to 65535. + * cygserver.conf: Add kern.ipc.msgmnb and kern.ipc.msgtql. + * sysv_msg.cc (msginit): Add TUNABLE_INT_FETCH call for + kern.ipc.msgmnb and kern.ipc.msgtql. + +2003-11-26 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.cc (main): Move call to ipcinit() up before installing + any threads. + * sysv_sem.cc: Update to FreeBSD version 1.67. + (seminit): Initialize semaphore sequence numbers to 0. + +2003-11-26 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (CYGWIN_LIB): Variable pointing to libcygwin.a in + the parallel cygwin dir. + (cygserver.exe): Depend on and link against $CYGWIN_LIB. + +2003-11-25 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (CXXFLAGS): Remove duplicate options handled in + Makefile.common. + +2003-11-22 Corinna Vinschen <corinna@vinschen.de> + + * msg.cc (client_request_msg::serve): Add default case to msgop switch. + * sem.cc (client_request_sem::serve): Add default case to semop switch. + * shm.cc (client_request_shm::serve): Add default case to shmop switch. + +2003-11-21 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (install): Explicitely create directories. Install + README to $(prefix)/share/doc/Cygwin. + * README: New file. + +2003-11-21 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.cc (print_usage): Fix scrambled output. + +2003-11-20 Corinna Vinschen <corinna@vinschen.de> + + * cygserver-config: Slightly modify printed message. + +2003-11-20 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (install): Install cygserver-config script to bindir. + * cygserver-config: New script. + +2003-11-19 Corinna Vinschen <corinna@vinschen.de> + + Don't use safe_new but new throughout. Fix copyright dates + throughout. + * Makefile.in: Accomodate all new files and name changes. + Add a *.d dependency. + (sbindir): Add. + (etcdir): Drop in favor of more appropriate sysconfdir definition. + (sysconfdir): Add. + (CXXFLAGS): Add -MMD flag. Add SYSCONFDIR definition. + (.SUFFIXES): Add. + (install): Add action items. + (libclean): New target. + (fullclean): Ditto. + * bsd_helper.cc: New file. + * bsd_helper.h: Ditto. + * bsd_log.cc: Ditto. + * bsd_log.h: Ditto. + * bsd_mutex.cc: Ditto. + * bsd_mutex.h: Ditto. + * client.cc: Rearrange to build as less as possible if + __INSIDE_CYGWIN__. + (client_request::handle_request): Add Message Queue and Semaphore + handling. + * cygserver.cc: Rearrange to build as less as possible if + __INSIDE_CYGWIN__. Use new debug/log/panic logging functions. + (DEF_CONFIG_FILE): New definition for configuration file. Use + throughout. + (getfunc): Remove. + (__cygserver__printf): Remove. + (client_request_attach_tty::serve): Return error if impersonation + fails. + (print_usage): Pump up help message. + (print_version): Add output of default configuration file. + (main): Accommodate new options. Allow overwrite of threading options + from config file. Call several new initialization functions. Drop + printing dots. Don't define SIGHANDLE inline. + * cygserver.conf: New file. + * cygserver_process.h: Rename to process.h. + * cygserver_transport.h: Rename to transport.h. + * cygserver_transport_pipes.h: Rename to transport_pipes.h. + * cygserver_transport_sockets.h: Rename to transport_sockets.h. + * msg.cc: Rewrite. + * sem.cc: Rewrite. + * shm.cc: Rewrite. + * sysv_msg.cc: New file, derived from FreeBSD version 1.52. + * sysv_sem.cc: New file, derived from FreeBSD version 1.66. + * sysv_shm.cc: New file, derived from FreeBSD version 1.89. + * threaded_queue.cc: Rearrange to build as less as possible if + __INSIDE_CYGWIN__. + * transport.cc (transport_layer_base::impersonate_client): Define bool. + (transport_layer_base::revert_to_self): Ditto. + * transport.h (transport_layer_base::impersonate_client): Declare bool. + (transport_layer_base::revert_to_self): Ditto. + * transport_pipes.cc (transport_layer_pipes::transport_layer_pipes): + Don't call init_security. + (init_security): Remove. + (transport_layer_pipes::accept): Use global sec_all_nih. + (transport_layer_pipes::connect): Ditto. + (transport_layer_pipes::impersonate_client): Define bool. + (transport_layer_pipes::revert_to_self): Ditt. + * transport_pipes.h (transport_layer_pipes::impersonate_client): Declare + bool. + (transport_layer_pipes::revert_to_self): Ditto. + * woutsup.h: Include bsd compatibility headers. + (SIGHANDLE): Add definition. + (__cygserver__printf): Remove definition. + (__noop_printf): Ditto. + (debug_printf): Define using debug. + (syscall_printf): Define using log. + (system_printf): Ditto. + Drop all other _printf definitions. + +2003-10-22 Corinna Vinschen <corinna@vinschen.de> + + Accomodate moving cygserver header files from cygwin/include/cygwin + to here and cygwin dir. + * Makefile.in (EXEEXT): Drop as unused. + (EXEEXT_FOR_BUILD): Ditto. + (all): Don't build libcygserver.a. + * cygserver_process.h: Moved from cygwin/include/cygwin to here. + * cygserver_transport.h: Ditto. + * cygserver_transport_pipes.h: Ditto. + * cygserver_transport_sockets.h: Ditto. + * ipc.h: Moved to ../cygwin and renamed to cygserver_ipc.h. + * shm.h: Moved to ../cygwin and renamed to cygserver_shm.h. + +2003-08-30 Christopher Faylor <cgf@redhat.com> + + * msg.cc: New file. + * sem.cc: Ditto. + +2003-08-30 Christopher Faylor <cgf@redhat.com> + + * threaded_queue.h: New file. + +2003-08-25 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Build libcygserver.a. + * client.cc: Rename allow_daemon to allow_server. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * configure.in: Use 'install-sh -c'. + * configure: Regenerate. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * configure.in: Always use install-sh. + * configure: Regenerate. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (OBJS): Move some more files from cygwin directory. + * woutsup.h: Define _MT_SAFE. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * configure.in: First pass. + * Makefile.in: Ditto. + * configure: Generate. diff --git a/winsup/CVSChangeLogs.old/cygserver/ChangeLog.64bit b/winsup/CVSChangeLogs.old/cygserver/ChangeLog.64bit new file mode 100644 index 000000000..7ab21bf54 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygserver/ChangeLog.64bit @@ -0,0 +1,87 @@ +2013-03-07 Corinna Vinschen <corinna@vinschen.de> + + * msg.cc (client_request_msg::serve): Revert change to refuse 64 bit + processes on 32 bit systems. + * sem.cc (client_request_sem::serve): Ditto. + * shm.cc (client_request_shm::serve): Ditto. + +2013-03-01 Corinna Vinschen <corinna@vinschen.de> + + * client.cc: Revert changes to handle 32 bit processes on 64 bit + systems. + * sysv_msg.cc: Ditto. + * sysv_sem.cc: Ditto. + * sysv_shm.cc: Ditto. + +2013-02-13 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygserver.exe): Make cygwin_build a tooldir (-B instead + of -L) to support bootstrapping. + +2013-02-09 Corinna Vinschen <corinna@vinschen.de> + + * configure: Regenerate to fix wrong ac_unique_file dependency. + +2012-12-06 Corinna Vinschen <corinna@vinschen.de> + + * sysv_msg.cc (conv_timespec32_to_timespec): Move implementation to + cygserver_ipc.h. + (conv_timespec_to_timespec32): Ditto. + (conv_msqid_ds32_to_msqid_ds): Drop and move code into copyin_msqid_ds. + (conv_msqid_ds_to_msqid_ds32): Drop and move code into copyout_msqid_ds. + * sysv_sem.cc (copyin_semid_ds): New inline function on Cygwin. + (copyout_semid_ds): Ditto. + (__semctl): Use a conditional arg_size value rather than a fixed + sizeof(real_arg) throughout, to accommodate 64/32 bit conversion. + Use copyout_semid_ds and copyin_semid_ds to copy semid_ds + structures from cygserver to client and vice versa on Cygwin. + * sysv_shm.cc (copyin_shmid_ds): New inline function on Cygwin. + (copyout_shmid_ds): Ditto. + (shmctl): Use copyout_shmid_ds and copyin_shmid_ds to copy shmid_ds + structures from cygserver to client and vice versa on Cygwin. + +2012-12-05 Corinna Vinschen <corinna@vinschen.de> + + * client.cc (client_request::header_t::header_t): Accommodate changes + to msglen member. + (client_request::handle_request): Ditto. + (client_request::client_request): Zero out entire parameter block. + Explain why. + * sysv_msg.cc (conv_timespec32_to_timespec): New inline function on + 64 bit Cygwin. + (conv_timespec_to_timespec32): Ditto. + (conv_msqid_ds32_to_msqid_ds): Ditto. + (conv_msqid_ds_to_msqid_ds32): Ditto. + (copyin_msqid_ds): New inline function on Cygwin. + (copyout_msqid_ds): Ditto. + (msgctl): Use copyout_msqid_ds and copyin_msqid_ds to copy msqid_ds + structures from cygserver to client and vice versa on Cygwin. + (msgsnd): Special case copyin of msg_type on 64 bit Cygwin. + (msgrcv): Special case copyout of msg_type on 64 bit Cygwin. + +2012-12-04 Corinna Vinschen <corinna@vinschen.de> + + * bsd_helper.cc (tunable_int_fetch): Convert 2nd parameter to + int32_t. + * bsd_helper.h (tunable_int_fetch): Fix declaration accordingly. + * bsd_log.cc (log_level): Change type to int32_t. + * bsd_log.h (log_level): Fix declaration accordingly. + * bsd_mutex.cc (msgmni): Change type to int32_t. + (semmni): Ditto. + * cygserver.cc: Fix debug output to be target agnostic. Use same + style throughout. + * msg.cc (client_request_msg::serve): Refuse to serve 64 bit processes + from 32 bit cygserver. + * sem.cc (client_request_sem::serve): Ditto. + * shm.cc (client_request_shm::serve): Ditto. + * sysv_shm.cc (shm_delete_mapping): Mark size as unused to make gcc + happy. + (kern_shmat): Ditto with flags. + * process.h (class process): Change type of _cleaning_up member to LONG. + * threaded_queue.h (class threaded_queue): Ditto for _workers_count. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add AC_NO_EXECUTABLES to allow bootstrap. + * configure: Regenerate. + diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1995 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1995 new file mode 100644 index 000000000..43d28a3a1 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1995 @@ -0,0 +1,177 @@ +Mon Dec 18 16:44:38 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in (target_cpu): specify valid Intel x86 architectures + explicitly. + +Mon Dec 18 15:04:29 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * sysdef/*.def: moved to sysdef/i386/. + +Mon Dec 18 15:00:56 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in: Set DLL_ENTRY and SYSDEF_DIR for i386 and powerpc. + * configure: Regenerated with autoconf 2.7. + + * Makefile.in: Use DLL_ENTRY and SYSDEF_DIR. + +Sat Dec 16 18:36:44 1995 steve chamberlain <sac@slash.cygnus.com> + + Changed the way that file handles are inherited. Now + all files are opened with the inheriting turned on, and they're + closed when necessary. + + Changed the way that children are waited for. Now + you can exec a non-gnuwin32 program and wait for its + result. + + * Makefile.in: Turn off frame-pointer. + * dcrt0.cc (environ_init): Lint. + * dirsearch.cc (opendir): Use new path_conv mechanism. + * exceptions.cc (ctrl_c_handler): Exit with correct status + * exec.cc (file_exists): Moved to paths.cc + (_execve): Moved most of the work into spawn.cc. + * fhandler.cc (*): Much. + * libccrt0.c (foo): Deleted. + (cygwin_crt0): Lint. + * path.cc (readlink): Initialize the SECURITY_ATTRIBUTES struct. + * pipe.cc (pipe, dup*): Reorganized. + * registry.cc (read_in): Create the key in CURRENT_USER. + * wait.cc, spawn.cc (*): Much. + * sysconf.cc (sysconf): Understand SC_PAGESIZE. + * times.cc (utime): New function. + * uname.cc (uname): Dig out more info. + +Wed Dec 13 05:54:55 1995 Michael Meissner <meissner@tiktok.cygnus.com> + + * dcrt0.cc (environ_init): Cast alloca return to appropriate type. + * spawn.cc (spawn_guts): Ditto. + + * strace.cc (__small_{v,}sprintf): Add appropriate prototypes. + + * exceptions.cc (_except_list): Only use segments for 386 systems. + (__stack_trace): Add PowerPC support, and do nothing for systems + that are not supported except print stack tracing is not yet + support. + + * sdata.cc (import_term): Only use __attribute__((section)) on 386 + systems. + + * shared.cc (shared_init): Use MARK macro instead of calling mark + directly with incorrect type arguments. + + * fhandler.cc (fhandler_dev_null::{read,write}): Use size_t in + prototype, not unsigned int. + + * fork.cc (find_exec): Fix type errors. + * path.cc (path_to_real_path_keep_rel): Ditto. + * syscalls.h (PATH_TO_REAL_PATH): Ditto. + + * {longjmp,setjmp}.c: #ifdef i386 code. + + * include/wintypes.h (ExitProcess): Add + __attribute__((__noreturn__)) so exit compiles without warnings. + +Tue Dec 12 18:25:05 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * include/wintypes.h (WINAPI): Only define WINAPI for x86 systems. + +Tue Dec 5 16:00:05 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in (all): Only build documentation for info target. + Expect texi2html to not be found most of the time. + +Tue Dec 5 08:08:08 1995 steve chamberlain <sac@slash.cygnus.com> + + Release-B10 + + * cygwin.dll (__assert, wait, spawnv, spawnvp): Deleted. + * dcrt0.c: Quoting rewritten. + * exec.cc (file_exists): Use new path_conv mechanism. + (_execve): Close open child process handles. + * fhandler.cc (fhandler_normal::open): Follow symlinks. + (fhandler_normal::read): Keep track of logical file posision. + (fhandler_normal::lseek): Seek in text files correctly. + (fhandler_normal::fstat): Set IFLNK bit if its a symlink. + (fhandler_normal::init): Maintain is_pipe. + (fhandler_dev_null::fstat): New. + (fhandler_dev_null::get_handle): Return INVALID_HANDLE. + * fork.cc: Use new event mechanism. + * libccrt0.cc: Keep track of _fmode variable. + * misc.c (readlink): Delete. + * path.cc (__path_to_real_path_1): Allow /d<letter> mechanism. + (path_to_real_path_keep_rel): New + (link_cookie:*): Support for symbolic links. + * spawn.cc (spawn_guts): Quoting rewritten. + * times.cc: New. + * syscalls.cc (_stat_worker): New. + (_stat, _lstat): Use _stat_worker. + * sysconf.cc (sysconf): Support _SC_CLK_TCK. + +Tue Nov 28 15:29:38 1995 steve chamberlain <sac@slash.cygnus.com> + + * loads of stuff. When I make < 100k of diffs in a day, + the ChangeLog will be usefull. + +Tue Nov 21 18:01:39 1995 steve chamberlain <sac@slash.cygnus.com> + + * Makefile.in: Build the doc. + * exceptions.cc: lint. + * fork.cc: lint. + * shared.cc (shared_init): If MapViewOfFileEx fails, then try + again, but get the OS to select the address (for win95) + * strace.cc (__sysprintf): Print pid and state in hex. + * syscalls.cc (_unlink): Translate path to realpath. + +Wed Nov 15 23:47:43 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * spawn.cc (_exit): set return value's lower byte to 0 by default. + + Tue Oct 3 10:23:14 1995 Anders Blomdell (anders.blomdell@control.lth.se) + + * spawn.cc (spawn_guts): quote doublequotes correctly + +Tue Nov 14 15:05:33 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in: comment out call to cfg-ml-com.in. + +Tue Oct 31 11:19:18 1995 steve chamberlain <sac@slash.cygnus.com> + + * libcerr.cc: New file. + * dcrt0.cc (environ_init): Initialize PATH and friends nicely. + * exceptions.cc (ctrl_c_handler): Default case is to exit. + * fork.cc (__suffixy, find_exec): translate between paths and + real_paths. + * shared.cc (shared_init): Hard wire shared memory at 0xa0000000. + * syscalls.c (__path_to_real_path, real_path_to_path): Always + translate '/' <> '\' + +Mon Oct 30 17:36:10 1995 steve chamberlain <sac@slash.cygnus.com> + + * syscalls.cc (_rename): Fix for win95. + +Fri Oct 27 20:53:47 1995 steve chamberlain <sac@slash.cygnus.com> + + * Everything changed. + +Thu Oct 19 10:47:52 1995 steve chamberlain <sac@slash.cygnus.com> + + * registry.cc, uinfo.cc: New files. + * crt0.c (*uinfo*, *_exe_suffix*): Delete. + (dll_crt0): Call shared_init. + * getlogin.c: deleted. + * shared.cc: Fill in. + * spawn.c (_spawn): Use __exe_suffix function. + * syscalls.c (getuid, getgid): Moved into uinfo.cc + * syscalls.h (*uinfo, __exe_suffix): Deleted + * Makefile.in: Cope with target configury. + * termios.c: Fix stub prototypes. + * win.h: Deleted. + * include/winadvapi.h: Fill in some REG prototypes. + +Thu Oct 19 10:47:52 1995 steve chamberlain <sac@slash.cygnus.com> + + * Makefile.in: Cope with target configury. + +Wed Oct 18 15:34:49 1995 steve chamberlain <sac@slash.cygnus.com> + + * Moved from newlib. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1996 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1996 new file mode 100644 index 000000000..9c786c408 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1996 @@ -0,0 +1,2031 @@ +Mon Dec 23 13:35:27 1996 Jeremy Allison <jra@cygnus.com> + + * Makefile.in: Added $(srcdir)/../libstdc++/stl -I$(srcdir)/../libio + to the include path. As mmap uses STL then this is needed + to build the cross compiler. Also added mmap.o file. + * cygwin.din: Added mmap, mprotect, msync, munmap. + * dcrt0.cc: Added code to get the module pathname from + a previously unused field in the u area so fork() calls + don't have to search the path. Forwards compatible with + earlier releases as they set this field to zero. + * fork.cc: Added call to recreate_mmaps_after_fork() in + child code. Ensures child has same view of mmap'ed areas + as parent. + * libccrt0.cc: (See dcrt0.cc change). Setup the module + handle so fork can get the path name. + * mmap.cc: New file. Implements mmap, mprotect, msync, munmap, + recreate_mmaps_after_fork. Uses STL. + * select.cc: Added code to set errno to EINVAL if select done + on handles and sockets. Must fix this soon. + * spawn.cc: Set new variable hmodule in u area to zero for child. + * syscalls.cc: Added fsync functionality. No longer a dummy call. + * winsup.h: Decremented internal_reserved array by one to add + hmodule in u area. Added prototype for recreate_mmaps_after_fork(). + * include/sys/mman.h: Fixed include file for mmap calls. + +Tue Dec 17 16:20:52 1996 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (_rename): fix code so we really do + return -1 if _rename fails. + +Tue Dec 17 12:12:29 1996 Jeremy Allison <jra@cygnus.com> + + * fhandler.cc: Added Sergeys patch for FakeReadFile. + * cygwin.din: Re-ordered network calls. + +Mon Dec 16 16:47:26 1996 Geoffrey Noer <noer@cygnus.com> + + * configure.in: remove AC_C_CROSS (now part of AC_PROG_CC) + * utils/configure.in: ditto + * configure: regenerate + * utils/configure: regenerate + +Mon Dec 16 14:50:46 1996 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: export cygwin32_getsockopt + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc: don't assume all scripts should be run in + bash -- run the shell specified after the #! + +Fri Dec 13 16:18:22 1996 Jeremy Allison <jra@cygnus.com> + + * path.cc: Added support for UNC paths. + +Fri Dec 13 10:56:21 1996 Jeremy Allison <jra@cygnus.com> + + * cygwin.din: Added h_errno, seteuid, _seteuid. + * exceptions.cc: Made init_exceptions extern "C". + * exceptions.h: Added cplusplus wrappers to enable this to + be used from C. + * net.cc: Added error numbers, fixed gethostbyaddr, added h_errno + fixes. + * stubs.cc: Added seteuid. + * include/mywinsock.h: Added HOST error entries for DNS lookups. + +Tue Dec 10 15:38:46 1996 Geoffrey Noer <noer@cygnus.com> + + * version.h: bump CYGWIN_DLL_VERSION_MINOR to 4 + + patch from Marcus Daniels <marcus@sysc.pdx.edu>: + * fhandler.cc: add fhandler_dev_null::dup (fhandler_base *child) + * fhandler.h: add matching header + + gnu-win32 beta 17.1 release made + +Thu Dec 5 14:03:08 1996 Geoffrey Noer <noer@cygnus.com> + + * select.cc: add missing end comment at about line 933. + gnu-win32 beta 17 release made + +Wed Dec 4 15:53:11 1996 Geoffrey Noer <noer@cygnus.com> + + * version.h: increment minor dll number in conjunction + with gnu-win32 beta 17 release + +Tue Dec 3 15:05:57 1996 Geoffrey Noer <noer@cygnus.com> + + * strsep.cc: new file containing Berkeley-copyrighted strsep + code previously in misc.cc. + * misc.cc: strsep moved to strsep.cc, stop including + unistd.h, strings.h, sys/types.h, stddef.h, and stdarg.h + * Makefile.in: appropriate adjustments to add strsep.cc + +Tue Dec 3 13:50:59 1996 Geoffrey Noer <noer@cygnus.com> + + * include/sys/copying.dj: new file whose presence is + required by include/sys/file.h + +Tue Dec 3 13:37:27 1996 Geoffrey Noer <noer@cygnus.com> + + Throughout all Cygnus-developped source files: put all + code under GPL + +Tue Dec 3 10:54:01 1996 Jeremy Allison <jra@cygnus.com> + + * fork.cc: Changed code to delete [] saved child_hinfo + after allocate_pid called. Needed as child changes this + value in the shared area when it de-linearizes fd array. + Needed to stop race condition with earlier fix. + * winsup.h: Changed definition of item in hinfo to be + a char array rather than fhandler_console. Stops + destructor being called when fork delete [] of + hinfo array called. + * hinfo.cc: Changes (casts) to support winsup.h changes. + +Mon Dec 2 17:22:13 1996 Geoffrey Noer <noer@cygnus.com> + + * include/utime.h: add ifdef _UTIME_U wrapper around header + +Mon Dec 2 15:45:46 1996 Jeremy Allison <jra@cygnus.com> + + * fork.cc: Fixed file descriptor resource leak in parent. + * registry.cc: Removed fatal error if registry key cannot + be opened. Causes errors in service code. + +Wed Nov 27 15:40:15 1996 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: for MS compatibility, also export functions + as _funcname = funcname + * include/netdb: + * include/sys/socket.h: + Do the equivalent thing for functions exported as cygwin32_funcname + +Wed Nov 27 15:14:30 1996 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove exported helper functions that shouldn't + need to be exported (_read et al) + * glob/Makefile.in: add SHELL definition + * utils/Makefile.in: add SHELL definition + +Mon Nov 25 14:24:52 1996 Geoffrey Noer <noer@cygnus.com> + + * include/commdlg.h, ddeml.h, winadvapi.h, winbase.h, wincon.h, + windef.h, windowsx.h, winerror.h, wingdi.h, winkernel.h, winnt.h, + wintypes.h, winuser.h, winversion.h: + Add MS-style header files back, each of which now includes our + windows.h. This should allow compilation of Windows code + that expects normal MS-named headers as long as the information + is in our windows.h somewhere. The appropriate wrappers have + been added to each file so windows.h isn't included more than + once. + * include/windows.h: add paranoia wrapper so it can be included + more than once. + +Mon Nov 18 22:19:40 1996 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: change rules around so new-cygwin.dll is + only rebuilt when necessary + * spawn.cc: include <stdlib.h> + +Mon Nov 18 21:08:15 1996 Geoffrey Noer <noer@cygnus.com> + + * net.cc: remove extern "C"s that shouldn't be there + (get_win95_ifconf, get_winnt_ifconf, get_if_flags) + * syscalls.cc: remove extern "C"s from num_entries, _stat_worker + * winsup.h: add extern "C"s for syscalls protos + +Mon Nov 18 20:35:39 1996 Geoffrey Noer <noer@cygnus.com> + + * winsup.h: include version.h + * Makefile.in: remove dependencies involving version.h, but add + version.h to winsup.h dependency line and also add others that + should also be there. + * dcrt0.cc: + * libccrt0.cc: + * registry.cc: + * shared.cc: delete includes of version.h + +Mon Nov 18 20:16:37 1996 Geoffrey Noer <noer@cygnus.com> + + * stubs.c -> stubs.cc, add extern "C"s + * uname.c -> uname.cc, add extern "C"s + * console.cc: add extern "C"s, remove include windows.h + since its already included in winsup.h + * dirsearch.cc: add extern "C"s + * fcntl.cc: add extern "C"s + * winsup.h: remove LEAN_AND_MEAN define since that's no longer + relevant with new windows headers, include version.h + * malloc.cc: fix typos + +Mon Nov 18 18:02:31 1996 Geoffrey Noer <noer@cygnus.com> + + * grp.c renamed to grp.cc, add extern "C"s + * misc.c renamed to misc.cc, add extern "C"s + +Mon Nov 18 16:08:26 1996 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc: extern "C"'d function calls + * net.cc: extern "C"'d function calls, some respacing + * hinfo.cc: extern "C"'d function calls, some respacing + * syscalls.h: removed defines for MIN, errno, alloca(x), + DEFAULT_GID/UID, NOT_OPEN_FD(fd), STD_RBITS et al, + O_NOSYMLINK + * winsup.h: added what was just deleted from syscalls.h + +Mon Nov 18 15:56:22 1996 Jeremy Allison <jra@cygnus.com> + + * cygwin.din: Added readv + * syscalls.cc: Added readv code. + * syscalls.h: Added readv prototype. + +Wed Nov 13 15:55:14 1996 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: added C++-related exports for stuff in + libgcc.a (from new.o, tinfo.o, tinfo2.o, exception.o). + +Mon Nov 11 15:50:26 1996 Geoffrey Noer <noer@cygnus.com> + + * dcrt0.cc + * dirsearch.cc + * malloc.cc + * passwd.cc + * path.cc, + * pinfo.cc + * syslog.cc + * utils/kill.cc + * utils/cygwin.cc: + need to #include <stdlib.h> which used to be included + automatically in windows.h included by winsup.h. + * shared.cc: UnmapViewOfFile takes a void *, not a + const void * + * malloc.cc: formatting fixes + +Fri Nov 8 17:31:55 1996 Jeremy Allison <jra@cygnus.com> + + * select.cc: Added fix for HANDLE select sent by + Sergey Okhapkin. + * fhandler.h: Changed dup to return int. Can now + return error to dup2. + * fhandler.cc: Changed dup to return error code. + Corrected fhandler_console::close to return + error code. + * hinfo.cc (dup2): Check return code from + fhandler->dup. + * times.cc: Changed DST calculation as tm struct + month starts at zero, NT wMonth starts at 1. + * TODO: Added the things i'd like to do. + +Wed Nov 6 17:42:31 1996 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: Changed name of base file for cygwin.dll from + base to cygwin.base. Changed name of exp file for cygwin.dll + from win.exp to cygwin.exp. Updated dependency list, removing + recently removed files like libcfork.cc, added missing files, + and added all missing header dependencies. Small formatting + fixes. + +Fri Nov 1 16:38:48 1996 Geoffrey Noer <noer@cygnus.com> + + * TODO: deleted old stuff from a long time ago, added some + new stuff + + * added public domain disclaimers to all files missing them, + reformatting of non-imported code to conform to GNU standards. + Changes to: + delqueue.h, exceptions.h, fcntl.cc, fhandler.h, grp.c, + init.cc, ioctl.cc, key.cc, libcctype.c, libcerr.cc, libcmain.cc, + misc.c, path.h, pold.c, resource.cc, smallprint.c, strerror.cc, + syslog.cc, termios.cc, test.c, version.h, wait.cc + +Fri Nov 1 14:44:29 1996 Jeremy Allison <jra@cygnus.com> + + * fhandler.h: Added is_console() method needed by + new select code. + * fhandler.cc (fhandler_console::init): Added c_oflag setting + dependent on bin parameter. + * select.cc: Added code to implement select from console + handles. Ignores keyup events and still blocks. + +Wed Oct 30 16:35:41 1996 Jeremy Allison <jra@cygnus.com> + + * fhandler.h: Removed fhandler_console_in, fhandler_console_out + and integrated them both into fhandler_console. Added output_handle_ + so fhandler console has two handles. + * fhandler.cc: Updated to support changes in fhandler.h. It is now + possible to open("/dev/tty") and read/write to the same fd. + * hinfo.cc(build_fhandler): Removed references to obsolete classes. + * spawn.cc: Changed to get correct reference to output_handle_ for + fhandler_console class. + * console.cc: Changed to get output handle rather than input handle. + * winsup.h: Changed definition of prototypes for functions changed + in console.cc + +Wed Oct 30 13:05:33 1996 Geoffrey Noer <noer@cygnus.com> + + * include/custcntl.h + * include/features.h + * include/icmp.h + * include/wchar.h + * include/cygwin32/icmp.h + * include/cygwin32/ip.h + * include/cygwin32/sockios.h + * include/cygwin32/types.h + * include/cygwin32/uio.h + * include/sys/ttychars.h + Added comment with name of header to each so that these are no + longer empty files (some unzip programs won't create + zero-length files which is a problem for headers) + +Sun Oct 27 17:30:03 1996 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: also export "_execl = execl" and the same + for _execle and _execlp + +Thu Oct 24 01:43:29 1996 Geoffrey Noer <noer@cygnus.com> + + * include/windows.h: rewritten to include headers from + the include/Windows32 subdirectory + * winsup.h: no longer define MAX_PATH here since it's defined + in header files dragged in by windows.h + * dirsearch.cc (readdir): change WIN32_FIND_DATAA to WIN32_FIND_DATA + * libccrt0.cc: #include <stdlib.h> + * syscalls.cc (_unlink): chmod file to be unlinked to be + writable and try to delete it again if first delete failed + with permission denied error (rm will now work on read-only files) + (num_entries): change WIN32_FIND_DATAA to WIN32_FIND_DATA + * include/commdlg.h: delete + * include/ddeml.h: delete + * include/winadvapi.h: delete + * include/winbase.h: delete + * include/wincon.h: delete + * include/windef.h: delete + * include/windowsx.h: delete + * include/winerror.h: delete + * include/wingdi.h: delete + * include/winkernel.h: delete + * include/winnt.h: delete + * include/wintypes.h: delete + * include/winuser.h: delete + * include/winversion.h: delete + +Wed Oct 23 10:43:05 1996 Jeremy Allison <jra@cygnus.com> + + * dcrt0.cc (api_fatal): Changed locking clear of + process table to unlocking clear. Needed as lock code calls + api_fatal. + * exceptions.cc: Added debug_printfs to follow exceptions in + strace mode. + * pinfo.cc: Added code to ensure fd table is cleared when new + pid entry allocated. Fixed bug when process is terminated + violently by TerminateProcess and leaves fd table non-zero. + * termios.cc: Changed stubbed out syscalls to syscall_printf + rather than small_printf. Stops annoying tcdrain message. + * winsup.h: Made get_empty_pinfo call private to pinfo_list. + Should never be called external to this class. + +Tue Oct 22 16:14:23 1996 Jeremy Allison <jra@cygnus.com> + + * hinfo.cc: Removed previous change. This is not the + correct place to flush input events. + +Tue Oct 22 09:25:32 1996 Jeremy Allison <jra@cygnus.com> + + * dcrt0.cc: Fixed up exit code to clean up pinfo array. + * exceptions.cc: Fixed up exit code to clean up pinfo array. + * fork.cc: Tidied up access to inuse_p entry. Added flags + to allow different states to be represented. + * hinfo.cc: Added code to flush pending events if + stdin is a console. + * pinfo.cc (pinfo::record_death): Added code to clean + the pinfo array if we are an exiting parent. + * spawn.cc: Removed erroneous code to clean childs + pinfo entry. + * wait.cc: Changed WAIT_ERROR_RC to Win32 WAIT_FAILED. + Tidied up access to pinfo array. + * winsup.h: Added record_death_nolock to pinfo class. + Added PID_XXX types for inuse_p. + +Tue Oct 22 01:26:52 1996 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/Base.h: + * include/Windows32/Functions.h: + * include/Windows32/Structures.h: + * include/Windows32/UnicodeFunctions.h: + Fixes to just commited changes + +Mon Oct 21 19:58:50 1996 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/ASCIIFunctions.h: + * include/Windows32/Base.h: + * include/Windows32/Defines.h: + * include/Windows32/Functions.h: + * include/Windows32/Structures.h: + * include/Windows32/UnicodeFunctions.h: + + Add back items in old include files (commdlg.h, ddeml.h, + shellapi.h, winadvapi.h, winbase.h, wincon.h, windef.h, + windowsx.h, winerror.h, wingdi.h, winkernel.h, winnt.h, + wintypes.h, winuser.h, winversion.h) which should now be able + to be erased and windows.h modified to point to the new headers + without anything nasty happening. + + * include/WINREADME: deleted + * include/mywinsock.h: removed many blank lines + +Mon Oct 21 09:48:00 1996 Jeremy Allison <jra@cygnus.com> + + * select.cc: Re-written from scratch. Take account of + the following cases. (1). All sockets [written&works] + (2). Handles, sockets and always readies [written,not tested] + (3). All handles [written,not tested]. (4). Handles & sockets + with timeout [not yet written,returns -1]. Correctly blocks + and doesn't spin cpu. + * pinfo.cc: Changed to add global lock around pinfo array. + * fork.cc: Changed to use global pinfo lock. + * shared.cc: Fixed bug with fork()->exec()->exec() code. + * net.cc: Removed select_init() call (no longer used). + * spawn.cc: Implemented suggestion that spawn creates + process suspended, then sets up it's dwProcessId entry + in the shared pinfo array. + * wait.cc: Changed to use global pinfo lock. + * winsup.h: Added missing windows_95() call. + * fhandler.h: Changed ifdefs to select new always_ready + methods. + * fhandler.cc (fhandler_console::write): Fixed bug + where return of write_normal was being ignored. + * dcrt0.cc: Added code to use global pinfo lock. + Ensure that process records it's own death. + * exceptions.cc: Added code to clear our entry in pinfo + array when we are exiting. Should reduce dead processes in + pinfo array. + * include/winbase.h: Added MAXIMUM_WAIT_OBJECTS define. + +Mon Oct 21 00:52:17 1996 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: install headers from new Windows32 dir + +Sat Oct 19 00:47:58 1996 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/Base.h: change DWORD to unsigned int from + unsigned long, change __WIN32__ checks to _WIN32, change + // comments to /* */ + +Fri Oct 18 17:33:07 1996 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/Defines.h: change INFINITE to 0xFFFFFFFF, + add back definitions present in old winsup headers missing from + this file (STATUS_WAIT_0 et al, CONTEXT stuff, FAR, PACKED, + ASCIICHAR) + * include/Windows32/Functions.h: change // comments to /* */ + * include/Windows32/Messages.h: add definitions for WM_NULL, + WM_PENWINFIRST, WM_PENWINLAST + * include/Windows32/Sockets.h: change __WIN32__ checks to _WIN32 + * include/Windows32/Structures.h: add ppc case for CONTEXT + structure, change // comments to /* */ + +Fri Oct 18 17:25:09 1996 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32: new directory for Windows headers + * include/Windows32/ASCIIFunctions.h: + * include/Windows32/Base.h: + * include/Windows32/Defines.h: + * include/Windows32/Errors.h: + * include/Windows32/Functions.h: + * include/Windows32/Messages.h: + * include/Windows32/Sockets.h: + * include/Windows32/Structures.h: + * include/Windows32/UnicodeFunctions.h: + New Win32 headers from Scott Christley's windows32api-0.1.2 package + with no local modifications. + +Wed Oct 16 17:16:33 1996 Geoffrey Noer <noer@cygnus.com> + + * key.cc: remove extra blank lines, change ASCIICHAR to AsciiChar + * registry.cc: remove #include <winbase.h> since it's already + included in windows.h + +Tue Oct 15 09:51:48 1996 Jeremy Allison <jra@cygnus.com> + + * fhandler.h: Many changes to support moving fhandler array out of + shared area into locally allocated memory. Removed fhandler class, + fhandler_base is now root of class tree. Re-arranged class definitions + to make it clear what functions are virtual and can be overridden. + Inlined may accessor functions. + * fhandler.cc: Many changes to support moving fhandler array out of + shared area into locally allocated memory. unix_path_name_ is now + always set (all fhandler_base classes have a name). + * hinfo.cc: Many changes to support moving fhandler array out of + shared area into locally allocated memory. Added linearization and + de-linearization functions. + * net.cc(socket): Added code to keep name for fhandler_socket. + * pinfo.cc : Changed allocation of fhandler_base array to be in local + memory rather than in shared area. (modified functions are pinfo_init, + pinfo_list::get_empty_pinfo, pinfo_list::allocate_pid, + pinfo::record_death). + * shared.cc: Added functions to copy fd area for spawned process. + Changed name of shared area to include master version number of + Cygwin32. + * spawn.cc (spawn_guts): Added code to initialize new shared area + for fds. + * syscalls.cc: Changed all code depending on NOFILE to use + getdtablesize(). Added internal setdtablesize() call for exec'ed + processes. + * syscalls.h: Added getdtablesize(). + * sysconf.cc (sysconf): Changed SC_OPEN_MAX to return getdtablesize(). + * winsup.h: Moved fhandler array out of shared area. Changed from + fhandler to fhandler_base (new root of class tree). + * include/mywinsock.h: Updated #endif to make end of + __INSIDE_CYGWIN32__ clear. + * include/winkernel.h: Added UnmapViewOfFile call. + +Mon Oct 14 14:59:16 1996 Geoffrey Noer <noer@cygnus.com> + + * sysdef/i386: replace all files with ones from Scott + Christley's windows32api-0.1.2 package. Still need to + integrate new headers. + +Mon Oct 14 13:41:14 1996 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (_unlink): need to fchmod file to writable + before attempting to delete. This change still needs more + work (fchmod isn't written yet). + * (fchmod): change comment + +Fri Oct 11 22:27:17 1996 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc, fhandler.h: minor fixes to console + support functions (remove missed reference to gotarg2, + definition in fhandler.h) + +Wed Oct 9 17:55:00 1996 Geoffrey Noer <noer@cygnus.com> + + * delqueue.cc: added copyright notice, reformatted file + + from sos@prospect.com.ru (Sergey Okhapkin): + * fhandler.cc, fhandler.h: add/fix ansi/vt100 console support, + and fix a tab bug + (modified functions are fhandler_console_out::clear_screen, + fhandler_console_out::clear_to_eol, + fhandler_console_out::char_command, + fhandler_console_out::write, + FakeReadFile) + +Wed Oct 9 17:32:17 1996 Jeremy Allison <jra@cygnus.com> + + * times.cc: Swapped gmtime and localtime (they were + incorrectly reversed). + Added is_dst determination to them both. + * misc.c: Added swab, ffs. + * fcntl.cc(fcntl): Added capability for lock calls. + * fhandler.h: Added lock method into fhandler class. + * fhandler.cc: Added NT/Win95 semantics locks into ::lock + made them pretend they are POSIX locks. + * syscalls.cc (writev): Fixed return value bug. + * net.cc: Added WSAEOPNOTSUPP error. + * cygwin.din: Added ffs and swab. + * include/strings.h: Added file (just include string.h). + * include/winbase.h: Added defines LOCKFILE_FAIL_IMMEDIATELY + and LOCKFILE_EXCLUSIVE_LOCK. + * include/winerror.h: Added define ERROR_LOCK_FAILED. + +Thu Oct 3 16:19:23 1996 Jeremy Allison <jra@cygnus.com> + + * fhandler.h: Many changes - removed all public variables + from classes, replaced with accessor functions. Renamed all + class variables to add a trailing '_'. This makes reading + and understanding which variables are class variables much simpler. + Changed name member to unix_path_name_ and made dynamic rather + than a fixed 31 byte buffer per entry. + * fhandler.cc: Updated varable access for above. + * fcntl.cc: Updated varable access for above. + * hinfo.cc: Updated varable access for above. + * spawn.cc: Updated varable access for above. + * syscalls.cc: Added fsync (null call) and fchmod(null + call at present). + * net.cc: Added ioctls for SIOCGIFCONF and SIOCGIFFLAGS. + Added ntohs, ntohl, static functions get_winnt_ifconf, + get_win95_ifconf and get_if_flags. + * include/cygwin32/if.h: Added structs for new ioctls. + * include/cygwin32/socket.h: Added iovec include. + * include/asm/socket.h: Added defines for above ioctls. + * cygwin.din: Added ntohs, ntohl, fsync, fchmod. + +Wed Oct 2 17:34:21 1996 Geoffrey Noer <noer@cygnus.com> + + * utils/configure.in: add call to AC_CANONICAL_SYSTEM + * utils/configure: regenerate + * Makefile.in: build cygwin.dll as new-cygwin.dll and install as + cygwin.dll to prevent confusion when building winsup natively + +Tue Oct 1 17:27:34 1996 Jeremy Allison (jra@cygnus.com) + + * include/regex.h: Added. + * net.cc: Added WSAECONNRESET, WSAEPFNOSUPPORT to + errmap array. + +Tue Oct 1 15:40:39 1996 Jeremy Allison (jra@cygnus.com) + + * fork.cc (cygwin_fork_helper1): Fixed resource leak of process + handles, added cleanup code. Also fixed timout problem when child + cannot be initialized. + * dirsearch.cc (readdir): Changed comparison to explicitly check for + INVALID_HANDLE_VALUE. Test < 0 fails with void *. + * syscalls.cc (num_entries): Changed comparison to explicitly check for + INVALID_HANDLE_VALUE. Test < 0 fails with void *. + * cygwin.din: Added regcomp, regexec, regerror, regfree. + * Makefile.in: Added EXTRA_OFILES containing ../librx/rx.o. Added + comment to explain makefrag. Added ../newlib/libc/include to include + path. + +Mon Sep 30 16:10:56 1996 Stu Grossman (grossman@critters.cygnus.com) + + * cygwin.din: Remove getopt and friends. + +Fri Sep 27 18:31:28 1996 Jeremy Allison <jra@cygnus.com> + + * dcrt0.cc (dll_crt_1): Moved initialization of _reent to correct + position. + +Fri Sep 27 14:24:05 1996 Jeremy Allison <jra@cygnus.com> + + * dcrt0.cc (dll_crt_1): Fixed fork bug with _impure_ptr not being + initialized correctly in a forked child. This should fix + the bash echo in a sub-shell bug. + * include/sys/uio.h: Created file. Contains definitions for writev + * include/limits.h: Added IOV_MAX and SSIZE_MAX. + * syscalls.cc: Added writev, changed read and write to return ssize_t. + * syscalls.h: Added writev, changed read and write to return ssize_t. + * cygwin.din: Added writev call. + +Wed Sep 20 13:09:00 1996 Jeremy Allison <jra@cygnus.com> + + * include/mntent.h: Added MOUNTED definition, needed by + some code. + * dcrt0.cc : Added __progname for getopt code. + * misc.c: Added getw code. + * cygwin.din: Added getopt, optarg, opterr, optind + optopt, putw, getw calls. + +Fri Sep 20 03:03:17 1996 Geoffrey Noer <noer@cygnus.com> + + * select.cc: change long millisec to unsigned int, + respaced file + + patch from Sergey Okhapkin <sos@prospect.com.ru>: + * select.cc (polled): fix for select to get keyboard input + working properly (check EventType != KEY_EVENT instead + of checking for KeyEvent.AsciiChar == 0) + * select.cc (cygwin32_select): make int i unsigned int so NULL is + a valid timeout argument for loop + +Fri Sep 13 18:21:52 1996 Jeremy Allison <jra@cygnus.com> + + * fhandler.cc (fhandler_base::read): rewrite text mode read + +Fri Sep 13 14:58:17 1996 Geoffrey Noer <noer@cygnus.com> + + * exceptions.cc (call_handler): fix control-C not working + problem by setting rethere variable before the old value is + clobbered. + +Thu Sep 12 16:27:00 1996 Jeremy Allison <jra@cygnus.com> + + * syslog.cc (pass_handler) : Removed duplicate code + in pass_handler::print(). Added get_win95_event_log_path() + to facilitate moving to registry configuration. + +Thu Sep 12 12:56:00 1996 Jeremy Allison <jra@cygnus.com> + + * syslog.cc : Added real openlog, syslog, logmask, closelog + calls. syslog logs to event log on NT, file on Win95. + * include/winnt.h : added EVENTLOG_xx_TYPE definitions. + * include/winadvapi.h : added ReportEventA, RegisterEventSourceA + DeregisterEventSourceA declarations. + * include/winkernel.h : added LockFile, UnlockFile, LockFileEx, + UnlockFileEx declarations. + * include/wintypes.h : added PSID typedef. + * include/sys/syslog.h : added options flag definitions for openlog. + +Wed Sep 11 15:34:09 1996 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc (popen): delete stub in favor of newlib's + (pclose): delete stub in favor of newlib's + +Tue Sep 10 17:20:56 1996 Geoffrey Noer <noer@cygnus.com> + + * configure.in: don't transform names (the only time this might + be a good idea is for unix x cygwin32) + * configure: regenerated with autoconf + +Tue Sep 10 17:20:56 1996 Geoffrey Noer <noer@cygnus.com> + + patch from Sergey Okhapkin <sos@prospect.com.ru>: + * fhandler.cc (FakeReadFile): support arrow keys, stop treating + bringing window to front as a key down (resulting in random + characters being printed in bash). + +Mon Sep 9 19:09:36 1996 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (system): fix system call + +Fri Sep 6 09:33:13 1996 Doug Evans <dje@canuck.cygnus.com> + + * fhandler.h (fhandler_base): Make execable_p public char, not + private signed char. Delete get_execable. + * fhandler.cc (fhandler_base::get_execable): Renamed to + check_execable_p. + (fhandler_base::open): Restore symlink support. + Set execable_p, symlink_p. + (fhandler_base::fstat): Replace call to get_execable with reference + to execable_p. + (fhandler_base::fhandler_base): Set execable_p to 0. + * path.h (symlink_check): Declare it. + * path.cc (symlink_check): New function. + (readlink): Call it. + (symlink_follow): Likewise. New arg EXEC, callers updated. + * syscalls.cc (_stat_worker): New arg CALLER, callers updated. + + * syscalls.cc: Delete all occurences of in/out and MARK. + +Thu Sep 5 18:51:01 1996 Doug Evans <dje@canuck.cygnus.com> + + * fork.cc: Don't include <ctype.h>. Delete find_exec and support. + * spawn.cc: Include <ctype.h>. Move find_exec and support here. + (perhaps_suffix): New argument report_failure_p, callers updated. + (find_exec_1): Use perhaps_suffix when scanning PATH. + (spawn_guts): Replace code to translate posix to win32 path lists + with calls to utility fns that do the job. + +Wed Sep 4 13:30:57 1996 Doug Evans <dje@canuck.cygnus.com> + + * path.cc (readlink): Make more bulletproof. + +Wed Aug 28 16:44:24 1996 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (system): use execlp + * public release beta 16 made + +Tue Aug 27 09:58:14 1996 Doug Evans <dje@canuck.cygnus.com> + + * version.h (CYGWIN_DLL_VERSION_MINOR): Bump up to 2. + +Mon Aug 26 15:12:44 1996 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (system): added basic system() call. + +Mon Aug 26 13:46:30 1996 Doug Evans <dje@canuck.cygnus.com> + + * cygwin.din (cygwin_fork_helper__FPvN30): Delete. + (vfork,select): Add. + * fork.cc (prepare_child): Delete, contents moved into + cygwin_fork_helper1. + (cygwin_fork_helper): Delete, contents moved into __fork. + * winsup.h (cygwin_fork_helper): Delete. + + * path.cc: #include <fcntl.h>. + (symlink,readlink): Reenable, rewrite. + (symlink_follow): New function. + * path.h (symlink): Delete. + (SYMLINK_COOKIE, MAX_LINK_DEPTH): Define. + (symlink_follow): Declare. + * spawn.cc (spawn_guts): Rewrite symlink support. + + * syscalls.cc (_unlink): Make arg a const char *. + * winsup.h (_unlink): Likewise. + + * spawn.cc (spawn_guts): Fix allocation of stack space for sh.exe path. + + * include/sys/errno.h: Deleted. Use newlib's. + +Fri Aug 23 16:00:00 1996 Jeremy Allison <jra@cygnus.com> + + * net.cc (getdomainname): Changed win95 code to open + "System" key rather than "SYSTEM". I think the registry + is case-sensitive. + +Thu Aug 22 17:04:09 1996 Geoffrey Noer <noer@cygnus.com> + + move fork into the dll: + * libcfork.cc: deleted + * fork.cc (vfork): used to be in libcfork.cc + * (__fork): used to be in libcfork.cc + * (fork): used to be in libcfork.cc + * Makefile.in: don't build libcfork.cc any more + * libccrt0.cc: set data_start, etc. from dll structure + * winsup.h: add data_start, etc. to public vars in dll + * cygwin.din: list fork + +Thu Aug 22 01:36:53 1996 Geoffrey Noer <noer@cygnus.com> + + * registry.cc: fix new registry code + * syscalls.cc: make Windows95 check function extern "C" + +Wed Aug 21 16:15:47 1996 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: list vfork + * dirsearch.cc: fix errno setting in readdir that caused + diff to not function on directories + * pipe.cc: reformatted + +Wed Aug 21 15:12:47 1996 Jeremy Allison <jra@cygnus.com> + + * net.cc (domainname): Changed getdomainname to get the + information from the registry. + * registry.h: Modified interface to reg_key. + * registry.cc: Added open(),close() calls, made + get/set string values return error indication, added trailing + underscore to hkey member so it can be seen to + be a class member. + * include/winadvapi.h: Added KEY_READ and KEY write + defines for registry access. + +Mon Aug 19 09:22:35 1996 Doug Evans <dje@canuck.cygnus.com> + + * path.cc (split_path): New function. + * path.h (split_path): Declare it. + * cygwin.din (cygwin32_split_path): Export it. + + * include/winkernel.h (FILE_SHARE_DELETE): Define. + + * syscalls.cc (__do_global_[cd]tors], __main): Move from here. + * dcrt0.cc: To here. + + * dcrt0.cc (recur): Restore (now that we know WHY it was needed). + (dll_crt0_1): Probe forked child's stack out. + + * fork.cc (FORK_WAIT_TIMEOUT): Bump up to two minutes. + + * fork.cc (dump_jmp_buf): New function. + (cygwin_fork_helper1): Call it. + * dcrt0.cc (dll_crt0:1): Call it. + * winsup.h (dump_jmp_buf): Declare it. + + * fork.cc (cygwin_fork_helper1): Reenable child suspend before + stack copy code. + +Sat Aug 17 04:06:36 1996 Geoffrey Noer <noer@cygnus.com> + + * dirsearch.cc: reformatted, removed a couple of gotos + +Thu Aug 15 17:56:08 1996 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: added __eprintf, a newlib function needed by assert. + * times.cc: swap gmtime and localtime (gmtime really was localtime + and vice versa). + +Tue Aug 13 03:46:22 1996 Geoffrey Noer <noer@cygnus.com> + + * signal.cc: renamed all signal variables "sig", + fixed signal range error checking in all relevant functions, + (sigaddset): new + (sigismember): new + (sigfillset): new + (sigemptyset): new + * cygwin.din: added corresponding entries for new signal functions. + * cygwin.h: added protos for them + * fhandler.cc, fhandler.h: major reformat of code + * net.cc (cygwin32_socket): call checkinit() at start to + initialize WinSock in case it isn't already. + * syscalls.cc (access): set errno appropriately when no + write access + * fcntl.cc: reformatting + +Sat Aug 10 16:30:14 1996 Geoffrey Noer <noer@cygnus.com> + + * signal.cc (_raise): rewrite to shorten code, corrected + return values. + * fcntl.cc, net.cc, signal.cc, stubs.c: reformatted, added + public domain notice at the tops if they were missing. + +Fri Aug 9 18:19:12 1996 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (_rename): return -1 if file to be renamed + doesn't exist. Reformatted whole file. + * fork.cc: increase timeout value to 60 sec from 30 sec + +Thu Aug 8 17:44:39 1996 Jim Wilson <wilson@cygnus.com> + + * config/i386/longjmp.c: Increment %eax if it is zero. + +Wed Aug 7 15:51:04 1996 Geoffrey Noer <noer@cygnus.com> + + * include/sys/mman.h: fixed defines for PROT_READ et al to + match what's more normally there in unix + * sysdef/i386/*: removed the extra underscores present in most + of these files that shouldn't have been there + * net.cc: cleaned up whitespace, formatting + +Tue Jul 16 12:43:16 1996 Doug Evans <dje@canuck.cygnus.com> + + * libccrt0.cc (__version): Deleted, unused. + + * uname.c (uname): Print CYGWIN_DLL_VERSION is version field. + +Mon Jul 15 16:48:29 1996 Doug Evans <dje@canuck.cygnus.com> + + * version.h (CYGWIN_DLL_VERSION_MINOR): Bump up to 1. + + Path handling clean up, pass 2 (use //<letter>, not /.<letter>.). + * path.cc (SLASH_DRIVE_PREFIX_LEN): Delete. + (slash_drive_to_win32_path): New function. + (mount_info::posix_path_p): Delete support for $CYGWIN, + always return 1. + (path_conv::path_conv): Call slash_drive_to_win32_path. + (mount_info::conv_to_win32_path): Renamed from + posix_path_to_win32_path. All callers updated. + (mount_info::conv_to_posix_path): Renamed from + win32_path_to_posix_path. All callers updated. + (normalize_posix_path): Keep two leading /'s (or \'s). + (normalize_win32_path): Likewise. + (conv_to_{win32,posix}_path): Renamed from + {posix,win32}_path_to_{win32,posix}_path_keep_rel. + (conv_to_full_{win32,posix}_path): Renamed from + {posix,win32}_path_to_full_{win32,posix}_path. + (posix_path_list_p): New function. + (cygwin32_{unix,dos}_path_to_{dos,unix}_path_keep_rel): Delete. + ({unix,dos}_path_to_{dos,unix}_path): Delete. + ({win32,posix}_to_{posix,win32}_path_list_buf_size): Renamed from + cygwin32_{win32,posix}_to_{posix,win32}_path_list_buf_size. + ({win32,posix}_to_{posix,win32}_path_list): Renamed from + cygwin32_{win32,posix}_to_{posix,win32}_path_list. + (slash_drive_prefix_p): Recognize //<letter>, not /.<letter>. + (build_slash_drive_prefix): Update. + * path.h: Update. + * cygwin.din ({dos,unix}_path_to_{unix,dos}_path): Delete. + (cygwin32_{dos,unix}_path_to_{unix,dos}_path_keep_rel): Delete. + (cygwin32_conv_to_{posix,win32}_path): Renamed from + (cygwin32_{win32,posix}_path_to_{posix,win32}_path_keep_rel. + (cygwin32_conv_to_full_{posix,win32}): New exports. + (cygwin32_posix_path_list_p): New export. + * dcrt0.cc (path_len): Delete. + (PATH_ENV_BUF_SIZE): Delete. + (conv_path_names): Delete all but PATH. + (dll_crt0_1): Rewrite environment variable conversion code. + * fork.cc (find_exec_1): Delete _SC_PATH_RULES support. Determine + path delimiter by calling posix_path_list_p. + * shared.cc (shared_info::initialize): Delete `path_rules'. + * sysconf.cc (sysconf): Delete _SC_PATH_RULES. + * winsup.h (shared_info): Delete `path_rules'. + + * fork.cc (cygwin_fork_helper1): Reset u->forkee after child has + started. + + * pinfo.cc (pinfo::init_from_fork): Delete. Empty function. + * fork.cc (cygwin_fork_helper1): Delete call to it. + + * utils/kill.cc (usage): New function. + (main): Allow multiple pids to be passed. Call usage. + +Mon Jul 15 13:07:23 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * Makefile.in (install): If cross compiling, install the + cygwin.dll file as $target_alias-cygwin.dll in the bin directory, + instead of plain cygin.dll. + Install the cygwin.dll file in the library directory as well. + + * configure.in: Test for cross compiling, and if cross compiling, + transform name of cygwin.dll file in the binary directory. + + * configure: Regenerate. + + * utils/Makefile.in (Makefile): Rebuild Makefile if configure.in + changes. + (install): Use the toplevel install.sh to install the utilities, + and transform the name if cross compiling. + + * utils/configure.in: Test for cross compiling, and if cross + compiling, tranform mount, umount, ps, etc. Do not call + AC_PROG_INSTALL anymore. + + * utils/configure: Regenerate. + +Fri Jul 12 16:25:09 1996 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: also make install in utils subdir so "mount" + et al gets installed. + +Thu Jul 11 17:53:31 1996 Geoffrey Noer <noer@cygnus.com> + + * include/sys/param.h: fixed value of HZ (now 1000 instead of 100). + caused bug that showed up as "time sleep 5" returning 50. + +Thu Jul 11 14:08:09 1996 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc: correct typo in comment + * exceptions.cc: remove definition of sig_func_ptr, replace + occurances with newlib-defined _sig_func_ptr. + +Wed Jul 10 19:12:18 1996 Doug Evans <dje@canuck.cygnus.com> + + * version.h (CYGWIN_DLL_VERSION_{MAJOR,MINOR}): Bump up to 17.0. + * winsup.h (class per_process): New members {public,internal}_reserved. + (SIZEOF_PER_PROCESS): Define. + * dcrt0.cc (dll_crt0_1): Add sanity check of per_process size. + Don't call checkout for forkee. + * libccrt0.cc (cygwin_crt0): Set magic_biscuit to sizeof per_process + again. + + * utils/ps.cc (main): Print uid. + + * hinfo.h: Deleted. Contents moved to winsup.h. + * Makefile.in (WINSUP_H): Update. + + * dcrt0.cc (u, environ): Moved here. + * shared.cc: From here. + + * pinfo.cc (pinfo_init): Renamed from pinfo_init_per_process. + All callers updated. + * hinfo.cc (hmap_init): Renamed from hmap_init_per_process. + All callers updated. + * winsup.h (cygwin_parent_p): Renamed from invoked_by_cygwin_p. + All uses updated. + + * fork.cc (prepare_child): Add debug message. + + * uinfo.cc (uinfo_init): Renamed from uinfo::init. + All callers updated. Call getlogin instead of GetUserName. + (getlogin): Call GetUserName. + * winsup.h (class uinfo): Delete. Members uid,gid moved ... + (class pinfo): To here. All uses updated. + (class shared_info): Delete member `u'. + * fork.cc (cygwin_fork_helper1): Set child's uid,gid. + + * pinfo.cc (pinfo::clearout): Reset strace_mask_ptr. + + * shared.cc (open_shared_file_map): Add debugging message. + +Fri Jul 5 15:36:48 1996 Doug Evans <dje@canuck.cygnus.com> + + * exceptions.cc (sig_func_ptr): New typedef. + (__stack_trace): Make i386 and ppc formats the same. + (sigfunc): Use sig_func_ptr. + (call_handler): Likewise. All callers updated. + (__cygwin_exception_handler): Handle exceptions before dll has + fully initialized. Only call dump_status once, like __stack_trace. + (really_exit): Call _exit, not exit. + + * hinfo.cc: Add copyright. + * uinfo.cc: Likewise. + + * passwd.c: Whitespace cleanup. + (search_for): Make static. + + * pinfo.cc (pinfo_list::init): Delete call to clearout vec[0]. + (pinfo::clearout): Reset more fields. + (pinfo_list::get_empty_pinfo): Delete printing of error messages + if table is full. + + * shared.cc (open_shared_file_map): Mark shared map as not inherited. + + * signal.cc (signal): Delete (void *) coersion of result. + (usleep): Convert microseconds to milliseconds. Delete second copy. + (_raise): Use _sig_func_ptr. + + * syscalls.h: Delete #include mntent.h, sys/types.h, string.h, + stdio.h, setjmp.h, stdlib.h, signal.h, sys/strace.h, unistd.h, + ctype.h, fcntl.h. + * winsup.h: #include sys/types.h, sys/strace.h, setjmp.h, signal.h, + string.h, windows.h. + * All necessary files updated. + + * winsup.h (class pinfo): Delete member localtime_buf. + * times.cc (corelocaltime): Use static local for localtime_buf. + + * winsup.h (class pinfo): Rename the_pid to pid. All uses updated. + Delete handle_valid_p, unused. Rename __sig_mask to sig_mask. + +Thu Jul 4 14:36:01 1996 Doug Evans <dje@canuck.cygnus.com> + + * shared.h: Deleted. All files updated. + * winsup.h: shared.h contents moved here. + * Makefile.in (WINSUP_H): Update. + + * heap.cc: Renamed from pproc.cc. + (heap_init): Renamed from per_process::init. + In forkee initialization, ensure memory being reserved is at same + address as parent's. Commit forkee memory in one chunk. + (_sbrk): Moved here, + * syscalls.cc (_sbrk): From here. + * Makefile.in (DLL_OFILES): Update. + * dcrt0.cc (dll_crt0_1): Call heap_init instead of u->init. + * winsup.h (class per_process): Delete member `init'. + + * dcrt0.cc (recur): Delete. + (dos_argv_to_unix_argv): Delete. + + * delqueue.cc: Delete #include of delqueue.h, winerror.h + * winsup.h: #include delqueue.h. + + * exceptions.cc (ctrl_c_handler): Only require 13 ^c's to quit task. + + * fork.cc (fork_mutex,forkee_stopped,forker_stopped): New static + globals, were in class_shared info. + (fork_init,fork_terminate): New functions. + (prepare_child,cygwin_fork_helper1): Update. + (cygwin_fork_helper1): If fork disabled, return EAGAIN. + Delete unnecessary resetting of forkee_stopped event. + * winsup.h (fork_init,fork_terminate): Declare them. + * dcrt0.cc (dll_crt0_1): Call fork_init. + (_exit): Call fork_terminate. + * shared.c (shared_info::initialize): Delete init of fork stuff. + + * shared.c (h): New static global, was in class shared_info. + (shared_info::terminate): Delete, move contents into shared_terminate. + + * strace.cc (flush_p): New static global. + (strace_init): Don't clobber u->strace_mask if _STRACE_INHERIT set. + (__sys_printf): Only flush buffers if _STRACE_FLUSH. + * include/sys/strace.h (_STRACE_FLUSH,_STRACE_INHERIT): Define. + Reorganize bitmasks. + + * utils/ps.cc (main): Make output prettier. + +Wed Jul 3 12:30:24 1996 Doug Evans <dje@canuck.cygnus.com> + + * utils/Makefile.in (mount,umount,ps,kill): Rewrite rules. + (PROGS): Add cygwin. + (cygwin): New target. + (install): Install all of $(PROGS). + * utils/cygwin.cc: New file. + + * pinfo.cc (pinfo_init_per_process): PID environment variable handling + moved here. Delete setting of u->parent. Set strace_mask_ptr. + Set invoked_by_cygwin_p appropriately. + (vfork_init): Delete, unused. + (pinfo::init_self): Delete setting of root_p. + (pinfo::terminate): root_p renamed to invoked_by_cygwin_p. + * winsup.h (class per_process): Delete initial_pid, no longer used. + (class pinfo): Add strace_mask_ptr. + * fork.cc (cygwin_fork_helper1): Update. + + * winsup.h (class per_process): Delete trace_file, trace_mutex. + Rename estrace to strace_mask. + (system_printf): Declare. + * strace.cc (strace_init): Renamed from per_process::strace_init. + Don't open trace file unless strace environment variable set. + Open trace file with FILE_SHARE_READ so others can read trace file + while tracing in progress. Print error if $strace too big. + (strace_file, strace_mutex): New static globals. + (__sys_printf): Don't do anything if strace file not opened. + (system_printf): New function. + * pproc.cc (per_process::init): Delete call to strace_init. + * dcrt0 (dll_crt0_1): Call strace_init as soon as possible. + + * dcrt0 (dll_crt0_1): Delete local can_glob, use + u->self->invoked_by_cygwin_p instead. + Move PID environment variable handling into pinfo_init_per_process. + Delete setting of u->self->in_bash. + Delete watching for bash. + * winsup.h (class pinfo): Delete in_bash. + + * exceptions.cc (*): Call system_printf, not __sys_printf. + + * shared.h (class shared_info): Delete pp, unused. + + * syscalls.cc (isatty): Replace ttyname with is_tty. + + * winsup.h (registry_init_once_only): Delete, unused. + (stdout_handle,file_handle_from_fd): Likewise. + (CHILD_P,child_p,ALL_FS,loadup_dll,cygwin_s): Likewise. + (unmixedcaseify): Prototype moved to path.h. + * path.h (unmixedcaseify): Declare. + + * fork.cc (FORK_WAIT_TIMEOUT, WAIT_ERROR_RC): Define. + (find_exec_1): Don't search PATH if directory present (not only if + absolute path). Search "." before searching PATH. + (copy): Return boolean indicating success. All callers updated. + (prepare_child): Simplify. Check return code of WaitForSingleObject. + Don't wait an infinite amount of time. + (cygwin_fork_helper1): Simplify. + Check return code of WaitForSingleObject. + Don't wait an infinite amount of time. + Check return code of copy. + Disable code to Suspend/Resume child thread a second time. + + * winsup.h (class per_process): Make initial_sp a char *. + * libccrt0.cc (cygwin_crt0): Update. + + * path.cc (path_conv): If name too long, set path to bogus value. + + * include/winkernel.h (WriteProcessMemory): Fix prototype. + + * include/sys/strace.h: Add extern "C" ifdef __cplusplus. + (_STRACE): Delete. + * dirsearch.cc (rewinddir): Use syscall_printf. + +Tue Jul 2 14:44:18 1996 Doug Evans <dje@canuck.cygnus.com> + + * wait.cc (WAIT_ERROR_RC): Use it instead of ALL_FS. + (wait_found): New argument `options'. If GetExitCodeProcess fails, + ensure `result' contains something reasonable. + (wait_for_single): Check whether `c' is NULL before dereferencing it. + (wait_for_any): Add some comments. Delete unnecessary gotos. + (waitpid): Print message if called with intpid == 0. + +Sat Jun 29 10:49:28 1996 Doug Evans <dje@canuck.cygnus.com> + + * dirsearch.cc (readdir): Clean up syscall tracing. + Mixed case handling temporarily disabled. + +Wed Jun 26 11:54:27 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (bindir, libdir, datadir, infodir, includedir): + Use autoconf-set values. + (docdir): Removed. + (install-info): Add. + * configure.in (AC_PREREQ): autoconf 2.5 or higher. + * configure: Rebuilt. + * glob/configure.in (AC_PREREQ): autoconf 2.5 or higher. + * glob/configure: Rebuilt. + * utils/Makefile.in (bindir, exec_prefix): Use autoconf-set values. + * utils/configure.in (AC_PREREQ): autoconf 2.5 or higher. + * utils/configure: Rebuilt. + +Tue Jun 25 17:48:56 1996 Doug Evans <dje@canuck.cygnus.com> + + * include/sys/param.h (PATH_MAX,MAXPATHLEN): Change from 1024 to 259. + (BIG_ENDIAN,LITTLE_ENDIAN,BYTE_ORDER): Define. + +Mon Jun 24 16:35:48 1996 Mark Eichin <eichin@cygnus.com> + + * fhandler.cc (read): Replace the old broken igncr code (which has + been disabled for a while anyway) with code that checks for + ENABLE_LINE_INPUT and replace only \r\n with \n. + +Mon Jun 24 00:12:22 1996 Doug Evans <dje@canuck.cygnus.com> + + * dcrt0.cc (dll_crt0_1): Convert argv[0] to posix style if necessary. + +Sun Jun 23 17:21:41 1996 Doug Evans <dje@canuck.cygnus.com> + + * version.h (CYGWIN_DLL_VERSION_MINOR): Bump up to 2. + + * fork.cc (perhaps_suffix): Simplify. + (find_exec_1): Likewise. Always try appending .exe first. + (cygwin_fork_helper1): Clean up (lots more needed still). + Test for split heap before calling CreateProcess. + No longer call find_exec, now done at start up. + * dcrt0.cc (dll_crt0_1): Call find_exec to expand argv[0]. + + * path.cc (conv_path_list_buf_size): New function. + (cygwin32_{win32,posix}_to_{posix,win32}_path_list_buf_size): Ditto. + (conv_path_list): Ditto. + (cygwin32_{win32,posix}_to_{posix,win32}_path_list): Ditto. + * cygwin.din: Export them. + + * misc.c (small_printf): Delete. + (vhangup): Set errno. + + * syscalls.cc (isatty): Print syscall trace message even if error. + + * console.cc (*): Check return codes of win32 api calls. + + * syscalls.cc (chmod): Set errno of SetFileAttributes fails. + Fix call to syscall_printf. + +Thu Jun 20 00:43:52 1996 Doug Evans <dje@canuck.cygnus.com> + + * dcrt0.cc (dll_crt0_1): Save full program name. + * fork.cc (cygwin_fork_helper1): Always call find_exec. + + * path.cc (normalize_{posix,win32}_path): Fix edge case handling. + (path_conv::path_conv): Ensure path is \-ified if win32 path rules. + + * spawn.cc (spawn_guts): Set errno if CreateProcess fails. + +Wed Jun 19 00:18:03 1996 Doug Evans <dje@canuck.cygnus.com> + + * path.h (PATH_RULES macros): Delete. Use ones in unistd.h. + (enum path_rules_enum): Deleted. All uses updated. + (path_conv): Rename member get_native to get_win32. All uses updated. + (*win32_path*): Renamed from *native_path*. + * path.cc (*win32_path*): Renamed from *native_path*. + (mount_info::posix_path_p): Prepend '_' to PATH_RULES. + Fix returning of cached value. + (slash_drive_prefix_p, build_slash_drive_prefix): New functions. + (mount_info::posix_path_to_win32_path): /.<letter>. is a drive spec. + (path_conv::path_conv): Likewise. + (mount_info::win32_path_to_posix_path): Convert unknown drives to + /.<letter>. Normalize win32_path. + (normalize_win32_path): New functions. + (getcwd_inner): New arg `posix_p'. All callers updated. + * shared.cc (shared_info::initialize): Prepend '_' to PATH_RULES. + _PATH_RULES_NATIVE -> _PATH_RULES_WIN32. + * spawn.cc (*win32_path*): Renamed from *native_path*. + * dcrt0.cc: Likewise. + * cygwin.din: Likewise. + + * Makefile.in (WINSUP_H): Add shared.h + + * smallprint.c (rn): Make static. + + * sysconf.cc: Renamed from sysconf.c. + (sysconf): Support _SC_PATH_RULES. + + * screen.c: Deleted. + * Makefile.in (DLL_OFILES): Delete screen.o. + + * fork.cc (cygwin_fork_helper): Don't pass 0 from longjmp to setjmp. + + * path.h (class mount_info): Update posix_path_to_native_path member. + * path.cc (path_prefix_p): Rewrite. + New arg `len'. All callers updated. + (mount_info::binary_native_path_p): Call path_prefix_p. + (path_conv::path_conv): Pass full_path to binary_native_path_p. + (mount_info::posix_path_to_native_path): Delete arg keep_rel_p. + New arg full_native_path. All callers updated. Don't call + getcwd_inner if unnecessary. Rewrite relative path handling. + (mount_info::native_path_to_posix_path): Call path_prefix_p. + Call slashify on `pathbuf', not original argument. + + * syscalls.cc (chdir): Fix lifetime of converted path. + +Tue Jun 18 11:48:51 1996 Doug Evans <dje@canuck.cygnus.com> + + * configure.in (EXE_LDFLAGS): Explicitly link with newlib if necessary. + * configure: Regenerated. + * Makefile.in (EXE_LDFLAGS): Define. + (FLAGS_TO_PASS): Add EXE_LDFLAGS. + (config.status): New target. + (utils-all): Depend on $(LIBNAME). + * utils/Makefile.in (EXE_LDFLAGS): Define. + (mount,umount,ps,kill): Link with $(EXE_LDFLAGS). + + * version.h (CYGWIN_DLL_VERSION_MINOR): Bump up to 1. + +Mon Jun 17 18:29:54 1996 Doug Evans <dje@canuck.cygnus.com> + + Improve pathname handling, first pass. + * path.h (symlink): Renamed from link_cookie. + (class path_conv): New member error. + (path_conv::get_native): Renamed from get_dos, all uses updated. + (path_conv::get_binary): Delete. + (mount_info::{mangle,reverse_mangle}): Delete. + (mount_item::posix_path_to_native_path): Renamed from mangle. + (mount_info::native_path_to_posix_path): Renamed from reverse_mangle. + (path_rules_enum): Define. + * path.cc: Temporarily disable mixed-case and symlink handling. + (mount_info::posix_path_p): New function. + (mount_info::binary_native_path_p): Renamed from binary_dos_path_p. + (path_conv::path_conv): Handle native path rules. + (mount_item::{mangle,reverse_mangle}): Delete. + (mount_info::posix_path_to_native_path): Renamed from mangle. + (mount_info::native_path_to_posix_path): Renamed from reverse_mangle. + (mount_info::from_registry): Set nmounts. Use MAX_PATH. + (mount_info::{add,del}_item): Rewrite. + (slashify): Renamed from flip_slash. + (getcwd_inner): Make static. Don't convert to posix path if using + native path rules. + (file_exists): Delete. + (addmntent,hasmntopt): Delete. + (mount): Only update registry if mount succeeded. + (umount): Only update registry if umount succeeded. + (normalize_posix_path): Renamed from normalize_path. Pass in cwd. + (cygwin32_{posix,native}_path_to_{native,posix}_path_keep_rel): Renamed + from ...{unix/dos}.... + * dcrt0.cc (dos_argv_to_unix_argv): #ifdef out. + (dll_crt0_1): Don't call it. + * fhandler.cc (fhandler_base::open): Temporarily disable symlinks. + * shared.cc (open_shared_file_map): New function. + (shared_init): Call it. + (shared_info::initialize): Fetch `path_rules' from registry. + * shared.h (inited): Make private. + (path_rules): New member. + * spawn.cc: #include "shared.h". + (spawn_guts, env var translation): Don't translate path names if + using native path rules. + * syscalls.cc (symlink): Delete (moved to path.cc). + * cygwin.din (dump__5pinfo): Delete. + (cygwin32_{posix,native}_path_to_{native,posix}_path_keep_rel): Renamed + from ...{unix/dos}.... + + * smallout.cc: Delete. + * sdata.cc: Delete. + * shared.cc (u,s,environ): Define here. + * Makefile.in (glob/libglob.a): Depend on glob/glob.c, glob/fnmatch.c. + (utils-all): New target. + (DLL_OFILES): Delete smallout.o, sdata.o. + (Makefile): Depend on cygwin.din. + (WINSUP_H): Depend on syscalls.h. + + * configure.in (AC_CONFIG_SUBDIRS): Add bin. + (AC_PROG_INSTALL): Call. + * configure: Regenerated. + * utils/{Makefile.in,configure.in,configure}: New files. + * utils/{kill.cc,mount.cc,ps.cc,umount.cc,termcap}: New files. + * Makefile.in (UTILS_ALL): Define. + (all): Depend on $(UTILS_ALL). + (utils-all): New target. + + * dcrt0.cc (recur): Make no-op to see what happens. + (globify): Don't call glob if unnecessary. + Check return code from glob. + (api_fatal): New function. + * fhandler.cc (fhandler_base::read): Dump first few chars read. + (fhandler_base::get_execable): New function. + (fhandler_base::fstat): Use it. + (fhandler_base::fhandler_base): Init execable_p. + (fhandler_disk_file::fhandler_disk_file): Delete execable_p. + (fhandler::{get,set}_execable_bit): Delete. + (fhandler_disk_file::{get,set}_execable_bit): Delete. + * fhandler.h (class fhandler): Delete {get,set}_execable_bit. + (class fhandler_base): New member execable_p. + New member fn get_execable. + * fork.cc: Simplify/cleanup. + (cygwin_fork_helper1): Use MAX_PATH, not MAXPATHLEN. + * pinfo.cc (pinfo::dump): Delete. + * pproc.cc (per_process::set_envname): Delete. + * strace.cc (smallout::do_pline): Delete. + * syscalls.h (readlink): Third arg is an int. + * winsup.h (class pinfo, member progname): Use MAX_PATH. + (class pinfo, member dump): Delete. + (class smallout): Delete. + (smallout): Delete. + (class per_process, member set_envname): Delete. + (file_exists): Delete. + (api_fatal): Declare. + * Makefile.in (LIB{C,CXX}FLAGS_FOR_TARGET): Delete, use {C,CXX}FLAGS. + (FLAGS_TO_PASS): Define. + (glob/libglob.a): Delete duplicate entry. + + * syscalls.cc (_sbrk): Update u->size when heap is grown. + + * hinfo.cc (hmap_init_per_process): Ensure stdout's handle != stderr's. + +Fri Jun 14 06:32:13 1996 Doug Evans <dje@canuck.cygnus.com> + + * register.h, registry.cc: Whitespace cleanup. + +Thu Jun 13 20:57:28 1996 Doug Evans <dje@canuck.cygnus.com> + + * Makefile.in (install): Install cygwin.dll in $(bindir). + +Tue Jun 11 13:46:17 1996 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc: lseek is now only binary mode, interpret control + z characters as EOF when reading from a file. Reformatted some + of the code (cleaned up line spacing, etc.) + +Tue Jun 11 09:50:09 1996 Jason Molenda (crash@kyriath.cygnus.com) + + * path.cc (nofinalslash): move it so it is next to its friends + flip_slash and backslashify. + +Mon Jun 10 18:57:03 1996 Jason Molenda (crash@kyriath.cygnus.com) + + * path.cc (*): Pretty printing. + (unix_path_to_dos_path_with_rel): use "dosnamein" and "unixnameout" + instead of "path" & "real_path". + (dos_path_to_unix_path_keep_rel): delete obsolete code. + (mount_item::mangle): use "unixnamein" and "dosnameout" instead of + "unixname" and "dosname". + (mount_info::mangle): use "unixnamein" and "dosnameout". Remove + obsolete code. + * path.h (mount_item): Update prototypes, add comment. + (mount_info): Update prototypes. + +Mon Jun 10 17:05:23 1996 Jason Molenda (crash@kyriath.cygnus.com) + + * path.cc (mount_item::reverse_mangle): Pretty printing, + add a bit to the comment. + (getcwd_inner): use MAX_PATH not MAXPATHLEN. + (normalize_path): use MAX_PATH not MAXPATHLEN. + (link_cookie::follow): use MAX_PATH not MAXPATHLEN. + +Mon Jun 10 15:36:32 1996 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: changed $(DOC) so it doesn't include html + files; made a new info-html target that does the html + versions of the docs. Since most customers don't have texi2html + installed, the make shouldn't fail because of this. + * configure: regenerated with autoconf 2.8 + +Sun Jun 9 17:10:37 1996 Doug Evans <dje@canuck.cygnus.com> + + * version.c: Deleted. + * version.h: New file. + * winsup.h (VERSION): Deleted. + (class per_process): Add version_major, version_minor. Delete version. + * registry.cc: #include "version.h". + (reg_session::reg_session): Update. + * libccrt0.cc: #include "version.h" + (cygwin_crt0): Delete setting of version, set magic_biscuit to 0. + Set version_major, version_minor. + * dcrt0.cc: #include "version.h". + (cygwin_dll_version_{major,minor}): New static locals. + (dll_crt0_1): Rewrite app/dll compatibility test. + * Makefile.in (LIBCOS): Delete version.o. + (DLL_OFILES): Delete version.o. + (dcrt0.o,libccrt0.o,registry.o): Depend on version.h. + + * exceptions.h: New file. + * exceptions.cc: Massive cleanups (still lots more to go). + #include "exceptions.h". + (init_exceptions): Renamed from __init_exceptions. New argument of + pointer to exception handler list entry. + (init_exception_handler): Renamed from init_thread_exceptions. + Rewrite based on info from Onno Hovers <onno@stack.urc.tue.nl>. + (ppc descriptor_to_{function,gotattr}): Make static. + (i386 __stack_trace): Fix test for top of stack. + * dcrt0.cc: #include "exceptions.h". + (dll_crt0_1): Exception handler list entry must live on stack. + * winsup.h (class pinfo): Delete member myp. + * syscalls.h (struct exception_list): Delete. + (__really_exit, __init_exceptions): Delete. + * Makefile.in (dcrt0.o,exceptions.o): Depend on exceptions.h. + +Fri Jun 7 17:49:28 1996 Jason Molenda (crash@phydeaux.cygnus.com) + + * dcrt0.cc (conv_path_names): Add GCC_EXEC_PREFIX. + +Fri Jun 7 14:38:05 1996 Doug Evans <dje@canuck.cygnus.com> + + * Makefile.in (CC_FOR_TARGET,LD,DLLTOOL): Define. + (AR,RANLIB): Set via configure. + * configure.in (AR,LD,DLLTOOL): Set. + (AC_PROG_RANLIB): Call. + * configure: Regenerated. + +Thu Jun 6 12:11:23 1996 Kim Knuttila <krk@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Removed reference to reent_data._next. + +Tue Jun 4 15:52:29 1996 Geoffrey Noer <noer@cygnus.com> + + * include/winkernel.h: fixed typo + +Tue May 28 13:08:25 1996 Doug Evans <dje@canuck.cygnus.com> + + * syscalls.cc (_sbrk): Fix test of return value from VirtualAlloc. + Delete lincr, make incr signed, and use only it. Misc. minor cleanup. + +Thu May 23 17:31:57 1996 Geoffrey Noer <noer@cygnus.com> + + sac diffs applied: + * path.h: change MAXMOUNTS to 30 instead of 20 + * sysdef/i386/rpcndr.def: add "none" to end of file + * fhandler.cc: fix memset call to say sizeof (*buf) instead + of sizeof (buf). + * include/winuser.h: define MDIS_ALLCHILDSTYLES + * Makefile.in: entry to build glob/libglob.a: + +Thu May 23 10:38:43 1996 Doug Evans <dje@canuck.cygnus.com> + + * fhandler.h (class fhandler_base): Make `name' private and shrink + to 32 bytes. + (set_name): Declare. + * fhandler.cc (fhandler::set_name): New function. + (fhander_base::open): Call it. + (fhander_base::init): Call it. + (fhandler_tty::ttyname): Call get_name instead of accessing `name' + directly. + + * dcrt0.cc (dll_crt0_1): Call ExitProcess instead of exit if + DLL and APP are out of sync. + +Thu May 16 03:07:18 1996 Mark Eichin <eichin@cygnus.com> + + * fhandler.cc (FakeReadFile): new function. Interface like + ReadFile, only called from fhandler_console_in::read, calls + ReadFile unless we're really reading from STD_INPUT_HANDLE and + with ENABLE_LINE_INPUT turned off, in which case we use + ReadConsoleInput instead. When using ReadConsoleInput, always read + all available events, but only block if we don't get at least one + actual character. This would be the place to implement FIONBIO on + the console tty, which doesn't actually exist yet. + (dbg_input_event): copied from select.cc, debugging code to show + detail of what events we're actually getting. + (ioctl): off-by-one on window size. + +Wed May 15 18:11:16 1996 Jim Wilson <wilson@chestnut.cygnus.com> + + * fhandler.h (class fhandler_base): Use MAXPATHLEN not 100 for size + of array name. + +Wed May 15 11:14:46 1996 Doug Evans <dje@canuck.cygnus.com> + + * fork.cc (cygwin_fork_helper1): More debugging printf's. + + * dcrt0.cc (num_ms_env_vars): Renamed from ms_env_arity. + (build_argv): Renamed from fill. + (compute_argc): Renamed from prepare. + * libccrt0.cc (cygwin_statu): Make static. + * pproc.cc (per_process::init): Move strace initialization from here, + * strace.cc (per_process::strace_init): To here. + Pass FILE_SHARE_WRITE to CreateFileA. Print error message if open + of log file fails. Create mutex for trace messages. + (__sys_printf): Always write to end of disk files. Use mutex. + (d): Delete. + * winsup.h (class per_process): Add strace_init. Reorganize. + `run_ctors' renamed to `run_ctors_p'. New member `trace_mutex'. + (d): Delete. + (PATH_MAX): Delete. + + * Makefile.in: Add header file dependencies. + + * dcrt0.cc (_exit): Add debugging printf. + * shared.h (class shared_info): Rename member mutex_a to fork_mutex. + * fork.cc (cygwin_fork_helper1): Update. + Return with error if process slot unavailable. + Set errno and release fork_mutex if failed because of split heap. + * shared.cc (shared_info::terminate): Update. + (shared_info::initialize): Update. + +Tue May 14 14:59:32 1996 Doug Evans <dje@canuck.cygnus.com> + + * fork.cc (cygwin_fork_helper1): Avoid SIGSEGV if allocate_pid fails. + + * pproc.cc (per_process::init): Fix test. + + * winsup.h (): Rename member `parent' to `ppid'. + * fork.cc (prepare_child): Update. + (cygwin_fork_helper1): Likewise. + * hinfo.cc (hmap_init_per_process): Likewise. + (hinfo_vec::dup_for_fork): Fix message. + (hinfo_vec::dup2): Fix args to debug_printf. Delete extra printf's. + * pinfo.cc (pinfo_init_per_process): Update. + (pinfo::dump): Likewise. + (pinfo::init_self): Likewise. + * pproc.cc (per_process::init): Open strace file in append mode. + * smallprintf.c (__small_vsprintf): Support %p. + * syscalls.cc (getppid): Update. + * wait.cc (wait_for_any): Likewise. + +Mon May 13 13:45:36 1996 Mark Eichin <eichin@cygnus.com> + + * fhandler.cc (ioctl): fix TIOCGWINSZ handling: (1) check the + error return (2) if we're trying on STD_INPUT_HANDLE, substitute + STD_OUTPUT_HANDLE since GetConsoleScreenBufferInfo only works on + console output (3) check srWindow for the *screen* size, instead + of checking dwSize for the scroll buffer size. + + * include/sys/errno.h (ECONNABORTED): add another errno value. + * net.cc (errmap): add ECONNABORTED case. + + * fhandler.cc (fstat): clear the *entire* stat buf, not just the + first four bytes. + +Fri May 10 17:59:09 1996 Mark Eichin <eichin@cygnus.com> + + * select.cc: change most debugging statements to select_printf. + (dbg_input_event): new function, prints an INPUT_RECORD via select + printf. + (polled): Don't sleep around WaitForMultipleObjects; let it have a + 10ms timeout until we have time to test it with 0. If + WaitForMultipleObjects says that STD_INPUT_HANDLE has data, use + PeekConsoleInput to scan the available events. If the first one is + not a *bKeyDown* with a non-zero *AsciiChar* then use + ReadConsoleInput to rip it off the queue, and pretend it wasn't + there, so that later calls to read (and thus ReadFile) don't block + because they can't find any *real* input. (This could be optimized + later to check the whole queue, and if there are *no* real input + events, nuke them all.) + + * include/sys/strace.h (_STRACE_SELECT, select_printf): new printf + category, because select needs a *lot* of work. STRACE=256 to use it. + + * fhandler.cc (fhandler_console_in::init): IGNCR can't work + without major changes to deal with the interaction with select + (which shouldn't wake up if IGNCR causes the whole input to be + deleted...) so don't make it the default. + (fhandler_console_out::tcgetattr, fhandler_tty::tcgetattr): don't + set IGNCR based on get_r_binary either. + +Wed May 8 20:20:05 1996 Mark Eichin <eichin@cygnus.com> + + * times.cc (__to_clock_t): must cast dwLowDateTime to *unsigned* + before adding it -- otherwise we may subtract it! + (to_time_t): same. + +Wed May 8 18:21:28 1996 Mark Eichin <eichin@cygnus.com> + + * times.cc (corelocaltime): new function. Basic localtime from + newlib, with no conversions. + (gmtime): just calls corelocaltime. + (localtime): uses GetTimeZoneInformation, biases to standard time + first, then uses DaylightDate and StandardDate to figure out if + we're in DST -- and calls corelocaltime a second time with the + rebiased seconds, if we are. + (times): add debug_printf statements which work around apparent + compiler bug and 7+ minute error. + + * select.cc: revert to <sac>'s changes of 4/20 which were + accidentally backed out on 4/24. + +Tue May 7 05:29:42 1996 Mark Eichin <eichin@cygnus.com> + + * times.cc (__to_clock_t): subtract out FACTOR, the difference + between 1601 and 1970, just like to_time_t() does. + +Tue May 7 01:55:06 1996 Mark Eichin <eichin@cygnus.com> + + * times.cc (gmtime): new function. Use GetTimeZoneInformation to + compensate ahead before calling localtime (since the newlib + version doesn't know what timezone we're in.) + (localtime): use SECSPERMIN, not 60, to show that we know what + we're talking about. + + * net.cc (errmap): add WSAEADDRINUSE, WSAECONNREFUSED mappings. + +Sun May 5 00:45:59 1996 Mark Eichin <eichin@cygnus.com> + + * include/sys/socket.h: add recvfrom macro and cygwin32_recvfrom + declaration. Remove htons/htonl misdeclarations as they collide + with the macros in asm/byteorder.h. + + * include/asm/byteorder.h: enable the ntohl/ntohs declarations so + we at least get the macro versions when we optimize, even if the + library hooks aren't there. + +Wed Apr 24 23:42:49 1996 Steve Chamberlain <sac@dilithium.transmeta.com> + + * winsup.h (pinfo, pinfo_list): Remove dummy item. + * fork.cc (*): Revert changes of Apr 2. + +Sun Apr 21 17:00:14 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * wait.cc (wait_for_any): Fix the wait heuristic. + +Sat Apr 20 13:22:03 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * Makefile.in (.cc.o): Pass -fno-rtti. + * dcrt0.cc (globify): A single match is ok. + * exceptions.cc (i386 call_handler): optimize. + * fhandler.cc (fhandler_console_in::read): Handle ICRNL right. + (*:get_name *:always_ready): New. + * select.cc: Understand that console output doesn't signal when it's + ready. + +Fri Apr 12 14:49:34 1996 Doug Evans <dje@canuck.cygnus.com> + + * Makefile.in (glob/libglob.a): Pass -I so glob.c finds right dirent.h. + +Wed Apr 10 16:13:30 1996 steve chamberlain <sac@slash.cygnus.com> + + * Makefile.in (glob/libglob.a): Call glob makefile correctly. + * winsup.h (pinfo, pinfo_list): Reorder elements to avoid + alignment bug in PPC gcc. + +Tue Apr 9 17:23:57 1996 steve chamberlain <sac@slash.cygnus.com> + + * dcrt0.cc (globify): Expand command line wildcards if + run from dos prompt. + + * exceptions.cc (386 call_handler): More fumblings. + * fhandler.cc (fhandler_base::stat): Initialize ino. + (fhandler_console::open): Fix test for RDONLY. + (fhandler_tty::stat): Set ino. + (fhandler_console_out::vt100 stuff): More. + * fork.cc: Lint. + * pinfo.cc (pinfo::init_self): Don't bother to DuplicateHandles + to get process info. + * signal.cc (usleep): Get correct order of magnitude. + * spawn.cc (spawn_guts): Turn of exception handling in + parent of thing which execs. + * syscalls.cc (stat): Look for <file> and <file.exe>. + * wait.cc (wait_for_any): Keep waiting if WaitForMultipleObject + returns invalid result. + +Tue Apr 2 12:45:35 1996 steve chamberlain <sac@slash.cygnus.com> + + * dcrt0.cc (conv_path_names): Add HOME. + (dll_crt0_1): Use u->self->head_sp. + * exceptions.cc (i386 call_handler): Rewritten, now almost works + on win95. + * fhandler.cc (fhandler_base::open): Calculate namehash. + (fhandler_base::fstat): ^ name hash with file index low. + * fork.cc (*): forkee/forkerr events moved from sinfo + into pinfo. + +Fri Mar 29 16:35:02 1996 steve chamberlain <sac@slash.cygnus.com> + + * libcmain.cc: New. + * winsup.h: restore and myp moved from per_process to pinfo class. + * dcrt0.cc (dll_crt0_1): Cope with move. + * exceptions.cc (init_thread_exceptions): Ditto. + * signal.cc (sigprocmask): Ditto. + * fork.cc (cygwin_fork_helper1): Don't fork if split_heap_p. + * pinfo.cc (pinfo::clearout): Zero split_heap_p. + * syscalls.cc (_sbrk): Cope with not being able to + allocate contiguous chunks. + + +Tue Mar 26 09:14:32 1996 steve chamberlain <sac@slash.cygnus.com> + + * exceptions.cc (__cygwin_exception_handler): re-export. + +Fri Mar 22 16:49:29 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * cygwin.din (__stack_trace): Export. + (__cygwin_exception_handler): Ditto. + + * exceptions.cc (i386 exception handling): Move under appropriate + x86 #ifdefs. Use the macro HAVE_INIT_THREAD_EXCEPTIONS to be + whatever a machine needs to do to initialize exceptions in this + thread. Nop for the PowerPC right now. + (__stack_trace): Make it a "C" function so there is no name + mangling, and export it. + (call_handler): Split by architecture before the function, rather + than inside it. First stab at PowerPC exception handling. + (__cygwin_exception_handler): Rename from ehandler3, and export + it. Add more status -> signal mappings. + (ctrl_c_handler, CTRL_LOGOFF_EVENT): Map to SIGHUP, not SIGQUIT. + (__stack_trace): Split into separate machine dependent functions, + rather than #ifdef'ing inside of a common function. Make the + PowerPC messages clearer. + +Mon Mar 18 13:27:05 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * include/winkernel.h (CreateThread): Correctly declare function + pointer argument. + + * misc.c (wprintf): Convert to use vprintf and fix warnings. + (tgetent): Declare to return int to fix warnings. + (vhangup): Declare to return int to fix warnings. Return -1 also. + + * include/winbase.h (UnhandledExceptionFilter): Declare. + +Tue Mar 12 12:56:28 1996 Doug Evans <dje@charmed.cygnus.com> + + * include/winkernel.h (FlushFileBuffers): Declare. + +Tue Mar 12 11:16:32 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * exceptions.cc (dump_status): Make columns line up for PowerPC. + (call_handler): Right now, call exit(255) for the PowerPC. + + * strace.cc (__sys_printf): Call FlushFileBuffers after writing + out the file to make sure it really gets flushed. + + * include/winkernel.h (PowerPC CONTEXT): Add fields returned if + CONTEXT_DEBUG_REGISTERS is set. + +Sun Mar 10 15:31:17 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * strerror.cc, syslog.cc, net.cc: New files. + * cygwin.din: Add new net functions. + * dcrt0.cc (dll_crt0_1): Fix call to build argv[0]. + * fhandler.cc (fhandler_base::open): Tidy. + * fhandler.h: Add net classes. + * hinfo.cc (hinfo_vec::build_fhandler): Add tape stuff. + * path.cc (*::mangle, *::reverse_mangle): Fix. + (mount_info::init): No trailing / now. + * select.cc (*): Rewrite. + * spawn.cc (spawn_guts): Fix leak. + * syscalls.cc (_sbrk): Keep working until memory really fills up. + +Tue Feb 20 16:53:24 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * dcrt0.cc (dll_crt0_1): Get version from the header. + * fhandler.cc (CHUNK_SIZE): New. + (fhandler_base::read, fhandler_base::write): CRLF conversion + rewritten. + path.cc (path_conv::path_conv): Initialize mixed, binary and silent. + * smallprint.c (__small_vsprintf): Add 'c' option. + * wait.cc (wait_found): Close child handles. + +Mon Feb 19 09:11:57 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * Makefile.in (real-headers): Eliminate real-headers dependency on + mspatches/*.patch, since you can't be guaranteed that it exists. + +Fri Feb 16 14:24:47 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * exceptions.cc (dump_status): On the PowerPC, dump all of the + integer registers. + + * uname.c (uname): Don't assume that the only two NT systems are + i386 and PowerPC. + * exceptions.cc (call_handler): Ditto. + (dump_status): Ditto. + +Thu Feb 15 18:20:33 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * cygwin.din (__empty): Add. + * dcrt0.cc (dos_argv_to_unix_argv): New. + (check, onetimecheck): New. + * exceptions.cc (ehandler3): Always show backtrace + if exception failed. + * fhandler.cc (*::open): Removed dos_path argument. + (fhandler_base::fstat): Use nFileIndexLow as the inode + value. + * hinfo.cc (init_std_file_from_handle): Don't default + to binary. + * paths.cc (*): Use new registry classes. + * registry.cc (*): Rewritten. + * syscalls.cc (open): Call fhandler->open without + the dos filename arg. + +Sat Feb 10 08:18:45 1996 Michael Meissner <meissner@tiktok.cygnus.com> + + * configure.in (ALLOCA for powerpc): Add __allocate_stack. + +Wed Feb 7 16:41:18 1996 Steve Chamberlain <sac@slash.cygnus.com> + + Release-B13 + + * malloc.cc (export_*): New. Changed the way that malloc + stubs are used. + * cygwin.din: Export the export_* stuff as malloc, realloc and free. + * path.cc (link_cookie::create): Keep cookie filenames in unix + format. + (reverse_mangle): Clean up. + (readlink): Ditto. + (qfunc): Sort by name too. + * spawn.cc (spawn_guts): Handle zero length arg. + Only set errno when it's not 0. + * Makefile.in: Build new doc. + * fhandler.cc (fhandler_base::fstat): Round up block used. + * path.cc (escape_char): Now it's ^. + * syscalls.cc (errmap): ERROR_INVALID_NAME yields ENOENT. + (chown): Returns 0. + (sbrk): Clean up. + (_unlink): Only try and DeleteFile once. + +Mon Feb 5 19:15:44 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * dcrt0.cc (dll_crt0_1): Build env string into static buffer. + * dirsearch.c (opendir): Stat on unix pathname. + * paths.cc (*): Support for mixed case filenames. + +Sun Feb 4 15:55:58 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * *.cc: Lint. + (conv_path_names): New. + (dll_crt0_1): Use conv_path_names list. + * fctnl.cc (F_DUPFD): Look from the fd forward. + * fhandler.cc (fhandler_base::open): Understand binary modes. + (fhandler_console_in::init): Call tcsetattr with reasonable start + values. + * spawn.cc (spawn_guts): Use conv_path_names. + (queue_file_deletion): Deleted. + (unlink): Use new queue file stuff. + * delqueue.cc, delqueue.h: New files. + * shared.h: New file. + +Wed Jan 31 11:12:24 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * crt0.cc: Hacks to probe out ppc stack. + * exceptions.cc (ehander3): Don't use 386 context info on the ppc. + * path.cc (mount_info::mangle): Turn /usi or /usp into /usr. + * uname.c (uname): Change sysname and get ppc name right. + +Fri Jan 26 15:47:31 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * pproc.cc (per_process::init): Cope when no memory is needed. + * Makefile.in, configure.in: Cope with config directory. + * setjmp.c, longjmp.c: Moved into config/i386. + * config/ppc/setjmp.S, config/ppc/longjmp.S: New. + +Fri Jan 26 14:57:33 1996 Jason Molenda (crash@phydeaux.cygnus.com) + + * Makefile.in (DLL_OFILES): removed ppc-stub.o + ppc-stub.c: Removed. + configure: regenerated with autoconf 2.7. + +Fri Jan 26 11:18:07 1996 Kim Knuttila <krk@cygnus.com> + + * Makefile.in (DLL_OFILES): added ppc-stub.o + +Thu Jan 25 09:33:24 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * malloc.cc (malloc, free, realloc): Hack for ppc. + +Wed Jan 24 20:22:42 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * cygwin.dll (loadup_dll): Remove. + * dcrt0.cc: lint. + * fhandler.* (*): Move to new class structure. + * hinfo.cc: Use new fhandler glue. + * libcfork.cc: Cope with ppc naming convention. + +Mon Jan 22 10:33:53 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * fhandler.h, hinfo.h: New files. + * winsup.h: Split from here. + * configure.in: Set i386 entry point correctly. + * fhandler.cc (fhandler_normal:open): .com files + are executable too. + * hinfo.cc (init_std_file_from_handle): Inspect + master_fmode_binary. + * misc.cc (wcscmp, wcslen): New. + * dcrt0.cc (probe): Change way a forkee's stack is allocated. + * pproc.cc (per_process::init): Initialize using heap chunk. + * shared.cc (shared_info::initialize): Initialize heap chunk. + * syscalls.cc (_sbrk): If current chunk is used, allocate another. + * wait.cc (wait_found): Fix exit code. + +Thu Jan 18 10:09:45 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * fhandler.cc (fhandler_normal::open) Don't test a + com port to see if it's executable. + * configure.in, cygwin.din: More powerpc configury. + +Wed Jan 17 16:25:36 1996 Steve Chamberlain <sac@slash.cygnus.com> + + * configure.in, Makefile.in: Build powerpc stuff. + * hinfo.cc (build_fhandler): Use new with placement. + (fhandler::operator new): New. + +Wed Jan 3 18:18:57 1996 steve chamberlain <sac@slash.cygnus.com> + + * select.cc: New file. + * Makefile.in: Cope with it. + +Tue Jan 2 08:58:58 1996 steve chamberlain <sac@slash.cygnus.com> + + * version.c: New file. + * Makefile.in: Cope with it. + * cygwin.def (setgrent, cuserid, setpgrp, mount, setmntent, endmntent, umount): New. + * dcrt0.cc: Remove obsolete vfork stuff. + (dll_crt0): Change way environ is built. Check that app is built + with correct version of dll. + * dirsearch.cc, exceptions.cc: Lint. + * fhandler.cc: Lint. Most of termios.c moved into here. + (fhandler_console:*): New. + * hinfo.cc (hinfo_vec::init_std_file_from_handle): Open stdfiles as consoles + if possible. + * libccrt0.cc: Lint. + * malloc.cc: More comments. + * path.cc (*): Cope with mount handling. + * registry.cc: Lint. + (reg_session): New. + * shared.cc: Lint. + * signal.cc (usleep): New. + * spawn.cc: Lint. Removed vfork stuff. + * stubs.c (getmntent, endgrent): Deleted. + * syscalls.c (__seterrno): Now takes arguments. + * termios.c: Much moved info fhandler.c + * times.cc (utime, utimes): New. + * uinfo.c (cuserid): New. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1997 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1997 new file mode 100644 index 000000000..33b001154 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1997 @@ -0,0 +1,2800 @@ +Wed Dec 31 15:00:32 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * hinfo.cc (hinfo_vec::find_unused_handle): correct + previous patch -- need to fix up vec[i].h pointers + +Wed Dec 31 14:13:22 1997 Ian Lance Taylor <ian@cygnus.com> + + * regexp/Makefile.in (tooldir): New variable. + (install): Install regexp.h. + +Tue Dec 30 19:52:46 1997 Ian Lance Taylor <ian@cygnus.com> + + * net.cc (inet_netof): New function. + (inet_makeaddr): New function. + * cygwin.din: Export inet_netof and inet_makeaddr. + +Tue Dec 23 17:45:07 1997 Ian Lance Taylor <ian@cygnus.com> + + * path.cc (current_directory_name): New static variable. + (current_directory_posix_name): New static variable. + (getcwd_inner): Cache the directory name. + (chdir): Move here from syscalls.cc. Clear directory cache + variables. + * syscalls.cc (chdir): Remove; now in path.cc. + + * environ.cc (setenv): Add cast to avoid warning. + + * security.cc (get_file_attribute): Make file parameter a pointer + to const char. + (set_file_attribute): Likewise. + * winsup.c (get_file_attribute): Update declaration. + (set_file_attribute): Likewise. + + * path.cc (path_conv): Don't pass the root directory to + symlink_check_one. + +Mon Dec 22 16:34:40 1997 Ian Lance Taylor <ian@cygnus.com> + + * path.cc (realpath): Use path_conv to resolve symlinks. + + * path.cc (path_conv::path_conv): Rewrite completely to convert to + win32 path first and then check for symlinks element by element. + (symlink_check_one): New static function based on old + symlink_check_worker, but without path conversion. + (path_prefix_p): Move definition before all uses. + (skip_n_slashes, symlink_expand, symlink_follow): Remove. + (symlink_check_worker, symlink_check): Remove. + (readlink): Rewrite to use new symlink_check_one. + (unmixedcaseify, mixedcaseify): Comment out. + * path.h (symlink_check, symlink_follow): Don't declare. + * fhandler.cc (open): Don't pass O_NOSYMLINK to path_conv. Set + errno from path_conv if it fails. + * dirsearch.cc (opendir): Check errors from path_conv, and set + errno appropriately. + * times.cc (utimes): Likewise. + * syscalls.cc (_unlink, _link, mkdir, rmdir, chdir): Likewise. + (chmod, _rename): Likewise. + (_stat_worker): Don't just pass nofollow to _open, but base + whether to pass O_NOSYMLINK on whether nofollow is set. + (lstat): Pass 1, not O_NOSYMLINK, to _stat_worker. + * strerror.cc (strerror): Add ELOOP. + +Thu Dec 18 12:30:47 1997 Ian Lance Taylor <ian@cygnus.com> + + * fhandler.h (class fhandler_base): Remove inline definitions of + tcflush, tcsendbreak, tcdrain, tcflow, tcsetattr, tcgetattr, + tcsetpgrp, and tcgetpgrp, so that we can set proper errno values. + (class fhandler_tty): Add pgrp_ field, and virtual tcgetpgrp and + tcsetpgrp functions. + * fhandler.cc (fhandler_base::tcflush): New function. + (fhandler_base::tcsendbreak): New function. + (fhandler_base::tcdrain): New function. + (fhandler_base::tcflow): New function. + (fhandler_base::tcsetattr): New function. + (fhandler_base::tcgetattr): New function. + (fhandler_base::tcsetpgrp): New function. + (fhandler_base::tcgetpgrp): New function. + (fhandler_tty::fhandler_tty): Initialize pgrp_. + + * tty.cc (tcsetpgrp): Set errno correctly on failure. + + * include/sys/termios.h (CBAUD): Change to 037. + (B57600, B115200): Change to values that can fit in a speed_t. + + * spawn.cc (spawn_guts): Set errno correctly if we can't find the + executable. + +Mon Dec 15 16:40:07 1997 Geoffrey Noer <noer@cygnus.com> + + patch from msnyder@cygnus.com (Michael Snyder): + * heap.cc (_sbrk): handle situation where newalloc < incr + +Mon Dec 15 16:40:07 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + Allow Cygwin32 to terminate process even when in a blocking + winsock call. + * exceptions.cc (call_handler): call to WSACancelBlockingCall() + removed. + (sighandle): call WSACleanup() before exiting the process to + cancel blocking winsock calls. + * include/mywinsock.h: add proto for WSACleanup(). + +Mon Dec 15 16:40:07 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: compile .cc files with -fno-exceptions to + decrease dll size and increase execution speed a little. + +Mon Dec 15 16:40:07 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * tty.cc (do_input): Detect CTRL-T as a special case when + STRACE_CACHE is active. Dumps the strace cache to disk. + * console.cc (fhandler_console::read): Detect CTRL-T as a special + case when STRACE_CACHE is active. Dumps the strace cache to disk. + +Sat Dec 13 15:12:53 1997 Ian Lance Taylor <ian@cygnus.com> + + * fork.cc: Include <malloc.h>. + (cygwin_fork_helper1): Call __malloc_copy after copying the stack + and heap to the child. + +Thu Dec 11 15:14:40 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * sigproc.cc (proc_subproc): Remove over-enthusiastic test for + process handling readiness or proc_wait will loop attempting to + handle a dying subprocess when signal handlers are not ready. + * fork.cc (cygwin_fork_helper1): Reorganize to ensure that a + forked process is capable of receiving signals when fork() + returns. + +Wed Dec 10 15:43:37 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/sys/termios.h (IXANY): Correct value. + (PARMRK): Define again. + +Wed Dec 10 00:05:23 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc (dll_crt0_1): Move start time initialization to a more + logical place (pinfo_init). + (do_exit): Reorganize to attempt to solve races when a cygwin + process occupies two windows pids (i.e., an execed process). + * exceptions.cc (lock_cs): Fix erroneous WFSO logic. + (sighandle): Use new method for determining if process was + initiated via fork. + (events_terminate): Do not close pinfo_mutex. Allow automatic + close by ExitProcess to lengthen the time that the pinfo structure + is locked, minimizing races between an exiting child and a + potentially exiting parent. + * hinfo.cc (hmap_init): Use new method for determining if process + was initiated via fork. + (hinfo_vec::de_linearize_fd_array): Fix a typo in a comment. + * pinfo.cc (clearout): Remove this function. Handled in + allocate_pid. + (pinfo_init): Move start_time setting here from dll_crt0_1. + Remove call to init_self in favor of adding three additional lines + of code. + (pinfo_list::operator []): Implement a very simple hashing + scheme for pid lookup. + (lpfu): New routine controlled by DEBUGGING conditional. When + DEBUGGING is activated, lpfu returns more information about the + state of a timed out pinfo_mutex. + (pinfo_list::get_empty_pinfo): Remove function. Move + functionality to allocate_pid. + (allocate_pid): Implement a (very) simple hashing scheme for + finding an available pid. Take advantage of reorganized pinfo + structure to zero all pertinent fields with one memset. + (pinfo::record_death_nolock): Don't bothering zeroing + inconsequential stuff. + (pinfo::record_death): Leave pinfo_mutex locked with the + understanding that this function will be called just prior to + exiting the process. This minimizes a race between a child which + is exiting at nearly the same time as its parent. + * sigproc.cc: Reformat function calls. + (sigproc_init): Clear new PID_INITIALIZING flag to indicate that + a (possibly execed) process is now capable of receiving signals. + (sig_send): Be more defensive in determining if a signal can be + sent to myself or suffer problems with execed processes. + (sigproc_terminate): Wait for sig_proc to exit to ensure that + all pending signals have been handled. Use new 'proc_terminate' + function to terminate the subprocess handling thread. + (allow_sig_dispatch): Don't bother blocking signals if signal + handling isn't active in this process yet. + (block_sig_dispatch): Don't bother blocking signals if signal + handling isn't active in this process yet. + (sig_proc): Use sig_loop_wait variable to control wait time for + signal semaphores. Uncouples this wait from wait_subproc. + Perform signal cleanup here on thread termination. + (proc_exists): More accurate tests to determine if a process + really exists. + (proc_register): Remove this function in favor of a macro. + (proc_subproc): More stringent test for being "ready" to process + subprocesses. Add more common initialization to PROC_ADDCHILD. + Remove PROC_EXIT in favor of a separate function. + (proc_terminate): New function. Replaces PROC_EXIT functionality + in proc_subproc. Terminates subproc handler thread. + (stopped_or_terminated): use lock_pinfo_for_update when modifying + child stopsig status or suffer a race. + (wait_subproc): Save sig_proc thread handle away for + synchronization when exiting. Set up 'i_am_alive' mutex inherited + by childen. Child's inability to lock this mutex means that the + parent is still alive and processing children. Use proc_loop_wait + to control WFMO. Clean up events queue on thread exit. + (zap_subproc): Clear out pinfo structure for a child. + * sigproc.h: Remove PROC_EXIT constant. Remove obsolete + proc_register declaration. + (alive_parent): New macro to determine if a parent is still alive. + * spawn.cc (spawn_guts): Fix a comment typo. Use proc_terminate + to terminate all subprocess handling prior to an exec. Use new + method for determining if this process was started via a fork. + Attempt to clean up races between execed process, its parent, and + the execed child. + * winsup.h (pinfo): Add a new handle indicating that a parent is + alive. This should be a foolproof way of determining if a parent + has gone away so that a child will know whether to remove itself + from the pinfo table. + Reorganize the structure in such a way that items to be zeroed + are grouped together at the beginning for more efficient zeroing + in allocate_pid. + Add a new PID_* constant. + New lock_pinfo_for_update macro for use when debugging cygwin. + +Wed Dec 10 00:05:23 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + Change the way to inherit fd table on spawn/exec calls. + Use STARTUPINFO structure to pass an fd table to a child process + instead of shared memory area. This is undocumented, but is used + by MSVC runtime. The desktop inheritance code added again, + otherwise user32.dll will fail to initialize after sexec calls. + * pinfo.cc (pinfo_init): delinearize fd array from STARTUPINFO + structure instead of call to copy_shared_fd_table. + * shared.cc (create_shared_fd_mapping_name): remove + (create/copy_shared_fd_table): remove + * spawn.cc (spawn_guts): use lp(cb)Reserved2 fields of STARTUPINFO + to pass fd table to a child. Remove call to + create_shared_fd_table. Inherit window station/desktop on sexec + calls. + * winsup.h: remove prototypes for create/copy_shared_fd_table. + +Fri Dec 5 18:57:42 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * kill.cc (main): Report error if kill() fails. Minor reformat. + * ps.cc (main): Only use month/day in start time when starting + time is > 24 hours in the past, not when it occurs yesterday. + +Fri Dec 5 15:54:41 1997 Geoffrey Noer <noer@cygnus.com> + + * fcntl.cc (_fcntl): reformat + * fhandler.cc (fhandler_tty::open): new, need special open for + ttys. In addition to calling fhandler_base::open, check + flags to handle blocking vs. non-blocking I/O. Should + initialize tty to standard state (9600 bits/sec - 8 - 1 with + no flow control) but this code needs more work still. Ifdef + out for now. + (fhandler_tty::tcsendbreak): new + (fhandler_tty::tcdrain): new + (fhandler_tty::tcflow): new + (fhandler_tty::tcsetattr): add support for action arg. Use + a DCB struct to hold the values we will set. First call + GetCommState to get the current state, then reassign values + based on the contents of the termios struct. Handle the + case where t->c_ospeed is set to B0, otherwise set state.BaudRate. + Set all the other DCB struct values appropriately, based on + the contents of the termios struct. + (fhandler_tty::tcgetattr): do the inverse of tcsetattr. + Call GetCommState to get the current state and use this to set + the appropriate termios struct values. + * termios.cc: reformat + (tcsendbreak): implement -- add duration arg, + call fhandler tcsendbreak as appropriate + (tcdrain): implement -- call fhandler tcdrain as appropriate + (tcflow): implement -- call fhandler tcflow as appropriate + * fhandler.h: add new tc* protos + * include/sys/termios.h: correct values of iflag bits, + define CRTSXOFF and CRTSCTS, CBAUD, B57600 and B115200. + Add protos for tc* functions. + +Wed Nov 26 17:06:17 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc (perhaps_suffix): resolve symlinks to .exes. + +Mon Nov 24 17:10:49 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove crypt + * syscalls.cc (crypt): remove crypt stub + +Sun Nov 23 17:34:42 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc (spawn_guts): save the path of the script itself, + use the saved path while building the command line to execute. + +Thu Nov 20 22:58:23 1997 Geoffrey Noer <noer@cygnus.com> + + * stubs.cc: delete file, move unimplemented stubs to the + files in which they would normally belong. + * grp.cc (setgrent): implement (was in stubs.cc) + * syscalls.cc: move regfree, mknod, setgid, set(e)uid, sync, + crypt, and PPC __chkstk/_alloca/dll_entry stubs here from stubs.cc + (sync): just return zero for now instead of -1 + (crypt): return -1 instead of 0 + +Thu Nov 20 22:41:57 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * spawn.cc (spawn_guts): A premature close of the spawned filehandle + was possible when reparenting an exited process. Fix this. + * dcrt0.cc (do_exit): Only do minimal cleanup if "pid focus" + has moved to another windows process or the other process will + become confused. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * sigproc.cc (getsem): set errno to EPERM if existing semaphore + cannot be opened. + (wait_subproc): allow access to signal semaphores to process's + owner only except for SIGCHLD (needed for SIGCHLD delivery after + sexecXX calls). + +Thu Nov 20 00:52:58 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * syscalls.cc (hash_path_name): Ignore trailing backslash when + calculating pathname hash. + * hinfo.cc (hinfo_vec::de_linearize_fd_array): Set use_tty + if /dev/ttyn is detected in the shared_fd_table. Before this + change, executing "set CYGWIN_TTY=1", "bash", "unset CYGWIN_TTY", + "/bin/pwd" would result in pwd printing nothing because + the de_linearize code would use the wrong fhandler_xxx when + reading from the buffer inherited from the parent process. + * cygwin.din: Add new ctermid function for export. + * syscalls.cc (ctermid): New function + * exceptions.cc (call_handler): If called during a P_OVERLAY + spawn, merely set appropriate flags and return. The spawn + code will then clean up and exit. + * sigproc.cc (proc_exists): Reorganize to better detect defunct + processes. Don't clean up pinfo if process has a parent since the + parent should clean up eventually. + * spawn.cc: New global exec_exit. Set by signal handler to + value which should be used on exit from aborted spawn. + (spawn_guts): Try harder to let the child terminate (if it is + going to) before exiting on a signal. Remove obsolete code. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * exec.cc (file_exists): Removed + * spawn.cc (spawn_guts): call perhaps_suffix to convert filename + to win32 form and to check file existance; prog variable + removed, all references changed to real_path variable. + Do not inherit parent's window station/desktop on sexecXX calls. + They are no longer needed with the new signal handling. + (_spawnve): extra file existance check removed + * winsup.h: file_exists prototype removed + +Wed Nov 19 16:23:47 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: add missing exports for random -- initstate + and setstate (accessed by gawk among others?) + +Tue Nov 18 22:27:10 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: Add spaces after colons in rules for make + +Mon Nov 17 22:35:25 1997 Geoffrey Noer <noer@cygnus.com> + + patch from proven@cygnus.com (Chris Provenzano): + * Makefile.in: set SHELL = @SHELL@, set VPATH to only @srcdir@. + Remove mingw from directories to build for now, adapt rules + for building sysdef files without fancy VPATH + * configure: regenerate + * config/i386/makefrag: add rules to build setjmp/longjmp + * regexp/Makefile.in: set SHELL = @SHELL@ + * regexp/configure: regenerate + * utils/Makefile.in: set SHELL = @SHELL@ + * utils/configure: regenerate + +Mon Nov 17 18:36:50 1997 Geoffrey Noer <noer@rtl.cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * fhandler.cc (fhandler_disk_file::open): calls to symlink_XXX + replaced with path_conv class calls. + * path.cc (path_conv::path_conv): comments added, O_NOSYMLINK case + added. + * path.h (class path_conv): symlink_p, exec_p - new class members. + * spawn.cc (spawn_guts): call path_conv instead of symlink_follow. + +Sun Nov 16 15:54:27 1997 Geoffrey Noer <noer@rtl.cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc (do_exit): Use new pinfo element in debug statement. + * pinfo.cc (pinfo_init): Eliminate use of "PID" environment + variable in favor of scanning the process table for a + SpawnedProcessId field matching current windows process id. + Should speed up spawned process startup slightly. Delay setting + of dwProcessId until process is capable of processing signals + since this field is used to build signal semaphores. + * signal.cc (kill_worker): Perform a `proc_exists' on the pid + in question if signal == 0. This will verify that the process + actually exists and was not abnormally terminated. + * sigproc.cc (sigproc_init): Initialize dwProcessId field after + signal processing has been initialized. + (sigproc_terminate): Remove events[0] close. + (getsem): Use GetCurrentProcessId to find the windows pid since + this dwProcessId field is not yet set up. Use proc_exists to + determine if error should be printed on OpenSemaphore error. + (proc_exists): New function. Makes more exhaustive test of + process existence. Determines if process died without going + through normal shutdown. + (wait_subproc): Close wakeup event only on thread exit. + * spawn.cc: Remove pExeced. Use new field in pinfo. + (spawn_guts): Initialize dwSpawnedProcessId field. + * utils/ps.cc (main): Perform a kill(pid, 0) on any pids that + appear to be active. This will clear out pids that have died + abnormally. 'ps -f' bypasses this. + * winsup.h (class pinfo): Add dwSpawnedProcessId field. + +Sun Nov 16 15:54:27 1997 Geoffrey Noer <noer@rtl.cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * pinfo.cc ((pinfo_init): use dwProcessId for execed/spawned + check, set subproc_ready event only if the process is exec'ed. + * spawn.cc (spawn_guts): initialize hProcess and dwProcessId + fields of pinfo on exec, keep progname field on spawn. + +Sun Nov 16 15:54:27 1997 Geoffrey Noer <noer@rtl.cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * dcrt0.cc: remove commented out code + * spawn.cc: fix misapplied patch problem + +Sun Nov 16 15:54:27 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * fhandler.cc (fhandler_dev_null::open): Open Windows 'nul' + device rather than "faking" a real open. + (fhandler_dev_null::close): delete. + (fhandler_dev_null::fstat): delete. + (fhandler_dev_null::ioctl): delete. + (fhandler_dev_null::read): delete. + (fhandler_dev_null::write): delete. + (fhandler_dev_null::lseek): delete. + (fhandler_dev_null::dup): delete. + * fhandler.h (class fhandler_base): delete above methods from + class. + * hinfo.cc (hinfo_vec::build_fhandler): Use new fhandler_dev_null + class which opens 'nul' device. Treat /dev/null similarly to + other Windows devices. This allows redirection of /dev/null to + non-cygwin processes. + +Sun Nov 16 15:54:27 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc (do_exit): Use EXIT_* flags to determine how exit + should proceed. Honor new EXIT_NOCLOSEALL to avoid + close_all_files. + * exceptions.cc (__cygwin32_exception_handler): Use new + EXIT_SIGNAL define to indicate exiting due to signal. + * signal.cc (sigprocmask): Slightly more defensive check against + being called prior to complete cygwin setup. + (_raise): Defensive check to guard against being called prior to + complete cygwin setup. + * sigproc.cc (stopped_or_terminated): Use new EXIT_SIGNAL define + to detect exiting due to signal. + * sigproc.h: Define flags to be used during exit process as + EXIT_*. + * spawn.cc (spawn_guts): Use EXIT_* constants to control how + do_exit proceeds after _P_OVERLAY. + +Sun Nov 16 15:54:27 1997 Geoffrey Noer <noer@cygnus.com> + + * sysconf.cc (sysconf): return 1048576 for ARG_MAX until + we figure out the right value (_POSIX_ARG_MAX is only 4K + which is too small). + +Sun Nov 16 15:54:27 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * dcrt0.cc (dll_crt0_1): call winsock_init if neccesary. + * fhandler.cc ((fhandler_socket::fhandler_socket): moved to net.cc + * fhandler.h (class fhandler_socket): destructor prototype added. + * fork.cc (cygwin_fork_helper1): set PID_SOCKETS_USED in the + child's pinfo if parent has open socket descriptors; call + winsock_init in child code if necessary. + * net.cc: static variable winsock_init_p removed; + number_of_sockets is new global variable containing number of + opened sockets. + (winsock_init): made global, save "winsock inited" flag in process + state field. + (cygwin32_winsock calls): condition for winsock initialisation + changed + (fhandler_socket::fhandler_socket): new, moved from fhandler.cc; + increment number_of_sockets on constructor call. + (fhandler_socket::~fhandler_socket): new. Decrement + number_of_sockets on destructor call, check for negative value. + (fhandler_socket::ioctl): check for winsock initialisation added. + * spawn.cc (spawn_guts): handle PID_SOCKETS_USED in child's pinfo. + * winsup.h: PID_SOCKETS_USED - new enum value; number_of_sockets + and winsock_init() prototypes added. + +Wed Nov 12 23:02:34 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * exceptions.cc: Substitute do_exit for _exit as appropriate. + do_exit allows full 32 bits of exit value. The upper 16 bits + are used for special cygwin operations. + * winsup.h: Change definition of do_exit to allow calling from + signal handler. + * dcrt0.cc (do_exit): Change to allow calling from signal handler + in place of _exit. This is necessary to ensure that only cygwin + internal applications can exit with the upper order 16 bits set + to non-zero. + +Wed Nov 12 23:02:34 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc (do_exit): New function. Subsumes functionality of + _exit but takes a DWORD argument. Changed to avoid some shutdown + activities when called with REPARENTING bit set in argument. Also + explicitly kills any executing non-cygwin subprocess from a + spawn(P_OVERLAY)... + (_exit): Use do_exit for exiting. Ensure that only low order 1 + bits of status are used or confusion will result if exiting with + some higher order bits set. + * exceptions.cc (set_process_mask): Reflect new method for + sig_send to send signals to self. + (handle_sigsuspend): Reflect new method for sig_send to send + signals to self. + * fork.cc: A handle name was changed in the pinfo structure to + be more reflective of its use. Change forkee_stopped to + subproc_ready everywhere. + * pinfo.cc (pinfo::clearout): Change forkee_stopped to + subproc_ready. + (pinfo_init): Use PID_EXECED flag to determine if this process has + been execed. If so, signal the remaining stub in the process + which invoked us so that the stub can terminate and let us take + over as this pid. + * sigproc.cc (sig_send): Change method for determining if sending + signals to myself. A NULL pointer means communicate with my + signal handler. This is necessary to allow communication with + our own signal processors after reparenting an execed process. + Also, add an additional test to detect if a process goes away in + the middle of attempting to send it a signal. + (allow_sig_dispatch): Reflect new method for sig_send to send + signals to self. + (getsem): Use dwProcessId in names for signal semaphores. Allows + communicating with both parts of a process that is temporarily + "split in two" while execing. + (sig_proc): Avoid printing an error if WAIT_FAILED and exiting + anyway. Process requests even if loop_wait == 0. + (proc_subproc): Defensive check for manipulating processes prior + to initialization or after terminating sigproc. + Use different check for subprocesses that have been reparented. + Hopefully this will eliminate WFSO, error 6 problems. + (wait_subproc): Only exit when loop_wait == 0 and not dealing with + a process. + * spawn.cc: Set up two global variables, used on exit when + execing a non-cygwin process: hExeced - handle of non-cygwin + process which is being waited for by a stub, pExeced - windows pid + of the process. + (spawn_guts): Reorganize to always (temporarily) wait for the new + process when P_OVERLAY. If a cygwin process is invoked, then the + wait will return when an event is signalled and the new process + will be "reparented" in the ppid. If a non-cygwin process is + invoked, wait until the process exits or a signal is received + which terminates the process. In this case, the do_exit function + will terminate the non-cygwin process. + * winsup.h: Rename forkee_stopped to subproc_ready since this + event now has a dual role which is better defined by this new + name. Add a new flag (PID_EXECED) for process_state. Define a + new function `do_exit' which operates similarly to _exit + but takes > 16 quantities with the high order bit signifying + different exit actions. + +Mon Nov 10 17:11:08 1997 Geoffrey Noer <noer@cygnus.com> + + * include/utime.h: remove (moved to newlib/libc/sys/cygwin32/sys) + so as not to conflict with the one in newlib/libc/include. + +Mon Nov 10 15:11:42 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * exceptions.cc (__cygwin32_exception_handler): exit with + "core dumped" exit code after writing "core" file. + +Mon Nov 10 15:11:42 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * console.cc: Add convenience macros and structures for handling + scrolling. + (fhandler_console::fillin_info): New function to fill in the `info' + struct. + (fhandler_console::scroll_screen): Change to scroll only the visible + portion of the screen. Honor scroll regions more stringently. + (fhandler_console::open): Use new fillin_info function. + (fhandler_console::ioctl): Use new fillin_info function which + automatically calculates screen size. + (fhandler_console::clear_screen): Use new fillin_info function. + Only clear visible portion of screen. + (fhandler_console::cursor_set): Add a flag to indicate whether + cursor positioning is absolute within buffer or is screen relative. + Use new fillin_info function to get screen information. + (fhandler_console::cursor_rel): Use new fillin_info function. + Change for new cursor_set parameter. + (fhandler_console::cursor_get): Use new fillin_info function. + (fhandler_console::char_command): Use new fillin_info function + where appropriate. Change for new cursor set parameter where + appropriate. Scroll only visible portion of screen when required. + * fhandler.h (class fhandler_console): Add fillin_info, change + cursor_set to reflect additional argument. + +Mon Nov 10 15:11:42 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc (dll_crt0_1): Register process start time. + * fork.cc (cygwin_fork_helper1): Register process start time. + * utils/ps.cc (main): Report process start time. + (start_time): New function to format time similarly to UNIX ps. + A time from today shows as HH:MM, times from previous days just + show the month and day. + * winsup.h (class pinfo): Add start_time field. + +Mon Nov 10 11:54:27 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/Windows32/Defines.h (TIME_ZONE_ID_INVALID): Define. + * times.cc (gettimeofday): The error return from + GetTimeZoneInformation is TIME_ZONE_ID_INVALID, not + TIME_ZONE_ID_UNKNOWN. + +Sun Nov 9 17:08:30 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * Makefile.in: add ../libiberty/strsignal.o + * cygwin.din: add exports for strsignal, strtosigno + * utils/kill.cc: changes to allow accepting signal name + as argument + +Sun Nov 9 17:08:30 1997 Geoffrey Noer <noer@cygnus.com> + + * include/limits.h: define PATH_MAX here instead of + include/sys/param.h, define _POSIX_NGROUPS_MAX as 0 not 1 + (system invariant value, not implementation-specific) + * include/sys/param.h: remove PATH_MAX, change NOFILE from 64 + to 8192, delete PATHSIZE, remove safety wrapper around + MAXHOSTNAMELEN, add comments + * sysconf.cc (sysconf): return NGROUPS_MAX not zero, + return _POSIX_SAVED_IDS not zero. Return _POSIX_CHILD_MAX + not 4096. Return _POSIX_CHILD_MAX, not 8. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * winsup.h: add proto for setdtablesize, define NOFILE_INIT + and NOFILE_INCR + * hinfo.cc (hmap_init, hinfo_vec::find_unused_handle): change to + support virtually unlimited numbers of fds. Remove setdtablesize + proto + * syscalls.cc: initialize dtable_size to NOFILE_INIT instead of + NOFILE + +Thu Nov 6 13:14:09 1997 Geoffrey Noer <noer@cygnus.com> + + * exceptions.cc (__cygwin32_exception_handler): don't + print "In cygwin32_except_handler" for exceptions Cygwin32 + isn't going to handle. Print "(progname PID) Exception: <type>" + to console. Redirect all detailed information including the + stack trace to <progname>.core. This should reduce confusion + about what's causing the exception (a lot of people would see "In + cygwin32..." and think the problem was in Cygwin32 when most of + the time it was in some other program). + * syscalls.cc: add fixme + * times.cc: add fixme + +Wed Nov 5 19:23:10 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * Makefile.in: force .c.os and .cc.os to be built in same + directories as source + +Wed Nov 5 19:23:10 1997 Geoffrey Noer <noer@cygnus.com> + + * drct0.cc (dll_crt0_1): stop initializing winsock on process + startup since that slows down startup time of all processes, even + ones that don't end up making Winsock calls. + * fork.cc (cygwin_fork_helper1): don't need to call uinfo_init + or socket_checkinit after fork -- the appropriate functions will + do the necessary initialization if they are ever called. + * net.cc: init winsock_init_p to zero and make it static + (all exported functions): call winsock_init before making + any WinSock calls since this no longer happens in dcrt0.cc + startup code. Only do this if !winsock_init_p. + (winsock_init): checkinit renamed. Now just inits winsock + without checking whether it has been already initialized. + Make it static. + * uinfo.cc (uinfo_init): after we call getpwnam, we know + the passwd file has been read in so don't check initialization + of it. However, we do need to read_etc_group() if group_in_memory + isn't set. + * passwd.cc: rename global i variable to pw_pos, rename + passwd_in_memory to passwd_in_memory_p to match net.cc scheme. + Add comments. + (read_etc_passwd): make static + (various): make sure to read_etc_passwd() if passwd_in_memory + isn't set + * grp.cc: add comments, rename idx global to grp_pos, + rename group_in_memory to group_in_memory_p to match net.cc + scheme, group_in_memory_p no longer static (needs to be accessed + by uinfo_init) + * winsup.h: remove proto for socket_checkinit since that's + renamed and static within net.cc + +Tue Nov 4 01:02:20 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * signal.cc (sigprocmask): Newer versions of gcc will call + sigprocmask when a builtin constructor is activated. If this + happens prior to the setup of u->self, then a NULL dereference + will occur. Guard against this. + +Mon Nov 3 17:00:45 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * hinfo.cc (hinfo_vec::build_fhandler): Open a console for + /dev/tty when !use_tty. + +Thu Oct 30 10:28:15 1997 Tom Tromey <tromey@cygnus.com> + + * include/mapi.h: New file. + * sysdef/i386/mapi32.def (MAPISendMail@20): New export. + +Thu Oct 30 15:08:13 1997 Geoffrey Noer <noer@cygnus.com> + + * times.cc: add comments listing standards funcs are defined in + (dump_filetime): remove unused local func + * net.cc (fail): remove local func, replace one reference with + equivalent debug_printf, add standards comments, reformat a little + (fhandler_socket::close): simplify handling of res + (fhandler_socket::fstat): set ENOSYS (unimplemented) + * stubs.cc: set ENOSYS in unimplemented funcs + * uname.cc: add standards comment + * ntea.cc: reformat + +Wed Oct 29 22:43:57 1997 Geoffrey Noer <noer@cygnus.com> + + * times.cc (settimeofday): set ENOSYS instead of EPERM + since ENOSYS maps to "Function not implemented" which is the + case here. + * syscalls.cc (seterrno): on failure, set EACCES instead of EPERM + which is better for the unknown error case + +Fri Oct 24 01:24:07 1997 Geoffrey Noer <noer@cygnus.com> + + patch from green@cygnus.com (Anthony Green): + * dcrt0.cc: new host_dependent_constants object with a global + instance of it which allows constants that are different in Win 95 + and NT to be saved here instead of having forks in the code and + having to check the OS type each time. Add two constants for + fhandler, one for sharing attributes and one for upper word value + for locking files. + (dll_crt0_1): call host_dependent init function + * fhandler.cc (fhandler_base::open): use above object for + setting shared attributes + (fhandler_disk_file::lock): get upper word for locking from + host_dependent_constants + * winsup.h: define host_dependent_constants class and add extern + for global instance of it + +Wed Oct 22 02:27:53 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: Export getenv, putenv, setenv and unsetenv instead + of cygwin32_ wrappers + * dcrt0.cc: External variable environ removed + (dll_crt0_1): strip executable's path on console title if + environment variable CYGWIN_TITLE set to "strip", references to + environ removed. + * environ.cc: New file. Code derived from newlib sources. + * exec.cc: include stdlib.h + (execl, execv): new (derived from newlib sources). + (sexecve): reference to environ removed. + (sexecvpe): call getenv instead of cygwin32_getenv. + * grp.cc: new static variable group_in_memory + (read_etc_group): skip blank lines + (getgrgid, getgrnam, getgrent): call read_etc_group when necessary. + * misc.cc (cygwin32_getenv/putenv/setenv/unsetenv): remove + wrappers. + * passwd.cc: new static variable passwd_in_memory + (read_etc_passwd): skip blank lines + (search_for, getpwent): call read_etc_passwd when necessary. + (setpwent): fixed incorrect initialization of i var. + * pinfo.cc (pinfo_init): initialize uid with illegal value to + force read of /etc/passwd and /etc/group. + * spawn.cc: call getenv instead cygwin32_getenv + (spawn_guts): force read of /etc/passwd and /etc/group on sexec + calls. + * uinfo.cc (uinfo_init): read /etc/passwd and /etc/group only if + uid is undefined. + * winsup.h: remove protos for environ, cygwin32_getenv, + cygwin32_putenv + +Wed Oct 22 02:08:54 1997 Geoffrey Noer <noer@cygnus.com> + + * utils/aclocal.m4: new file. Define autoconf macros for + determining whether we're compiling for the cygwin32 environment + or not and determine the executable suffix + * utils/configure.in: call AM_CYGWIN32 and AM_EXEEXT + * utils/configure: regenerate + * utils/Makefile.in: add $(exeext) after executable names so + programs will be built with the .exe suffix + +Wed Oct 22 00:50:27 1997 Geoffrey Noer <noer@cygnus.com> + + Now that it is possible to use gdb using a stable + cygwin.dll to debug a program using a newer, potentially buggy + cygwin.dll, the strace mechanism will probably end up being + used more and more for debugging timing/race-condition bugs that + aren't easily exposed in a gdb session. The following changes + make the strace facility better for debugging timing issues by + storing the last few commands in a buffer instead of writing + to disk each function call. + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc (dll_crt0_1): Change to strace_init call to take + an argument (for planned future registry changes). + (_exit): Call strace_dump when appropriate. Add a debugging + printf. + * include/sys/strace.h: Add _STRACE_CACHE, _STRACE_EXITDUMP, + strace_dump (). + * strace.c (strace_init): Allow hexadecimal, octal setting of + strace flags in environment variable. Handle new cache option. + (strace_printf): Display number of seconds from last message. + Handle _STRACE_CACHE. + (strace_dump): New function. Dump cached messages to disk. + +Wed Oct 22 00:08:40 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: export socket calls without cygwin32_ prefix + * net.cc: remove unused herror function in favor of + cygwin32_herror which is exported as herror + * include/netdb.h: we are now exporting the socket calls without + the cygwin32_ prefix so we don't need the nasty remapping in + header files + * include/arpa/inet.h: ditto + * include/sys/socket.h: ditto + * select.cc (select): make extern C + +Tue Oct 21 22:52:29 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * sigproc.cc (sigproc_terminate): Fix flawed attempt to signal + any processes waiting for signal notification success when the + process receiving the signal is terminating. + (wait_subproc): Report on errors when opening the + sync_proc_subproc mutex. Move initialization of events[0] + "wakeup" signal prior to wait_subproc_inited or risk a (miniscule) + chance for a reference to a NULL handle. + * strace.cc (ta[]): Change WM_ASYNCIO entry to reflect previous + changes to WM_ASYNCIO constant. + +Tue Oct 21 14:30:14 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * sigproc.cc (proc_subproc): fix minor error output problem + +Mon Oct 20 20:19:02 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: change DLL_NAME to cygwin97r2.dll + +Mon Oct 20 20:16:47 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * window.cc (alarm): When there is a previous alarm() request + with less than one second remaining, then the return from a call + to alarm() is supposed to return 1. + +Mon Oct 20 20:16:47 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * Makefile.in: Add sigproc.o target. Add sigproc.h dependency + where appropriate. Add -s to intermediate ld of cygwin.dll to + speed up the process of building the .dll. + * dcrt0.cc: Add new sigproc.h include. + (dll_crt0_1): Replace window_init with sigproc_init for + initialization of signal/sub process handling. Change to use new + process_state field in pinfo. + (_exit): Remove spurious debugging statement. Terminate sigproc + processing. Remove signal blocking obviated by previous signal + termination. Remove SIGCHLD notification of parent as it is now + handled automatically in the parent. + (api_fatal): Terminate sigproc processing. + * exceptions.cc: Add new sigproc.h include. Change name of + ourhThread. + (ctrl_c_handler): Change to static as this is no longer called + outside of this module. + (lock_cs): Change to a function which will optionally grab new + signal dispatch mutex. Don't wait forever for cs mutex. + (unlock_cs): Change to a function which will optionally release + new signal dispatch mutex. + (init_exceptions): Detect errors from SetConsoleCtrlHandler. + Initialize new sig_dispatch mutex. This mutex is used to + control dispatching to a function on signal receipt. + (sig_dispatch_pending): New function. Called from signal + processing thread to dispatch pending signals. + (set_process_mask): Block signal dispatch during setting of new + mask, if possible. Contact signal thread to dispatch pending + signals. + (handle_sigsuspend): New function. Attempts to implement a + sigsuspend which will not lose signal notification. Called from + sigsuspend. + (call_handler): Use sigproc_printf where appropriate. + (ctrl_c_handler): Use _raise to invoke the correct signal. + (sighandle): New function. Subsumes most of ctrl_c_handler. + Change to mark as suspended signals which would dispatch for which + the sig_dispatch mutex is unavailable. Use sigproc_printf where + appropriate. + (events_init): Remove application_stopped mutex made obsolete by + new sigproc handling. + (events_terminate): Remove application_stopped mutex made + obsolete by new sigproc handling. + * fork.cc: Add new sigproc.h include. + (cygwin_fork_helper1): Use process_state field in pinfo (replaces + inuse_p). Call proc_register to add a new subproc to sigproc + handling. Call sigproc_init for new subprocess. Remove obsolete + window_init. + * heap.cc (_sbrk): Use process_state field in pinfo (replaces + split_heap_p). + * hinfo.cc (hmap_init): Use process_state field in pinfo (replaces + cygwin_parent_p). + * include/sys/strace.h: Add tracing for signal/subprocesses. + * init.cc: Add new sigproc.h include. Add waitq_storage global + for new sigproc handling. + (dll_entry): Add initialization, destruction of structures needed + by new sigproc handling. + * net.cc (fhandler_socket::ioctl): Use gethwnd() function to find + hwnd of hidden window. + * pinfo.cc: Add new sigproc.h include. + (pinfo::clearout): Use process_state field in pinfo (replaces + split_heap_p). Explicitly initialize various handles to NULL. + (pinfo_init): Use process_state field in pinfo (replaces + cygwin_parent_p). + (pinfo_list::operator): Use process_state field in pinfo (replaces + inuse_p). + (pinfo_list::alocate_pid): Initialize process_state field. + (pinfo::init_self): Remove obsolete initialization of hProcess. + (pinfo::record_death_nolock): Changes for new sigproc handling. + (pinfo::record_death): Move bulk of this code to sigproc.cc. + (pinfo::terminate): Remove function made obsolete by sigproc + handling. + (pinfo::init_from_exec): Use process_state field (replaces + inuse_p). + * signal.cc: Add new sigproc.h include. + (kill_worker): Call new sig_send function to send signals to + cygwin processes. + (_kill): Use process_state field in pinfo (replaces inuse_p). + (sigsuspend): Call handle_sigsuspend in exceptions.cc to handle + sigsuspend in a non-raceable way. + * sigproc.cc: New signal/subprocess handling module. Replaces + SendMessage method for signals with a method using semaphores. + Also detects changes in the state of child processes. + * sigproc.h: New header file defining constants and functions for + signal/subprocess handling. + * spawn.cc: Add new sigproc.h include. Clean up trailing spaces. + (spawn_guts): Reorganize to use new sigproc handling. + Use new pinfo process_state field (replaces inuse_p). + * syscalls.cc (_read): Use new pinfo process_state field (replaces + inuse_p). + (_write): ditto. + * tty.cc (tty_init): Use new pinfo process_state field (replaces + cygwin_parent_p). + * utils/ps.cc (main): Use new pinfo process_state field (replaces + inuse_p). Detect "zombie" processes similarly to UNIX ps. + * wait.cc: Add required includes. + (wait_found): Function obsoleted by new sigproc handling. + (wait4): Reorganize to use new sigproc handling. + * window.cc: Changes for new sigproc handling. + (WndProc): Remove SIGNAL handling obsoleted by new sigproc + handling. Use static window handle since the field has been + removed from pinfo. Use _raise where appropriate to send signals. + (Winmain): Replace global window handle with static since the + field has been removed from pinfo. + (window_init): Remove obsolete function. + (gethwnd): New function to allocate hidden window on demand rather + than at startup. + (window_terminate): Kill hidden window only if allocated. + (setitimer): Use gethwnd function to retrieve hidden window + handle. + * winsup.h: Remove stuff made obsolete by sigproc handling. Move + some constants to new sigproc.h header file. Remove inuse_p, + cygin_parent_p, split_heap_p. Replace with a single process_state + field. Define bit fields for process_state in an enum for easier + debugging. + +Mon Oct 20 19:17:33 1997 Geoffrey Noer <noer@cygnus.com> + + * sysdef/i386/winserve.def: remove ancient version of cygwin.din + * include/sgtty.h: remove since Cygwin32's tty handling doesn't + support bsd syntax/semantics + * include/sys/termios.h: change winsize struct to include + ws_xpixel and ws_ypixel members + * cygwin.din: remove export of ScreenCols, ScreenGetCursor, + ScreenRows, ScreenSetCursor, get_pid__5pinfo, getkey, _getkey, + kbhit, _kbhit, __small_printf = small_printf__FPCce + * key.cc: remove. Similar functionality exists in ncurses + which can be compiled for Cygwin32 + * console.cc (ScreenCols, ScreenGetCursor, ScreenSetCursor, + ScreenRows): delete and delete SCREEN_ROWS/COLS defines + * pold.c: remove old pipe-related code that's no longer used + * include/regex.h: remove, it's not a part of cygwin.dll + * syscalls.cc: started to add comments including standards + information + (truncate): new + (ftruncate): length is an off_t, not a size_t. Add missing + return value to debug printf + * syscalls.h: ftruncate length is an off_t, add proto for truncate + + patch from cgf@bbc.com (Chris Faylor): + * console.cc (fhandler_console::write): Recognize '@' as a valid + character to follow a '\e[' sequence or get 'Bad escape' errors. + +Wed Oct 15 18:44:25 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: restore __main as an export + +Mon Oct 13 18:41:09 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: revert renaming of __assert since that's + actually what it's supposed to be called + * assert.cc: ditto + +Fri Oct 10 19:25:49 1997 Tom Tromey <tromey@cygnus.com> + + * include/Windows32/Base.h: Moved typedefs of CHAR, SHORT, etc, + before all other uses in file. + +Fri Oct 10 17:50:12 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/Windows32/Base.h: Only typedef CHAR, SHORT, and LONG if + VOID is not defined + +Thu Oct 9 00:46:40 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove all libgcc.a exports. They don't + belong here since libgcc.a doesn't really relate to the + purpose of cygwin.dll, and (to make things worse) the contents + change over time. + * assert.cc: rename __assert to __cygwin32_assert + * exceptions.cc: rename __stack_trace to __cygwin32_stack_trace, + __cygwin_except_handler to __cygwin32_except_handler + * version.h: increment major and minor numbers + +Tue Oct 7 12:52:25 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * dcrt0.cc (_exit): under Win 95, don't send SIGCHLD + unless special env variable is set. This works around a + problem where exiting a process can hang under Win 95. + +Mon Oct 6 23:41:34 1997 Geoffrey Noer <noer@cygnus.com> + + * regexp: new directory containing free regexp code by + Henry Spencer. Taken from the most recent release of NetBSD. + Write configure.in and Makefile.in, based on files from + winsup/utils. + * Makefile.in: build regexp directory and include objs in + cygwin.dll. + * stubs.cc: remove all reg* stubs except for regfree which + isn't provided by above code. + +Mon Oct 6 13:35:48 1997 Geoffrey Noer <noer@cygnus.com> + + * dcrt0.cc: remove asm idata3 terminator, now that ld is fixed + such that this is no longer necessary. + * libccrt0.cc: ditto + +Mon Oct 6 13:14:00 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc (spawn_guts): return child's PID on + spawn (_P_NOWAIT,...) instead of child's handle. + (cwait): rewritten as a wrapper to waitpid. + +Mon Oct 6 13:02:01 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * net.cc (socketpair): new + * cygwin.din: add socketpair export + +Mon Oct 6 13:01:51 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc: Remove obsolete call to fork_terminate. + * exceptions.cc: Respace, remove extraneous trailing whitespace. + Change critical section to mutex since there are supposedly + multi-processor problems with critical sections under NT. + Use "lock_cs" and "unlock_cs" macros to lock/unlock critical + regions. + (init_exceptions): Change critical section initialization to mutex + initialization. + (set_process_mask): Use locking macros to control access to + sig_mask. + (ctrl_c_handler): Use lock_cs/unlock_cs to control access. + (events_init): Use standard cygname function to create names for + shareable objects. + (events_init): Close cs mutex. + * fork.cc: Use event flags which are specific to the child being + forked. This prevents one process from prematurely activating + another. It also makes fork slightly more thread-safe. + (fork_init): Remove event initialization. + (fork_terminate): Remove function. + (cygwin_fork_helper1): Initialize events on a per-fork basis. + Events are inherited in child's pinfo structure. + Remove child->hThread initialization as it not needed. Use + pi.hThread where child->hThread is used. + Work around Windows 95 bug where a WaitForSingleObjects will + sometimes return ERROR_INVALID_HANDLE when it is resumed after + a suspend. + * pinfo.cc: Remove references to hThread field whereever it occurs. + * strace.cc: Use standard cygname function to create name for + strace_mutex. Prevents confusion between different .dll versions. + * wait.cc (wait_found): Remove reference to hThread. + * winsup.h (class pinfo): Remove reference to hThread. Add + per-process fork control event handles. + * include/limits.h: Increase NGROUPS_MAX from 0 to 1 to reflect + recent change to getgroups. + +Mon Oct 6 11:06:22 1997 Geoffrey Noer <noer@cygnus.com> + + Oops. ../libio refers to objdir and is not the same + as $(srcdir)/../libio. + +Thu Oct 2 23:12:19 1997 Geoffrey Noer <noer@cygnus.com> + + Revert patches to sources applied after Sept 16. Removed + relevant portions of ChangeLog entries. Some of those changes + may reappear later (removing the entries makes this log easier + to understand). + +Thu Oct 2 15:34:03 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: remove hardcoding of SHELL to /bin/sh, remove + ../libio from INCLUDES since $(srcdir)/../libio is already + included. + * glob/Makefile.in: remove hardcoding of SHELL to /bin/sh + +Mon Sep 29 14:06:24 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: add exports for rcmd, rresvport, rexec + * net.cc (cygwin32_rcmd): new + (cygwin32_rresvport): new + (cygwin32_rexec): new + * include/mywinsock.h: add protos for Winsock calls associated + with functions called by the above. + +Mon Sep 29 13:26:24 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * grp.cc (getgrent): Change overlooked comment to reflect new + behavior. + +Thu Sep 25 18:35:49 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: remove debugdll defs since the shared memory + overlap problem is solved by the timestamp addition of Sept 23 + * version.h: rework explanations of version numbers + +Thu Sep 25 16:21:49 1997 Geoffrey Noer <noer@cygnus.com> + + * spawn.cc: add missing cast to debug printf + +Thu Sep 25 16:14:17 1997 Ian Lance Taylor <ian@cygnus.com> + + * path.cc (conv_to_win32_path): Call backslashify on a win32 + path. + +Tue Sep 23 17:58:17 1997 Geoffrey Noer <noer@cygnus.com> + + Fixes for things that were causing compile-time warnings: + * exec.cc (_execve): add missing const to args to match def + of execve in newlib which this calls. + (sexecve): add missing const to def + (sexeclpe): don't need to cast argv in sexecvpe call + (sexecvpe): add missing const to def + * winsup.h: correct _execve proto, add protos for login/logout + * syscalls.h: correct sexecve, sexecvpe protos + * include/Windows32/Base.h: NULL should be defined differently + for C++ + * init.cc: respacing + +Tue Sep 23 17:05:50 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * dcrt0.cc (dll_crt0_1): don't use alloca for allocating storage + for environment blocks because setenv() uses realloc! + +Tue Sep 23 17:05:50 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * Makefile.in (LD_STUFF): Add datestamp.o after DLL_OFILES. + (datestamp.o): New target. datestamp.c is generated whenever .o + files change. It creates a file containing a "date stamp" + which is used by the function "cygname" to create named + shared memory, events, mutexes, and semaphores used by + cygwin.dll. The unique datestamp allows multiple loading of + different cygwin.dll's even when they have incompatible use + of shared memory areas. + * init.cc (dll_entry): Create the name string used by cygname + from the name of the invoking .dll + the datestamp of the + .dll from the auto-generated datestamp.c + * misc.cc (cygname): New function. Creates a standard Cygnus + shared resource name given a prefix, a name (e.g., pinfo_mutex), + and a numeric suffix (e.g., a pid). Replaces custom code in + several files. Uses cygwin_dlldate from datestamp.c to construct + names that are unique for a given cygwin load. + * shared.cc (open_shared_file_map): Use standard cygname function + to create names for sharable objects. Use static handle 'h' + so that it can be closed later by shared_terminate. + (shared_terminate): Guard against calling CloseHandle with a + NULL handle. + (create_shared_fd_mapping_name): Use cygname function to generate + the name for the "fd_map". + +Tue Sep 16 23:34:36 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * fcntl.cc (_fcntl): correct errno value (EBADF instead of + EBADFD). + +Tue Sep 16 17:22:28 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * include/Windows32/Defines.h: add missing defines needed + for NTEA usage. + * ntea.cc: remove them from here + * syscalls.cc (_link): call CreateFile with FILE_WRITE_ATTRIBUTES + flag instead of GENERIC_WRITE + +Tue Sep 16 17:22:28 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * pinfo.cc (pinfo_init): Fix a NULL pointer dereference when PID + environment variable contains garbage. + +Thu Sep 11 16:51:40 1997 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (ftruncate): read file pointer location at + beginning of function and restore it at the end + +Thu Sep 11 15:35:10 1997 Ian Lance Taylor <ian@cygnus.com> + + * path.cc (backslashify): Don't turn a single trailing slash into + a double trailing slash. + +Wed Sep 10 11:40:55 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/Windows32/Structures.h: Add PACKED to PRINTDLG. + * include/Windows32/Functions.h: Add STDCALL to a few function + declarations. + +Tue Sep 9 02:12:18 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * syscalls.cc (_link): Implement hard links under NT with NTFS + using the backup API. Default to copying the file (what we did + before). + +Mon Sep 8 20:19:09 1997 Geoffrey Noer <noer@cygnus.com> + + Merge in the following changes: + + Thu Aug 21 13:30:12 1997 Ian Lance Taylor <ian@cygnus.com> + * assert.cc: New file. + * Makefile.in (DLL_OFILES): Add assert.o. + (assert.o): New target. + * pinfo.cc (cygwin32_winpid_to_pid): New C function. + * cygwin.din: Add cygwin32_winpid_to_pid. + * include/sys/cygwin.h: Include <sys/types.h>. + (cygwin32_winpid_to_pid): Declare. + * pinfo.cc (pinfo_init): Add debug_printf showing pid and pgid. + + Wed Aug 20 13:24:30 1997 Ian Lance Taylor <ian@cygnus.com> + * spawn.cc (env_sort): New static function. + (spawn_guts): Sort the environment before passing it to + CreateProcess. + * exceptions.cc (exit_already): New file static variable. + (__cygwin_exception_handler): If exit_already is set, just + return. If we get an exception we don't recognize, let the next + exception handler handle it. Just ignore the INVALID_HANDLE + exception. + (really_exit): Remove file static exit_already variable; use the + global one. + (events_terminate): Set exit_already. + * include/Windows32/Defines.h (EXCEPTION_INVALID_HANDLE): Define. + (STATUS_INVALID_HANDLE): Define. + * include/Windows32/Functions.h: Declare some shell functions. + +Mon Sep 8 17:40:46 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * dcrt0.cc (_exit): Kill the foreground process group on session + leader exit only if job control is in progress. + * exceptions.cc (ctrl_c_handler): protect the code with critical + section. This helps stability under Win 95. + * include/sys/strace.h: add new wm_printf macro + * signal.cc (kill_worker): window message number changed (window + messages WM_USER-WM_USER+0x100 reserved for common controls on + windows95). Debug print added. + * spawn.cc (spawn_guts): removed unneeded flag DETACHED_PROCESS. + * strace.cc: defines for SIGNAL and ASYNCIO messages added. + * tty.cc (create_tty_master): initialize speed fields of termios + structure. + (fhandler_pty_master::open): likewise. + * window.cc (WndProc): debug print added, window message number + changed. + * winsup.h: WM_ASYNCIO number changed. + +Mon Sep 8 16:40:46 1997 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * fhandler.h: set_w_binary/set_r_binary now defined to + return void + * grp.cc (getgroups): always return an array of length 1 where + the element is the user's gid. + * pinfo.cc (pinfo_init): verify that we haven't exceeded the + maximum number of processes + (pinfo_list::allocate_pid): ditto + * include/Windows32/Functions.h: add noreturn attrib to ExitProcess + * include/sys/strace.h: change strace defs so strace-related + printfs will automatically add __FUNCTION__: to the beginning, + rename __sys_printf to strace_printf. + * *.cc: remove function names from debug printfs in favor of the + new scheme where they are automatically added, change __sys_printf + references (now strace_printf). + * smallprint.c (__small_vsprintf): new function displayer code + to support the above changes + +Wed Sep 3 12:44:45 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: split subdir_do into subdir_dobefore and + subdir_doafter to reflect whether the subdir in question + should be built before or after the top level is built + (e.g. glob needs to be built before libcygwin.a but libcygwin.a + needs to be built before utils). + +Thu Aug 28 12:09:39 1997 Geoffrey Noer <noer@cygnus.com> + + * configure.in: when setting up EXE_LDFLAGS, correct the + location of crt0.o to ../../newlib since EXE_LDFLAGS is used + by Cygwin32 subdirectories where newlib is two directories up + instead of one. + * configure: regenerate with autoconf + +Thu Aug 28 00:13:11 1997 Geoffrey Noer <noer@cygnus.com> + + Replace all licensing-related headers in all Cygnus-owned + files. Instead of listing terms at the top of each file, now + we simply refer to: + * CYGWIN32_LICENSE: new file listing Cygwin32 licensing terms + +Wed Aug 27 17:40:16 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: export random, srandom + +Wed Aug 20 16:56:39 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: remove unused winsock-related build rules + that were commented out, minor comment changes, remove + test.exe build rule. + +Wed Aug 20 14:45:17 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: link cygwin.dll with -lm -lgcc -lc -lgcc instead + of -lc -lm -lm -lgcc so lgcc finds abort(). Add definitions that + will eventually be used to build a cygwindebug.dll used by gdb + so gdb can debug a buggy cygwin.dll. Change some variable names + to have underscores in them (DLL_NAME, LIB_NAME, DEF_FILE, etc.). + Comment out text.exe build rule. + +Tue Aug 19 20:41:51 1997 Geoffrey Noer <noer@cygnus.com> + + * dcrt0.cc: respace, modify some comments slightly + +Tue Aug 19 16:17:57 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: include ../libiberty/random.o, stop including + librx since it is LGPL'd code. + * stubs.cc: add stubs for regcomp, regexec, regerror, regfree + * dcrt0.cc (dll_crt0_1): default to not support tty/pty devs, + default to not displaying the running process in the title bar. + +Fri Aug 15 18:23:43 1997 Rob Savoye <rob@cygnus.com> + + Add mingw directory for the minimalist cygwin environment. + See mingw/ChangeLog for changes specific to that directory + + * configure.in: Add mingw to AC_CONFIG_SUBDIR. + * configure: Regenerated from autoconf 2.12 with Cygnus patches. + * Makefile.in: Use subdir_do which uses the value of $SUBDIRS + rather than having seperate target for each directory. + * glob/Makefile.in: Add a phony target for install. + * configure.in: Add mingw to AC_CONFIG_SUBDIR. + +Fri Aug 15 01:12:19 1997 Geoffrey Noer <noer@cygnus.com> + + * times.cc: add missing extern "C"s around exported functions + +Thu Aug 14 17:00:32 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * console.cc (fhandler_console::input_tcsetattr): clear iflag_ and + lflag_ when tty support enabled. + (FakeReadFile): do not interrupt read when tty support enabled. + Do not reset signal_arrived event. + * cygwin.din: add exports - cf(g)set(i)ospeed, login, logout, ttyslot + * dcrt0.cc (_exit): kill orphaned childs with SIGHUP and SIGCONT + on group leader exit, kill foreground process group on session + leader exit. + * dirsearch.cc (closedir): check for FindFirst() was called + * exceptions.cc: include mywinsock.h. + (call_handler): call WSACancelBlockingCall to try to interrupt + blocking winsock call, do PulseEvent() instead of SetEvent(). + (ctrl_c_handler): clear pending SIGCONT on stop signals, clear all + pending stop signals on SIGCONT, suspend the thread before resuming + to avoid W95 bug, process pending signals on SIGCONT, add signals to + pending if the process is stopped. + * fcntl.cc (fcntl): some code rearrangement to always do debug printfs + on call exit. + * hinfo.cc: include stdio.h + (hinfo_vec::build_fhandler): always add ttynum to tty's filename + (hinfo_vec::dup2): fix return value initialization and errno setting. + * include/netdb.h: typedef for sig_t removed + * include/sys/termios.h: octal constants changed to hexadecimals + to simplify debugging. + * misc.cc: include unistd.h and utmp.h + (login): new + (logout): new + * pinfo.cc (lock_pinfo_for_update): debug printf added + (pinfo::record_death): mark processes as orphaned on group leader + exit. + * select.cc (cygwin32_select): ResetEvent() removed + * signal.cc: unneeded ResetEvents removed + (_kill): ignore stop signals from a member of orphaned process group, + kill self process the last on group kill. + (sigaction): reset pending SIGCHLD when the disposition is set to + default. + * spawn.cc (spawn_guts): ResetEvent removed + (cwait): do not interrupt the call + * strerror.cc: include stdio.h, reenable disabled cases, remove + duplicated cases, return decimal error value in the default case. + * syscalls.cc (setsid): set process group id to process id when setsid + called. + (setpgid): check for negative pgid + * syslog.cc (syslog): %m macro support added + * termios.cc (cfg(s)eti(o)speed): new fuctions needed to support + NIST PCTS requirements. + * tty.cc: include utmp.h. + (ttyslot): new + (tty_list::terminate): fill in utmp on tty master exit + (tty_list::allocate_tty): check for tty master pocess alive + (create_tty_master): fill in utmp + (do_input): restart tty output on interrupt + (fhandler_tty_slave::fhndler_tty_slave): ttynum logic moved to + build_fhandler. + (fhandler_tty_slave::open): set tty's session id to sid of the calling + process. + (fhandler_tty_slave::write): check for TOSTOP bit + (fhandler_tty_slave::fstat): allow access to tty to everyone + (fhandler_tty_slave::ioctl): check for TOSTOP bit + * tty.h: ttyslot prototype added + * wait.cc (wait4): check for valid value of option argument added + * winsup.h: define PID_ORPHANED, move tty_list array to the end + of shared area. + +Thu Aug 14 11:42:59 1997 Ian Lance Taylor <ian@cygnus.com> + + * path.cc (slash_unc_prefix_p): Correct check of path[3]. Permit + numbers after the host name. + + * include/Windows32/Defines.h: Correct value for SM_CMETRICS, + SM_CXDRAG, SM_CYDRAG, SM_CXEDGE, SM_CYEDGE, SM_CXFIXEDFRAME, + SM_CYFIXEDFRAME, and add SM_MOUSEWHEELPRESENT. + +Wed Aug 13 20:11:52 1997 Ian Lance Taylor <ian@cygnus.com> + + * fork.cc (cygwin_fork_helper1): If we don't have a console, pass + DETACHED_PROCESS to CreateProcess. + * spawn.cc (spawn_guts): Likewise. + +Tue Aug 12 19:51:32 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/Windows32/Structures.h (IMAGE_DOS_HEADER): Remove + dos_message and nt_signature fields; they aren't present in the + Windows header file. + +Wed Aug 6 16:27:13 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/Windows32/Structures.h: Define LPMEASUREITEMSTRUCT as a + pointer to MEASUREITEMSTRUCT. + + * syscalls.cc (_stat_worker): In directory case, only set + STD_WBITS in st_mode if FILE_ATTRIBUTE_READONLY is clear. + (access): Remove special case for directory. + + * include/Windows32/Defines.h (HKEY_DYN_DATA): Define. + (REG_FULL_RESOURCE_DESCRIPTOR): Define. + (REG_RESOURCE_REQUIREMENTS_LIST): Define. + +Mon Aug 4 21:15:05 1997 Andrew Cagney <cagney@b1.cygnus.com> + + * glob/Makefile.in: Add include of newlib/libc/sys/cygwin32 to + explicit .c.o rule so that dirent.h is found. + +Thu Jul 24 02:14:24 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: fpathconf, initgroups - new exports + * console.cc: new static variable CONSOLE_SCREEN_BUFFER_INFO info + (fhandler_console::scroll_screen): local variable info removed + (fhandler_console::open): likewise + (fhandler_console::ioctl): likewise + (fhandler_console::clear_screen): likewise + (fhandler_console::cursor_set): likewise + (fhandler_console::cursor_rel): likewise + (fhandler_console::cursor_get): likewise + (fhandler_console::write_normal): fixed scroll region bug, termcap + "cs" entry works now + * dcrt0.cc (dll_crt0_1): set file API to use OEM charset, convert + command line from ANSI to OEM charset. + (_exit): clear stopsig value on process exit + * exceptions.cc (call_handler): add one millisecond delay before + SetEvent() + (ctrl_c_handler): clear pending stop signals on SIGCONT, do not send + SIGCHLD to parent on process resuming; some debug printfs added; do + not call _exit() in a context of signal handling thread (would cause + more harm than good); fixed a bug with SA_NOCLDSTOP flag. + * fhandler.cc (fhandler_base::open): use full win32 path name to + generate inode number namehash instead of unix filename. + * fork.cc (cygwin_fork_helper1): block all signals while child and + parent are in fork() code + * grp.cc (initgroups): new stub added + * include/limits.h: new posix defines added + * include/sys/termios.h: typedef speed_t as unsigned char + * path.cc (mount_info::conv_to_posix_path) bugfix + * pinfo.cc (pinfo_list::operator []): PID_NOT_IN_USE check added + (pinfo::record_death): set child's ppid to 1 on parent exit + * signal.cc (sleep): correct return value if sleep call was + interrupted + (_kill): correct return value if killed pid was not found. + (sigaction): correct return value on handling non-handlable + signals, clear pending ignored signals + (sigsuspend): sigsuspend call should always return -1 and set errno + to EINTR. + * spawn.cc: respace + * syscalls.cc: map ERROR_NO_DATA to EPIPE instead of ENODATA + (isatty): fixed return value + (fpathconf): new + (pathconf): rewritten + (ttyname): fixed return value + * sysconf.cc (sysconf): misc fixes + * termios.cc (tcsendbreak): corrected errno set + (tcdrain): likewise + (tcflush): likewise + (tcflow): likewise + (tcsetattr): likewise + (tcgetattr): likewise + (tcgetpgrp): likewise + (tcsetpgrp): likewise + * tty.cc (fhandler_tty_slave::ioctl): TCGETA/TCSETA support added + * wait.cc (_wait): wait() syscall should do not terminate if + a child is stopped. + (wait4): wait calls should wait childs only; fixed a bug with + nprocinfo count; fixed signal handling. + +Thu Jul 24 02:10:25 1997 Geoffrey Noer <noer@cygnus.com> + + * uname.cc: uname now outputs Cygwin32_NT or Cygwin32_95 + instead of Cygwin32/NT or Cygwin32/95. + +Thu Jul 24 02:10:25 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: sexecve, sexecl, sexecle, sexeclp, sexeclpe, + sexecv, sexecp, sexecvpe - new exports + * exceptions.cc (ctrl_c_handler): do not raise SIGHUP on + CTRL_LOGOFF_EVENT to prevent termination of cygwin application + run as NT service on user logoff, raise SIGHUP instead of SIGQUIT + on system shutdown, clear stopped status in inuse_p on SIGCONT, + set stopped status on stop signals, call _exit() on process + termination in a context of signal thread to terminate while + in a blocking win32 syscall. + * exec.cc: include unistd.h and ctype.h. + (_execve): code moved to sexecve, call sexecve with a NULL hToken + handle. + (sexecve): new, check path, argv[0] and envp to null values, + pass nToken handle to spawn_guts(). + (sexecl): new (code derived from spawn family of functions in + spawn.cc) + (sexecle): new + (sexeclp): new + (sexeclpe): new + (sexecv): new + (sexecp): new + (strccopy): new + (sexecvpe): new + * fhandler.cc (fhandler_base::fstat): add STD_RBITS and STD_WBITS + to st_mode of non-file handles. + (fhandler_dev_floppy::open): clear O_TRUNC bit. + (fhandler_dev_tape::open): likewise + * fhandler.h (fhandler_pty_master): new member pktmode (flag to + indicate pty's packet mode) + * fork.cc (cygwin_fork_helper1): call uinfo_init () in a child code + to read /etc/passwd, /etc/group into memory. + * hinfo.cc (hinfo_vec::build_fhandler): check socket names for right + inheritance on exec(). + * include/Windows32/Defines.h: fixed a typo in LPSTR_TEXTCALLBACKA + definition + * include/Windows32/Functions.h: added prototype for + ImpersonateLoggedOnUser() API call. + * net.cc (cygwin32_socket): duplicate socket handle as inheritable + to avoid Windows95 socket inheritance bug, close the original socket. + (cygwin32_accept): likewise. + * path.cc (mount_info::conv_to_win32_path): do not add trailing + backslash to UNC device names like "\\.\a:", "\\.\tape0:" etc. + * pinfo.cc (pinfo::record_death_nolock) set PID_WAITING_FOR_PARENT + bit to inuse_p instead of assignment - inuse_p is a bit set now. + (pinfo::record_death): check PID_WAITING_FOR_PARENT bit instead of + comparison. + * select.cc (fd_pipe_map::convert_to_unix_fdset): deal with pipe + errors. + (pipethread): likewise + * shared.cc (create_shared_fd_table): allow any process to access + shared arg, needed for sexec() family implementation + * signal.cc (kill_worker): fixed a typo in debug printf + * spawn.cc (spawn_guts): new hToken argument (security token of + logged on user for sexec() calls implementation), added checks for + zero prog_arg and argv[0], if hToken is not NULL run + CreateProcessAsUser() on the current window station/desktop, or + just CreateProcess() otherwise, close hToken after the process is + created. + (_spawnve): pass NULL hToken to spawn_guts(). + * syscalls.cc (_read): set process's read status while in a read call + (_write): set process's write status while in a write call + (stat_worker): if GetFileAttributes() fails, try to call fstat to + support raw devices + * syscalls.h: include windows.h, added sexec() family functions + prototypes. + * sysdef/i386/kernel32.def: ImpersonateLoggedOnUser - new export + * tty.cc: tty attachment logic changed - tty_list::count field + counts now number of tty opens, but not a number of processes, + attached to a tty. + (tty_init): do not call attach_tty() in a exec'ed process + (attach_tty): correct return value if !use_tty. + (tty::init): initialize pgid and hwnd fields. + (tty_list::terminate): clearout tty on master exit. + (tty_list::allocate_tty): fixed a bug in a tty allocation. + (fhandler_tty_master::init): on NT allow any process to open + tty-master process for handle duplication, create synchronisation + events with a world-wide access, initialize winsize structure with + a default values. + (fhandler_tty_slave::open): if a tty doesn't have process group set, + set it to a process group of current process. + (fhandler_tty_slave::write): added missed \n to debug print, tty + write synchronization moved to a more correct place. + (fhandler_tty_slave::read): Sleep time changed for conformance with + other sleeps. + (fhandler_tty_slave::tcsetattr): synchronization added + (fhandler_tty_slave::ioctl): initialize arg.winsize with a tty-stored + value, copy the result of ioctl call to winsize. + (fhandler_pty_master::fstat): small fix + (fhandler_pty_master::open): on NT allow any process to open + pty-master process for handle duplication, initialize winsize + structure with a default values. + (fhandler_pty_master::read): check for pipe errors, changes to support + packet mode + (fhandler_pty_master::ioctl): rewritten, no longer a stub. + (fhandler_pty_master::linearize/de_linearize): save/restore pktmode + value. + * tty.h (class tty): winsize - new member + * utils/ps.cc: show process status just after tty number field + * winsup.h: defines for new bits in inuse_p added, spawn_guts() + prototype changed. + +Thu Jul 24 02:10:25 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * Makefile.in: Add tty.o to link and dependency lists, add + tty.h to headers list + * console.cc (fhandler_console::open): save open call flags + (fhandler_console::input_tcsetattr): clear all console modes if + tty support enabled + (FakeReadFile): restart read on signal delivering, changed CTRL + macro to CONTROL to avoid conflict with sys/termios.h, copy as + much as possible chars to output buffer instead of call to + undo_input after every char to prevent timeouts problem. + * cygwin.din: srandom, ptsname, grantpt, unlockpt - new exports. + * dcrt0.cc: include tty.h, new use_tty global variable. + (dll_crt0_1): call events_init() on application startup, set + use_tty to FALSE if CYGWIN_NOTTY environment variable is defined, + do not change console title if CYGWIN_NOTITLE environment + variable set, call tty_init(). + (_exit): call tty_terminate(), events_terminate() and others + in the right order. All modifications of console title are + mutexed to allow tty code to obtain console window handle right. + * exceptions.cc (exception_init): initialization of signal_arrived + event moved to events_init(). + (call_handler): raise signal arrived event after resuming main + thread. + (__cygwin_exception_handler): raise signal instead of calling + ctrl_c_handler, because exception handler is called in a context + of the thread, caused exception, and SuspendThread in call_handler + blocks itself :-) + (ctrl_c_handler): clear stopsig on SIGCONT delivery, call + ResumeThread until suspend count > 1, notify parent about child's + status changed. Care about handling SIGCONT signal. On stop + signals release vital mutexes used by stopped thread, save + signal number for wait(WUNTRACED) calls, notify parent about child's + status change. Do not stop processes running without job control + (when pgid == 0). Ensure that main thread is unblocked before + call _exit(). + (events_init): new + (events_terminate): new + * fcntl.cc (_fcntl): use saved open flags on F_GETFL/F_SETFL instead + of game with access_ variable. Is this variable longer needed? + * fhandler.cc (fhandler_base::linearize/de_linearize): save/restore + openflags_ variable. + (fhandler_base::open): save file open flags. + * fhandler.h (fhandler_base): new openflags_ member, new member + functions get_flags/set_flags, new virtual functions ptsname, + dup_for_fork, tcget(set)pgrp + (fhandler_pipe): remove always_write/except_ready because pipes + are always write ready (not true...) and selectable on read. + new classes fhandler_tty_slave, fhandler_pty_master, + fhandler_tty_master + * fork.cc (cygwin_fork_helper1): inherit control tty number on fork, + call tty_init on child startup. + * hinfo.cc: include stdlib.h and ctype.h. + (hmap_init): take care on exec'ed processes. + (init_std_file_from_handle): open /dev/tty for standard handles if + tty usage enabled. + (build_fhandler): check for tty slave and pty master devices. + * include/exceptions.h: exception handler returns "int" (exception + handling code), not "void". + * include/termios.h: new defines, struct winsize must contain + ws_xpixel and ws_ypixel members (commented now to avoid + incompabilities with existing binaries. Should be uncommented in + next release. + * net.cc (gethostbyaddr): corrected return value + * passwd.cc (parse): remove trailing newline from password + lines (user's shell was reported with trailing newline before). + * pinfo.cc (lock_pinfo_for_update): open mutex code moved to + events_init() in exceptions.cc. + (destroy_pinfo_lock): removed, pinfo_mutex is now closed in + events_terminate() in exceptions.cc. + (init_self): the initial value for pgid must be 0 (no job-controlled + process). + * select.cc: all debug_printf's changed to select_printf. + (fd_pipe_map): new class to implement (polling...) select on pipes. + (pipethread): new + (cygwin32_select): comment out socket only case since generic + code (select on different types of handles) works for sockets too + but is interruptable. The case for always_ready_used is used now + and for polling select (zero timevalue). Changes to support + select on pipes. + * shared.cc (shared_info::initialize): initialize tty table. + * signal.cc (sleep/usleep/sigsuspend/pause): signal_arrived moved + from u area to dll's address space, signal_arrived is manual reset + event now. + (_raise): implemented as kill (self, sig). + (kill_worker): new. Use SendMessage instead of PostMessage to avoid + some timing problems. + * spawn.cc: include tty.h. + (spawn_guts) call close_all_files() on exec, call tty_terminate() + before process exit. Some changes due to moving signal_arrived to + dll's address space. + (_spawnve): inherit control tty number on spawn. + * syscalls.cc (close_all_files): reenabled. The code is ok after + all! The troubles were due to incorrect usage on exec() calls. + (setsid): no longer a stub + (ptsname): new + * termios.cc: all syscall_printf's changed to termios_printf. + (tcget(set)pgrp): rewritten, no longer a stub. + * times.cc (utimes): It looks like Win32 does not allow changing + times of directories, so just return success in this case. + * tty.cc: new file + (tty_init): new + (tty_terminate): new + (attach_tty): new + (detach_tty): new + (tty::init): new + (tty_list::terminate): new + (tty_list::connect_tty): new + (tty_list::free_tty): new + (tty_list::init): new + (tty_list::allocate_tty): new + (fhandler_tty_master::fhandler_tty_master): new + (create_tty_master): new + (fhandler_tty_master::init): new + (doecho): new + (do_input): new + (process_input): new + (do_output): new + (process_output): new + (process_ioctl): new + (fhandler_tty_slave::fhandler_tty_slave): new + (fhandler_tty_slave::open): new + (fhandler_tty_slave::init): new + (fhandler_tty_slave::close): new + (fhandler_tty_slave::write): new + (fhandler_tty_slave::read): new + (fhandler_tty_slave::linearize): new + (fhandler_tty_slave::de_linearize): new + (fhandler_tty_slave::dup): new + (fhandler_tty_slave::dup_for_fork): new + (fhandler_tty_slave::fstat): new + (fhandler_tty_slave::tcgetattr): new + (fhandler_tty_slave::tcsetattr): new + (fhandler_tty_slave::tcflush): new + (fhandler_tty_slave::tcsetpgrp): new + (fhandler_tty_slave::tcgetpgrp): new + (fhandler_tty_slave::send_ioctl_request): new + (fhandler_tty_slave::ioctl): new + (fhandler_pty_master::fhandler_pty_master): new + (fhandler_pty_master::fstat): new + (fhandler_pty_master::open): new + (fhandler_pty_master::close): new + (fhandler_pty_master::write): new + (fhandler_pty_master::read): new + (fhandler_pty_master::tcgetattr): new + (fhandler_pty_master::tcsetattr): new + (fhandler_pty_master::tcflush): new + (fhandler_pty_master::ioctl): new + (fhandler_pty_master::ptsname): new + (fhandler_pty_master::linearize): new + (fhandler_pty_master::de_linearize): new + (fhandler_pty_master::dup_for_fork): new + (grantpt): new + (unlockpt): new + * tty.h: new + * utils/ps.cc: display process's control tty number. + * wait.cc (wait_for_single): removed. + (wait_for_any): all code moved to wait4(). + (wait4): rescan process table on child status changes, support for + WUNTRACED flag, avoid time races on child exit, correct return + value on timeout. + * window.cc: misc changes to wait creation of process's hidden + window to avoid race conditions on multiprocessor systems. + * winsup.h: misc changes to support all of the above. + +Thu Jul 24 02:10:25 1997 Geoffrey Noer <noer@cygnus.com> + + * net.cc (cygwin32_shutdown): New implementation to replace + stub previously present + +Tue Jul 22 14:59:22 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove random, srandom + * Makefile.in: remove random/srandom-related lines + +Tue Jul 22 14:10:32 1997 Ian Lance Taylor <ian@cygnus.com> + + * path.cc (realpath): New C function. + * cygwin.din: Export realpath. + + * cygwin.din: Export srandom. + +Wed Jul 9 12:26:03 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: libiberty random.o ends up in winsup, link + in that obj for now + +Tue Jul 8 14:02:41 1997 Ian Lance Taylor <ian@cygnus.com> + + * libcmain.cc (main): Pass wShowWindow field from startup info to + WinMain. + +Mon Jul 7 17:47:48 1997 Geoffrey Noer <noer@cygnus.com> + + * path.cc: respace, reword comments + * times.cc (utimes): add FIXME + +Tue Jun 24 18:31:27 1997 Geoffrey Noer <noer@cygnus.com> + + * winsup.h: adjust protos to reflect the above, add enum os_type + which contains {winNT, win95, win32s, unknown} + * security.cc (is_nt): Delete + * syscalls.cc (windows_95): Delete + (get_os_type): New local function which returns os_type. Replaces + windows_95() and is_nt(). + + * fhandler.cc: Reformat. Call get_os_type() instead of + windows_95() and/or is_nt(), reorder so NT cases are first. + * mmap.cc: ditto + * net.cc: ditto + * syscalls.cc: ditto + * syslog.cc: ditto + + * uname.cc (uname): call get_os_type to fill new our_os local + variable, check that when filling out utsname struct, default + to i386 when we can't find out the specific Intel processor + variant. + * fhandler.cc (get_file_owner): remove doit variable + (get_file_group): ditto + * mmap.cc: extern "C" individual functions instead of wrapper + around most of file. + * misc.cc: minor reformat + * heap.cc (_sbrk): split a = b = c statement into two to + make code clearer and avoid invalid C++ casting warning during + compile. + * path.cc (symlink_follow): initialize syml_p and exec_p to zero + * select.cc: respace + (selectthread): cast first arg of WINSOCK_FD_SET + * ntea.cc (NTReadEARaw): add missing casts in front of malloc calls + * utils/mount.cc: remove mixed option since that hasn't been + supported for quite some time + +Sun Jun 22 17:27:03 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/windows.h: If RC_INVOKED is defined, don't include + limits.h, stdarg.h, Structures.h, Functions.h or Sockets.h, and + don't typedef BOOL. + * include/Windows32/Base.h: Don't do any typedefs if RC_INVOKED is + defined. + + * include/Windows32/Sockets.h (MAXHOSTNAMELEN): Don't define if + already defined. + * include/sys/param.h (MAXHOSTNAMELEN): Likewise. + +Fri Jun 20 11:06:09 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * include/sys/wait.h: correct operator precidence bug + in WIFSIGNALED + +Thu Jun 19 12:58:45 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + Handle unblocked pending signals on sig_mask changes + * exceptions.cc (return_handler): renamed to set_process_mask + (set_process_mask): new; use to set process mask instead of direct + u->self->sig_mask manipulations. + * winsup.h: rename return_handler proto to set_process_mask + * signal.cc: throughout file, call set_process_mask() instead of + direct manipulations of u->self->sig_mask. + (pause): new + * cygwin.din: add pause() export + * syscalls.cc (system): correct return value + +Wed Jun 18 22:01:56 1997 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: add $(srcdir)/../newlib/libc/sys/cygwin32 to + the list of includes since that's where sys/dirent.h is + supposed to live + * include/sys/dirent.h: moved to newlib/libc/sys/cygwin32/sys + +Wed Jun 18 13:56:47 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * signal.cc (sigsuspend): deal with pending unblocked signals + * winsup.h: add proto for return_handler (sigset_t) + +Wed Jun 18 02:02:13 1997 Geoffrey Noer <noer@cygnus.com> + + respaced console.cc, fhandler.cc, syscalls.cc, pinfo.cc, + fork.cc, spawn.cc + +Tue Jun 17 14:57:09 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: add getpgid, killpg exports, delete duplicate + random export + * fork.cc (cygwin_fork_helper1): inherit pgid and sid on fork + * misc.cc (cygwin32_*env): save environ value in __cygwin_environ + too. Is __cygwin_environ variable really neccessary? Why not + export cygwin.dll's environ variable with "__cygwin_environ" name? + * pinfo.cc (pinfo::init_self): initialize pgid and sid + * signal.cc (kill_worker): new + (_kill): rewritten to support process groups + (killpg): new + * spawn.cc (_spawnwe): inherit pgid and sid on spawn family calls + * stubs.cc (setpgrp, getpgrp): remove stubs + * syscalls.cc (setpgid, getpgid, setpgrp, getpgrp): new + * termios.cc (setpgid): remove stub + * utils/ps.cc (main): add pgid to output, change output + format + * wait.cc (wait_for_any): add intpid argument, arrays ctable and + ptable have now fixed MAXIMUM_WAIT_OBJECTS size to avoid extra + scan of process table, changes for process groups support. + (wait4): misc changes to support process groups + * winsup.h (pinfo class): add new variables pgid, sid. + Define __cygwin_environ. + +Mon Jun 16 18:30:21 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc (spawn_guts): set child->hProcess and child->hThread, + CloseHandle on pi.hThread at end of spawn_guts instead of right + after starting the child process, + _P_WAIT needs to be handled separately from _P_OVERLAY + +Sun Jun 15 23:51:10 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: remove setenv/getenv-related exports, + export cygwin32_ equivalents + * exec.cc: check ? + * misc.cc (cygwin32_getenv): new + (cygwin32_putenv): new + cygwin32_setenv): new + (cygwin32_unsetenv): new + * spawn.cc: call cygwin32_getenv instead of getenv, + call spawn with *u->envptr instead of environ + * winsup.h: define **environ as extern, define *cygwin32_getenv + +Sun Jun 15 20:51:09 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * Makefile.in: add ../libiberty/random.o to EXTRA_OFILES + * cygwin.din: remove exports of tgetent and _tgetent, added random + * exception.cc (exceptions_init): make OurThread handle + noniherittable, remove unused buf array. + (return_handler): add restmask argument (sig_mask value before + calling signal handler) + (call_handler): save sig_mask in user's stack before calling signal + handler, change PulseEvent() call to SetEvent() -- there were + losses of signal_arrived events if main thread was not in wait + state. + (ctrl_c_handler): add support for SIGIO signal. + * fhandler.cc (fhandler_base::linearize/delinearize): + save/restore async_ flag + (fhandler_base::fhandler_base): clear async_ flag + * fhandler.h: add async_ as new variable in fhandler_base, + add get_async/set_async functions + * misc.cc (tgetent): remove stub + * net.cc (fhandler_socket::write): raise SIGPIPE if write to + disconnected socket. + (cygwin32_accept): check the result of find_unused_handle() before + accept() call, set errno if no more file descriptors available. + (fhandler_socket::ioctl): add support for async I/O on sockets + * pinfo.cc (pinfo::clearout): clear sig_pending mask + * syscalls.cc (readv, writev): rewrite + * window.cc (WndProc): add support for async I/O + * winsup.h: define WM_ASYNCIO + +Mon Jun 9 18:51:09 1997 Geoffrey Noer <noer@cygnus.com> + + * include/winsock.h: fix protection wrapper name + +Fri Jun 6 12:41:09 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/Windows32/Defines.h: Define CommonDlgExtendedError + return values (CDERR_*, PDERR_*, CFERR_*, FNERR_*). Define + TEXTMETRIC tmPitchAndFamily values (TMPF_*). + + * include/dlgs.h: New file; just includes windows.h. + * include/cderr.h: Likewise. + + * libcmain.cc (main): Don't pass the program name to WinMain. + + * cygwin.din: Export strlwr and strupr. + + * include/winreg.h: New file; just includes windows.h. + * include/winsock.h: New file; just includes windows.h and + Windows32/Sockets.h. + * include/Windows32/Sockets.h: Don't define u_char, et. al. if + _SYS_TYPES_H is defined. Undefine fd_set if it is defined. + + * include/Windows32/Functions.h: Define MoveMemory, FillMemory, + and ZeroMemory as macros. + + * times.cc (_timezone, _daylight, _tzname): New global variables. + (tzset): New function. + * cygwin.din: Don't set _timezone to timezone. Export tzset and + _tzset. Export _timezone, _daylight, and _tzname. + + * dcrt0.cc (__cygwin_environ): New global variable. + (dll_crt0_1): Set __cygwin_environ to environ. + * cygwin.din: Export __cygwin_environ. + +Thu Jun 5 17:52:02 1997 Ian Lance Taylor <ian@cygnus.com> + + * times.cc (gettimeofday): Check return values and set tz_dsttime + correctly. + +Wed Jun 4 00:04:33 1997 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc (fhandler_pipe::lseek): new virtual function + * fhandler.h: add lseek to fhandler_pipe class + +Tue Jun 3 19:20:47 1997 Ian Lance Taylor <ian@cygnus.com> + + * include/Windows32/Defines.h (IMAGE_DOS_SIGNATURE): Define. + (IMAGE_NT_SIGNATURE): Define. + * include/Windows32/Structures.h (IMAGE_DOS_HEADER): Define. + +Tue Jun 3 13:05:26 1997 Geoffrey Noer <noer@cygnus.com> + + * console.cc: respace + * fhandler.h: add virtual off_t lseek to fhandler_socket and + fhandler_tty defs, respacing + +Mon Jun 3 12:21:20 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * cygwin.din: export wait3, wait4 + * dcrt0.cc (_exit): call fill_rusage + * exceptions.cc (ctrl_c_handler): increment rusage_self.ru_nsignals++ + * fhandler.cc (fhandler_pipe::fhandler_pipe): new stub + * fhandler.h: add fhandler_pipe class + * hinfo.cc (hinfo_vec::build_fhandler): call + GetNumberOfConsoleInputEvents instead of GetConsoleScreenBufferInfo, + handle fhandler_pipe class + * pinfo.cc: include sys/resource.h, + (pinfo::clearout): erase memory associated with rusage_self + and rusage_children + * resource.cc (getrusage): rewrite + (add_timeval): new helper function + (add_rusage): new helper function + (fill_rusage): new helper function + * shared.cc (create_shared_fd_table): pass file mapping handle to + children letting them close it + * spawn.cc (spawn_guts): call fill_rusage and add_rusage as + appropriate + (cwait): ditto + * times.cc (__to_clock_t): add flag arg which says whether or not + to substract FACTOR from total + (times): also fill in tms_cstime and tms_cutime, add flag arg to + __to_clock_t calls + (totimeval): add extra flag passed on to __to_clock_t + (gettimeofday): add extra flag passed on to totimeval + * wait.cc (wait_for_single): add extra rusage arg, change + wait_found calls to account for extra arg + (wait_for_any): ditto + (_wait): call wait4 instead of waitpid + (wait_found): add rusage arg, deal with it calling add_rusage as + appropriate + (wait_pid): now just calls wait4 + (wait4): was wait_pid but adds extra rusage arg and deals with it + (wait3): new, calls wait4 + * winsup.h: include sys/resource.h, add rusage_self and + rusage_children to pinfo class, fix totimeval proto, add protos + for fill_rusage and add_rusage + * passwd.cc: include termios.h + (getpass): new + * stubs.cc (getpass): delete old stub + +Tue Jun 3 14:51:47 1997 Ian Lance Taylor <ian@cygnus.com> + + * times.cc (ftime): New function. + * cygwin.din: Export ftime. + +Mon Jun 2 14:34:00 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * include/limits.h: NGROUPS_MAX should be 0 + * include/asm/socket.h: add missing additional options + including SO_SNDBUF, SO_RCVBUF, et al + * include/sys/wait.h: include sys/resource.h, add protos for + wait3() and wait4(). + +Mon Jun 2 15:26:35 1997 Ian Lance Taylor <ian@cygnus.com> + + * utils/configure.in: Call AC_PROG_INSTALL. + * utils/configure: Rebuild. + +Mon Jun 2 11:44:14 1997 Geoffrey Noer <noer@cygnus.com> + + * grp.cc (getgroups): new + * cygwin.din: export getgroups + +Fri May 30 16:47:38 1997 Geoffrey Noer <noer@cygnus.com> + + * uname.cc (uname): completely rewrite, using more of the + SYSTEM_INFO struct to figure out information (now x86 type is + set correctly in Windows 95. + * version.h: increment CYGWIN_DLL_VERSION_MINOR + * include/Windows32/Structures.h: SYSTEM_INFO struct's first + member is dwOemId, not dwOemID according to MS docs + +Fri May 30 16:47:38 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * window.cc: new file + * Makefile.in: add window.cc to lists of source, object files, + and dependencies. + * console.cc: include <stdlib.h>, scroll_screen() added to + fhandler_console class, + add support for default screen attributes, + (open): set default_color on tty open + (linearize/delinearize): pass default_color to the child process + (clear_screen): fix Win95-specific bug, add support for + default_color. + (clear_to_eol): remove + (fhandler_console::fhandler_console): set default_color to + white on black + (char_command): add invisible screen attribute, misc changes + (FakeReadFile): do not convert AltGr-char to ESC-char sequence + to support international keyboards. + * cygwin.din: export setitimer, getitimer + * dcrt0.cc (dll_crt0_1): add call to window_init(), uppercase + environment vars only if started by a win32 process. + (_exit): add call to window_terminate() + * fhandler.cc: add mode argument to open() calls, + (fhandler_base::open): do not check for symlink in path_conv + calls, calls to set/get_file_attribute() instead of NTRead/WriteEA. + (fhandler_base::fstat): use get_file_attribute if possible + (fhandler_disk_file::open): remove unneeded unixattr checks + * fhandler.h: changes to support above. + * fork.cc (cygwin_fork_helper_1): pass umask value to the child, + call window_init() in child + * ntea.cc: enable EA calls, add FILE_FLAG_BACKUP_SEMANTICS + to CreateFile calls to support EA of directories. + * path.cc (symlink): add mode argument to _open call, remove + unneeded stuff + (symlink_check_worker): add checks for "system" attribute and EA. + * security.cc (get/set_file_attribute): new. Calls EA code now, + placeholders for NTFS security support. + * signal.cc (alarm): remove in favor of new implementation in + window.cc + (RemoteThread): remove + (_kill): use window messages to emulate signals on both NT and Win95 + * spawn.cc (spawn_guts): call window_terminate on exec() + (cwait): correct return result code + (_spawnve): add umask inheritance, some bug fixes + * syscalls.cc (_open): add mode argument, umask support + (umask): rewritten + (chmod): try to set file attributes, set system bit on symlinks + (stat_worker): fix nlinks of directories, add mode argument + to _open() call. + * syscalls.h: add mode argument to _open() prototype + * winsup.h: changes to support above + +Tue May 27 12:22:19 1997 Geoffrey Noer <noer@cygnus.com> + + * times.cc (gettimeofday): return 0 on success instead of 1 + (utimes): init res to 0 + +Wed May 21 11:29:24 1997 Geoffrey Noer <noer@cygnus.com> + + * include/limits.h: define NGROUPS_MAX + +Tue May 20 14:13:59 1997 Geoffrey Noer <noer@cygnus.com> + + * passwd.cc: rename function setpwend to setpwent (typo) + * cygwin.din: ditto, also remove name__C9type_info from + exports list. + +Wed May 14 17:38:39 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * signal.cc (sleep): call WaitForSingleObject instead of Sleep + (usleep): ditto + +Wed May 7 15:34:07 1997 Geoffrey Noer <noer@cygnus.com> + + Public gnu-win32 beta 18 release made + +Sun May 4 15:34:07 1997 Geoffrey Noer <noer@cygnus.com> + + patch from Mikey <jeffdb@netzone.com>: + * console.cc (FakeReadFile): FlushConsoleInputBuffer if + flags & ENABLE_LINE_INPUT and then return ReadFile + +Fri May 2 10:53:10 1997 Geoffrey Noer <noer@cygnus.com> + + * signal.cc: make exported functions extern "C" + * include/cygwin32/socket.h: replace values assigned to + IP_ definitions with ones suitable for use with WinSock. + * cygwin.din: add exports for sigpending, sigsuspend, remove + exports for __9type_infoPCc and before__9type_infoRC9type_info + * winsup.h: remove signal-related protos from winsup.h in favor + of newlib/libc/include/sys/signal.h + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * signal.cc: (sigpending) new + (sigsuspend): new + * utils/termcap: replace with one from Linux + +Tue Apr 29 19:03:29 1997 Geoffrey Noer <noer@cygnus.com> + + * utils/ps.cc: print Win32 pid as unsigned int so Windows 95 + pids don't show up as negative values + +Tue Apr 29 17:20:57 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc (spawn_guts): allocate new cygwin PID for a child + created with spawn(!_P_OVERLAY) + +Tue Apr 29 13:24:59 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * console.cc: assorted console fixes + * select.cc (fd_socket_map::convert_to_unix_fdset): only + do full debug_printf if used_ valid + * exceptions.cc: correct constants used for checking size of + stack (should be negated) + * fhandler.cc (fhandler_base::open): fix syscall_printf typo + + patch from marcus@cathcart.sysc.pdx.edu (Marcus Daniels): + * include/sys/mman.h: define MAP_ANON MAP_ANONYMOUS (typo fix) + +Mon Apr 28 15:19:44 1997 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove libgcc2.a internal functions + +Mon Apr 28 14:57:04 1997 Michael Meissner <meissner@cygnus.com> + + * cygwin.din (before__9type_infoRC9type_info): Remove, the + type_info::before(type_info const &) function no longer seems to + exist. + +Mon Apr 28 14:19:44 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * console.cc (undo_input): new + (scroll_screen): new + (fhandler_console::output_tcsetattr): fix debug printf + (fhandler_console::input_tcsetattr): no longer call set_w_binary + (fhandler_console::cursor_get): fix base_chars + (fhandler_console::char_command): make savex, savey globals, + add char buf, add code to handle clears better, many other + additions + (fhandler_console::write_normal): assorted fixes + (fhandler_console::write): move screen scroll code to + scroll_screen(), support Reset Linux terminal, Restore cursor + position, Save cursor position, Skip orig_colors + (FakeReadFile): enlarge keytable to include shift/control/alt + values + Command set still missing set pelette, character sets, and + UTF codes. + +Mon Apr 28 12:19:44 1997 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc (fhandler_base::open): only include + FILE_SHARE_DELETE in shared when running NT (Win 95 doesn't + support it). + +Thu Apr 24 18:57:21 1997 Geoffrey Noer <noer@cygnus.com> + + patch from Jeremy Allison <jra@cygnus.com>: + Correct problem caused by setting /dev/null fd to -1 which is + same as INVALID_HANDLE_VALUE. + * fhandler.h: set DEV_NULL_HANDLE_VALUE to -2 + * fhandler.cc (fhandler_dev_null::open): set handle to + DEV_NULL_HANDLE_VALUE instead of INVALID_HANDLE_VALUE + * hinfo.cc (hinfo_vec::build_fhandler): add case for + handle == (HANDLE) DEV_NULL_HANDLE_VALUE + +Thu Apr 24 15:12:13 1997 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc (fhandler_base::write): catch return of raw_write + and return -1 if it failed + +Thu Apr 24 10:42:01 1997 Geoffrey Noer <noer@cygnus.com> + + path.cc (symlink): restore chmod call for now since the NTEA code + isn't quite up to the task yet. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * exceptions.cc (ctrl_c_handler): corrections to Apr 18 patch + * fhandler.cc: ditto + * dcrt0.cc (dll_crt0_1): move console title setting code, + set up default signal handlers + * fork.cc (cygwin_fork_helper1): also set child->sigs and + child->sig_mask + * spawn.cc (spawn_guts): if mode _P_OVERLAY, set up child + signal handlers. + +Mon Apr 21 22:29:49 1997 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/ASCIIFunctions.h: remove old def of + GetEnvironmentStringsA, add new one based on def from Functions.h + * include/Windows32/Functions.h: define GetEnvironmentStrings as + GetEnvironmentStringsA when not unicode, remove definition of + GetEnvironmentStrings in favor of ones in ASCIIFunctions.h and + UnicodeFunctions.h + * include/Windows32/Defines.h: add missing XTYP_ definitions, + change value of XTYPF_NOBLOCK to 0x0002 from 0x2 + * include/Windows32/Sockets.h: comment out redefinitions of + errno.h-type constants since MS doesn't define them and we + have our own in errno.h + +Fri Apr 18 10:40:30 1997 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/Structures.h: add typedefs for + LPDLGITEMTEMPLATE, PDLGITEMTEMPLATE. + * include/Windows32/Defines.h: define FW_REGULAR FW_NORMAL + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * exceptions.cc (ctrl_c_handler): do not reset signal + handler to SIG_DFL while processing the signal, instead + block the signal while handler executes. + * signal.cc (_raise): fixes related to the above + +Thu Apr 17 23:50:50 1997 Geoffrey Noer <noer@cygnus.com> + + * path.h: increase path length in mount table to MAX_PATH + in size instad of 30. This will increase cygwin.dll memory + usage by 20K. We need to remove static allocations from + path code. + +Thu Apr 17 10:11:50 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * exceptions.cc (ctrl_c_handler): CTRL_CLOSE_EVENT should + generate SIGHUP instead of SIGQUIT + * signal.cc (_raise): rewrite + +Wed Apr 16 10:42:46 1997 Geoffrey Noer <noer@cygnus.com> + + * version.h: increment CYGWIN_DLL_VERSION_MINOR + * syscalls.cc (system): use spawnvp instead of fork/exec + * ntea.cc: make all functions return false for now; they + were causing an obscene performance hit + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * console.cc (FakeReadFile): patch to support EINTR, EIO + * exceptions.cc: add support for return_handler, remove + control-C counter + (return_handler): new + (ctrl_c_handler): handle SIGCHLD, other assorted fixes + * fhandler.cc (fstat): reset errno to 0 + * passwd.cc (search_for): correct location of a debug printf + * select.cc: patches to handle signals better, respacing + * signal.cc (_raise): misc fixes + (_kill): call OpenProcess with PROCESS_ALL_ACCESS instead of + PROCESS_TERMINATE + * spawn.cc: more signal fixes + * syscalls.cc: add two new errors to errmap[] + (_stat_worker): fill out buf struct when stating directories + * wait.cc (wait_for_single): use INFINITE instead of large value + for timeouts + (wait_for_any): init nprocinfo to 1, not 0, other small fixes + * winsup.h: add signal_arrived to per_process class, reduce + amount of reserved space, add sig_pending to pinfo class + +Tue Apr 15 17:01:34 1997 Geoffrey Noer <noer@cygnus.com> + + * utils/mkpasswd.c: change default shell to /bin/sh + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * utils/kill.cc: support sending numbered signals using + signal code instead of just calling TerminateProcess + +Tue Apr 15 15:24:55 1997 Ian Lance Taylor <ian@cygnus.com> + + * utils/Makefile.in (INSTALL): Set to @INSTALL@. + (INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@. + (INSTALL_DATA): Set to @INSTALL_DATA@. + (INSTALL_XFORM): Remove. + (install): Depend upon installdirs. Use $(program_transform_name) + directly, rather than using $(INSTALL_XFORM). + (installdirs): New target. + +Mon Apr 14 16:32:05 1997 Ian Lance Taylor <ian@cygnus.com> + + * utils/Makefile.in (INSTALL): Change install.sh to install-sh. + +Mon Apr 14 12:33:22 1997 Geoffrey Noer <noer@cygnus.com> + + * registry.cc: change key name to "Cygnus Solutions" instead + of "Cygnus Support" + * security.cc: don't include windows.h, already in winsup.h + * Makefile.in: add dependencies section entries for security.cc + and ntea.cc + +Fri Apr 11 00:03:49 1997 Geoffrey Noer <noer@cygnus.com> + + * dcrt0.cc: add harmless cast to FreeEnvironmentStrings call + * registry.cc: added more presumed-harmless casts + * shared.cc: and another, and respacing + * utils/Makefile.in: don't need to link with -lkernel32 since it's + included automatically + * fhandler.cc: fhandler_console and FakeReadFile moved to + console.cc, stop including sys/stat.h, sys/param.h, sys/types.h, + stdio.h, ctype.h, pwd.h, grp.h, stdlib.h + reordered/respaced code so now we have all of fhandler_base, then + all of fhandler_disk_file, then all of fhandler_tty, etc... + (fhandler_base::ioctl): delete unused switch statement + * console.cc: added fhandler_console and FakeReadFile from + fhandler.cc, add includes necessary for this code + * grp.cc, Makefile.in: fix copyright dates + * ntea.cc: include string.h + +Thu Apr 10 22:00:43 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * path.cc (symlink): do NTWriteEA instead of chmod using same + flags + +Thu Apr 10 17:36:43 1997 Geoffrey Noer <noer@cygnus.com> + + patch from gunther.ebert@ixos-leipzig.de (Gunther Ebert): + * Makefile.in: add libnetapi32.a to DLL_IMPORTS list, build security.o + * fhandler.cc (get_file_owner): new + (get_file_group): new + (fhandler_base::fstat): do another path_conv and check for error, + use get_file_owner and get_file_group to set buf->st_uid and + buf->st_gid + * fhandler.h: add protos for get_file_owner() and get_file_group() + * grp.cc (add_grp_line): new helper function + (read_etc_group): new helper function + (getgrgid): rewritten, no longer a stub + (getgrnam): rewritten, no longer a stub + (endgrent): rewritten, no longer a stub + (getgrent): rewritten, no longer a stub + * include/Windows32/ASCIIFunctions.h, include/Windows32/Base.h, + include/Windows32/Functions.h, include/Windows32/Defines.h, + include/Windows32/Structures.h, include/Windows32/UnicodeFunctions.h: + misc security/uid-related additions + * passwd.cc (add_pwd_line): new + (read_etc_passwd): new + (search_for): rewrite + (setpwend): rewritten, no longer a stub + (getpwent): rewritten, no longer a stub + (endpwent): rewritten, no longer a stub + * security.cc: new file + (get_world_sid): new + (world_full_access): new + (get_id_from_sid): new + (is_nt): new + * stubs.cc (endgrent): remove + (getgrent): remove + * syscalls.cc (rel2abssd): new + (set_process_privileges): new + (chown): now implemented for real for NT, still a stub in Win95 + (_stat_worker): use get_file_owner and get_file_group to set + buf->st_uid and buf->st_gid + * uinfo.cc: add protos for read_etc_passwd, read_etc_group + (uinfo_init): call read_etc_passwd(), read_etc_group() + * utils/Makefile.in: build mkpasswd, mkgroup + * utils/mkgroup.c: new, use to make an /etc/group file + * utils/mkpasswd.c: new, use to make an /etc/passwd file + * winsup.h: add protos for is_nt(), get_id_from_sid() + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * Makefile.in: build ntea.o + * dcrt0.cc (dll_crt0_1): move console title code here from spawn_guts + * exceptions.cc (ctrl_c_handler): small signal fixes, prepare + things so we can eventually reset the signal handler to SIG_DFL + * fhandler.cc (fhandler_disk_file::open): first check for EA info + about exec/symlink status before doing it the hard way + (fhandler_make_pipe): u->self->hmap.build_fhandler takes extra arg + (fhandler_base::open): make use of NTEA + * fhandler.h: remove init_std_file_from_handle, build_fhandler + protos + * hinfo.cc: include mywinsock.h and sys/socket.h, define + __INSIDE_CYGWIN_NET__, __INSIDE_CYGWIN32__ + (hinfo_vec::build_fhandler): takes an additional handle arg, + call GetConsoleScreenBufferInfo with it to see if are + fhandler_console, call GetCommState with it to see if we're + an fhandler_tty, call getpeername with it to see if we wamt + fhandler_socket. Old determining methods still work too. + * path.cc (symlink): chmod file to ((S_IFLNK) | (STD_RBITS) | + (STD_WBITS) | (STD_XBITS)) permissions + * select.cc: include stdio.h + (cygwin32_select): fix typo (missing an &), + assorted fixes for mixed socket/handles case + * shared.cc (create_shared_fd_table): set sa.bInheritHandle to 1 + to support reparenting + * signal.cc (_kill): add FIXME, cleanup return codes + * spawn.cc (spawn_guts): remove console title code, add code + to support reparenting of child processes + * syscalls.cc: add new third arg to hmap.build_fhandler calls + (chmod): make use of NTWriteEA + * ntea.cc: new file, NTEA handling routines + * times.cc: fix value of NSPERSEC + (utimes): fix return value + * wait.cc: changes to support reparenting, change INFINITE to + constant 500 to avoid "blocking win32 syscalls and signals" + problem + * winsup.h: add NTReadEA, NTWriteEA protos, define REPARENTING, + fix build_fhandler proto to add new arg, add handles hrProcess and + hrThread + +Tue Apr 9 00:25:33 1997 Geoffrey Noer <noer@cygnus.com> + + * libcerr.cc: remove fixed size of sys_errlist array, figure out + sys_nerr from the sizeof the array rather than hard coding it. + * shared.cc (open_shared_file_map): add typecast + * signal.cc (_kill): SIGKILL should avoid exception handler + * fork.cc (cygwin_fork_helper1): don't call ExitProcess with a + negative arg on recreate_mmaps_after_fork failure + * include/Windows32/Defines.h: define VER_PLATFORM_WIN32_WINDOWS + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * dcrt0.cc: move reent_data from private address space to cygwin.dll + * fork.cc: copy parent's reent_data to the child + * cygwin.din: export reent_data + * winsup.h: add as public struct _reent reent_save to pinfo class + + another patch from sos@prospect.com.ru (Sergey Okhapkin): + * winsup.h: add ctrl_c_handler prototype + * exceptions.cc (init_exceptions): don't use u->self->hThread + since for a spawned process, this contains thread id of parent + Win32 process, not the child's. Instead use GetCurrent* funcs + to get thread handle. + (ctrl_c_handler): add more signal support, especially for kill + * signal.cc (_kill): more signal support, using CreateRemoteThread + under NT. Win95 only supports SIGKILL since it doesn't have this + call. + * syscalls.cc (windows_95): first version check should be an & + of 0x80000000 instead of 0x8000000 + (close_all_files): hmap[i] doesn't always exist, for now comment + out code + + patch from marcus@sysc.pdx.edu (Marcus Daniels): + * path.cc (skip_n_slashes): new local function + (symlink_check_worker): new local function, used to be symlink_check + (symlink_check): calls symlink_check_worker and returns + whether path is a symlink or not. + (symlink_expand): new local function, expand a symlink into + a file or directory path using symlink_check_worker + (path_conv::path_conv): takes extra follow_mode arg + (symlink_follow): call symlink_expand + * fhandler.cc, syscalls.cc: fix path_conv references + * path.h: fix path_conv prototype + +Mon Mar 24 19:44:28 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * select.cc: fix Feb 19 patch to select + * syscalls.cc: add statfs() and fstatfs() calls + * include/sys/vfs.h: new header file to support these + * cygwin.din: add them to dll export list + +Tue Mar 18 18:10:24 1997 Geoffrey Noer <noer@cygnus.com> + + * dcrt0.cc: change idata3 asm section to have five null fields + instead of eight to conform to how MS does this section. + +Sun Mar 9 13:10:55 1997 Geoffrey Noer <noer@cygnus.com> + + * include/sys/resource.h: add missing struct members to rusage struct + * resource.cc: added setting of missing fields, mostly to 0 until + we investigate how to set correct values. + +Wed Feb 19 17:44:06 1997 Jeremy Allison <jra@cygnus.com> + + * select.cc: Added fixes from sos@prospect.com.ru (Sergey Okhapkin) + to implement blocking select on sockets/handles. This isn't + the way I finally want to do this, but I won't get chance + to do the re-write for a month or two so... + * include/Windows32/Defines.h: Added defines for NT ACL + stuff. + +Tue Feb 18 12:28:11 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * fhandler.cc: support reverse index escapes in console code + +Fri Feb 14 18:55:01 1997 Jeremy Allison <jra@cygnus.com> + + * path.cc: Fixed normalize_posix_path() so that double slashes + are removed, except for those starting a UNC path. The command + ls .///////FILE_IN_DIRECTORY works now. + +Thu Feb 13 14:06:04 1997 Geoffrey Noer <noer@cygnus.com> + + * path.cc: remove SLASH_P define and + * winsup.h: define it here instead + patch from scottk@utig.ig.utexas.edu (Scott Kempf): + dirsearch.cc (opendir): fix problem with accessing "/" + +Mon Feb 10 13:57:11 1997 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * misc.cc: replace nice () stub with Win32 implementation + * spawn.cc + * fork.cc: use priority returned by GetPriorityClass + +Wed Feb 5 16:56:23 1997 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc, syscalls.cc: minor reformat + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc: set console title to reflect what's running + * winsup.h: TITLESIZE define added + +Mon Feb 3 16:53:10 1997 Geoffrey Noer <noer@cygnus.com> + + * fhandler.h: fix typo + * fhandler.cc: check_execable_p should only take one arg now + +Mon Feb 3 16:16:39 1997 Jeremy Allison <jra@cygnus.com> + + * fhandler.cc: Removed open_helper, turned it into + fhandler_base::open and added fhandler_disk_file::open. More + correct C++. + fhandler_disk_file: Moved check_execable_p into fhandler_disk_file. + tty ports are now closed correctly. + * fhandler.h: Changes to support the above. + +Fri Jan 31 19:14:34 1997 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc (fhandler_base::open_helper): new function + containing the common open() code. symlink and executable + status defaults to 0. + (fhandler_tty::open): new function that calls + fhandler_base::open_helper + (fhandler_base::open): remove common code now in open_helper, + leaving symlink checking and executable checking + * fhandler.h: changes for the above, open_helper is protected + +Thu Jan 30 15:23:15 1997 Geoffrey Noer <noer@cygnus.com> + + * hinfo.cc: also treat com3 and com4 as special files + * spawn.cc (spawn_guts): check return of WaitForSingleObject + in _P_WAIT case, some reformatting + +Tue Jan 28 10:46:16 1997 Jeremy Allison <jra@cygnus.com> + + * net.cc: Added errors "WSAEINVAL", "WSAEFAULT" as these + can be returned for net calls. + * fhandler.cc: Added FILE_SHARE_DELETE to open share modes. + Much closer to POSIX on NT now (ignored on '95). + +Fri Jan 17 13:32:26 1997 Geoffrey Noer <noer@cygnus.com> + + * configure.in: + * utils/configure.in: define LIB_AC_PROG_CC to get around + autoconf 1.12 problem. Invoke it instead of AC_PROG_CC. + * configure: + * utils/configure: regenerate + +Thu Jan 16 12:35:41 1997 Geoffrey Noer <noer@cygnus.com> + + * mmap.cc: added missing copyright notice + +Tue Jan 14 12:51:12 1997 Jeremy Allison <jra@cygnus.com> + + * cygwin.din: Added get_osfhandle, cwait and all the + spawn functions. + * exec.cc: Added include of process.h. Changed call to + spawn_guts to add extra parameter. + * libcerr.cc: Added extra error messages. Ensured + messages start at zero. + * spawn.cc: Changed spawn_guts to do wait and nowait + calls. Added all spawn functions. + * syscalls.cc: Added get_osfhandle. + * winsup.h: Removed incorrect spawn definitions, + corrected prototypes for spawn_guts and file_exists + calls. + * include/io.h: New file. Added for get_osfhandle. + +Thu Jan 9 14:20:01 1997 Jeremy Allison <jra@cygnus.com> + + * exceptions.h: Moved from winsup to winsup/include. + * include/mywinsock.h: Added getprotobynumber and + getservbyport. + * Makefile.in: Moved exceptions.h dependency. + * cygwin.din: Added cygwin32_getprotobynumber and + cygwin32_getservbyport. + * net.cc: Added cygwin32_getprotobynumber and + cygwin32_getservbyport. + +Wed Jan 8 14:15:35 1997 Jeremy Allison <jra@cygnus.com> + + * fhandler.cc: Fix from Scott Kempf (scottk@rimu.ig.utexas.edu) + to ensure creation_disposition is set correctly in open. + +Fri Jan 3 12:10:22 1997 Jeremy Allison <jra@cygnus.com> + + * fork.cc: Added parameter to recreate_mmaps_after_fork + in child, and added set_child_mmap_ptr() call in parent. + Needed as cygwin.dll statics are not copied accros a fork. + * mmap.cc: Added parameter to recreate_mmaps_after_fork, + added set_child_mmap_ptr() call. + * winsup.h: Added mmap_ptr to pinfo struct. Removed obsolete + comments. + * Makefile.in: Added -I../libio, needed to rebuild source + using STL. Also added -nostdinc++ on recommendation of + Mike Stump (mrs@cygnus.com). + +Thu Jan 2 17:23:10 1997 Jeremy Allison <jra@cygnus.com> + + * dcrt0.cc: Added a call to initialize winsock on app + init. + * fork.cc: Added call so child initializes winsock before + returning from the fork. This makes many network daemons + run correctly that did not before (apache soon...). + * net.cc: Removed calls to checkinit, this is now done on + app startup. Renamed checkinit to socket_checkinit and + removed static scope. + * winsup.h: Added prototype for socket_checkinit(). + +Thu Jan 2 12:25:06 1997 Jeremy Allison <jra@cygnus.com> + + * dcrt0.cc (api_fatal): Check that u and u->self are + not zero before indirecting through them. + * fork.cc: Changed security descriptor for fork + mutexes to allow access by all. + * pinfo.cc: Changed security descriptor for shared + area to allow access by all. + * shared.cc: Added get_null_sd() call to return + security descriptor allowing access by all. Needed + when a cygwin32 service is running and also interactive + cygwin32 apps by the current logged in user. + * winsup.h: Added prototype for get_null_sd(). diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1998 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1998 new file mode 100644 index 000000000..aa657e01e --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1998 @@ -0,0 +1,4490 @@ +Thu Dec 31 16:50:32 1998 DJ Delorie <dj@cygnus.com> + + * mmap.cc: replaced all references to libstdc++ templates with + inline classes to remove build dependency on libstdc++ + +Thu Dec 31 00:02:40 1998 Geoffrey Noer <noer@cygnus.com> + + * sysdef/uuid.def: remove useless stub. + * sysdef/oldnames.def: ditto. + * sysdef/largeint.def: ditto. + * sysdef/rpcndr.def: ditto. + +Wed Dec 30 20:33:09 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/cygcheck.cc: clean up misc. warnings relating to + signed vs. unsigned, char * vs. const char *, etc... + +Wed Dec 30 21:41:25 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Remove previous dwProcessId + change as it presumes too much knowledge about signalling + in the wrong place in the code. + * sigproc.cc (sigproc_terminate): Move the dwProcessId + assignment here but only do it when it is necessary or + programs will die abnormally. + * fhandler.h: Add raw_write method to fhandler_serial. + * fhandler_serial.cc (raw_write): New method. Accommodates + overlapped I/O that now must be used with serial. + * utils/kill.cc (main): Allow `0' signal. Just checks + for existence of process. + +Wed Dec 30 00:01:18 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: bump API_MINOR to 8 to mark + recently exported _ctype_, _sys_errlist, _sys_nerr. Briefly + describe all API_MINOR changes to date. + +Wed Dec 30 01:31:34 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Set myself->dwProcessId so that + some exit routines will not falsely believe that this + process has been execed. + * select.cc (peek_serial): Remove debugging statements. + * sigproc.cc (sigproc_terminate): Detect state where + myself->dwProcessId == 0 as indicative of not being + an exec stub. + +Tue Dec 29 21:13:33 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (alloc_stack_hard_way): Fix a couple of thinkos + in calculating size of the new stack. Just use the size + passed from the parent. + (dll_crt0_1): Set up new frame pointers here, if appropriate. + * fork.cc (fork): Move frame pointer setup into dll_crt0_1. + +Tue Dec 29 12:57:38 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/mkpasswd.c: Include wchar.h. + * utils/mkgroup.c: Ditto. + +Tue Dec 29 12:53:23 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: remove dep for libcerr.o + +Mon Dec 28 22:02:15 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h: Make fhandler_serial io_status public since + select needs it. Add 'saw_error' field to select_record so + that select can detect error conditions. + * fhandler_serial.cc (fhandler_serial::raw_read): Detect + "operation aborted" error and retry. This seems to indicate + an attempt to retry an overlapped operation. + * select.cc (select_stuff::wait): Honor saw_error field when + appropriate. + (peek_serial): Rewrite to operate similarly to + fhandler_serial::raw_read. + * include/sys/termios.h: CBAUD mask was still not right. + +Mon Dec 28 09:09:27 1998 Christopher Faylor <cgf@cygnus.com> + + * libcerr.cc: Make obsolete. Move into errno.cc + * libctype.c: Make obsolete. Use newlib table. + * Makefile.in: Remove obsolete entries from LIBCOS. Define + __INSIDE_CYGWIN__ explicitly for .c -> .o compilation. + * cygwin.din: New exports: _ctype_, _sys_errlist, _sys_nerr. + * errno.cc: Move _sys_errlist and _sys_nerr here. + * dlfcn.cc: Reorganize includes to put ctype.h after winsup.h + so that __INSIDE_CYGWIN__ will be defined for use in ctype.h. + * fhandler_console.cc: Ditto. + * fhandler_tty.cc: Ditto. + * path.cc: Ditto. + * spawn.cc: Ditto. + +Sat Dec 26 00:20:48 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * include/Windows32/CommonFunction.h: Added proto for + NetUserChangePassword(). + +Thu Dec 24 16:15:40 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Add more debugging output. + * ioctl.cc (ioctl): Can't use TC[GS]ET ioctls for pty master as + it conflicts with TIOCPKT. + * passwd.cc (passwd): Bypass tc[gs]etattr call in favor of appropriate + method or conversion confusion will result due to attempts to + appropriately convert to old-style termios structures in tc[gs]etattr. + * strace.cc (strace_vsprintf): Define t explicitly. + * termios.cc (tcsetattr): Reorganize to allow meaningful debugging + output. + (tcgetattr): Ditto. + +Wed Dec 23 15:02:11 1998 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Reorganize include order to allow thread-safe build. + +Wed Dec 23 11:45:33 1998 DJ Delorie <dj@cygnus.com> + + * strace.cc (strace_microseconds): new function; returns elapsed + time in microseconds, using performance counters if available. + (strace_vsprintf): print timestamps and deltas as microseconds, + not seconds. + +Wed Dec 23 11:35:02 1998 DJ Delorie <dj@cygnus.com> + + * times.cc (__to_clock_t): Change return value to unsigned long + long to prevent overflow. + +Tue Dec 22 19:37:55 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h: Reflect fhandler_*::init argument reordering. + Add dup and init methods to fhandler_serial. + * fhandler.cc (fhandler_base::init): Reorder arguments to mirror + open(). + * fhandler_console.cc (fhandler_console::init): Ditto. Initialize + using fhandler_base rather than fhandler_serial as console is + now being slowly uncouple from fhandler_serial. + * fhandler_serial.cc (fhandler_serial::fhandler_serial): Set size + of data structure or suffer strange behavior on exec(). + (raw_read): Add debugging output. + (fhandler_serial::init): New method. + (fhandler_serial::open): Detect call from init method and avoid + calling fhandler_base::open. Don't worry about non-blocking reads + since they are now handled correctly by _read(). + (fhandler_serial::tcsetattr): Honor ICANON in a kludgey sort of way. + (fhandler_serial::tcgetattr): Ditto. + (fhandler_serial::dup): New method. Ensures duplication of all + elements of fhandler_serial class. + * fhandler_tty.cc (fhandler_tty_master::init): Reflect init argument + reordering. + (fhandler_tty_slave::init): Ditto. + * hinfo.cc (hinfo::init_std_file_from_handle): Remove unnecessary + argument. + (hinfo_init): Reflect change to init_std_file_from_handle. + (cygwin_attach_handle_to_fd): Use more appropriate types for + arguments. + (hinfo::build_fhandler): Add some slop to allocated buffer just + for paranoia's sake. + (hinfo::dup2): Avoid dereferencing a NULL pointer when oldfd==newfd. + * pipe.cc (make_pipe): Reflect init argument change. + * shared.h: Another immigrant from winsup.h + * winsup.h: Reflect change to init_std_file_from_handle. Relocate + a declaration to shared.h so that it can be used in fhandler.h. + * include/sys/cygwin.h: Reflect change to cygwin_attach_handle_to_fd. + +Mon Dec 21 16:22:48 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::open): Detect serial device as a special + case requiring an overlapped open. + * fhandler.h (fhandler_serial): Add several methods. Add new 'fixup after + fork required' field. + * fhandler_serial.cc (raw_read): Rewrite to come closer to handling VMIN + VTIME parameters and to allow EINTR. + (fhandler_serial::open): Initialize overlapped event here. Make error + messages more explicit. + (fhandler_serial::close): Close status event. + (fhandler_serial::tcsetattr): Store vtime_ as milliseconds. Attempt to + handle VMIN > 0, VTIME == 0 better. + (fhandler_serial::fixup_after_fork): Initialize a new event handle after + a fork. + (fhandler_serial::de_linearize): Ditto. + * hinfo.cc (hinfo::fixup_after_fork): Call fork fixer upper if close_on_exec + of need_fork_fixup set. + +Sun Dec 20 16:05:25 1998 Geoffrey Noer <noer@cygnus.com> + + * include/shellapi.h: replace with stub that includes windows.h + like similar headers already do. + * scandir.cc (scandir): add parens around assignment used as truth + value. + +Sat Dec 19 00:42:44 1998 Christopher Faylor <cgf@cygnus.com> + + * thread.cc: Fix copyright info. + * thread.h: Ditto. + * libcmain.cc: gcc is now more picky about requiring a type + for main(), so add one. + * include/pthread.h: Add attribution for net contributor. + +Fri Dec 18 19:21:30 1998 Geoffrey Noer <noer@cygnus.com> + + * pthread.cc: fix copyright header. + * shared.h: ditto. + +Fri Dec 18 19:21:30 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * cygwin.din: export scandir and alphasort. + * Makefile.in: add scandir.o to deps + * scandir.cc: New file with scandir and alphasort implementations. + * include/cygwin/version.h: bump API_MINOR to 7. + +Fri Dec 18 16:44:07 1998 Geoffrey Noer <noer@cygnus.com> + + * include/pthread.h: clean up, remove C++-style comments, + remove pthread_getsequence_np proto. + +Fri Dec 18 15:26:33 1998 Christopher Faylor <cgf@cygnus.com> + + Throughout, prepend cygwin_ to functions that are exported + as cygwin_* which previously needed to be aliased. + + * path.cc (cygwin_conv_to_win32_path): Resolve symbolic links. + Return success or failure value. + (cygwin_conv_to_full_win32_path): Ditto. + (cygwin_conv_to_posix_path): Return success or failure value. + (cygwin_win32_to_posix_path_list): Ditto. + (cygwin_posix_to_win32_path_list): Ditto. + * shared.h: New include file that incorporates parts of + winsup.h, fhandler_tty.h, path.h, and delqueue.h. + * Makefile.in: Remove old include files. + * cygwin.din: cygwin_* aliases are no longer required. + * libccrt0.cc: Store api_minor in per_process structure. + * select.cc: Change meaning of second argument to ready_for_read + to indicate whether read_ahead should be ignored. + * fhandler.h: Reflect change in second argument to ready_for_read. + * syscalls.cc (_read): Ditto. + * termios.cc: Throughout, detect attempt to use old style termios + structure and convert as appropriate. + * ioctl.cc (ioctl): Detect use of ioctl requiring termios field + and call appropriate tc[gs]et* function to handle it. + * fhandler_console.cc (fhandler_console::ioctl): Remove TC* calls + that are now handled in main ioctl. + * fhandler_tty.cc (fhandler_tty_slave::ioctl): Ditto. + * include/cygwin/version.h: Added TERMIOS defines. Bump API_MINOR + to 6. + * include/sys/cygwin.h: Reflect change in return value for some + cygwin_conv_* calls. + * include/sys/termios.h: Reformat slightly. Add conversion macros + for dealing with old style termios structure. + * include/pthread.h: add + +Fri Dec 18 15:03:33 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Cleanup pthread usage. + +Fri Dec 18 14:35:59 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove obsolete header dependency for + thread-safe build. + +Fri Dec 18 14:16:04 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sig_handle): Avoid suspending top-level + processes. + * trace.cc: Remove unneeded include. + +Thu Dec 17 19:19:53 1998 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove pthread_getsequence_np, _reent_clib + +Thu Dec 17 16:48:15 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: correct two typos in comments + +Thu Dec 17 19:11:31 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * include/Windows32/Defines.h: Add values for using Windows + function `DeviceIoControl()'. + +Thu Dec 17 18:00:34 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): exception_list is not a struct. + * debug.cc (thread_stub): Ditto. + +Thu Dec 17 08:24:37 1998 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Remove leading underscores from pthread functions. + * include/cygwin/version.h: Bump DLL major version to 21, DLL minor + version to 0, and API_MINOR to 5. + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + Merge in thread-safe branch changes. + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + * pthread.cc: Include winsup.h. + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + * thread.cc: Reformat. + * pthread.cc: New file. + * cygwin.din: Add pthread interface functions + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Add some --enable options. + * configure: Regenerate. + * Makefile.in: Reorganize CFLAGS to recognize new --enable options. + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (stack_base): Store slightly different information + in child_info_fork structure for later use in alloc_stack_hard_way. + (fork): Set frame pointer information if stack has been reallocated. + * dcrt0.cc (alloc_stack_hard_way): Reflect change in + child_info_fork structure. + (dll_crt0_1): Make thread initializers "static" and NO_COPY or death + of the main thread causes death of other threads. + * winsup.h (child_info_fork): Change structure. + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + * thread.h: Remove extraneous declaration. + * include/sys/strace.h: Make a new thread_printf function + for use by new thread-safe code. + * thread.cc: Use thread_printf throughout. + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Marco Fuykschot (marco@ddi.nl) + * Throughout sources add locking control for preliminary + thread-safe cygwin operation. + +Wed Dec 16 22:54:16 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (getprogname): Should be a static. + (alloc_stack): Extend to allow forking from another + thread. + (alloc_stack_hard_way): New function used by alloc_stack. + (dll_crt0_1); Don't pass parameters since stack may be + "funny". Use statics instead. Move fork/spawn checking + into dll_crt0. + (dll_crt0): Do fork spawn checking here. alloc_stack() + will call dll_crt0_1 if forked from a non-main thread. + * fork.cc (stack_base): New function determines base + (and other values) of this thread's stack. + (fork): Use new PROC_FORK1 method for forking. Provides + more data to forkee. Use stack_base to set stack + values. + * winsup.h (child_info_fork): Changes for PROC_FORK1. + +Wed Dec 16 16:15:29 1998 Geoffrey Noer <noer@cygnus.com> + + * include/shellapi.h: fix typo in DragQueryPoint proto. + +Mon Dec 14 12:37:43 1998 Geoffrey Noer <noer@cygnus.com> + + * net.cc: minor respacing + (get_ifconf): new local function, combines get_winnt_ifconf and + get_win95_ifconf. + (get_win95_ifconf): delete + (get_winnt_ifconf): delete + (fhandler_socket::ioctl): adjust ifconf calls in light of above, + check returned value for safety. + * include/cygwin/version.h: bump CYGWIN_VERSION_API_MINOR to 4 + in honor of newly supported socket ioctls. + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * include/asm/socket.h: Added defines for ioctl() calls + SIOCGIFADDR, SIOCGIFBRDADDR and SIOCGIFNETMASK. + * net.cc (get_winnt_ifconf): Check the registry entries + instead of just calling get_win95_ifconf(). Added what argument + to support the new ioctl() calls. + (get_win95_ifconf): Check the Windows 9x registry entries as + described by Tim Newsham. + (fhandler_socket::ioctl): Support the ioctl() commands + SIOCGIFADDR, SIOCGIFBRDADDR and SIOCGIFNETMASK. + (get_if_flags): Check for a down interface. + +Wed Dec 9 18:11:31 1998 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc (fhandler_disk_file::open): check for shell scripts + regardless of Win32 OS type. + +Sun Dec 6 19:38:11 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * fhandler_console.cc (fhandler_console::tcgetattr): Fix typo. + ISIG should be ored with c_lflag. + +Tue Dec 1 16:28:56 1998 Geoffrey Noer <noer@cygnus.com> + + * include/utmp.h: delete, moved to newlib/libc/sys/cygwin/sys. + +Thu Dec 3 15:41:51 1998 Geoffrey Noer <noer@cygnus.com> + + Released 20.1 update. + +Thu Dec 3 22:24:18 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (set_process_mask): Add `sync' parameter + to control whether signals should be synched on exit. + (handle_sigsuspend): Provide second argument to set_process_mask - + don't sync. + (call_handler): Ditto for asm handler. + * signal.cc (sigprocmask): Ensure that signals are synchronized + by calling set_process_mask with sync == 1. + * sigproc.cc (__release_signal_mutex): Third argument is not + strictly a BOOL, so change it. + * sigproc.h: Reflect above parameter changes. + +Thu Dec 3 15:30:44 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_console): Work around NT bug that + caused strange behavior with ReadFile after this + function was invoked. + +Tue Dec 1 14:43:35 1998 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sigproc_init): Set maintid and signal_mutex early + to avoid races in wait_sig initialization. + (__get_signal_mutex): Improve debug output. + (__release_signal_mutex): Ditto. + * spawn.cc (spawn_guts): Allocate more space for string when building + up from #! and absolute path is not known. Otherwise weird stuff + like infinite recursion or unknown file errors occur. + +Tue Dec 1 08:34:18 1998 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Accommodate lack of timezone in date output so that + year shows up correctly. + +Mon Nov 30 14:30:51 1998 Jeff Johnston <jjohnstn@cygnus.com> + + * times.cc (times): Altered function so that on non-Windows-NT systems + it does not use the GetProcessTimes() API which is not supported. + +Mon Nov 30 00:38:54 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc: Fix incorrect use of struct on exception_list + typedef. + * debug.cc (thread_stub): Ditto. + * dll_init.cc: Ditto. + * include/Windows32/Structures.h: Correct typo where + typedef SYSTEM_POWER_STATUS was being used as a struct. + +Sun Nov 29 22:03:17 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * fhandler_console.cc (fhandler_console::ioctl): + Added ioctl commands TCGETA, TCSETA, TCSETAW, TCSETAF. + +Fri Nov 27 22:30:58 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h: Set aside NOEINTR bit. When this is set + cygwin will not allow the read on this device to be + interrupted by a signal. + * pipe (_pipe): Set NOEINTR bit for read end of pipes + created using this method. The vague rationale for this + is that these pipes are supposed to be more like Windows + pipes than UNIX pipes. + * syscalls.cc (_pipe): Honor NOEINTR flag. + * getopt.c: Clean up some gcc warnings. + * libcerr.c: Ditto. + +Fri Nov 27 21:56:03 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (SIG_NONMASKABLE): Update for new signal + mask method. + (handle_sigsuspend): Release of signal mutex must be + synchronous -- the signal must be delivered before the + function returns. Otherwise, there will be races in + the caller code. + * sigproc.cc (sigproc_terminate): Minor cleanup. + +Thu Nov 26 20:26:17 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Attempt to work around + potential race when setting signal_arrived. This + particularly affects sigsuspend. + (handle_sigsuspend): Reset signal_arrived prior to + grabbing the mutex. This should reduce the probability + of a race. + * sigproc.cc (sig_send): Don't reset signal_arrived in + the SIGSUSPEND case since this could introduce a race. + +Thu Nov 26 12:19:16 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * select.cc (MAKEready): Don't wait for signal prior to + testing for read. That introduces an unnecessary delay. + +Wed Nov 25 23:03:47 1998 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Make `isdirsep' an alias for SLASH_P. + Implement isabspath convenience macro. + Change sigprotect to a macro since it appears to + be impossible to send __FILE__ type macros to a + constructor. Change use of sig_protect throughout. + * dcrt0.cc (dll_crt0_1): Use new path macro. + * dlfcn.cc (get_full_path_of_dll): Ditto. + * path.cc (path_conv::path_conv): Ditto. + (normalize_posix_path): Ditto. + (slashify): Ditto. + (backslashify): Ditto. + * syscalls.cc (num_entries): Ditto. + * lock.cc: Redefine lock methods to pass debug info to + {get,release}_signal_mutex. + * environ.cc (environ_init): Correct strncmp test for + TERM=, otherwise it's impossible to set TERM. + * exceptions.cc: Eliminate lock_cs and unlock_cs macros. + Use {get,release}_signal_mutex throughout. + (signal_init): Don't initialize signal_mutex here. + (set_process_mask): Remove vestiges of old mutex code. + (handle_sigsuspend): Ditto. + (call_handler): Move signal_arrived SetEvent back here. + It was being triggered too often before. + Detect when the signal thread is exiting. + (sig_handle): Remove inappropriate SetEvent(signal_arrived). + (events_terminate): Move close of signal_mutex elsewhere. + * glob.cc: Increase "MAXPATHLEN" size for arguments that + are not necessarily pathnames. + * pinfo.cc (lpfu): Lower timeout for reporting possible + problem with INFINITE wait. + * sigproc.cc (wake_wait_subproc): Make this a macro with + no arguments so that its use in the code is a little + clearer. + (proc_terminate): Eliminate signal blocking here since + this should already be handled by the caller. + (sigproc_init): It makes sense to initialize signal_mutex + here, so do so. + (__allow_sig_dispatch): Rename. Take debugging arguments. + Pass arguments on to release_signal_mutex. + (__block_sig_dispatch): Rename. Take debugging arguments. + Pass arguments on to get_signal_mutex. Detect signal + thread exiting confition. + (__get_signal_mutex): Take debugging arguments. Maintain + a stack of nested mutex calls for later display in + __release_signal_mutex. Detect signal thread exit + condition. Don't bother with locking if signal thread is + executing or if just an exec stub. + (__release_signal_mutex): Don't bother with locking if signal + thread is executing or if just an exec stub. + * sigproc.h: Reflect renamed functions above. Provide + wrappers to pass in diagnostic information. + * spawn.cc (spawn_guts): More fixes to deal with nested + #! and to properly report posix argv[0] when invoked as a + script. + +Wed Nov 25 12:41:12 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Reinstate libwinspool.a/winspool.drv creation. + +Tue Nov 24 18:48:56 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: add CFLAGS_COMMON and CFLAGS_CONFIG to CFLAGS + and CXXFLAGS in FLAGS_TO_PASS. + + * include/sys/select.h: new file with select proto. Avoid + potential conflict with Winsock inclusion by Cygwin internals. + * include/sys/socket.h: remove select proto. + * winsup.h: define __INSIDE_CYGWIN__. Include windows.h after + Unix include files. + * include/mywinsock.h: delete file + * include/Windows32/Sockets.h: add ndef __INSIDE_CYGWIN__s + around portions that conflict with Unix definitions. This + yields what used to be mywinsock.h which is a blend of Unix + sockets and Winsock needed by Cygwin internals. + * exceptions.cc: define Win32_Winsock to include + Windows32/Sockets.h. No longer define __INSIDE_CYGWIN__. + * hinfo.cc: ditto + * net.cc: ditto + * select.cc: ditto + + * include/exceptions.h: change wrapper define to _EXCEPTIONS_H. + * include/sys/resource.h: move includes outside __cplusplus check. + * include/sys/wait.h: ditto. + +Sun Nov 22 23:33:19 1998 Geoffrey Noer <noer@cygnus.com> + + * sigproc.cc (__release_signal_mutex): revert Nov 3d change. + +Sun Nov 22 17:04:44 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * regexp/Makefile.in: Add additional bits necessary to + allow correct installation of include file. + +Fri Nov 20 17:04:48 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Set "Warn about writable strings" option in CFLAGS. + * fhandler_tty.h: Fix for writable strings detection. + * grp.cc (add_grp_line): Ditto. + * mkvers.sh: Ditto. + * path.h: Ditto. + * registry.cc: (reg_key::reg_key): Ditto. + * smallprint.c (__small_vsprintf): Ditto. + * tty.cc (tty::get_event): Ditto. + * winsup.h: Give up on read_ready_thread. Move sig_protect + here since it needs to use information set up after the sigproc.h + include. + * dcrt0.cc: Ditto. + * debug.cc (WFSO): New function. Used to ensure that + function shows up on stack trace. + (WFMO): Ditto. + * debug.h: Define the above. + * exceptions.cc (ctrl_c_handler): Record last signal + for signal handler. + * select.cc (MAKEready): New macro for constructing + fhandler_*::ready_for_read function. + (fhandler_*::ready_for_read): Use macro to construct this + method throughout. + * sigproc.cc (sig_send): Work around race on process termination + where the event being waited for may disappear. + (sigproc_terminate): #ifdef code here that attempted to deal with + the above condition in sig_send. + * sigproc.h: Move sig_protect to winsup.h. + * spawn.cc (perhaps_suffix): Don't return pointer into an + automatic variable. + (find_exec): Always point known_suffix to something. + * syscalls.cc (read_handler): Refine debug output. + (read_ready_thread): Delete. + (_read): Eliminate use of read_ready_thread. Call ready_for_read + directly as appropriate. + +Thu Nov 19 15:26:40 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: remove -Wunused since that's already in -Wall + * dlfcn.cc (check_path_access): rename winenv arg to mywinenv + * path.cc (symlink): change save_errno var to saved_errno + * spawn.cc (find_exec): rename winenv arg to mywinenv + (spawn_guts): rename sigprotect handle to starting_here + * winsup.h: remove trailing comma from process_state flags + enum + * utils/aclocal.m4: regenerate + * utils/configure: regenerate + +Thu Nov 19 11:16:38 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use correct libpthread.a target when + thread-safe is enabled. + +Thu Nov 19 10:49:27 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv): Correct error reporting. + +Wed Nov 18 20:07:50 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/Makefile.in: remove termcap file install rule + +Wed Nov 18 18:14:18 1998 Geoffrey Noer <noer@cygnus.com> + + More minor cleanup: + * environ.cc (winenv): don't define len twice. + * fork.cc (sync_with_parent): should NOT use rc since + this is a macro and that could have interfered with rc in + the calling function. Renamed to psync_rc. + * fhandler_serial.cc (fhandler_serial::open): change + access to myaccess since it shadows global decl. + * hinfo.cc: ditto throughout + * path.cc: ditto throughout + (path_conv::path_conv): change error to err. + +Wed Nov 18 16:17:58 1998 Geoffrey Noer <noer@cygnus.com> + + * profil.c: include stdio.h + (print_prof): comment out unused func + (profile_ctl): should return an int + +Wed Nov 18 16:17:58 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/ps.cc: include sys/cygwin.h, make pname buf + MAXPATH in size. + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * utils/ps.cc (main): converting windows paths to posix + paths in output. + +Wed Nov 18 15:34:46 1998 Geoffrey Noer <noer@cygnus.com> + + * include/wchar.h: include stddef.h. + +Wed Nov 18 17:39:15 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (environ_init): Fix incorrect TERM= detection. + +Tue Nov 17 17:28:09 1998 Geoffrey Noer <noer@cygnus.com> + + * gcrt0.c: include stdlib.h, add proto for monstartup. + +Tue Nov 17 16:47:42 1998 Geoffrey Noer <noer@cygnus.com> + + * include/wchar.h: add protos for wcslen and wcscmp. + * syscalls.cc: minor reformat. + +Tue Nov 17 15:38:45 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::fhandler_base): Default non-disk + devices to binary mode. + * fhandler.h: Reformat slightly. + +Tue Nov 17 11:19:23 1998 Christopher Faylor <cgf@cygnus.com> + + * external.cc (fillout_pinfo): Copy progname using strcpy to + save on time. + * path.h: Add new enums for more fine-grained control + of path_conv. + * dir.cc (opendir): Use enum argument to path_conv. + (mkdir): Ditto. + (rmdir): Ditto. + * dlfcn.cc (get_full_path_of_dll): Ditto. + * fhandler.h: Add new set_readahead_valid to set actual + readahead. + * fhandler.cc (raw_read): Remove extraneous variable. + (fhandler_base::read): Rework to allow readahead when + not text mode. + (fhandler_disk_file::fstat): get_symlink_p() only returns + true/false now. + (fhandler_disk_file::fhandler_disk_file): Use enum argument + to path_conv. + (fhandler_disk_file::open): Ditto. + * spawn.cc (perhaps_suffix): Ditto. + * syscalls.cc (_unlink): Ditto. + (_link): Ditto. + (stat_worker): Ditto. + (_rename): Ditto. + * fhandler_serial.cc (fhandler_serial::open): Always reset timeouts. + * path.cc (path_conv::path_conv): Honor new enum arguments. + Specifically, use SYMLINK_CONTENTS for readlink interface. + (readlink): Use SYMLINK_CONTENTS argument to path_conv. + * select.cc: Rework serial support which has apparently never + worked. + +Mon Nov 16 16:15:20 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: FLAGS_TO_PASS should pass CFLAGS and CXXFLAGS + not ALL_CFLAGS and ALL_CXXFLAGS. Rework handling of CFLAGS + variables to remove duplication and make it possible to + build mingw directory. + +Mon Nov 16 09:40:21 1998 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_open): Use new macro to check for + NULL or empty pathname and return appropriate error. + * path.cc (check_null_empty_path*): Move macro to + path.h. + * path.h: Move macros here. + +Sun Nov 15 20:23:10 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: bump API_MINOR to 3 to mark + addition of dll_noncygwin_dllcrt0 to exports list. + +Sun Nov 15 23:05:21 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (check_null_empty_path): New macro. + (check_null_empty_path_errno): Ditto. + (path_conv::path_conv): Check for NULL and empty + path names here and set appropriate error. + (conv_to_win32_path): Ditto. + (conv_to_full_win32_path): Ditto. + (conv_to_posix_path): Ditto. + (conv_to_full_posix_path): Ditto. + (mount_info::conv_wo_win32_path): Back out previous + change. + (mount_info::conv_to_posix_path): Ditto. + +Sun Nov 15 19:29:19 1998 Geoffrey Noer <noer@cygnus.com> + + * include/limits.h: define CHILD_MAX to be 63. + * sysconf.cc (sysconf): return CHILD_MAX when asked for + instead of _POSIX_CHILD_MAX. + +Sun Nov 15 18:25:22 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * path.cc (mount_info::conv_to_posix_path): Handle NULL and + empty pathnames. + (mount_info::conv_to_win32_path): Likewise. + +Sun Nov 15 18:09:06 1998 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: export dll_noncygwin_dllcrt0. + * {libccrt0.cc, winsup.h}: minor reformat. + +Sat Nov 14 22:14:51 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (environ_init): Use sizeof for string lengths + rather than hard-coded values. + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * dll_init.cc (dll_foreign_dllcrt0): Rename to + dll_noncygwin_dllcrt0. + * winsup.h: Ditto. + * include/cygwin/cygwin_dll.h: Ditto. + +Sat Nov 14 14:09:33 1998 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::de_linearize_fd_array): Reset first fd + for open to zero after an exec. + +Sat Nov 14 01:29:23 1998 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork): No need for intermediate jmp_buf variable. + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * libccrt0.cc (cygwin_attach_foreign_dll): New function. + * dll_init.cc (dll_foreign_dllcrt0): New function to initialize + DLLs loaded by non-cygwin apps. + (dll_dllcrt0_1): Initialize process table entry. + (dll_dllcrt0): Revert last change to do partial initialization. + * winsup.h (dll_foreign_dllcrt0): Prototype. + * include/cygwin/cygwin_dll.h (_cygwin_foreign_dll_entry): New + entry point that does partial initialization for non-cygwin apps. + +Fri Nov 13 16:17:28 1998 Geoffrey Noer <noer@cygnus.com> + + Assorted -Wall cleanup: + * utils/mount.cc (show_mounts): remove unused var i. + * utils/cygcheck.cc (dll_info): comment out unused var ofs. + (dump_sysinfo): return a void, not an int. Comment out unused + var len in two places. Add parens around assignment used as + truth value. + * utils/kill.cc (main): remove unused var i + * utils/mkpasswd: include <ctype.h> and <stdlib.h>. + (enum_users): remove unused var rc. + (enum_local_groups): ditto. + * utils/ps.cc (main): Add parens around assignments used as + truth values. + * utils/mkgroup.c: include <ctype.h> and <stdlib.h>. + (enum_groups): return void, not int. Remove unused var rc. + * gmon.c: include <stdio.h> and <unistd.h>. + (_mcleanup): remove unused vars buf and profdir. + +Fri Nov 13 16:17:28 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * include/sys/sysmacros.h: new file, define major, minor, makedev + +Fri Nov 13 17:03:52 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc: Reflect a variable name change. + * fhandler.h: *::ready_for read takes an additional argument. + * fhandler_console.cc (get_non_ascii_key): New function derived + from fhandler_console::read1. + (fhandler_console::read1): Use new function. + * select.cc (*::ready_for_read): Add new "nonblocking" argument. + (peek_console): Be more diligent in detecting when a usable + character has been entered or false positives will be returned. + (fhandler_tty_common::ready_for_read): Detect attempt to perform + a "background" read. + * syscalls.cc (read_handler): Remove code for dealing with slow + devices. Just deal with non-blocking here. + (read_ready_thread): Renamed function. Rewritten to only detect + when an fd has data ready to be read. Actual reads happen in + the main thread. + (_read): Rely on read_handler to read data for everything. Use + the read_ready_thread to indicate when data is ready to be read. + Gut the read_thread_info class since it no longer needs to return + much information. + * winsup.h: Reflect above changes to read_thread_info. Rename + to read_ready_thread_info. + +Fri Nov 13 15:09:26 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de> and + Ron Parker <rdparker@butlermfg.org>: + * path.cc (mount_info::conv_to_win32_path): Refined recognition of + UNC devices. + +Fri Nov 13 12:37:00 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Fix a typo. + +Fri Nov 13 10:59:43 1998 DJ Delorie <dj@cygnus.com> + + * Makefile.in: "make" uses new "ld -shared" by default internally. + +Fri Nov 13 00:58:38 1998 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (find_exec): Make sure that return value is correct + in all cases. Document. + * fhandler.h (fhandler_tty_common): Give unit number to constructor. + * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Give + unit number to descriptor. Create correct UNIX path name for + tty so that ttyname() will work correctly. + * select.cc (fhandler_tty_common::ready_for_read): Don't worry + about read_for_read since the tty read routines are already + interruptible. + * syscalls.cc (_read): Reset read thread events on signal. + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * dlfcn.cc (ctype.h): Include. + (check_access): Document. + (check_path_access): Document. + (get_full_path_to_dll): Rework to handle general filenames and + symlinks. + +Thu Nov 12 17:01:52 1998 DJ Delorie <dj@cygnus.com> + + * Makefile.in (shared): "make shared" uses the new "ld -shared" + * cygwin.din: add LIBRARY and BASE tags for "ld -shared" + +Wed Nov 11 17:16:17 1998 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Add --enable options for various cygwin defines + including preliminary thread-safe defines. + * configure: Regenerate + * Makefile.in: Honor new --enable options. + * glob.h: Move BSD defines to sys/cdefs.h. + * include/sys/cdefs.h: Move __P definition here. + +Wed Nov 11 14:00:45 1998 DJ Delorie <dj@cygnus.com> + + * cygwin.din (getpwnam): remove duplicates + +Tue Nov 10 18:27:09 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/aclocal.m4: regenerate with aclocal + * utils/configure.in: don't call AM_CYGWIN32 + * utils/configure: regenerate + +Tue Nov 10 15:56:03 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Gary V. Vaughan <gvaughan@oranda.demon.co.uk>: + * dlfcn.cc (dlopen): return an introspective handle to the + current module if name arg is NULL. The Single UNIX + Specification, Version 2 has this as a requirement. + +Mon Nov 9 16:29:27 1998 Geoffrey Noer <noer@cygnus.com> + + * errno.cc (strerror): all errnos in + newlib/libc/include/sys/errno.h are now listed here. + +Mon Nov 9 16:29:27 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: up DLL version, bump API_MINOR to 2 + to mark following change. + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * cygwin.din: add exports for some of the newlib bessel + functions (j1, jn, y1, yn). + +Mon Nov 9 15:10:06 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (_link): rewrite FIXME. + +Mon Nov 9 14:51:03 1998 Geoffrey Noer <noer@cygnus.com> + + * errno.cc (strerror): add string for EDEADLOCK. + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * errno.cc (errmap[]): add END_OF_MEDIA and additional Win32 + error codes. + +Sun Nov 8 21:28:01 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h: fhandler_pipe cannot be is_slow under + Windows9[58]. There is no way to check for EOF on a pipe + without performing a read on that system. + * syscalls.cc (read_handler): Don't check for ready_for_read + unless this is a "slow" device. + * winsup.h: Reorganize to accomdate fhandler.h requirement + for os_type. + +Sat Nov 7 23:27:05 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_console): Add a new function declaration. + * fhandler_console.cc (fhandler_console::read1): New function + renamed from console_read to allow use of class fields. + Detect readahead situation when doing line buffering and + buffer does not contain \n. + (fhandler_console::read): Reflect function name change. + * select.cc (cygwin_select): Changes for better handling + of < 1000 usec timeouts. + (select_stuff::wait): Perform a poll on timeout to + set any fd's that may have become active. + (peek_pipe): More debugging. Honor write_ready if set. + (peek_console): Can't always use WaitForSingleObject. + Detect readahead conditions set in fhandler_console::read1. + Honor write_ready if set. + (peek_windows): Honor write_ready if set. + * times.cc (__to_clock_t): Return clock_t value. + (times): Add some debugging printfs. + +Fri Nov 6 20:15:20 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * spawn.cc (spawn_guts): find_exec() argument mismatch + resulted in inability to run !# scripts which did not + begin with '/'. + +Tue Nov 3 16:12:59 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Don't wait for signal + completion. + (ctrl_c_handler): Ditto. + * fhandler.h (fhandler_*): Declare new ready_for_read functions. + * select.cc: Reorganize all methods into a peek_*, a poll_*, + and a fhandler_*::ready_for_read. This is to allow the _read + function to query the state of an fd without starting a thread. + * signal.cc (kill_worker): If sending a signal from a non-main thread + don't wait for completion. + * sigproc.h (myself_nowait_nonmain): New define for use by sig_send. + * sigproc.cc (sig_send): Honor myself_nowait_nonmain. Don't wait + if not in main thread. + (__release_signal_mutex): Revert to calling ReleaseMutex only + once or mutex is released prematurely. + * syscalls.cc (read_handler): Use new ready_for_read method to + determine if an fd has data for reading. This function optionally + blocks until there is data to read. + (read_helper): Add debugging statement. + (_read): Move signal_arrived reset to before sig_protect to avoid + a race. Force read_handler thread to longjmp back to read_handler + function on signal. + +Tue Nov 3 12:18:31 1998 DJ Delorie <dj@cygnus.com> + + * utils/cygcheck.cc (dump_sysinfo): Note when not finding a + program (like cpp) on the path is a good thing. + +Tue Nov 3 01:26:08 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Kazuhiro Fujieda <fujieda@jaist.ac.jp>: + * environ.cc (environ_init): correct size arg to parse_options + +Mon Nov 2 21:40:32 1998 Christopher Faylor <cgf@cygnus.com> + + * regexp/regexp.c (regatom): Respond to compiler warning. + +Mon Nov 2 21:36:48 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): cygwin should not + print exception information if the exception is trapped + via signal(). + Also use consistent timings for lock_cs() throughout. + +Mon Nov 2 16:46:28 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: For now, also include newlib/libc/sys/cygwin. + Eventually will stop including newlib/libc/sys/cygwin32. + +Mon Nov 2 19:38:30 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * syscall.cc (gethostname): function deleted + * net.cc (gethostname): new function 'gethostname' which + first calls wsock32::gethostname and only if it fails, + calls GetComputerNameA. + +Wed Oct 28 17:57:53 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: up DLL version to 20.0 in honor + of new Net release. + +Wed Oct 28 17:57:53 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * dll_init.cc (doGlobalCTORS): Fix invocation order. + (doGlobalDTORS): Likewise. + +Wed Oct 28 17:57:53 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: add include/exceptions.h to dll_init.cc deps. + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * dll_init.cc (exceptions.h): Include. + (dll_dllcrt0_1): New function to initialize Cygwin DLL guts + properly when a non-Cygwin app uses the Cygwin DLL. + (dll_dllcrt0): Call dll_dllcrt0_1 when user_data is NULL. + +Tue Oct 27 17:35:00 1998 Geoffrey Noer <noer@cygnus.com> + + * syslog.cc: drop "32" from CYGWIN32_LOG_NAME + +Tue Oct 27 16:09:09 1998 DJ Delorie <dj@cygnus.com> + + * utils/cygcheck.cc (usage): cygwhich->cygcheck + +Mon Oct 26 17:47:10 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: fix deps for dll_entry.o and dll_main.o, + add dep for glob.o. + + patch from Mumit Khan <khan@xraylith.wisc.edu>: + * dll_entry.cc: New file for user DLL entry point. + * dll_main.cc: New file for user DLL main. + * Makefile.in (LIBCOS): Add dll_entry.o and dll_main.o. + +Mon Oct 26 13:47:10 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: add back install of include/net which was + removed by accident. + +Mon Oct 26 15:25:22 1998 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (get_strace_mutex): Don't reset last windows + error. + (strace_printf): Preserve last windows error. + +Mon Oct 26 11:01:46 1998 Christopher Faylor <cgf@cygnus.com> + + * uname.cc (uname): Remove slash from system name. + +Mon Oct 26 02:11:44 1998 Geoffrey Noer <noer@cygnus.com> + + * include/asm/byteorder.h: add missing __cplusplus wrapper. + +Mon Oct 26 00:46:33 1998 Christopher Faylor <cgf@cygnus.com> + + * uname.cc (uname): Remove space from the system name. + +Sun Oct 25 23:47:56 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (console_read): Several typos caused flaky + behavior when \r or \n detected under ENABLE_LINE_INPUT. Also ignore + first \n detected under ENABLE_LINE_INPUT if it isn't preceded by a \r. + This avoids problems when switching from "raw" mode into "cooked mode. + +Sun Oct 25 12:28:21 1998 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove unnecessary __cygwin32_stack_trace and + __cygwin_stack_trace exports. + +Sat Oct 24 21:18:46 1998 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * path.cc (symlink): Standard protection for symlink should + be 0777. + * syscalls.cc (num_entries): Calculated links for directory + entry should only include directories. + +Sat Oct 24 20:51:08 1998 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Modify check for CVS/Tag to work around ash bug. + * sigproc.cc (wait_sig): Fix detection of non-blockable signals. + +Fri Oct 23 18:24:43 1998 Geoffrey Noer <noer@cygnus.com> + + * environ.cc: CYGWIN32 environment variable is now called CYGWIN + * window.cc: lose "32" in Cygwin32WndClass + * syslog.cc: lose "32" in WIN95_EVENT_LOG_PATH and + CYGWIN32_LOG_NAME. + +Fri Oct 23 16:32:59 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/cygcheck.cc: reformat, add copyright notice + +Fri Oct 23 18:15:28 1998 DJ Delorie <dj@cygnus.com> + + * utils/cygcheck.cc: new file + * utils/Makefile.in: build cygcheck.exe + +Fri Oct 23 16:48:41 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (signals_init): Add error to api_fatal. + (events_init): Ditto. Collapse printfs into one. + (winsock_init): Ditto. + * net.cc (winsock_init): Remove "Cygwin" from error message. + +Fri Oct 23 13:48:10 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: install include/cygwin headers, losing the "32". + * include/cygwin32: remove + +Fri Oct 23 14:36:31 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (environ_init): Avoid reallocating environ array. + * exec.cc: Increase number of arguments to 1024 throughout. + * fhandler.cc (fhandler_disk_file::open): Revert to checking + a file for '#!' to find out if it is executable but add + extra check for NTEA which, if set, eliminates the need for + the read. + * sigproc.cc (sigproc_terminate): Close hwait_sig and set it + to NULL prior to closing other handles since this flags some + routines that the process is going down. + +Fri Oct 23 00:31:27 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/*: remove "32"s from cygwin32_foo function calls + +Fri Oct 23 00:24:27 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: increment CYGWIN_VERSION_DLL_MINOR + and CYGWIN_VERSION_API_MINOR since I'm changing the API in a + meaningful but backwards-compatible fashion. + + * exceptions.cc: strip "32" from cygwin32_exception_handler + debug printfs + + * net.cc: strip "32" from all net functions + * select.cc, syscalls.cc, winsup.h: lose "32" from cygwin32_select + * cygwin.din: adjust for these changes (no backwards + compatability issues here). + + * cygwin.din: rename all cygwin32_foo functions, aliasing as + cygwin_foo for backwards compat. for now but intend to lose them + at a later date. + * include/sys/cygwin.h: copy all cygwin32_ protos and make them + usable without the "32". We will remove the cygwin32_ ones at a + later date. + * external.cc, external.h: lose "32" from cygwin32_internal + * shared.cc, winsup.h: lose "32" in cygwin32_getshared + * path.cc, path.h: lose "32" in cygwin32_foo comments + * dll_init.cc: lose "32" in cygwin32_detach_dll + * hinfo.cc: lose "32" in cygwin32_attach_handle_to_fd + * libccrt0.cc: lose "32" in refs to cygwin32_attach_dll + * pinfo.cc: lose "32" in cygwin32_winpid_to_pid + + * include/cygwin32: remove all files except cygwin32_dll.h which + some people may already be including. Aim to remove this + remaining file at a later date. + * include/cygwin: move all include/cygwin32 files here. + * cygwin/cygwin_dll.h: change protos to reflect loss of "32"s + * include/net/if.h, include/netinet/in.h, include/netinet/ip.h, + include/netinet/ip_icmp.h, include/asm/socket.h: + include/sys/socket.h: include the headers in include/cygwin + * Makefile.in, winsup.h: fix references to + include/cygwin32/version.h + + * libcctype.c, smallprint.c, test.c: lose "32" in Cygwin32 refs in + comments + * include/dlfcn.h, include/exceptions.h, include/mapi.h, + include/winsock.h, include/mywinsock.h: ditto + * config/*: ditto + * profil.c: ditto, and respace + +Thu Oct 22 22:52:40 1998 Geoffrey Noer <noer@cygnus.com> + + * net.cc, exceptions.cc, hinfo.cc, select.cc, + include/mywinsock.h: rename __INSIDE_CYGWIN32__ to + __INSIDE_CYGWIN__ + +Thu Oct 22 17:39:06 1998 Geoffrey Noer <noer@cygnus.com> + + First round of Cygwin32 -> Cygwin renaming. In all files, + rename Cygwin32 to Cygwin in comments. + * CYGWIN32_LICENSE: delete and + * CYGWIN_LICENSE: add it back under this name + +Thu Oct 22 20:10:24 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc: Eliminate cs mutex. Just use signal_mutex + throughout. Rename sig_dispatch_mutex to signal_mutex throughout. + (lock_cs): Rewrite to be a front-end for get_signal_mutex. + (unlock_cs): Rewrite to be a front-end for release_signal_mutex. + (set_process_mask): Synchronize signals after resetting mask. + * sigproc.cc (release_signal_mutex): Report on success or + failure of signal_mutex release. + * include/Windows32/Defines.h (FILE_FLAG_WRITE_THROUGH): Make + unsigned to avoid a compiler warning. + +Thu Oct 22 14:23:49 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/Makefile.in: disable building cygwin.exe. + +Thu Oct 22 14:16:10 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sig_handle): Minimize life of cs lock during + handling of signals to reduce the potential for a race. + +Thu Oct 22 10:23:19 1998 Christopher Faylor <cgf@cygnus.com> + + * include/sys/strace.h: Minor addition from threadsafe-branch. + +Thu Oct 22 09:03:18 1998 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (close_handle): Error condition needs a return value. + * environ.cc (parse_thing): char pointers should all be constant. + (add): Ditto. + * heap.cc (heap_init): Provide a little more information in + fatal printf. Use api_fatal to print errors. + * sigproc.cc (sigproc_terminate): Move code executed on + thread termination here from wait_sig since this function + may actually be executing in the signal thread. + * strace.cc (strace_open): Argument should be const. + (strace_init): Ditto. + * winsup.h: Ditto. + * include/cygwin32/version.h: Note that original shared memory + version was 0 for 98r2. + +Wed Oct 21 08:41:39 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (__api_fatal): Remove "cygwin" identifier. + * fhandler.cc (fhandler_disk_file::open): Set symlink flag + appropriately for previous change. + * shared.cc (shared_name): Initialize static buffer to + (hopefully) force it into NO_COPY segment. + * mkvers.sh: Reorganize, add cvs tag detection, and output + cygwin "info" defines. + +Tue Oct 20 18:42:50 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin32/version.h: rewrite versioning comments, + updating for new scheme but keeping historical information. + +Mon Oct 19 23:45:24 1998 Geoffrey Noer <noer@cygnus.com> + + * include/windows.h: remove Objective-C BOOL ifdef, now taken + care of within the include/Windows32 header files. + * fhandler_console.cc: fix KeyEvent references in light of + changes to the KeyEvent struct in the Windows32 headers. + + Update include/Windows32 header files. Changes from + Mumit Khan <khan@xraylith.wisc.edu>, Corinna Vinschen + <corinna.vinschen@cityweb.de>, and me. + * include/Windows32/CommonFunctions.h: new file, contents from + Functions.h. + * include/Windows32/*.h: Misc updates. + +Mon Oct 19 20:26:15 1998 Christopher Faylor <cgf@cygnus.com> + + * debug.cc: Throughout, avoid calling *_printf while lock + is active. Previous lock count was not thread-safe. + * fhandler_console.cc (console_read): Avoid sending a + \r to caller if ENABLE_LINE_INPUT. + (fhandler_console::read): Rely on console_read to handle + \r\n conversion. + +Mon Oct 19 12:10:09 1998 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Use more portable constructs to allow running + this with /bin/sh, bash, and ksh. + +Mon Oct 19 11:19:58 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::from_registry): Missed "b15.0" part + for writing mount information back to registry. + (mount_info::init): Remove obsolete stuff. + +Mon Oct 19 10:42:17 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Avoid newer GNU make construction when building + version.cc. + +Mon Oct 19 00:09:06 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: invoke mkvers.sh with $(SHELL) + +Sun Oct 18 15:19:17 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (set_name): Accept unit argument for generating + win32_name. + (fhandler_base::fhandler_base): Ditto. + (fhandler_dev_floppy::fhandler_dev_floppy): Ditto. + (fhandler_dev_tape::fhandler_dev_tape): Ditto. + (fstat): Set symlink bit only if symlink_p is positive. + * fhandler.h: Reflect unit argument changes. + * fhandler_serial.cc (fhandler_serial::fhandler_serial): Accept + unit argument for generating win32_name. + * hinfo.cc (hinfo::build_fhandler): Pass unit argument to constructor + where apropriate. + * path.cc (path_conv::path_conv): Set symlink_p to a positive + value if !nofollow, negative otherwise. + (windows_device_names): Can't default to \dev\comx. \dev part + doesn't work. + (get_device_number): Accept just "comN" for backwards compatibility. + +Sat Oct 17 01:58:15 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (globify): Fix problem with argument corruption + due to use of pointer freed by realloc. + +Sat Oct 17 00:10:53 1998 Christopher Faylor <cgf@cygnus.com> + + Change NOT_OPEN_FD to dtable.not_open throughout. + * Makefile.in: Change .dll name to cygwin1.dll. Increment + the '1' when there are API/shared memory changes. Make + version.cc file every time .dll is linked. Remove datestamp + stuff. + * mkvers.sh: New file. Creates version.cc. + * cygwin.din: Export setdtablesize. + * dcrt0.cc: Remove obsolete version variables. + (build_argv): Use issep() macro rather than isspace since + isspace includes whitespace that the shell does not consider + a command separator. + (check_sanity_and_sync): Use new cygwin version defines and + structures for compatibility checking. + (dll_crt0_1): Ditto. + (__api_fatal): Renamed from api_fatal. Now always called from + macro which tacks program name to beginning of fmt. Increase + size of buffer. + * environ.cc (regopt): Use new reg_key class constructor + functionality. + * net.cc (getdomainname): Ditto. + * path.cc (read_mounts): Ditto. + (mount_info::from_registry): Ditto. + (mount_info::to_registry): Ditto. + (hash_path_name): No need for this to be a "C" function. + * external.cc (cygwin32_internal): Export version info strings. + * external.h: Add CW_GETVERSIONINFO. + * fhandler.cc (fhandler_base::write): Eliminate use of MIN macro. + * init.cc (set_dllname): Obsolete function. Handled in version.cc. + (dll_entry): Remove reference to set_dllname. + * libccrt0.cc (this_proc): Renamed from cygwin_statu. + (cygwin_crt0_common): Record api version in this_proc. + * mmap.cc (recreate_mmaps_after_fork): No need for this to be + a "C" function. + * syscalls.cc (close_all_files): Ditto. + * pinfo.cc (lock_pinfo_for_update): Eliminate a compiler warning. + * registry.cc: Eliminate reg_session class. Augment reg_key to handle + functionality of reg_session. + * registry.h: Ditto. + * shared.cc (shared_name): No need for this to be a "C" function. + Use new cygwin version structure. + (shared_info::initialize): Use new reg_key class constructor + functionality. + * smallprint.c (__small_vsprintf): Accept %P as a format specifier. + Signifies the program name. + * spawn.cc (spawn_guts): Quote *all* of the stuff the dcrt0.c considers + special. + * tty.cc (tty::inuse_event_exists): Remove debugging printf. It results + in too much output to strace log. + * uinfo.cc: Add a needed include. + * uname.cc (uname): Use new cygwin version structure to fill in utsname + fields. + * winsup.h: Regroup into sections. Add new version structure. + * include/utmp.h: Move login/logout function declarations here. + * include/cygwin32/version.h: Define new CYGWIN version/info + stuff here. + +Fri Oct 16 00:13:35 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: enable building mingw subdir by default + +Thu Oct 15 12:01:08 1998 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Set all security attributes + for CreateProcess so that sexec will work properly. + +Thu Oct 15 08:49:12 1998 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::dup2): Avoid a null pointer dereference + in a debugging printf. + +Wed Oct 14 18:06:51 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * fhandler_console.cc (fhandler_console::dup): reset + default_color since the console fhandler forgets its default + colorizing when it's `dup'ed. + (fhandler_console::fhandler_console): remove unnecessary + erasing in constructor of fhandler_console. + +Mon Oct 12 22:20:59 1998 Christopher Faylor <cgf@cygnus.com> + + * fcntl.cc (fcntl): According to the "Single UNIX Specification", + F_DUPFD should *not* close its argument. Revert to previous + behavior. + * hinfo.cc (dup2): Guard against closing target fd too early. + * pinfo.cc: Always initialize myself to a dummy value so that + myself != NULL checks are avoided. + * include/sys/strace.h (strace): Remove NULL check for myself. + * dcrt0.cc (api_fatal): Ditto. + * exceptions.cc (handle_exceptions): Ditto. + * signal.cc (sigprocmask): Ditto. + (_raise): Ditto. + * strace.cc (get_strace_mutex): Ditto. + +Mon Oct 12 15:19:47 1998 DJ Delorie <dj@cygnus.com> + + * utils/ps.cc (main): use const char *pname + +Fri Oct 9 12:32:23 1998 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (getw): Simplify. + +Thu Oct 8 23:09:34 1998 Geoffrey Noer <noer@cygnus.com> + + * times.cc: add missing syscall_printfs to time functions, + slight reformatting. + +Thu Oct 8 21:56:37 1998 DJ Delorie <dj@cygnus.com> + + * hinfo.cc (cygwin32_attach_handle_to_fd): allow to pass -1 + for dup() simulation; return allocated fd. + * pinfo.cc (lock_pinfo_for_update): if the mutex is broken, + fail instead of looping. If you do loop, don't use 100% CPU. + +Thu Oct 8 18:33:02 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc: Add another per-thread object for strace. + (quoted): Fix misconception of method used to quote + quotes. + (globify): Optionally output arguments. + (build_argv): Ditto. + (dll_crt0_1): Fix typo in line reassignment. + * debug.cc (class locker): Avoid calling lock multiple times. + * exceptions.cc (call_handler): Set strace recursion flag + to zero when invoking a signal handler. + * fcntl.cc (_fcntl): F_DUPFD should close its argument. + * fork.cc (fork): Move determination of parent process to + a safer place. + * sigproc.cc (get_sig_dispatch_mutex): Rename. Use macro + interface to provide the name of the caller for strace output. + (release_sig_dispatch_mutex): Ditto. + * sigproc.h: Define *_dispatch_mutex wrappers. + * strace.cc (strace_printf): Use new per-thread object to + guard against recursion. + * winsup.h: Define per_thread_strace_protect. Redo per_thread + base class for a little more clarity. + +Wed Oct 7 22:30:43 1998 Geoffrey Noer <noer@cygnus.com> + + * fhandler_tty.h: up NTTYs from 16 to 128 + +Wed Oct 7 09:15:55 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (console_read): Distinguish between + 0 byte return from CTRL-C and EOF condition. + +Tue Oct 6 22:31:44 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (build_argv): Rewrite. Now: 1) allocates argv on + the fly, 2) inserts '@' files as they are found, 3) uses + sh-style quoting using either " or ' which may be embedded + in an argument. + (insert_file): Don't scan command line. Accept already + parsed arguments from build_argv. + (quoted): New function for parsing quoted strings. + (globify): Don't scan argv list. Accept element from + build_argv which will be tacked to end of argv as it + is being built. Extend quoting options to allow + tilde, braces, and quotes. + (dcrt0_dll_1): Simplify argv processing. Just call + build_argv, which handles everything. + +Tue Oct 6 11:04:43 1998 Christopher Faylor <cgf@cygnus.com> + + Change Create[A-Z]* calls throughout to use sec_none_nih + to avoid subprocesses accidentally inheriting handles. + * grp.cc: Hold group structures in group_buf rather than + an image of the /etc/group file. + (parse_grp): New function to parse a group line into a + struct group. + (add_grp_line): Use parse_grp to add line from /etc/group + into internal cache. + (read_etc_group): Avoid redundant feof call. Set up + default group. + (getgrgid): Just return appropriate entry from group_buf + rather than reparsing internal representation. + (getgrnam): Ditto. + (getgrent): Ditto. + * hinfo.cc (hinfo::select_*): Set errno value when attempt + is made to use an unopened fd. + * passwd.cc: Hold passwd structures in passwd_buf rather than + an image of the /etc/passwd file. + (parse_pw): New function to parse a passwd line into a + struct passwd. + (add_pw_line): Use parse_pw to add line from /etc/passwd + into internal cache. + (read_etc_passwd): Avoid redundant feof call. + (search_for): Just scan passwd_buf for matching entries. + (getpwent): Just return appropriate entry from passwd_buf + rather than reparsing internal representation. + +Mon Oct 5 18:06:31 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * sysdef/kernel32.def: add missing GetDiskFreeSpaceEx lines + +Sat Oct 3 23:52:23 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (si): Initialize so that NO_COPY will work. + * debug.cc (class locker): Fix previous change. Critical + sections are still required, so protect them if operating + in main thread to avoid signal problems. + Make any previously static use of locker global since that + appears to be the only foolproof way of marking the variable + NO_COPY. Rename these variables to something that is not + likely to be collided with. + * exceptions.cc (call_handler): Signal arrival of a dispatched + signal here and wait a long time for the mutex before giving + up. Should increase performance slightly. + * sigproc.cc (maintid): New external symbol. + * sigproc.cc (maintid): Make this global since it is used + in other places now. + (sig_dispatch_pending): Don't wait for wait_sig to complete + if there are no pending signals. Avoids a race and should + be faster. + (wait_sig): Don't set signal_arrived event here. Do it in + call_handler. + * strace.cc (strace_printf): Remove previous recursion check + since it is not signal safe. + * syscalls.cc (_read): Remove duplicate CreateEvent typo. + +Fri Oct 2 09:54:42 1998 DJ Delorie <dj@cygnus.com> + + * strace.cc (strace_printf): protect against recursion + +Thu Oct 1 17:08:47 1998 Geoffrey Noer <noer@cygnus.com> + + * utils/ps.cc (main): add more detailed usage printfs + +Thu Oct 1 11:05:16 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Fix typo in debug.o dependency. + * debug.cc (class locker): Give up on using critical sections + since they are not safe to use in the main thread due to signals. + +Wed Sep 30 22:34:42 1998 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork): Close parent's parent_alive handle + if there is one or suffer a handle leak. + * syscalls.cc (_read): Make all events no access and + non-inheritable or suffer potential handle leak. + * windows.cc (gethwnd): Ditto. + +Wed Sep 30 17:22:29 1998 Geoffrey Noer <noer@cygnus.com> + + * include/io.h: add missing setmode proto + +Tue Sep 29 23:33:11 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_pty_master::close): Make sure + both sides of both pipes associated with a tty master are + closed or suffer handle leaks. + +Tue Sep 29 16:55:00 1998 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount_info::init): remove default mounts for + raw devices. + * utils/mount.cc (reset_mounts): ditto + (main, usage): new -f flag disables warning messages about + missing mount point directories. Two new flags, disabled for + now: -c will create missing mount point directory, -g will + select adding the mount point to the global registry location. + * include/sys/mount.h: add MOUNT_GLOBAL define, for future use. + +Tue Sep 29 14:20:30 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (exception): Use %p to denote some hex + values. + * winsup.h (read_info): Add jmp_buf to structure. Required + for syscalls.cc change below. + +Mon Sep 28 19:36:41 1998 Syd Polk <spolk@cygnus.com> + + * include/{tchar.h, direct.h}: Added so that + tcl8.1a2 can be compiled with cygwin. + +Mon Sep 28 19:36:41 1998 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (thread_reset): Yet another method for + handling interruptible reads. + (_read): Use thread_reset to reset reads after a signal. + +Sun Sep 27 21:11:46 1998 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: New alias for __cygwin32_stack_trace. + * debug.cc (find_handle): Avoid leaving function without + unlocking. + (newh): Ditto. + * exceptions.cc (__cygwin32_stack_trace): Rename to just + `stack'. Shortens stack trace output. + (exception): Use %p to distinguish register values. + * fhandler_console.cc (fhandler_console::init): Remove + debugging sig_protect. + * init.cc (dll_entry): Move definition to avoid a + compiler warning. + * path.cc (mount_info::conv_to_win32_path): Detect + case of root directory when setting win32 relative + path. + (mount): Remove obsolete label. + * syscalls.cc (thread_sync): New function for exiting + the read helper thread. + (_read): Use new method for exiting the read helper + thread. + +Sun Sep 27 11:25:06 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * delqueue.cc (delqueue_list::process_queue): Clear queue + entry if file cannot be deleted for a reason other than + sharing violation. + +Fri Sep 25 08:52:50 1998 Christopher Faylor <cgf@cygnus.com> + + * debug.cc: locker variables should all be static. + * syscalls.cc (_read): Call ForceCloseHandle on + thread handle since it is protected. + +Thu Sep 24 18:59:25 1998 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount): don't verify that path is an existing + directory. Instead + * utils/mount.cc: verify that path is an existing directory + and print warning if it's not. Still do the mount. + +Thu Sep 24 11:45:04 1998 Christopher Faylor <cgf@cygnus.com> + + * debug.cc: locker class variables must be NO_COPY since + they contain data that should not be precisely duplicated + after a fork. This hopefully fixes a "SIGSEGV" problem. + * select.cc (peek_pipe): Pipes apparently should set both + "read" and "exception" flags on EOF. + +Wed Sep 23 18:26:31 1998 DJ Delorie <dj@cygnus.com> + + * doc/doctool.c (main): typo checking for --help + +Wed Sep 23 17:46:06 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_check_one): Try much harder to ensure that + CloseHandle is called on the file which was opened to check + for a symlink. Avoid obsolete check for NULL buf. + +Wed Sep 23 17:11:50 1998 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_read): Close thread handle or suffer a leak. + * dir.cc (opendir): Simplify logic. + (readdir): Ditto. Close handle explicitly when hit end + of files. + (rewinddir): Close directory handle or suffer leak. + (closedir): Simplify logic. + +Wed Sep 23 14:42:12 1998 Christopher Faylor <cgf@cygnus.com> + + patch from DJ Delorie <dj@cygnus.com>: + * path.cc (symlink_check_one): Don't re-define res or symlinks + will be undetectable. + +Wed Sep 23 12:02:39 1998 Christopher Faylor <cgf@cygnus.com> + + * Change calls to api_fatal throughout to avoid need for \n + (see below). + Adapt some *_printf()/ExitProcess combinations to use api_fatal. + * winsup.h (SIGTOMASK): Generate signal mask correctly for + programs linked with newer cygwins. + * dcrt0.cc (check_sanity_and_check): Set subtract constant for + signal mask calculation based on whether binary was linked with + "older" or "newer" cygwin. + (do_global_ctors): Accept a second argument indicating whether + the ctors should always be run. Necessary in forked processes + for cygwin constructors which may do more than just allocate memory. + (checkout): Remove obsolete function. + (dll_crt0_1): Remove obsolete function call. Call do_global_ctors + with second argument TRUE. + (api_fatal): Change to a print-style function, allowing arguments. + Always emit a "\n" after a message. + (__main): Do not force running of constructors in forked processes. + * exceptions.cc (call_handler): Simplify arguments passed to this + function. Eliminate potential race by setting signal masks here. + (sig_handle): Just calculate current sigaction pointer once. + Change call_handler arguments. + * fhandler_console.cc (fhandler_console::write_normal): Output + unknown characters to screen. + (fhandler_console::write): Make signal protection synchronous. + * fork.cc (fork): Reorganize slightly to eliminate a compiler warning. + * init.cc (dll_entry): Temporarily remove freeing of waitq_storage + on thread detach until a more robust scheme is developed. + * signal.cc (signal): Make signal protection synchronous. + (sigaction): Ditto. + * sigproc.cc (get_sig_dispatch_mutex): More debug info. + (release_sig_dispatch_mutex): Work around potential bug in windows + with double allocation of a mutex when WaitForSingleObject is + interrupted. Save errno here only if about to call sig_send + where it may be changed. + (wait_sig): Remove unnecessary sig_sign stuff. Add some debugging + output. + * termios.cc (tcflow): Signal protection. + (tcgetattr): Ditto. + (tcsetattr): Make signal protection synchronous. + * winsup.h: Add new extern for SIGTOMASK macro. Use it in SIGTOMASK + macro. Move errno stuff to end so that it can benefit from previous + declarations. + * configure.in: Move AC_CANONICAL_SYSTEM up a little to avoid having + configure generate some code (like the check for host type) twice. + * configure: Regenerate. + +Wed Sep 23 11:49:55 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_check_one): Fix handle leak resulting + from open of file to check for symlink magic. Suggested + by Corinna Vinschen <corinna.vinschen@cityweb.de> . + +Wed Sep 23 08:33:26 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * fhandler_tty.cc (process_ioctl): Use console handle + for ioctl operations. + +Tue Sep 22 23:58:20 1998 Geoffrey Noer <noer@cygnus.com> + + based on patch from sos@prospect.com.ru (Sergey Okhapkin): + * utils/ps.cc (main): rewrite ps to give it more options, + including a, e, f, l, and u. + +Tue Sep 22 15:18:41 1998 Geoffrey Noer <noer@cygnus.com> + + * path.cc (umount): remove initial system_printf + (mount): stat path, verify that it's an existing directory, + otherwise fail. + (strncasematch, strcasematch): return 0 instead of FALSE + * utils/mount.cc (reset_mounts): reset / to System drive, + not C: as was done in the old days. + +Mon Sep 21 18:18:18 1998 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount, umount, setmntent, getmntent, endmntent): + make extern "C" + +Mon Sep 21 20:37:16 1998 DJ Delorie <dj@cygnus.com> + + * doc/configure.in: don't try to find cc until we can correctly + configure it for a native cc in a cross build. + +Mon Sep 21 17:17:14 1998 Geoffrey Noer <noer@cygnus.com> + + * fhandler.cc (fhandler_disk_file::check_execable_p): + don't check for .shc since that's non-standard. Check for + .exe first. + +Mon Sep 21 14:57:50 1998 Geoffrey Noer <noer@cygnus.com> + + * doc/Makefile.in: reference -db2html in case docbook + tools aren't installed. + +Mon Sep 21 14:43:40 1998 Geoffrey Noer <noer@cygnus.com> + + patch from DJ Delorie <dj@cygnus.com>: + * doc/doctool.c (scan_file): correct off by one error in + malloc + +Mon Sep 21 14:28:38 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (select_record): Clear memory in constructor. + +Mon Sep 21 08:49:22 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * select.h: Use unsigned int to hold count in fd_set + structure or suffer alignment problems. + (WINSOCK_FD_ZERO): Back out previous change as it + is no longer needed due to the above. + +Sat Sep 19 22:58:18 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (console_read): Keep looping in + ENABLE_LINE_INPUT mode when no characters are read. + This apparently means that a CTRL-C has been hit. + * select.cc (select_record::operator new): Remove. + (setlect_stuff::~select_stuff): Use delete to remove + record. + (pipe_cleanup): Remove unneeded statement. + (poll_socket): Add debugging statement. + (start_thread_socket): Add debugging statements. + * fhandler.h: Remove new operator from select_record. + * select.h: Make WINSOCK_FD_ZERO more aggressive. + * sigproc.cc (allow_sig_dispatch): Use new errno + saving method. + * syscalls.cc (_read): Reorganize stack freeing + code to avoid overhead when it's not needed and + to actually decommit stack memory. + +Sat Sep 19 19:16:32 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * select.cc (socket_cleanup): Avoid using a pointer + after it has been deleted. + +Fri Sep 18 13:57:37 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * Makefile.in: Really remove extra slash in INCLUDES. + Previous change didn't work. + pipe.cc (make_pipe): set close-on-exec flag for non-inheritable + pipes. + +Thu Sep 17 15:26:14 1998 Christopher Faylor <cgf@cygnus.com> + + * doc/Makefile.in: Add dummy install target. + +Thu Sep 17 12:30:49 1998 Christopher Faylor <cgf@cygnus.com> + + * winsup.h (per_thread*): New classes for storing and + manipulating per_thread information. + (threadstuff): New array of per_thread objects which are + manipulated after a fork. + (read_helper_thread_info): read() thread local storage. + (waitq_storage): wait() thread local storage. + * debug.cc (class locker): New class for generic locking + of debug table manipulation. Use this throughout for + locking access to thread/debug tables. + (debug_init): Remove in favor of automatic constructor. + * debug.h: Ditto. + * fork.cc (fork): Iterate through threadstuff looking + for thread information to clear out. Should solve some + problems for Windows 95/98. + * init.cc (dll_entry): Remove thread storage initialization. + Use per_thread class for DLL_THREAD_DETEACH. + * sigproc.cc: Use system_printf rather than alert_printf + throughout since system_printf now has the same functionality. + (sigproc_init): Use method to initialize per-thread storage. + * sigproc.h: Remove waitq_storage declaration. + * syscalls.cc (_read): Use per_thread class to manipulate + per-thread information. + * wait.cc (wait4): Ditto. + +Wed Sep 16 12:58:49 1998 Christopher Faylor <cgf@cygnus.com> + + * syscalls.c (_read): Lower timeout for signal detection after + EOF on device. Should fix recent configure performance problems. + * Makefile.in: Extend clean target into regexp directory. + +Wed Sep 16 11:44:14 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::set_name): Honor no_free_names(). + (fhandler_base::linearize): Remove unneeded check for NULL + get_win32_name(). + (fhandler_disk_file::fhandler_disk_file): Set path names + to a standard constant. They should eventually be filled + out by fhandler_disk_file::open. + (fhandler_disk_file::open): Detect if win32_path_name_ is + a dummy path. Fill it out from real_path, if so. + * hinfo.cc (hinfo::init_std_file_from_handle): Improve debugging + statement. + (hinfo::linearize_fd_array): Remove unneeded check for NULL + get*_name (). + * path.cc (path_conv::path_conv): Correct problem with + symlinks found at places like E:\. + +Wed Sep 16 02:25:33 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * fhandler.cc (fhandler_disk_file::open): fix typo. + +Tue Sep 15 23:52:44 1998 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Remove side effects from SLASH_P. + +Tue Sep 15 18:36:08 1998 Ben Elliston <bje@cygnus.com> + + * sysdef/kernel32.def: Add definition for the Win32 API function + `TryEnterCriticalSection'. + +Tue Sep 15 12:26:48 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove extra slash in INCLUDES. + * hinfo.cc (hinfo::dup2): Always clear close-on-exec + flag for duplicated handle (problem and fix determined + by Sergey Okhapkin, sos@prospect.com.ru). + * fhandler.cc (fhandler_base::set_name): Avoid use of empty + path names. + (fhandler_base::raw_read): Show error code on failure. + (fhandler_base::linearize): Avoid copying NULL names. + (fhandler_base::open): Use NULL detection in small_printf. + (fhandler_base::dup): Move set_close_on_exec_flag to dup2 + so it is caught in all cases. + (fhandler_disk_file::fhandler_disk_file): Set "no free names" + flag. + (fhandler_disk_file::open): Clear "no free names" flag since + names have been allocated to the fhandler structure at this point. + * fhandler.h (set_no_free_names): Newconditional "no free names" + function. + * hinfo.cc (hinfo::dup2): Clear close on exec here. + (hinfo::linearize_fd_array): Avoid copying NULL names. + * path.cc (normalize_posix_path): Avoid copying trailing slash + if root. + (nofinalslash): Rename variable. + * path.h: Add flag for future use. + * regexp/regerror.c: Avoid including RCS strings in product. + * regexp/regsub.c: Ditto. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * select.cc (thread_pipe): Sleep for 10ms on every iteration. + (start_thread_pipe): Set the handle in the select structure + so that it will be properly identified in select_stuff::wait. + +Tue Sep 15 12:28:30 1998 DJ Delorie <dj@cygnus.com> + + * added documentation and doctool.c + +Tue Sep 15 08:37:26 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Fix LIBGCC definition for native builds. + Remove CFCOMMON in favor of configure solution. + * configure.in: Default CXXFLAGS to be == CFLAGS. + * configure: regenerate. + +Sun Sep 13 19:52:04 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: include ../libio when building + +Sun Sep 13 19:30:58 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin32/version.h: bump version minor now that + we've merged in all that new code... + +Sun Sep 13 21:34:33 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_global_ctors): Reverse call order + of constructors thanks to insight from Mumit Khan + (hkan@xraylith.wisc.edu). + (do_global_dtors): Reflect above change: invoke destructors + in the proper order. + * smallprint.c (__small_vsprintf): Gracefully detect a + null pointer for '%s' format. + * syscalls.cc (_read): Set correct flags to retrieve stack + information or suffer sporadic failures due to uninitialized + flag. + * regexp/regexp.c: Comment out RCS string. This provides + no useful information in the .dll. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + Merge in experimental-980602 branch changes. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_check_one): known_suffix needs to be + determined here in some cases, so deal with it here. + (path_conv::path_conv): More effort needed to propagate + the known_suffix back to caller in every case. + (has_suffix): Return suffix found. + (readlink): Avoid two passes through symlink_check_one. + * spawn.cc (find_exec): Propagate known_suffix from + perhaps_suffix back to caller, if appropriate. + (spawn_guts): Use suffix returned from find_exec to + determine if file should be scanned as a script when + a #! file is found. Avoids a duplicate call to + perhaps_suffix. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * path.h (suffix_info): New struct for dealing with standard + suffix (.exe, .bat, etc.) information. + (path_conv): Constructor now takes a suffix_info argument. + (std_suffixes) Standard array of suffixes to consider "special". + * path.cc (path_conv): Constructor now takes a suffix_info + argument. Record any known suffix in path_conv known_suffix + field. + (has_suffix): New function for determining if a path already + has a known suffix. + (next_suffix): New function for returning the next suffix from + a list of suffixes. + (symlink_check_one): Take an optional suffix_info argument + for suffixes to consider or tack on. + * spawn.cc (std_suffixes): Standard list of executable suffixes. + (perhaps_suffix): Pass std_suffixes to path_conv. Use + new known_suffix field in path_conv to determine if a + suffix has been detected. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + Substitute new str{,n}casematch for strcasecmp throughout. + This implementation is faster since it only tests equality. + + Change fhandler*::open throughout to return true/false + since the pointer returned was never used for anything. + + * Use strcasestr throughout for case insensitive matches for + filenames. + * Makefile.in: Use GNU make construct for determining gcc lib. + * dcrt0.cc (check_sanity_and_sync): Make error message more + explicit. + * debug.h: Better defines for dummy functions when !DEBUGGING. + * fhandler.cc (fhandler_base::fstat): Don't bother zeroing buf + here since it is always done in the caller. + (fhandler_base::~fhandler_base): Recognize cases where *_path_name_ + should not be freed. + (fhandler_disk_file::open): Split into two functions. First + function performs a path_conv and does testing on same. This + calls new fhandler_disk_file::open with path_conv data. New + function is called by stat_worker to avoid extra path tests and + mallocs. + Also, fix long standing off-by-one typo looking for #! magic. + Also, reapply test for != WinNT when checking files for magic. + Otherwise there is a tremendous slowdown in file opening, especially + for stat(). + * fhandler.h: Add support for setting/detecting when *_path_name + should not be freed. + Add new fhandler_disk_file::open declaration. + * hinfo.cc (digits): Remove obsolete function. + (hinfo::build_fhandler): Add default name for FH_DISK. + * path.cc (path_prefix_p_): Don't check beyond len1 for leading + slash. Responsible for reported performance problems? + (path_conv::path_conv): Ensure that fileattr is filled out + correctly in all cases. Return immediately when a file + is detected in !follow_mode. + (nofinalslash): Simplify. + (strncasematch): New function similar to strncasecmp except + that it only checks for =/!= and benchmarks faster than same. + (strcasematch): Ditto, re. strcasecmp. + (strcasestr): New function which does a case-insensitive strstr. + Needed for filename matching. + * smallprint.c (__small_vsprintf): Fix off-by-one in %.ns processing. + * spawn.cc (exe_exts): Make global for eventual use by other modules. + * syscalls.cc (_fstat): Zero buf prior to use. + (stat_worker): Rename from _stat_worker. Reorganize to minimize + mallocs and path name conversions. Should now perform only one + path conversion and 0 malloc/frees. + * winsup.h: Declare new functions. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + Clean up error messages throughout using new strace_printf + options. + * smallprint.c (__small_vsprintf): Add %E option for printing + error code. Understand %.n syntax. + * strace.cc (strace_vsprintf): Common routine for formatting + strace output. Default to always ending with \n unless + string ends with \b. + (strace_write): Common routine for writing to strace output. + (strace_printf): Use above two routines. + (system_printf): Ditto. + * path.cc (path_conv): Scan path to be converted from right + to left for efficiency. Implement extension searching + which is passed from spawn to symlink_check_one to minimize + overhead. + (symlink_check_one): Check extensions for existence for use + with spawn. + (readlink): Accommodate changes to symlink_check_one. + * spawn.cc (perhaps_suffix): Use new extension checking + capabilities of path_conv. + (find_exec_1): Delete. + (find_exec): Generalize to allow searching on any PATH like + environment variable. + * dllfcn.cc (check_path_access): Use find_exec to find a path. + This also ensures that paths are in Windows format which was + not the case before. + * environ.cc (conv_envvars): Add LD_LIBRARY_PATH. + * fork.cc (fork): Clean up dll loading slightly. + * Makefile.in: Turn on compiler warnings. + * winsup.h (save_errno): New class for saving errno from + being clobbered. + * include/sys/strace.h: Make system_printf a macro similar + to strace_printf_wrapper. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sig_send): Attempt to work around Windows strangeness + when thread interrupted while waiting for completion event. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc: Remove debugging function DELETEME (). + * fhandler.cc (fhandler_base::fstat): Respond to compiler warning. + * signal.cc (sleep): Reset signal_arrived event before using it or + we could wake up immediately. + (usleep): Ditto. + (pause): Ditto. + * spawn.cc (spawn_guts): Ditto. Respond to compiler warning. + * sigproc.cc (sig_send): More debugging info. + (sig_dispatch_mutex): Only ping wait_sig when needed. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (socket_cleanup): Close thread handle or suffer + handle leak. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (verify_true): New function. + (fhandler_socket::select_*): Use verify_true for verification + function to avoid multiple calls to socket select. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (select_stuff::wait): Scan entire list of fds + when WFMO wakes up. + (set_bits): Add some strace debugging output. + (thread_socket): Ditto. + (verify_ok): Return result of set_bits rather than always 1. + (start_thread_socket): Set the handle in the select structure + so that it will be properly identified in select_stuff::wait. + (fhandler_windows::select_read): Verification routine should + be `poll_windows'. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc: Change some sigproc_printfs to only occur when + #ifdef DEBUGGING. + * spawn.cc (perhaps_suffix): Search for (PROG is the pathname to + the executable file) PROG.exe, PROG.com, PROG.bat, PROG.cmd, and + PROG and return extension found or NULL if no matching file. + (spawn_guts): If the file name of the executable ends in either + .exe, .com, .bat, or .cmd we assume that it is not a script file + and therefore do not open the file to determine if it is. + Fix "wait_failed" error when exec() called and non-cygwin parent. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (rmdir): Set correct errno when non-empty directory and + Windows9x. + * pipe.cc (pipe): Use binary mode by default for pipes. + * syscalls.cc (_read): Wait for terminated thread to exit before + clearing its stack memory. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::fixup_after_fork): Start initial fd search + to zero forked processes so that a close(0)/dup(fd) will work. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler_windows::set_close_on_exec: Deal with possible + NULL handle. + (fhandler_windows::fixup_after_fork): Ditto. + * select.cc (select_stuff:wait): Handle return from + MsgWaitForMultipleObjects correctly for windows case. + * sigproc.cc (sig_send): Reset completion event for main thread. + * syscalls.cc (_read): Better handling of stack free condition. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Exit earlier if just running + in an exec'ed stub since the stub may own the sig_dispatch mutex, + but we still want to exit. + * select.cc (select_stuff::wait): Fix check for window activity + from MsgWaitForMultipleObjects. Handle infinite wait correctly. + (poll_windows): Add debugging output. + * spawn.cc (spawn_guts): Protect against signals interrupting + at an inopportune moment. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (select_stuff:test_and_set): Take appropriate action + when a select record uses a window_handle. + (fhandler_windows::select_read): Set handle and windows_handle + appropriately. + (fhandler_windows::select_write): Ditto. + (fhandler_windows::select_except): Ditto. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (cygwin32_select): Need to reset signal_arrived before + testing it or suffer loop. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (resume_child): Give up on SuspendThread synchronization + and use subproc_ready/forker_finished events. + (sync_with_parent): Ditto. + * sigproc.cc (wait_sig): Make sigcomplete_main manual reset to + allow handling of nested interrupts. + (wait_sig): Fix stupid typo on exit that would cause a + loop to run for a long time. Are exits faster now? + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (unlock_cs): Leave decision to release + sig_dispatch_mutex to the caller. + (set_process_mask): Call release_sig_dispatch_mutex explicitly + if needed. + (handle_sigsuspend): unlock_cs no longer takes an argument. + (call_handler): Try to acquire the strace mutex prior to + suspending the main thread to ensure that the mutex is always + released. + (sig_handle): Call release_sig_dispatch_mutex explicitly. + * fhandler_console.cc (fhandler_console::write): Protect against + signals while writing. + * signal.cc (signal): Protect against signal dispatch. + (sigaction): Ditto. + * sigproc.cc (sig_dispatch_pending): Return status no longer needed. + (sig_send): Assume pending_signals if sending signal to self. + (allow_sig_dispatch): Accept synchronize argument to control whether + to wait for wait_sig to do its thing. + (release_sig_dispatch_mutex): Just awaken wait_sig loop and wait + for acknowledgement if waitfor is TRUE. + (wait_sig): Don't ever zero pending_signals to avoid a possible race. + Set pending_signals for blocked signals, too. + * sigproc.h: Add __SIGFLUSH signal. + (class sig_protect): Allow destructor to wait for signal dispatch, + or not given constructor argument. + * strace.cc (get_strace_mutex): Renamed from waitfor_strace_mutex. + (release_strace_mutex): External function for use by call_handler. + This replaces raw calls to ReleaseMutex throughout. + * syscalls.cc (_read): Use sig_protect to protect against signals. + Other cosmetic cleanups. + (_close): Protect function with sig_protect. + * termios.cc (tcsetattr): Protect function with sig_protect. + +Thu Sep 10 21:09:51 1998 DJ Delorie <dj@cygnus.com> + + * syscalls.cc (_read): typo in matching printf format to args. + + * fhandler.cc (write): Switch to the Microsoft/DJGPP way of + writing out text files: pass \r but prepend \r to \n. + (read): Don't collapse multiple \r's. + + * delqueue.cc: rewritten for speed. Don't check *every* entry in + the list if we know the list is empty, plus check for duplicates. + * delqueue.h: ditto. + * path.cc (path_conv): If a path component is missing, short- + circuit the symlink check. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h: Reorder fhandler status field so that device is + in lower bits. This allows gcc to optimize access to the device. + * hinfo.cc: Inline not_open(). + * winsup.h: Inline hinfo::not_open(). Make hinfo::[] operator a + simple array reference. + * strace.cc: Change strace() to a macro. + * include/sys/strace.h: Ditto. + * syscalls.cc (read_handler): New function. Called directly from + _read for "non-slow" devices or via read_handler for slow devices. + (_read): Use read_handler for reading. + (read_helper): Ditto. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Don't ignore signals if reparenting. + Besides being a race, this screws up the process which is + actually executing. + * fork.cc (fork): Don't create a new process group when + forking or subprocesses won't respond to CTRL-C. + * syscalls.cc (_read): Ensure correct setting of EINTR errno. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (sync_with_child): Consider it a success if the child + has set the subproc_ready signal regardless of whether it has + exited or not. + * init.cc (dll_entry): Set read_helper_thread_info stuff to 0 + on dll initialization. Windows 95 seems to keep garbage here, + despite documentation to the contrary. + * syscalls.cc (_read): Report on errors to create read_helper + events. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (compute_argc): Limit debug_printf string argument size + or suffer a buffer overrun. + (do_exit): Add debugging statement. + * exceptions.cc (call_handler): Remove extraneous sigproc_printf. + Consolidate signal_arrived event with sig_was_dispatched. + (events_terminate): Consolidate signal_arrived event with + sig_was_dispatched. + * fhandler.h: Rename a field to something more mnemonic. + * fhandler_tty.cc: Throughout: Only set up fhandler_tty_master when + actually using ttys. Change tty_master `f' field to `console'. + * tty.cc: Ditto. + * fork.cc (sync_with_child): Add more information to "child died" + error. + * hinfo.cc (hinfo::build_fhandler): Call tty master constructor + when appropriate. + * select.cc (select_stuff::wait): Consolidate signal_arrived event + with sig_was_dispatched. + * sigproc.h: Ditto. + * syscalls.cc (_read): Ditto. + * winsup.h: Ditto. + * sigproc.cc: Ditto, throughout. + (block_sig_dispatch): Don't reset signal_arrived. Causes races. + * spawn.cc (spawn_guts): Limit debug_printf string argument size + or suffer a buffer overrun. + * include/sys/strace.h: Implement strace_minimal for very minimal + output which, hopefully, will not affect the behavior of traced + programs as much. + +Thu Sep 10 21:09:51 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: build libwinspool.a with the dll name winspool.drv + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (build_argv): Remove verbose debug_printf. + (dll_crt0_1): Use shared data handle passed in from parent process + when appropriate. Remove extraneous debug_printf. + * environ.cc (getwinenv): New function. Returns (possibly cached) + native version of an environment variable. + (win_env::add_cache): Add cached version of posix and win env + variables to local table. + (posify): Modify for use with native caching. + (setenv): Convert special environment variables to native here, + when they are set. + (struct parse_thing): Simplify struct. + (struct parse_things): Extend table to accommodate "envcache" + setting. + (parse_options): Add "envcache" option to control whether special + environment variables are cached. Simplify handling of remembered + parameters. + (winenv): Modify for use with getwinenv. + * exceptions.cc (unlock_cs): release_sig_dispatch takes an argument + now. + (set_process_mask): unlock_cs now wakens wait_sig when appropriate. + (handle_sigsuspend): Reorganize to take advantage of new behavior + of release_sig_dispatch_mutex and hopefully avoid a race. + (handle_sig): Avoid waking wait_sig if we couldn't get the dispatch + mutex. + * exec.cc (strccpy): Change to modify second argument to point + to position where "parse" stopped so that it doesn't have to be + recalculated by the caller. + (sexecvpe): Use find_exec () to find program to run. If you've + got a function for this, you might as well use it. + * fhandler_tty.cc (fhandler_pty_master::process_input_to_slave): + Report on signal being sent in termios_printf. Use kill_pgrp + interface. + * fork.cc (fork_copy): Just copy everything at once rather than + in individual pieces. + (fork): Potentially move up sbrk() when DEBUGGING so that parent + and child heaps are in sync. Pass cygwin_shared_h to child. + * path.cc (path_conv::path_conv): Make sure that a file is not + a symlink when returning immediately. + * sigproc.cc (sig_dispatch_pending): Return TRUE if signals were + pending. + (sigproc_init): Move sig_was_dispatched initialization here so + that it will always be available to other functions which rely + on it. Otherwise these functions would have to wait for wait_sig + to complete its initialization. + (sig_send): Rework SIGSUSPEND handling. + (release_sig_dispatch_mutex): Wait for signal to be dispatched + after releasing mutex if argument is TRUE. + (wait_sig): Remove sig_was_dispatched initialization from here. + * sigproc.h: release_sig_dispatch takes an argument. + * spawn.cc (perhaps_suffix): Take an optional argument indicating + whether the path has already been converted to win32. + (find_exec_1): Use getwinenv to get windows version of PATH. Use + windows version of individual directories to avoid posix lookups. + (spawn_guts): Call strace_dump here to cause strace output to + be slightly more synced when using strace caching. + (spawnvpe): Use find_exec () to find program to run. If you've + got a function for this, you might as well use it. + * syscalls.cc (_read): Only block signals for "slow" devices. + * winsup.h: Changes needed for previous checkin and getwinenv. + +Thu Sep 10 21:09:51 1998 DJ Delorie <dj@cygnus.com> + + * path.cc (path_conv): bug fix when path ends in slash + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::set_name): Use fhandler + method for determining native name. Avoid path_conv + when possible. + (fhandler_disk_file::get_native): New function, returns + windows name of disk file. + * fhandler.h: Add get_native() method to fhandler_* + classes. + * fhandler_serial.cc (fhandler_serial::get_native): Return + windows name of serial port. + * fhandler_tty.cc (fhandler_tty_master::init): Use consistent + name for tty master. + * fork.cc (fork_copy): Experimental change to avoid loop. + * grp.cc (add_grp_line): Use realloc to extend group buffer. + * hinfo.cc (hinfo::release): fd object should be deleted, + not freed or suffer a memory leak. + (init_std_file_from_handle): Reset first_fd_for_open to + signal that std* locations have been opened. Avoids use + of these locations prior to full dtable setup. + * passwd.cc (add_pwd_line): Use realloc to extend passwd buffer. + * path.cc (path_conv::path_conv): Avoid checking for symlinks on + network shares. Check for existence of file prior to taking + it apart for symlink checking (this needs more work). + (windows_device_names): Make global. + (get_device_number): Detect tty master. + * sigproc.cc (wait_sig): Maintain a flag which indicates when + signals are queued due to the wait_sig's inability to get a + sig_dispatch mutex. + (sig_dispatch_pending): Don't wake up the wait_sig thread if + unless there are signals queued (see above) or force argument. + (allow_sig_dispatch): Only wait for signal dispatch if something + is queued. + * sigproc.h: allow_sig_dispatch takes a (defaulted) argument now. + * syscalls.cc (_open): Use default hinfo::find_unused_handle call. + * net.cc: Ditto, throughout. + * pipe.cc: Ditto. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Ignore user initiated signals here. + * fhandler.cc (fhandler_disk_file::open): Detect error condition + on fhandler_base::open. + * fhandler_console.cc (undo_input): Respond to compiler warnings. + * grp.cc (getgrgid): Ditto. + * times.cc (_tzname): Ditto. + * fhandler_tty.cc (fhandler_Tty_slave::open): Cosmetic changes. + * fork.cc: Clean up debugging output. + * pinfo.cc (pinfo_init): Set pgid and sid to different values + initially. Let user program set sid appropriately if it is + to be the owner of a tty. + * sigproc.cc (allow_sig_dispatch): Try harder to detect when we + should wait for a signal dispatch. + * strace.cc (strace_open): Revert to previous mutex behavior. + * include/sys/strace.h: Ditto. + * syscalls.cc (_open): Detect error from fhandler open. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + Global changes: + Store win32 name in fhandler structure to avoid multiple translations. + Support close_on_exec at the Win32 level for all but sockets. + Respond to gcc warnings. + Use single fstat() call for devices. + *::set_close_on_exec modified. + * dir.cc (opendir): Use win32 name in stat to speed things + up a little. + * debug.cc: New file. Provides routines for extra debugging + when -DDEBUGGING is specified. + * debug.h: New file. Definitions for debug.cc. + * exceptions.cc (signals_init): Break out signal initialization + from exceptions. + (dump_status): Add thread name to stack dump output. + (handle_exceptions): Renamed. + (set_process_mask): Don't ever mask non-maskable signals. + (ctrl_c_handler): Preliminary change to allow propagation of + cygwin signals back to gdb. + (sig_handle): Call do_exit directly from signal thread rather than + attempting to redirect the main thread. + * fhandler.cc (set_name): Store win32 name in fhandler structure. + (*::open) name field is extraneous now. Use get_win32_name () to + retrieve stored win32 name. + (fhandler_base::fstat): Default to performing fstat on a device. + (fhandler_disk_file::fstat): Renamed from fhandler_base::fstat. + Operate only on disk files. + (fhandler_base::set_close_on_exec_flag): New function sets flag + without touching the handle. + (fhandler_base::~fhandler_base): Free unix/win32 path names. + (fhandler_disk_file::close): Only call delqueue.process_queue from + this function since disk files are the only things that can + be unlinked, currently. + (fhandler_dev_null::open): Delete. + (set_inheritence): New function. Set handle inheritence. + (fhandler_*::fork_fixup): New functions. Inherit fhandler data + after a fork. + fhandler.h: *::set_output_handle - new method. + Setup methods for use by select(). + fork.cc (fork): Call fixup_after_fork in child to inherit + handles marked as non-inheritable on CreateProcess. + hinfo.cc (hinfo::build_fhandler): Use new function to detect + devices. + (dup_for_exec): Delete obsolete function. + (hinfo::dup2): Remove extraneous tests. + (hinfo::select_*): Interfaces into select(). + (hinfo::release): Free fd in dtable. + (hinfo::fixup_after_fork): New function. Inherit close-on-exec + handles from parent after fork. + path.cc (mount_info::posix_path_p): Make inline. + (path_conv::path_conv): Short circuit when path resolves to a device. + (digits): Move here from hinfo.cc. + (windows_device_names): Win32 names for Cygwin devices. + (get_device_number): New function. Return devie number given device + name. + (win32_device_name): New function. Decode a windows device name + and an optional "unit". + (mount_info::conv_to_win32_path): Short circuit when path resolves to + a device. + * path.h: add device and unit fields to path_conv class. + * select.cc: Rewrite for more structure, more OO. + * sigproc.cc: (get_sig_dispatch_mutex): New function. + (release_sig_dispatch_mutex): New function. + * sigproc.h: sig_protect class. Automatic protection from signals + when used. + * syscalls.cc (stat_dev): New function. + (stat_worker): Short-circuit when a cygwin device is detected. + * utils/ps.cc: Don't lock_pinfo when -f. Compress format to fit + more on a line. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Register name for main thread. + * exceptions.cc (dump_status): Add thread name to diagnostic output. + (__cygwin32_exception_handler): Rename to handle_exceptions. Avoid + creating a .core file. + * exec.cc (sexecve): Reflect spawn_guts argument change. + * fhandler_tty.cc (fhandler_tty_master::init): Use makethread to + create a new thread. + * select.cc: Create pipe/socket threads each time select is called. + Use thread termination as indication of fd readiness. + * sigproc.cc (sigproc_init): Use makethread to create a new thread. + (wait_sig): Simplify default signal call slightly. + * spawn.cc (spawn_guts): Accept child pinfo pointer rather than + pid. Reorganize so that common initialization is handled once. + * strace.cc: Set strace_mutex to NULL initially to catch CreateMutex + errors. + * window.cc (gethwnd): Use makethread to create a new thread. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add debug.o target. + * cygwin.din: Separate pipe from _pipe. + * dcrt0.cc (alloc_stack): New, more precise method for allocating + stack space after a fork. + (dll_crt0_1): Use new child_proc_info class to retrieve information + from possible parent process. Remove #ifdef erroneously checked in. + Remove extraneous syscall_printf. + * exceptions.cc (signals_init): New function. + * fhandler.cc (fhandler_make_pipe): Move to pipe.cc. + * fhandler.h (fhandler_base): New = operator preserves unix_path_name_. + * fhandler_tty.cc: Strip some tty functions from here into tty.cc. + * fork.cc: Remove obsolete ifdefs. Reorganize, streamline with new + fork. + * hinfo.cc: Speed up build_fhandler. + * libccrt0.cc: Remove obsolete ifdefs. + * pinfo.cc (pinfo_init): Simplified by new fork/spawn info passing + method. + * pipe.cc (make_pipe): Moved from fhandler.cc. Handles MS-style + _pipe. + (pipe): Use new arguments to make_pipe. + (_pipe): New MS-compatible function. + * shared.cc: cygwin_shared_h make global so that it can be inherited + via new fork/spawn info passing method. + (open_shared_file_map): Detect if shared info is already set up from + fork/spawn. + * sigproc.cc (sigproc_init): Initialize signals with signals_init here. + Use new fork/spawn info passing method. + * spawn.cc (spawn_guts): Pass information in a structure to spawned + process. Identify structure type with a "magic number". + * strace.cc (strace_printf): Only print program full path spec once + to save space and clutter. Preserve any windows error. + * syscalls.cc (_open): Detect and avoid error return from + build_fhandler. + * tty.cc: Accept some non-fhandler functions formerly found in + fhandler_tty.cc + * winsup.h (pinfo): Remove some fields obsoleted by new fork/spawn + info passing method. + (child_info*): New classes for passing information to forked/spawned + process. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add debug.o target. + * console.cc (fhandler_console::char_command): Fix failed merge. + * dcrt0.cc (alloc_stack): New, more precise method for allocating + stack space after a fork. + (dll_crt0_1): Use new child_proc_info class to retrieve information + from possible parent process. Remove #ifdef erroneously checked in. + Remove extraneous syscall_printf. + +Thu Sep 10 21:09:51 1998 Christopher Faylor <cgf@cygnus.com> + + Global changes: + Replace pinfo hmap entry with "dtable" reference. + Replace cygwin_shared .t field with '.tty' and allow indexing via + tty into this array. + Make fhandler_ constructors set the size of the structure into any + created class. + Change fhandler settings into a bit mask. Use methods to access. + Record device type in fhandler class. + Remove old linearize/de_linearize code in favor of newer method + uses more bullet-proof method for determing device type of inherited + files. + Protect various important handles from closing when operating + under -DDEBUGGING. + * dcrt0.cc (do_global_ctors): Renamed, made static and reused + for calling from dll_crt0_1 to initialize cygwin.dll constructors. + (do_global_dtors): Renamed. + (dll_crt0_1): mark noreturn. Use new do_global_ctors function. + Call debug_init to initialize features turned on by -DDEBUGGING. + Call dtable_init to initialize dtable, hinfo_init to initialize + standard fds. + (dll_crt0): Mark noreturn. Move constructor calls to dll_crt0_1. + (__main): Use new do_global_ctors (). + Remove OLDWAY and _PPC_ conditionals. + * environ.cc (environ_init): Use appropriate strace printf. + * exceptions.cc (set_process_mask): Don't ever mask out unmaskable + signals. + * init.cc (dll_entry): Initialize storage for read_helper. + * pinfo.cc (init_from_exec): Delete obsolete function. + * sigproc.cc (sig_send): Implement myself_nowait to allow + sending a signal to myself without waiting for synchronization. + (wait_sig): Change method for determining whether signal should + be examined slightly. + * strace.cc (strace_printf): Add ability to report on thread from + which message originated. + (threadname): New function + * syscalls.cc (read_helper): New function. Invoked in separate thread + from _read. + (_read): Use a separate thread for reads that can be interrupted + with a TerminateThread(). Allows EINTR. + (setdtablesize): Use new method for extending the size. Callable + from anywhere. + (getdtablesize): Use new method for getting the current dtable size. + * tty.cc: Remove use count in favor of a method which checks tty + availability via an event. Some code cleanup. + (tty::inuse): New function for determining if a tty is + in use by any process. + (tty_list::terminate): Use new method for determining if a tty is in + use. Should avoid hangs waiting for non-existent processes to + free up a tty. + (tty::common_init): Common initialization for tty/pty master. + (fhandler_tty_master::init): New function. + (do_output): Use new method for determining if a tty is in use. + (fhandler_pty_master::open): Use comon initialization code. + (fhandler_pty_master::ptsname): static buffer is ok now. + * tty.h: Reflect inuse changes and tty.cc cleanup. + * winsup.h: Include debug.h for use when -DDEBUGGING. Remove + stuff previously here which was conditionally compiled with -DDEBUGGING. + (hinfo_vec): Rename to hinfo. Maintain argv style list of pointers + to open fds. Add methods to deal with above changes. + (pinfo): Removals due to above changes. + (shared_info): Rename t to tty. + Add common defines to extern "C" section. + +Wed Sep 9 22:24:50 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_prefix_p_): Rewrite to avoid false match + against root when remote path or \\x style disk device. + * include/sys/strace.h: Implement new macro for use by + malloc_printf which does not default to "on" if STRACE=1. + This avoids massive strace logs. + +Tue Sep 8 11:31:42 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Remove ill-advised ifdef NEEDOEM. + +Thu Sep 3 17:54:18 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Speed up dll links. + * path.cc (chdir): Fix previous change. + +Mon Aug 31 12:23:33 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Protect free from potential signal race. + +Fri Aug 28 15:59:27 1998 Geoffrey Noer <noer@cygnus.com> + + * dlfcn.h: delete, move it + * include/dlfcn.h: here + +Thu Aug 27 14:20:38 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * path.cc (path_conv::path_conv): remove trailing backslash from + full win32 name, otherwise the last component of the path isn't + checked for symlink. + +Wed Aug 26 14:15:22 1998 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_base): Make set_name() public and implement + clear_name() to accommodate dup2. + * hinfo.cc (dup2): Previous change exposed problem with dup2. + Same unix_path_name_ ptr was being used in two separate fds. + Fix this. + +Wed Aug 26 12:10:27 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * malloc.cc: Use malloc_printf throughout. + * path.cc (getcwd_inner): Allocate buffer with realloc to + avoid a memory leak. + * syscalls.cc (_close): delete unix_path_name_ explicitly since + destructor is never called. + * include/sys/strace.h: Add strace_malloc stuff. + +Mon Aug 24 15:45:59 1998 Geoffrey Noer <noer@cygnus.com> + + * include/sys/ioctl.h: variable names in protos should start + with two leading underscores. + * include/sys/mman.h: ditto. + * include/sys/mount.h: ditto. + * include/sys/resource.h: ditto. + * include/sys/smallprint.h: ditto. + * include/sys/socket.h: ditto. + * include/sys/strace.h: ditto. + * include/sys/vfs.h: ditto. + * include/sys/wait.h: ditto. + * include/mntent.h: ditto. + +Tue Aug 18 17:00:20 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Trevor Yann (TYann@vet.com.au): + * uname.cc (uname): report processor type for win98 + +Tue Aug 18 16:09:13 1998 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (cygwin_fork_helper1): Start initial fd search + to zero forked processes so that a close(0)/dup(fd) will work. + +Mon Aug 17 16:58:09 1998 Christopher Faylor <cgf@cygnus.com> + + * winsup.h (hinfo): Remember initial fd to start searching + for new fds. This avoid assigning std/in/out/err to + files opened early in initialization. + (hinfo_vec::find_unused_handle): New default way to search + for a new handle. Avoids using std/in/out/err until the + proper time in the initialization. + * fhandler.cc (fhandler_make_pipe): Use default method for + finding unused handle. + * net.cc: Ditto throughout. + * pipe.cc (dup): Ditto. + * syscalls.cc (_open): Ditto. + * hinfo.cc (hinfo_vec::init_std_file): Set initial fd for open + search to include std/in/out/err. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * spawn.cc (perhaps_suffix): Use translated win32 path when + determining if a .exe extension should be added or suffer adding + a .exe extension twice. + +Mon Aug 10 15:08:49 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin32/version.h: up minor version number + +Mon Aug 10 07:04:13 1998 DJ Delorie <dj@cygnus.com> + + * delqueue.cc: rewritten for speed. Don't check *every* entry in + the list if we know the list is empty, plus check for duplicates. + * delqueue.h: ditto. + +Sat Aug 8 14:03:52 1998 Eric Bachalo <ebachalo@cygnus.com> + + * spawn.cc (perhaps_suffix): If report_failure_p is non-zero this + function will search for (PROG is the pathname to the executable + file) PROG.exe, PROG, PROG.com, PROG.bat, and PROG.cmd and return + either the full path name if found or NULL if not. + (spawn_guts): If the file name of the executable end in either + .exe, .com, .bat, or .cmd we assume that it is not a script file + and therefore do not open the file to determine if it is. + +Thu Aug 6 22:25:38 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv): If a path component is missing, short- + circuit the symlink check. Bug fix for case where path ends + in a slash. + (path_conv::path_conv): Make sure that a file is not + a symlink when returning immediately. Avoid checking for + symlinks on network shares. Check for existence of file prior + to taking it apart for symlink checking (this needs more work). + +Sun Aug 2 19:17:59 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (cleanup_pipe_thread): Cleanup thread handle or suffer + handle leak. + (cleanup_socket_thread): Ditto. + * sigproc.cc (proc_subproc): Make wait thread manual reset to + solve problem with nested waits not waiting correctly. + * fhandler_tty (fhandler_tty_slave::open): Don't create the output + mutex, just open it. If it can't be opened, its an error. + +Wed Jul 29 12:08:19 1998 Eric Bachalo <ebachalo@loony.cygnus.com> + + * include/Windows32/Defines.h: Added Virtual-Key Code defines + for the Win95 keys - VK_LWIN, VK_RWIN, and VK_APPS. + +Tue Jul 21 14:47:59 1998 DJ Delorie <dj@cygnus.com> + + * path.cc (path_prefix_p): optimize calls by comparing first + characters inline. + (path_conv): optimize by not checking both foo and foo/ for + symbolic links. + +Tue Jul 21 14:39:03 1998 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (pinfo_init): Set myself->sid to 1 so that + a program started up outside of cygwin will not trump + other opens of ttys. Fixes problem with pgid change below. + +Tue Jul 21 12:59:21 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Force chdir to disk device to go to the root + directory. + +Tue Jul 21 09:32:23 1998 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (pinfo_init): 0 is a very bad value for a default pgid. + +Fri Jul 16 15:09:50 1998 Stan Cox <scox@cygnus.com> + + * (gcrt0.c, gmon.c, profil.c, mcount.c, gmon.h, profil.h, + config/i386/profile.h): New files for gprof cygwin support. + Some code contributed by Tim Newsham for Secure Networks, Inc. + * Makefile.in (LIBGMON_A, GMON_START, GMON_OFILES): New for gprof. + +Mon Jul 13 19:29:00 1998 Eric Bachalo <ebachalo@loony.cygnus.com> + + * dcrt0.cc (insert_files): Now both -@file and @file work as + command line file insertion options. + * fhandler_serial.cc (fhandler_serial::open): Enabled RTS Control + Line by default to make full handshaking cables work for the + D10V board. (CDB.fRtsControl) + (fhandler_serial::tcsetattr): same as above + +Wed Jul 8 15:53:35 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Avoid redundant strace_printf. + +Wed Jul 8 15:05:10 1998 DJ Delorie <dj@cygnus.com> + + * fhandler.cc (fhandler_base::lseek): Note lseek so that next + write() can check for the Win95 "gap" bug. + (fhandler_base::write): If Win95 and lseek past eof + followed by write, use WriteFile to force the "gap" to be filled + with zeros rather than left to the "undefined" data Win32 specifies. + (fhandler_base::fhandler_base): initialize check_win95_lseek_bug_. + * fhandler.h (class fhandler_base): Add check_win95_lseek_bug_ + for bug: when seek past EOF and write, win95 fills with random + data (security hole). + +Thu Jul 2 10:45:15 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (winenv): Be more paranoid when restoring special + win32 environment variables beginning with '='. + +Thu Jul 2 09:19:32 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc: Previous change was not rigorous enough. + Track environment variables to convert in a structure which + records the correct function for converting the environment + variable from/to POSIX format. + (isspecial): New function. + (parse_options): Use template to initialize parse array. + (posify): Use new conversion function. + (winenv): Ditto. Also restore special win32 environment variables + beginning with '='. + * path.cc (conv_path_list): Source argument should be const. + (win32_to_posix_path_list): Ditto. + (posix_to_win32_path_list): Ditto. + * path.h: Reflect changes to path.cc. + +Tue Jun 30 14:00:32 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (winenv): Avoid converting environment variables to + windows style if they begin with something like a 'C:'. + +Sun Jun 28 20:59:16 1998 Christopher Faylor <cgf@cygnus.com> + + * include/Windows32/Structures.h (MINMAXINFO): Add a missing + *LP... + +Thu Jun 25 10:45:38 1998 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (sigpending): Stop from always reporting pending signals + when no signals are actually pending. + +Tue Jun 23 15:38:45 1998 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add a new target. + * cygwin.din: Add cygwin32_internal interface. + * dcrt0.cc (dll_crt0_1): Don't call main if no main set. Allows + initialization from a .dll. + * utils/ps.cc: Use new internal/external interface to cygwin to + provide an unchanging interface to some cygwin internals. + * external.h: Preliminary stab at an interface to cygwin32 for + getting at the "naughty bits". + * external.cc: External interfaces to some cygwin internal stuff. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * exceptions.cc (sig_handle): When abnormally terminating, + close_all_files in signal thread context to prevent socket hangs. + +Thu Jun 18 15:17:06 1998 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (pinfo_list::allocate_pid): Wrap pids at SHRT_MAX + or ash complains. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * window.cc (WndProc): Always kill timer before starting up + a new one or eventually suffer a timer proliferation. + +Mon Jun 15 09:40:30 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc: Cosmetic change. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * syscalls.cc (system): Ignore SIGINT, SIGQUIT and SIGCHLD while + in a system() call. + +Thu Jun 11 18:37:02 1998 Geoffrey Noer <noer@cygnus.com> + + * include/sys/syslog.h: add missing LOG_LOCALn bits + +Tue Jun 9 22:29:26 1998 Christopher Faylor <cgf@cygnus.com> + + * dll_init.cc (DllNameIterator::operator const char* ()): Add + a missing \n to a *_printf. + * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto. + (fhandler_tty_slave::ioctl): Ditto. + * errno.cc (errmap): Add an unrepresented windows error. + Simplify table. + +Tue Jun 9 17:21:44 1998 Christopher Faylor <cgf@cygnus.com> + + * errno.cc (errmap): Make sure that errmap array is + terminated with a NULL or suffer a SIGSEGV. + +Tue Jun 9 10:30:02 1998 Christopher Faylor <cgf@cygnus.com> + + Change `sprintf' to `__small_sprintf' throughout cygwin. + * cygwin.din: Don't export exception handler. + * exceptions.cc (__cygwin32_exception_handler): Rename to + handle_exceptions. Make static. Redo core file generation + slightly so that __small_sprintf can be used. + (call_handler): Remove use of `rethere' in asm code. Don't + probe stack as this is potentially dangerous unless done + meticulously. + * select.cc (select): Redo to create thread whenever needed + for pipe/socket. Thread termination denotes fd readiness. + +Mon Jun 8 14:31:11 1998 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (set_std_handle): New function to set windows + "standard" handles from cygwin handles. + (hinfo_vec::dup2): Set windows standard handle if appropriate. + * syscalls.cc (_open): Set windows standard handle if appropriate. + +Sun Jun 7 16:34:00 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * fhandler_console.cc (fhandler_console::scroll_screen): Add a + workaround for Win95 ScrollConsoleScreenBuffer bug which allowed + scrolling to work correctly in both directions. + (fhandler_console::char_command): Simulate underscore with cyan + instead of magenta like on a real linux console. + +Sat Jun 6 00:01:18 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc: Remove obsolete PPC and OLDWAY defines. + * exceptions.cc: Remove obsolete PPC defines. + +Fri Jun 5 22:18:01 1998 Christopher Faylor <cgf@cygnus.com> + + * utils/Makefile.in: install should build products if necessary. + +Fri Jun 5 17:47:11 1998 Geoffrey Noer <noer@cygnus.com> + + * errno.cc (seterrno): shouldn't & against 0xff since there + are error codes above 255. + +Fri Jun 5 14:35:36 1998 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (ctrl_c_handler): Ignore CTRL_LOGOFF_EVENT or + everybody gets signalled when a user logs off. Allow program + to clean up when receiving a CTRL_CLOSE_EVENT or CTRL_SHUTDOWN_EVENT. + * spawn.cc (_spawnve): Delete hmap.vec from created child since + it just gets overwritten in the child anyway. + * pinfo.cc (lpfu): u -> user_data. + +Thu Jun 4 22:45:12 1998 Geoffrey Noer <noer@cygnus.com> + + * mmap.cc (mprotect): 3rd arg to VirtualProtect call should + be new_prot, not prot. Also, fix check for PROT_NONE (==, + not &). + +Wed Jun 3 16:37:43 1998 Geoffrey Noer <noer@cygnus.com> + + * exceptions.cc: Fix typo in comment + (ctrl_c_handler): Add comments, return FALSE on CTRL_CLOSE_EVENT, + CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT events. Otherwise, + we handle the console event ourselves, send a SIGINT, and return + TRUE. + +Wed Jun 3 14:36:08 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * path.cc (conv_to_win32_path, conv_to_full_win32_path): resolve + symlinks before converting. + +Wed Jun 3 02:11:23 1998 Geoffrey Noer <noer@cygnus.com> + + * exceptions.cc (ctrl_c_handler): return zero when a + CTRL_LOGOFF_EVENT occurs. + +Wed Jun 3 01:01:17 1998 Geoffrey Noer <noer@cygnus.com> + + Reorganize fhandler-related file layout. + * Makefile.in: Remove console.o, add fhandler_console.o. Add + fhandler_serial.o. Remove tty.o, add fhandler_tty.o. + * fhandler_console.cc: Was console.cc. + * console.cc: Delete. + * fhandler_serial.cc: Was code in fhandler.cc. + * fhandler.cc: Delete fhandler_serial routines. + * fhandler.h: Fix comments describing fhandler file layout. + * fhandler_tty.cc: Was code in tty.cc. + * tty.h: Delete. + * fhandler_tty.h: Was tty.h. + * tty.cc: Delete code moved to fhandler_tty.cc. + * winsup.h: Include fhandler_tty.h instead of tty.h. + +Tue Jun 2 23:34:42 1998 Geoffrey Noer <noer@cygnus.com> + + Don't need processor-specific sysdef directories: + * sysdef/powerpc: remove all files + * sysdef/i386: move all files to top of sysdef directory + * configure.in: stop setting processor-specific sysdef variable + * configure: regenerate + * Makefile.in: build .a files from top-level sysdef files. + +Tue Jun 2 16:52:18 1998 Geoffrey Noer <noer@cygnus.com> + + patch from lhall@rfk.com (Larry Hall): + * console.cc (fhandler_console::fhandler_console): call + fillin_info() to check if console attributes have already been + set. If so, set the default foreground color to be the default + for the console, otherwise set it to white. + (fhandler_console::char_command): use the default color to set fg, + bg, and bold for all cases. + +Mon Jun 1 14:05:01 1998 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (writable_directory): Avoid a malloc. + (opendir): Convert to fully qualified path spec. Use inode from + stat as hash instead of recalculating. + (readdir): Try hard to generate the same inode for filenames + as inodes returned from stat(). Handle '.' and '..' inodes + differently than normal files. Note that '..' will still fail + in certain pathological conditions. + * fhandler.cc (fstat): Preserve errno around path conversion. + * path.cc (path_conf::path_conv): Add an extra argument signifying + whether caller wants a fully qualified Windows spec. + (get_current_directory_name): New function. Retrieves current + directory name into internal buffer. + (getcwd_inner): Reorganize. Use get_current_directory_name() + to retrieve a (possibly cached) directory name. + (hash_path_name): Move function here from syscalls.cc. Rewrite to + deal (simplistically) with non-absolute path specs. Use + get_current_directory_name to absolutize path. + * path.h: Reflect additional argument for path_conv. + * select.cc (cygwin32_select): Remove newline from select_printf(). + * syscalls.cc (hash_path_name): Move to path.cc. + (stat_worker): Always use full path spec so that inodes are + calculated correctly. + * uinfo.cc (getlogin): Make extern "C". + * include/sys/resource.h: Put extern "C" around this file. + +Mon Jun 1 13:16:03 1998 Christopher Faylor <cgf@cygnus.com> + + * console.cc: Comment out small_printfs which issue errors + on things like invalid escape sequences. This is very much + unlike a normal terminal, or even like linux which console.cc + purports to emulate. + (console_read): Renamed from FakeReadConsole. Streamline + slightly. + (fhandler_console::read): Ditto. + +Fri May 29 22:41:18 1998 Geoffrey Noer <noer@cygnus.com> + + * hinfo.cc: Include unistd.h, not fcntl.h. + +Fri May 29 21:38:10 1998 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::binary_win32_path_p): Don't allow + the root mount to replace a //drive or //host specification. + +Fri May 29 08:20:28 1998 Geoffrey Noer <noer@cygnus.com> + + * winsup.h: Remove exports section in favor of external + include files. Fix some comments. + * {console.cc, fcntl.cc, pipe.cc}: Include unistd.h. + * dcrt0.cc (__main): Make extern "C". + * strace.cc: Include time.h. + * wait.cc (_wait): Make extern "C". + * version.h: Bump minor version to 3 in honor of /dev/windows + support. + +Fri May 29 03:11:28 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * Makefile.in: Add fhandler_windows.o target + * fhandler.h: Include <sys/ioctl.h>. fhandler_windows: new + fhandler class that handles access to Windows message queue. + (fhandler_base::is_windows): new virtual member function + * fhandler_windows.cc: New file, fhandler_windows class + implementation. + * hinfo.cc (hinfo_vec::build_fhandler): build fhandler_windows + class for "/dev/windows". Include <sys/ioctl.h>. + * select.cc: New fd_windows_map class + (fd_windows_map::convert_to_unix_fdset): New, check for Windows + messages in a queue. + (cygwin32_select): check for windows fd is passed to select call, + increase size of harray by one to support windows pseudo-handle, + do MsgWaitForMultipleObjects if windows fd passed to select call. + +Thu May 28 18:22:24 1998 Ian Lance Taylor <ian@cygnus.com> + + * utils/cygpath.cc: New file. + * utils/Makefile.in (PROGS): Add cygpath$(EXEEXT). + (cygpath$(EXEEXT)): Ne target. + + * include/sys/cygwin.h: Declare more path conversion functions. + +Thu May 28 15:56:26 1998 Geoffrey Noer <noer@cygnus.com> + + * include/sys/ioctl.h: need to include <sys/cdefs.h> + * syscalls.h: remove ioctl proto + +Wed May 27 01:34:06 1998 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: add sethostent/endhostent exports + * net.cc (sethostent, endhostent): new stubs + +Fri May 22 17:31:50 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin32/in.h: correct typo in IPPORT_WHOIS define + +Fri May 22 17:00:48 1998 Geoffrey Noer <noer@cygnus.com> + + * include/sys/ioctl.h: add ioctl proto + +Wed May 20 18:52:31 1998 Geoffrey Noer <noer@cygnus.com> + + * include/sys/param.h: delete, file overlaps with newlib's. + Move it to newlib/libc/sys/cygwin32/sys where such files + are supposed to go. + +Wed May 20 18:20:35 1998 Geoffrey Noer <noer@cygnus.com> + + * select.cc (auto_del_fd_set_map::auto_del_fd_set_map): correct + C++ problem -- can't use parens in call to new. + +Wed May 20 17:03:25 1998 Geoffrey Noer <noer@cygnus.com> + + based on patch from newsham@lava.net (Tim Newsham): + * select.cc: FIXMEs added/adjusted + (select_sleep): new static select helper function + (cleanup_sockthread): ditto + (cleanup_pipethread): ditto + (cygwin32_select): remove degenerate goto in favor of calling + select_sleep, call cleanup_sockthread and cleanup_pipethread + instead of previously duplicated code. + +Wed May 20 02:21:37 1998 Geoffrey Noer <noer@cygnus.com> + + patch from Christopher Faylor <cgf@cygnus.com> + * fhandler.cc (fhandler_serial::raw_read): When + vmin_ == 0, vtime_ > 0, don't force only one char at a time + to be read. + (fhandler_serial::tcsetattr): set to.ReadIntervalTimeout + and to.ReadTotalTimeoutMultiplier appropriately so reads + will time out properly when vmin_ == 0, vtime_ > 0. + +Tue May 19 09:05:46 1998 Christopher Faylor <cgf@cygnus.com> + + * init.cc (set_dllname): Use consistent "cygwin32" name for dll + if the name of the dll is actually cygwin. This will allow + better interoperability between dlls which have been renamed, + i.e., cygwindevo.dll -> cygwin98r1.dll. + +Mon May 18 22:39:35 1998 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Remove sig* undefs since this is now done in newlib. + Define SIGTOMASK define for use by signal mask operations. + * exceptions.cc (__cygwin32_exception_handler): Use SIGTOMASK. + (sig_handle): Ditto + * signal.cc (sigpending): Ditto. + (sigaddset): Use SIGTOMASK. Disallow signal 0. + (sigdelset): Ditto. + (sigismember): Ditto. + * strace.cc (strace_printf): It is possible for strace_mutex to + be an invalid handle. Open the mutex if so. Call ReleaseMutex + until exhausted since a signal may have interrupted an strace_printf. + (strace_dump): Call ReleaseMutex until exhausted. + * tty.cc (do_output): Remove strace printf to avoid filling up strace + output. + (fhandler_tty_slave::read): Use SIGTOMASK. + +Mon May 18 09:11:38 1998 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Clear errno before calling main. + +Thu May 14 00:37:01 1998 Geoffrey Noer <noer@cygnus.com> + + * dcrt0.cc: add comments, reformatting + +Wed May 13 17:47:23 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * times.cc (to_time_t): prevent stat from returning incorrect + file modification time (one second less) on fat partitions due + to round-up error. + +Wed May 13 16:03:07 1998 Geoffrey Noer <noer@cygnus.com> + + * select.cc: add comments, FIXMEs, respace, delete old + sockets-only case that was previously commented out. + (cygwin32_select): in case where handles and sockets are + set, don't check that always_ready_used is zero (that case is + covered before). + * syscalls.cc: delete unused file_queue struct. + +Tue May 12 18:36:25 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (get_os_type): add FIXME + +Tue May 5 14:02:12 1998 Christopher Faylor <cgf@cygnus.com> + + Throughout Cygwin replace use of "sa" SECURITY_ATTRIBUTE variables + with appropriate global variables. + * shared.cc (shared_init): Initialize global security attribute + variables for use in various places around cygwin. + * fork.cc (fork_init): Remove. Functionality replaced by above. + * dcrt0.cc (dll_crt0_1): Remove obsolete fork_init() call. + +Sat May 2 17:40:51 1998 Christopher Faylor <cgf@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * tty.cc (create_tty_master): Fill in ut_host utmp field with + local host name instead of "local" to avoid "who" command timeouts. + +Fri May 1 22:38:20 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc: Add a global to control com port reset behavior. + (parse_options): Recognize "reset_com" as a CYGWIN32 option. + * fhandler.cc (fhandler_serial::raw_read): Handle vmin and vtime + more like UNIX. + (fhandler_serial::open): Revive code to reset com port on open. + Only reset the port if reset_com global is not set and if this + function is being called explicitly by open. + (fhandler_serial::tcsetattr): Make CRTSCTS flow control more + like UNIX -- it should turn on hardware handshaking in both + directions. Handle vmin and vtime in a manner more consistent + with UNIX. + (fhandler_serial::tcgetattr): Reflect CRTSCTS changes above when + reporting this state. + * include/sys/termios.h: Move CRTSCTS and CRTSXOFF (sic) into + 16 bits or they will never be capable of being set. + +Thu Apr 30 15:05:45 1998 Christopher Faylor <cgf@cygnus.com> + + * console.cc (fhandler_console::init): If resetting stdin, + make sure to reset the ConsoleCtrlHandler. + * exceptions.cc (set_console_handler): New function broken out + of init_exceptions(). Sets the function responsible for handling + CTRL-C. + (init_exceptions): Snipped out set_console_handler. + +Thu Apr 30 14:11:30 1998 Christopher Faylor <cgf@cygnus.com> + + * include/sys/cygwin.h: Remove cygnus-specific declaration. + * winsup.h: Move cygnus-specific cygwin32_attach_handle_to_fd + declaration here. This function may eventually be replaced by + an osf_* function. + +Tue Apr 28 17:07:46 1998 Geoffrey Noer <noer@cygnus.com> + + * passwd.cc (parse, getpass): remove unneeded uses of NO_COPY + * grp.cc (getgrgid, getgrnam): ditto + +Tue Apr 28 16:18:03 1998 Geoffrey Noer <noer@cygnus.com> + + * version.h: bump minor version to 2 + * errno.cc: add FIXME + +Wed Apr 22 15:43:56 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (cygname): delete + * shared.cc (shared_name): new, was cygname + * strace.cc, exceptions.cc, sigproc.cc, shared.cc: fix + cygname references in light of above + +Wed Apr 22 14:12:09 1998 Christopher Faylor <cgf@cygnus.com> + + * select.cc (fd_set_map::remove_pair_by_handle): minor optimization + * strace.cc (strace_printf): change format for consistency + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * dcrt0.cc (dll_crt0): Call global constructors explicitly + * tty.cc (create_tty_master): Remove code which attempted to + invoke tty constructor + +Tue Apr 21 16:18:27 1998 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (ucenv): inline + (posify): Ditto + (environ_init): remove obsolete function use + * path.cc (symlink_check_one): Set errno here where appropriate. + (readlink): Rely on errno set by symlink_check_one rather than + defaulting to EINVAL. Should fix problems with RCS. + +Tue Apr 21 15:36:41 1998 Christopher Faylor <cgf@cygnus.com> + + * Implement a NOSTRACE preprocessor define to allow building + Cygwin32 without any STRACE code. + * configure.in: Add entries for architecture specific programs + to allow easier cross-compile builds + * configure: Ditto + * Makefile.in: Ditto + * console.cc (fhandler_console::char_command): Fix two problems + with cursor position report: 1) it reported position relative + to beginning of buffer rather than beginning of screen, 2) it + reported y, x in reversed order + * dcrt0.cc: Remove NO_COPY from variables that don't need it. + Remove variables obsoleted by NO_COPY. + (dll_crt0_1): strace settings are now inherited. Don't try + to initialize strace early. Remove initialization of variables + which are now handled automatically by NO_COPY. Set error mode + for Cygwin32 to fail on critical errors rather than popping up + a dialog box. + * spawn.cc (spawn_guts): Always use default error mode when + spawning a new process. Move error message to more generally + useful location. Terminate signal handling in a cygwin parent + process or two processes will be handling signals. + (_spawnve): Inherit strace stuff + * exceptions.cc (events_init): Provide more information on + "Catastrophic failure". Change error message wording slightly. + * fork.cc: Remove obsolete structure + (cygwin_fork_helper1): Remove use of obsolete structure. Inherit + strace settings in child processes. + * sigproc.cc (sigproc_init): Set wait_sig priority immediately + after thread creation. + * smallprint.c: Remove unneeded include + * strace.cc: Reorganize to handle NOSTRACE + (strace_open): Use strace entries in pinfo structure which are + now inherited + (strace_dump): ditto + (strace_init): preprocessor define STRACE_HHMMSS causes strace + output to use alternate log file format. + (strace_printf): ditto + * syscalls.cc (access): Remove SetErrorMode in favor of global + cygwin32 setting in dll_crt0_1. + * fhandler.cc: Handle NOSTRACE + * tty.cc: Ditto + * window.cc: Ditto + * include/sys/strace.h: Ditto + * winsup.h: Move strace_file handle from per_process to pinfo so + that it can be inherited. Remove obsolete pinfo entry. + +Tue Apr 21 14:30:52 1998 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (cygwin32_attach_handle_to_fd): New function + * include/sys/cygwin.h: Ditto. + * cygwin.din: Export new cygwin-specific function + +Tue Apr 21 02:32:08 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc: comment out file_queue struct that doesn't + seem to be used for anything anymore. Don't need to include + stdarg.h or sys/socket.h. Include utmp.h. Minor respacing. + Move all functions from misc.cc here. + (_read): change strace debug printf function name to _read + (logout): rename success to res + * misc.cc: delete file + * Makefile.in: adjust for above change + +Tue Apr 21 01:45:05 1998 Geoffrey Noer <noer@cygnus.com> + + * dir.cc: new file for directory-related functions, was + dirsearch.cc. + (mkdir, rmdir, writable_directory): move here from syscalls.cc, + writable_directory no longer static + * dirsearch.cc: delete file + * winsup.h: add proto for writable_directory. + * errno.cc: new file for errno-related functions, move errmap + struct here from syscalls.cc + (seterrno): move from syscalls.cc + (strerror): move from strerror.cc + * strerror.cc: delete file + * syscalls.cc: delete everything moved to any of the above files + * Makefile.in: adjustments for above + +Thu Apr 17 16:43:23 1998 Geoffrey Noer <noer@cygnus.com> + + * termios.cc: add comments, add extern "C" in front of exported + calls, move debugging local functions to end of file + * winsup.h: remove fork_terminate proto for function that is no + longer with us. Add strccpy proto. + * spawn.cc (_spawnve): make static + (strccpy): remove in favor of identical function in exec.cc + * exec.cc (strccpy): no longer static + + patch from newsham@lava.net (Tim Newsham): + * select.cc (cygwin32_select): fix off by one error, stop + using memcpy to copy memory over itself + +Thu Apr 16 16:23:00 1998 Geoffrey Noer <noer@cygnus.com> + + * net.cc: respace, put all fhandler_socket functions together + (getsockopt): fix case statement bug resulting in faulty strace + output + (setsockopt): ditto + * shared.cc: throughout, rename global h to cygwin_shared_h + * strerror.cc: make error global a local variable + * fhandler.h: add comments, add virtual function always_read_ready + to fhandler_serial which should return zero to allow non-blocking + serial I/O. + * Makefile.in: select.cc should depend on select.h + +Wed Apr 15 16:14:01 1998 Geoffrey Noer <noer@cygnus.com> + + * select.h: new file, containing macros used by select.cc. + * select.cc: remove them from here, include select.h + +Wed Apr 15 15:23:55 1998 Geoffrey Noer <noer@cygnus.com> + + * ntea.cc (NTReadEARaw): mark as static, don't check allow_ntea + since this is only accessed by functions that have already checked + it. + +Tue Apr 14 14:07:54 1998 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: export truncate call + +Mon Apr 13 23:15:13 1998 Geoffrey Noer <noer@cygnus.com> + + Throughout Cygwin32, rename *u for per_process data *user_data. + Likewise, rename *s for shared memory data *cygwin_shared. + Respace where necessary. + * registry.cc: minor respace + * registry.h: ditto + * net.cc: ditto + * fhandler.cc (fhandler_base::read): don't redeclare int len + * syslog.cc: add FIXME, reformatting, remove extern "C" around + whole file, add before exported functions + (syslog): rename second cp char pointer cp2 + (setlogmask): comment out unused function + +Mon Apr 13 17:55:43 1998 Geoffrey Noer <noer@cygnus.com> + + * environ.cc (parse_options): add "ntea" setting to CYGWIN32 + env variable. Setting determines whether NTEA is used or not. + * ntea.cc: Add allow_ntea global which is inited to FALSE. + Now instead of immediately returning FALSE, make all + functions check allow_ntea variable and use or not use NTEA + based on its value. + * ps.cc (main): widen Win32_pid field by one to better handle + Win 95 pids. + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * shared.cc (shared_info::initialize): increase default + heap_chunk_size to 128 mb to get around the problem that + Cygwin32 still can't cope with a split heap properly. + +Wed Apr 8 18:04:07 1998 Geoffrey Noer <noer@cygnus.com> + + * net.cc (cygwin32_bind, cygwin32_getsockname, cygwin32_listen, + cygwin32_shutdown): if should check sock, not s. + +Wed Apr 8 15:00:46 1998 Geoffrey Noer <noer@cygnus.com> + + Eliminate warnings revealed by -Wshadow -Wall: + * console.cc (FakeReadFile): fix aggregate with partly bracketed + initializer (add missing brackets). + * tty.cc (fhandler_tty_slave::close): remove unused variable tty + (fhandler_tty_slave::dup): ditto + (fhandler_tty_slave::send_ioctl_request): ditto + +Wed Apr 8 03:04:11 1998 Geoffrey Noer <noer@cygnus.com> + + Eliminate warnings revealed by -Wshadow -Wall: + * console.cc (FakeReadFile): change variable name index to + modifier_index. + (fhandler_console::read): remove second definition of flags + * dcrt0.cc (build_argv): rename s to start, e to end + (insert_files): reformat, add parens around assign used as truth + value, make i a DWORD, remove dup def of i. + * dlfcn.cc (set_dl_error): rename s to str + (checkAccess): rename to check_access + (checkPathAccess): rename to check_path_access + (getFullPathOfDll): rename to get_full_path_of_dll, don't + redeclare len + * dll_init.cc (DllList::detachDll): rename index to dll_index + * fork.cc (cygwin_fork_helper1): rename index to dll_index, + reformat slightly, rename res in dll load section to loadres, + don't redeclare rc two additional times + (dump_jmp_buf): rename s to sbuf + * grp.cc (initgroups): rename group arg to grp + * hinfo.cc (digits): rename s to str + (hinfo_vec::build_fhandler): rename first buf variable to + buf_info, the second to buff. + (hinfo_vec::linearize_fd_array): cast sizeof return to int, + declare i in for loop + (hinfo_vec::de_linearize_fd_array): declare i in for loop + * misc.cc (nice): rename pri to priority, index to curr + (cygname): rename s to str + (login): rename tty to currtty + (logout) put missing parens around arg to sizeof calls + * net.cc (DuplicateSocket): rename function to duplicate_socket, + rename s arg to sock + (fhandler_socket::fhandler_socket): rename s arg to sock + (socketpair): rename sin to sock_in + (cygwin32_rexec): rename passwd arg to password + * passwd.cc (parse): rename stat array to tmpbuf + * resource.cc (fill_rusage): rename creation to creation_time, + exit to exit_time, kernel to kernel_time, user to user_time + (getrusage): rename rusage arg to rusage_in + * sigproc.cc (proc_terminate): move i declaration outside of + loop, get rid of extra declaration + (getsem): rename s to str + (proc_strace): declare i at top of function, remove extra two + declarations of it later + * smallprint.c: include ctype.h for isalnum proto + (__small_vsprintf): put parens around assign used as truth value + * spawn.cc (spawn_guts): rename both s variables to str, remove + redeclarations of i + * strace.cc (mark): rename s arg to str + * syscalls.cc (chown): remove unused vars group, passwd + (access): rename s to st + (ctermid): rename s to str + * termios.cc (cfsetospeed, cfsetispeed): rename s to speed + * times.cc (times): rename creation to creation_time, + exit to exit_time, kernel to kernel_time, user to user_time + (time_t_to_filetime, timeval_to_filetime): rename time to time_in + * tty.cc (create_tty_master): rename utmp variable our_utmp + (fhandler_tty_master::init): rename ttynum arg ttynum_in + +Tue Apr 7 17:18:05 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (seterrno): add FIXME + * path.cc (symlink_check_one): change comment wording + + patch from Tom Tromey (tromey@cygnus.com) + * syscalls.cc (access): Call SetErrorMode to turn off critical + errors dialog. + + patch from Mikey (jeffdb@netzone.com): + * fhandler.cc (fhandler_disk_file::open): under Win95, set + S_IXOTH|S_IXGRP|S_IXGRP if the first two bytes of a file contain + a '#!'. + (fhandler_disk_file::check_execable_p): consider shell scripts + execable + +Mon Apr 6 20:55:06 1998 Geoffrey Noer <noer@cygnus.com> + + * include/sys/cygwin.h: add protos for cygwin32 path conversion + functions. + +Wed Apr 1 16:12:58 1998 Geoffrey Noer <noer@cygnus.com> + + * {fhandler.cc, fhandler.h, hinfo.cc, console.cc}: Rename + fhandler_tty class to fhandler_serial + +Tue Mar 31 16:27:36 1998 Geoffrey Noer <noer@cygnus.com> + + * ntea.cc: temporarily disable reading/writing NTEA information + due to the large penalty incurred on NT fat partitions. + +Fri Mar 27 13:35:30 1998 Geoffrey Noer <noer@cygnus.com> + + * environ.cc (parse_options): change struct to union to avoid + references to uninitialized fields. + +Thu Mar 26 19:03:00 1998 Eric Bachalo <ebachalo@cygnus.com> + + * dcrt0.cc (insert_files): added this function to replace + -@file in the command line with the contents of the file + (dll_crt0_1): calls insert_files before building argv + +Wed Mar 25 15:25:26 1998 Geoffrey Noer <noer@cygnus.com> + + And more: + * {fhandler.cc, fhandler.h, tty.cc, net.cc, console.cc}: make + ioctl calls' cmd arg unsigned, ditto for access arg of init calls. + * console.cc (fhandler_console::fillin_info): add parens around + assignment used as truth value. + (FakeReadFile): make copied_chars a size_t + (fhandler_console::read): make i in loop unsigned + * environ.cc (setenv): make l_value unsigned, add parens around + assignments used as truth values. + * exceptions.cc (call_handler): supposed to return an int and + wasn't at the end of control flow. Now returns 1 there. + * fhandler.h (~fhandler_base): destructor should be marked virtual + * misc.cc (login): add parens around assignment used as truth + value. + * net.cc: cast INVALID_SOCKET to int in comparisons + (fhandler_socket::ioctl): remove int cast to FIONBIO since cmd + is now unsigned + (get_win95_ifconf): add cast to signed vs unsigned int comparison. + * ntea.cc (NTReadEA): add cast to signed vs unsigned int + comparison. + * path.cc (getcwd_inner): make len a size_t + * pinfo.cc (cygwin32_winpid_to_pid): add comment + * select.cc (cygwin32_select): make wait_ret an int + * signal.cc (kill_worker): add parens around assignments used as + truth values. + * sigproc.cc (wait_sig): make rc a DWORD + (sig_send): add parens around assignment used as truth value. + * strace.cc: make inqueue global a static DWORD + * tty.cc (do_output): add cast to signed vs unsigned int + comparison. + (fhandler_pty_master::open): remove unused handle nh + +Tue Mar 24 18:03:59 1998 Geoffrey Noer <noer@cygnus.com> + + More spring cleaning: + * net.cc: move LOAD macro definition out of winsock_init, + correction to make it valid ANSI C++. + * grp.cc (read_etc_group): pass default line directly to + add_grp_line call + +Mon Mar 23 19:21:00 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor): + * spawn.cc (spawn_guts): Don't call close_all_files if a cygwin + process has been spawned. Otherwise, we close tty handles twice. + +Fri Mar 20 23:01:24 1998 Geoffrey Noer <noer@cygnus.com> + + * pinfo.cc (pinfo_list::init): Initialize next_pid to PBASE. + (pinfo_list::operator []): Now index is given by pid mod size(). + (pinfo_list::allocate_pid): Allow more pid numbers than spaces in + the process table. Pids now can range from PBASE (1000) to + INT_MAX. At that point they wrap to 1000 again. For speed, use + modular arithmetic to map pids into table. + * winsup.h: move PBASE to pinfo.cc, rename next_pid_index to + next_pid + * utils/ps.cc (main): reorg of what's printed where, listing pid + first. + +Thu Mar 19 15:05:07 1998 Geoffrey Noer <noer@cygnus.com> + + * winsup.h: Change section name in NO_COPY definition. We were + using a .data$nocopy section to avoid copying certain data on + fork. The linker used to include this between __data_start__ and + __data_end__, but that broke building the cygwin32 dll. The fix + is to rename the section ".data_cygwin_nocopy" and explictly + include it after __data_end__. + +Wed Mar 18 15:03:51 1998 Geoffrey Noer <noer@cygnus.com> + + * tty.h: fix ttyslot proto; it returns an int + * glob.h: fix glob proto; it returns an int + +Mon Mar 16 16:16:40 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: stop installing the dll in the lib directory as + well as the bindir. + * environ.cc (parse_options): don't need to call malloc + +Mon Mar 16 11:56:23 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor): + * tty.cc (fhandler_tty_slave::dup): Don't set flags to 0. Flags + have already been set in wrapper. + * net.cc: Rename `s' variable which shadows global `s'. + * termios.cc: ditto + * time.cc: ditto + +Tue Mar 10 15:54:04 1998 Geoffrey Noer <noer@cygnus.com> + + * version.h: up CYGWIN_DLL_VERSION_MINOR + +Tue Mar 10 15:41:29 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor): + * spawn.cc (spawn_guts): Make argument handling after `#! pgm' + handle spaces similarly to UNIX. Close "linearized" file handles + when a non-cygwin32 binary is executed or suffer hangs on exit. + Reorganize lpReserved2 buffer to avoid conflicts with Microsoft + usage which resulted in incorrect stdin/stdout operation with + programs compiled using MSVC. + * pinfo.cc (pinfo_init): Accommodate change to lpReserved2 + organization. + +Mon Mar 9 19:27:17 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (_open): modify to take a variable number of + arguments to match newlib's fcntl.h. + * environ.cc (parse_options): rewrite struct known to conform + to ANSI standards. Can't statically initialize, so do so + dynamically at the beginning of the function instead. + + patch from jeffdb@netzone.com (Mikey): + * dcrt0.cc (build_argv, compute_argc): need to escape quotes + +Sat Feb 28 16:41:54 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * fhandler.cc (fhandler_base::init): call set_flags based on + access arg. + * net.cc: include fcntl.h + (fhandler_socket::fhandler_socket): made sockets O_RDWR + +Thu Feb 26 23:41:54 1998 Geoffrey Noer <noer@cygnus.com> + + Beta 19 release made. + +Sun Feb 22 23:46:31 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * Makefile.in: Do not link cygwinb19.dll with libwsock32.a + * exceptions.cc: add proto for i_WSACleanup. + (sig_handle): call *i_WSACleanup if winsock was inited. + * hinfo.cc: add proto for i_getpeername. + (hinfo_vec::build_fhandler): call *i_getpeername if winsock + was inited + * net.cc: wsock32, i_wsockimports - new globals. Throughout + file, call winsock functions via indirect pointers. + (winsock_init): dynamically load wsock32.dll and resolve addresses + of exports. + (cygwin32_rcmd, cygwin32_rexec, cygwin32_rresvport): resolve + addresses of exports. + * select.cc: add protos for i___WSAFDIsSet, i_WSAGetLastError, + i_select, i_socket, i_closesocket. WINSOCK_FD_ISSET changed to + use indirect pointer. Direct winsock calls changed to indirect. + (cygwin32_select): initialize winsock before calling select in + degenerate case. + * winsup.h: remove protos for ScreenRows, ScreenCols, + ScreenGetCursor, ScreenSetCursor. + +Sun Feb 22 17:44:55 1998 Geoffrey Noer <noer@cygnus.com> + + * environ.cc (parse_options): comment out -- no longer + compiles with egcs. Will rewrite/enable later. + +Sun Feb 22 13:49:10 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.h: remove protos for _open, _read, _write since + they are in newlib headers that are already included + * syscalls.cc (_read): return int, not ssize_t + (_write): ditto + +Sat Feb 21 14:21:17 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: rename dll to cygwindevo.dll + +Sat Feb 21 01:33:56 1998 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove dup definition of endpwent + +Thu Feb 19 14:20:21 1998 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin32/cygwin_dll.h: Correct protection wrapper + +Tue Feb 17 20:21:24 1998 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/Structures.h: tagBITMAPFILEHEADER should + be packed. + +Tue Feb 17 19:34:41 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor): + * cygwin.din: export sigpause + * signal.cc (sigpause): New "compatibility interface" to + sigsuspend function. Used currently by inetutils. + +Tue Feb 17 11:43:27 1998 Ian Lance Taylor <ian@cygnus.com> + + * tty.h (class tty): Add slave_opened field. + * tty.cc (fhandler_tty_master::init): Initialize slave_opened. + (do_output): Only return with EOF if the slave has been opened. + (fhandler_tty_slave::open): Set slave_opened. + (fhandler_pty_master::open): Initialize slave_opened. + + * tty.cc (fhandler_pty_master::read): Change type of n to DWORD. + If there are no characters to read, and the descriptor is in + nonblocking mode, just return EGAIN. + +Mon Feb 16 15:11:25 1998 Ian Lance Taylor <ian@cygnus.com> + + * tty.h (class tty): Remove handle_pid and slave_handles fields. + (class tty_list): Add getcount method. + * tty.cc (tty::init): Initialize input_handle and output_handle. + (tty_list::free_tty): If we just freed the last reference to this + tty, close input_handle and output_handle. + (fhandler_tty_master::init): Don't initialize handle_pid and + slave_handles. + (do_output): Instead of just calling ReadFile, loop using + PeekNamedPipe and check whether the tty has been closed. Return 0 + on EOF and -1 on error. + (process_output): Only print debugging error message if error + occurs in do_output. + (fhandler_tty_slave::open): Always duplicate handles from master. + Never close handles in source. Don't change slave_handles. + (fhandler_tty_slave::close): Don't change slave_handles, and don't + close tty handles. + (fhandler_tty_slave::linearize): Call attach_tty. + (fhandler_tty_slave::de_linearize): Don't call attach_tty. + (fhandler_tty_slave::dup): Don't increment slave handles. + (fhandler_pty_master::open): Don't initialize handle_pid and + slave_handles. + (fhandler_pty_master::close): Don't check slave_handles, and don't + close tty handles. + (fhandler_pty_master::read): Handle EOF return value from + do_output. + (fhandler_pty_master::linearize): Call attach_tty. + (fhandler_pty_master::de_linearize): Don't call attach_tty. + + * fork.cc (cygwin_fork_helper1): Copy strace_mask from parent to + child. + +Thu Feb 12 20:33:57 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor): + * utils/cygwin.cc: Modify -s option to use new strace_mask entry + in pinfo. Prepare for future ability to specify an strace file. + +Thu Feb 12 11:57:26 1998 Geoffrey Noer <noer@cygnus.com> + + * grp.cc (read_etc_group): add a default /etc/group in memory + if /etc/group isn't found + (getgrnam): return NULL if requested group isn't found instead + of returning a default group + +Wed Feb 11 15:59:10 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * strace.cc (strace_open): do not close u->strace_file if it + points to stderr. + * malloc.cc (malloc_init): do not check for application's malloc + in a forkee, this breaks memory coherency in a forkee and forker. + use_internal_malloc flag now copies on fork. + +Tue Feb 10 18:11:30 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor) + Throughout sources, mark statics and globals as NO_COPY where + appropriate. + * fork.cc (cygwin_fork_helper1): Remove #if 0 around fork_copy of + cygwin data/bss. Remove __malloc_copy since it is no longer + necessary. + +Tue Feb 10 15:30:19 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor) + * console.cc (fhandler_console::write): Implement xterm style + escape sequences for setting title in the console title bar. + * fhandler.h: Define constants for console title escape sequence. + +Tue Feb 10 14:16:17 1998 Geoffrey Noer <noer@cygnus.com> + + * include/a.out.h: remove junk chars introduced by mailer + when this header was sent to us + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * libccrt0.cc: rename cygwin_attach_dll to cygwin32_attach_dll + + patch from cgf@bbc.com (Christopher Faylor): + * environ.cc: fix off by one problem + +Mon Feb 9 14:56:00 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: add registry.h to environ.o deps + +Mon Feb 9 14:42:24 1998 Ian Lance Taylor <ian@cygnus.com> + + * Makefile.in (DLL_OFILES): Rename dllinit.o to dll_init.o. + + * tty.cc (fhandler_tty_slave::close): Don't close the tty handles + if the slave and the master are the same process. + + * path.cc (read_mounts): Change key parameter to reference, to + avoiding running the destructor. + +Mon Feb 9 13:53:50 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Christopher Faylor): + Moves all environment manipulation into environ.cc. + Switches to CYGWIN32 for settings: + set CYGWIN32=[no]title [no]strip_title [no]binmode [no]glob + strace=mask:cache,file [no]tty + (set STRACE=whatever is still honored). + Propagates tty settings to all subprocesses regardless of + unsetting of environment variable. + Moves strace mask into pinfo structure for easier future + manipulation by external program. Moves strace_file into the + vacated position for automatic use in forked processes. + Propagates old title to execed processes so that they can + correctly restore the correct title when they exit. + * console.cc: Use PID_USETTY setting in process_state so that + tty state can be easily inherited. + (set_console_title): New function to set console title. + * syscalls.cc: Use PID_USETTY setting in process_state so that + tty state can be easily inherited. + * tty.cc: Ditto. + * hinfo.cc: Ditto. + (hinfo_vec::de_linearize_fd_array): Return last location in buffer + for further potential processing. + * dcrt0.cc: Add global variables for control of glob and title, + set by environ_init. Mark some variables as NO_COPY. + Remove routines and variables for dealing with environment. + (dll_crt0_1): Move environment initialization into separate + function. Honor 'noglob' CYGWIN32 setting. + * environ.cc (environ_init): New function to initialize the + environ table. Also scans for CYGWIN32 environment variable, + setting appropriate values. + (ucenv): New function. Upper cases an environment variable. + (parse_options): New function. Parse CYGWIN_* environment + variable. + (posify): New function. Convert a Windows env path spec to + cygwin. + (env_sort): New function. Sort an environ block. + (winenv): New function. Returns a windows style environment + block. + * fhandler.cc (fhandler_base::read): Reflect change to location of + strace_mask. + * fork.cc (cygwin_fork_helper1): Remove save/restore of some + settings since this is automatic now with new dll data copy. Save + PID_USETTY setting in child process_state. + * strace.h: Cosmetic change. + * pinfo.cc (pinfo_init): Call environ_init here since it may + affect further processing in this function. Use old console title + from "parent" process if execed process. Reflect change to + location of strace_mask. + * spawn.cc (spawn_guts): Remove environment manipulation code. + Use new winenv function call instead. Save old title in block of + memory copied to newly execed process if title is being displayed. + * strace.cc: Changes to reflect new location for strace_mask and + strace_file. These are now automatically inherited on fork. + * winsup.h: Move strace_mask into pinfo to allow possible + manipulation by other processes. Put u->strace_file in uptr + structure so that it will be automatically duplicated on fork, + removing the necessity of initializing strace in a forked + process. Add functions/variables associated with environment + manipulation and console title setting. + +Mon Feb 9 03:06:56 1998 Geoffrey Noer <noer@cygnus.com> + + Extensive reformatting in new files from next patch. + Rename dllinit.h file to dll_init.h and likewise for dll_init.cc. + Rename cygwin_detach_dll to cygwin32_detach_dll throughout. + Similarly, rename cygwin_attach_dll and _cygwin_dll_entry. + And rename sanityAndSyncCheck to check_sanity_and_sync. + Also: + * dll_init.h: don't include winsup.h + * dll_init.cc: include winsup.h here instead + * dlfcn.cc: include winsup.h, don't include windows.h + * cygwin.din: rename cygwin_detach_dll to cygwin32_detach_dll. + + patch from giac@dalim.de (Philippe Giacinti): + Copy data areas of cygwin-compiled dlls on fork(), + implement dlopen/dlsym/dlclose/dlerror calls. + * Makefile.in: add dlfcn.o and dllinit.o to DLL_OFILES, add + dllinit.h dependencies + * cygwin.din: dll_dllcrt0, cygwin_detach_dll, dlopen, dlclose, + dlsym, dlerror, dlfork -- new exports. + * dcrt0.cc: include dllinit.h, mark u pointer as NO_COPY. + (sanityAndSyncCheck): new, code moved from dll_crt0_1. + Initialize all linked dlls before calling main(). + * dlfcn.cc: new file. + * dllinit.cc: new file. + * dllinit.h: new file. + * exceptions.cc: mark some variables with NO_COPY. + * fork.cc: include dllinit.h; declare cygwin.dll data/bss + start/end. + (cygwin_fork_helper1): copy data/bss of cygwin.dll itself to child + process (the code is disabled now); copy data areas of + linked/loaded dlls (if any); free loaded dll list on cleanup. + * include/cygwin32/cygwin_dll.h: new file. + * include/dlfcn.h: new file. + * libccrt0.cc (cygwin_crt0_common): new, code derived from + cygwin_crt0, MainFunc parameter added. + (cygwin_crt0): call cygwin_crt0_common. + (cygwin_attach_dll): new. + * shared.cc: mark some data as NO_COPY + * strace.cc: mark some data as NO_COPY + * winsup.h: add dll_dllcrt0 proto, NO_COPY macro. + +Sun Feb 8 17:51:26 1998 Geoffrey Noer <noer@cygnus.com> + + * getopt.c: new. Import Berkeley getopt code modified for use + in Cygnus' kerberos implementation (including the writing of + getopt_long by Chris Provenzano (proven@cygnus.com)) then modified + a bit more to get it working in Cygwin32. Although we were + going to remove getopt, it appears that too many programs would + need fixing to remove it completely. Whether getopt should be + included in Cygwin32 should be decided at a later time. + * include/getopt.h: new. Import Berkeley getopt.h. + * Makefile.in: add getopt.o to LIBCOS + * utils/Makefile.in: remove include of ../../include since + getopt.h is now in winsup/include, also revert recent change + of addition of GETOPT_OBJS. + +Fri Feb 6 16:28:19 1998 Geoffrey Noer <noer@cygnus.com> + + * cygwin.din: remove set_new_handler and cygwin_set_attributes + exports + * version.h: up major version number + * Makefile.in: rename dll to cygwinb19.dll + * syscalls.cc (cygwin_set_attributes): axe + +Thu Feb 5 18:28:37 1998 Geoffrey Noer <noer@cygnus.com> + + * include/Windows32/Functions.h: add protos for + DdeCmpStringHandles and DdeCreateDataHandle + * Makefile.in: stop including ../libiberty/getopt* since + we aren't exporting or using them + * utils/Makefile.in: add new variable for libiberty getopt objs + which is linked in for cygwin.exe + +Thu Feb 5 17:59:12 1998 Geoffrey Noer <noer@cygnus.com> + + syscalls.cc: move ppc dll_entry asm code to... + dcrt0.cc: ...here + + Import new globbing code from NetBSD 1.3 + * glob: delete subdirectory + * glob.c: new file + * glob.h: new file + * Makefile.in: remove glob from submakes, remove glob/libglob.a + from DLL_IMPORTS, fix dcrt0 glob.h dependency + * configure.in: don't configure glob subdirectory + * configure: regenerate + * dcrt0.cc: include glob.h, not glob/glob.h. + (globify): don't call glob with GLOB_NOESCAPE which isn't a valid + flag with this glob + +Wed Feb 4 16:14:13 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + Allow system administrator to enter into the HKLM registry tree + a predefined mount table inherittable by all cygwin users. The + predefined mounts are non-mandatory so the user's mount table has + a higher priority than the default one. Cygwin reads HKLM tree + in read-only mode. + * path.cc (read_mounts): new, code derived from + mount_info::from_registry(). + (mount_info::from_registry): call read_mounts from user's table, + then from system-wide mount table. + * registry.cc (reg_session::reg_session): key and access arguments + added. + (reg_key::init): access argument added. + (reg_key::reg_key): access argument added. + * registry.h (class reg_key): init prototype changed, default + argument of reg_key added. + (class reg_session): default arguments of constructor added. + +Wed Feb 4 15:38:59 1998 Geoffrey Noer <noer@cygnus.com> + + * include/a.out.h: new coff header file + +Wed Feb 4 01:55:18 1998 Geoffrey Noer <noer@cygnus.com> + + * uinfo.cc: define DEFAULT_UID/GID here + * winsup.h: removed DEFAULT_UID/GID defs and unused + set_console_title proto. Did some major reorganizing, + and a little reformatting, commenting. + +Tue Feb 3 23:59:23 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + Replace u->self and this_procinfo () with new `myself' pointer + wherever appropriate. Also replace get_pid() calls with a + simple ->pid reference. + +Mon Feb 2 12:34:49 1998 Geoffrey Noer <noer@cygnus.com> + + patch from sos@prospect.com.ru (Sergey Okhapkin): + * console.cc (FakeReadFile): limit bytes to read to 30000 due to + Win NT 4.0 SP3 bug. Kill foreground process group with SIGWINCH + on console buffer size change if tty support enabled. + * include/sys/termios.h: define more constants. + * tty.cc (fhandler_pty_master::ioctl): kill foreground process + group with SIGWINCH on window resizing. + +Mon Feb 2 12:14:49 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * dcrt0.cc (dll_crt0_1): Initialize u->self here, early in a + forked process so the correct pid is used in strace output and so + signals do not end up being erroneously sent to the parent. + * exceptions.cc: Make a global variable static. Some minor + optimizations. + (call_handler): Make sure that the signal mask is restored when + sig_dispatch mutex is unavailable. + Reorder asm statements to prevent clobbering of flags register by + preceding ors or risk random inexplicable behavior when returning + from a signal handler. + * fork.cc (cygwin_fork_helper1): Put setjmp restore in child's + pinfo. Have the child figure out its pid earlier in the + initialization process. Don't print a "child failed" error if the + child failed during initialization due to a CTRL-C. This is still + not quite right (see comment). + * sigproc.cc (sig_send): Remove unlock/lock_pinfo or suffer + consistent hangs in zsh. Make {allow,block}_sig_dispatch globally + available. + (wait_sig): Fix problem where blocked signals would still be + processed if queued. Add debugging SIGNOQUEUE conditional to turn + off signal queueing, making cygwin more like traditional UNIX. + * sigproc.h: Add {allow,block}_sig_dispatch functions. + +Mon Jan 26 17:33:57 1998 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount_info::init): don't hardcode C: as the default + slash mount. Instead, use the drive letter that the OS is loaded + on. + +Mon Jan 26 13:33:57 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * fork.cc (cygwin_fork_helper): Move setting PID_INITIALIZING + process_state here to avoid erroneously setting it permanently + via proc_register(). + * pinfo.cc (pinfo_init): Delay notifying "parent" when execing + until this process is ready to receive signals or risk a race + condition if exec parent calls sigproc_terminate prior to + the child exec. + * sigproc.cc (proc_subproc): Don't set PID_INITIALIZING here. + It is too late in the process creation. + (sig_send): Reset sigsuspend mutex prior to use to avoid a race. + (wait_sig): Create sigsuspend mutex as an auto reset to attempt + to avoid a race condition. Notify parent that this process is + ready if we were execed (code moved from pinfo_init). Change + PulseEvents to SetEvents to avoid races + * spawn.cc (spawn_guts): Move setting PID_INITIALIZING + process_state here to help avoid race. + +Fri Jan 23 12:31:37 1998 Ian Lance Taylor <ian@cygnus.com> + + * malloc.cc (malloc_critical_section): New static variable. + (malloc_init): New function. + (__malloc_lock, __malloc_unlock): New functions. + * winsup.h (malloc_init): Declare. + * heap.cc (heap_init): Call malloc_init. + +Thu Jan 22 18:46:40 1998 Ian Lance Taylor <ian@cygnus.com> + + * tty.h (class tty): Change slave_handles to int. + * tty.cc (fhandler_tty_slave::open): Check for invalid tty + handles. If this is the first slave, set slave_handles to 2; + otherwise, increment slave_handles. + (fhandler_tty_slave::close): Only close the tty handles if the + slave_handles field drops to 1. + (fhandler_tty_slave::write): Add a debugging message if WriteFile + fails. + (fhandler_tty_slave::dup): Set ttynum of new fhandler. Increment + slave_handles if appropriate. + (fhandler_pty_master::close): Only close the tty handles if the + tty is no longer allocated. + + * tty.h (class tty): Add handle_pid and slave_handles fields. + * tty.cc (attach_tty): Call connect_tty even if use_tty is not + set. + (detach_tty): Don't check use_tty. + (fhandler_tty_master::init): Initialize handle_pid and + slave_handles of tty. + (do_input): Treat \r as end of line character. + (do_output): Only set output_done_event if it is not NULL. + (fhandler_tty_slave::open): Don't worry if we can't open + output_done_event. Check slave_handles field of tty to decide + from where to duplicate the handles. Call detach_tty on error. + If we are now the owner of the slave handles, mark the tty + appropriately. + (fhandler_tty_slave::close): Only close output_done_event if it is + not NULL. Check for errors from CloseHandle. Close the tty + handles if we own them. + (fhandler_tty_slave::write): Only wait for output_done_event if it + is not NULL. + (fhandler_tty_slave::read): If nobody owns the tty, return EOF. + (fhandler_tty_slave::dup): Attach the tty. Don't duplicate + output_done_event if it is NULL. Detach the tty on error. + (fhandler_pty_master::open): Initialize handle_pid and + slave_handles of tty. Don't create output_done_event. + (fhandler_pty_master::close): Only close output_done_event if it + is not NULL. Check for errors from CloseHandle. Only close the + tty handles if we own them. + (fhandler_pty_master::read): Only set output_done_event if it is + not NULL. + * hinfo.cc (de_linearize_fd_array): Don't set use_tty just because + we find a tty to delinearize. + +Wed Jan 21 21:58:27 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * sigproc.cc: Changes in wait_sig/sig_send semaphore/event + signaling to attempt to eliminate races. + +Tue Jan 20 16:11:05 1998 Geoffrey Noer <noer@cygnus.com> + + Remove last remnants of the mixed case handling support. + * path.cc (path_conv::path_conv): remove mixed_p init + (mount_info::from_registry): don't check for fmixed + (mount_info::to_registry): ditto + (mount_item::getmntent): when setting ret.mnt_opts, only consider + text vs binary flag + (mount_item::init): remove init of mixed + * path.h: remove mixed_p, mixed from path_conv class. Remove + unmixedcaseify proto. + * include/sys/mount.h: comment out MOUNT_MIXED define, protect + header against multiple inclusion + + A little header file cleanup. Mostly to protect headers against + multiple inclusion. Some aren't strictly speaking necessary but... + * include/sys/cygwin.h: protect header against multiple inclusion + * include/sys/smallprint.h: ditto, also add cplusplus wrapper + * include/sys/strace.h: comment last endif + * include/cygwin32/in.h: change _LINUX_IN_H protect defines + to _CYGWIN32_IN_H + * include/arpa/inet.h: protect header against multiple inclusion + * include/asm/types.h: ditto + * include/net/if.h: ditto + * include/netinet/ip.h: ditto + * include/netinet/ip_icmp.h: ditto + * include/netinet/in.h: ditto, remove commented out real header + file + * include/fcntl.h: protect header against multiple inclusion + * include/memory.h: ditto + * include/mntent.h: ditto + * include/strings.h: ditto + * include/syslog.h: ditto + * include/termio.h: ditto + +Tue Jan 20 12:51:59 1998 Ian Lance Taylor <ian@cygnus.com> + + * strace.cc (strace_stderr): New static variable. + (strace_init): Set strace_stderr. + (system_printf): If not strace_stderr, use debug_printf to put the + message in a trace file. + + * fhandler.h (fhandler_pty_master): Add neednl_ field. + * tty.h (RESTART_OUTPUT_EVENT): Change to be different from + IOCTL_DONE_EVENT. + * tty.cc (fhandler_tty_master::init): Initialize neednl_. + (do_output): Handle a length of one by using neednl_ to record an + expansion of \n to \r\n which doesn't fit. Never expand \r to + \r\n. Correct order of \r\n. + (fhandler_tty_slave::open): Improve error handling. Use + DUPLICATE_CLOSE_SOURCE to close the pipes in the master process. + (fhandler_tty_slave::dup): Duplicate the handles, rather than + calling fhandler_tty_slave::open. + (fhandler_pty_master::open): Initialize neednl_. + (fhandler_pty_master::read): Return EOF for ERROR_BROKEN_PIPE, + rather than error. Set errno correctly. + * hinfo.cc (digits): New static function. + (build_fhandler): Always accept /dev/ptmx and /dev/ttyDDD, even if + use_tty is not set. use_tty now only controls the interpretation + of /dev/tty. + +Mon Jan 19 14:49:45 1998 Geoffrey Noer <noer@cygnus.com> + + * sigproc.cc (sig_send): lock_pinfo_for_update during this + function + +Fri Jan 16 18:09:59 1998 Geoffrey Noer <noer@cygnus.com> + + * sigproc.cc (sigproc_init): if we can't create a signal + thread or can't create sync_proc_subproc mutex, fail with + an api_fatal call rather than just returning + +Fri Jan 16 18:08:49 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + Changed signal handling to use one semaphore and one shared + memory array which is manipulated via Interlocked*() functions. + * exceptions.cc (lock_cs): Comment. Report on error. + (unlock_cs): Add debugging statement. + (sig_dispatch_pending): Remove obsolete function. + (set_process_mask): Adapt to new signal method. + (call_handler): Clear wait()ing threads here while main thread is + suspended to avoid timing screwups. Avoid calling the handler if + can't get dispatch mutex (code moved from sig_handle). Return + status of acquiring the sig_dispatch mutex. + (sighandle): Adapt to new signal method. Reorganize to *always* + honor sig_dispatch mutex or suffer deadlock on fatal signals when + someone else has the mutex and we're attempting to cleanup. + (events_init): Reflect change in cygname() arguments. + * fork.cc (stack_dummy): New function. Returns address of + argument to determine bounds for eventual stack copy. + (cygwin_fork_helper1): Call subproc_init to start up subproc + thread if it is not alreay started. Ensure that signals are + blocked while forked process is initializing. Change method of + calculation for lower stack bounds to slightly more foolproof + method. Preserve some global settings in forked process. + * misc.cc (cygname): Remove an unused argument. + * pinfo.cc (pinfo_list::allocate_pid): Add a useful debugging + statement. + * shared.cc (open_shared_file_map): Reflect change in cygname() + arguments. + * signal.cc (kill_pgrp): Avoid killing dead processes. Don't + kill processes in my pgrp if not also in my ctty. + (sigaction): Adapt to new signal method. + (sigpending): Adapt to new signal method. + * sigproc.cc: Many changes to adapt to new signal method. Also + delay waits for thread initialization until the thread needs to be + contacted. + * sigproc.h: Ditto. + * spawn.cc (spawn_guts): Fix potential off-by-one error(?) in + transcribing the argument list and add paranoid code to detect + future overruns. Change priority to highest so that waiting + process will clear out quickly. + (_spawnve): Call subproc_init() to start up subproc thread if is + not already started. + * strace.cc (strace_printf): Increase size of internal buffer so + that long argument lists printed from spawn_guts do not overrun it + so easily. + * wait.cc (wait4): Set status flag to -1 prior to exit. This will + cause previous wait that was interrupted by a signal which + dispatched to another wait to return the correct error value. + * winsup.h (pinfo): Add _sigtodo array for new signal method. + Remove obsolete field. Reflect change in cygname arguments. + +Thu Jan 15 13:07:07 1998 Ian Lance Taylor <ian@cygnus.com> + + * syscalls.cc (mkdir): Don't permit the directory to be created if + the parent directory is not writable. + + * syscalls.cc (fchmod): Call chmod with the path name, rather than + just returning zero. + + * syscalls.cc (writable_directory): New static function. + (_unlink): Don't permit the file to be removed if the directory is + not writable. + (rename): Don't permit the rename if either the source or + destination directory is not writable. + + * syscalls.cc (chown): Set username and groupname lengths to UNLEN + + 1, rather than 100. If getpwuid fails, try to look up the real + user name to see if it is the same. Don't report an error if + there is no security mapping. + +Wed Jan 14 15:34:20 1998 Ian Lance Taylor <ian@cygnus.com> + + * syscalls.cc (setegid): New function which just returns ENOSYS. + (chroot): Likewise. + * cygwin.din: Export setegid, _setegid, chroot, and _chroot. + + * syscalls.cc (setmode): Rename from _setmode. Change to return + the old mode. Remove old setmode function. + * cygwin.din: Make _setmode an alias for setmode. + +Wed Jan 14 14:46:00 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: don't strip cygwin.dll by default + * winsup.h: minor reformatting, removed/reworded some comments + +Mon Jan 12 13:53:03 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + Speed up cygwin pid calculation by staying in the range + 1000 through (1000 + PSIZE - 1). + * pinfo.cc (pinfo_list::init): Change to reflect new pid + calculation method. + (pinfo_list::operator []): Ditto. + (pinfo_list::allocate_pid): Ditto. + * winsup.h (pinfo): Move pid and ppid into non-zeroed region since + they are always set by allocate_pid. + (pinfo_list): Change pid_base to next_pid_index to reflect new pid + calculation method. + (PBASE): New constant for new pid calcuation method. + +Sat Jan 10 12:06:38 1998 Geoffrey Noer <noer@cygnus.com> + + * syscalls.cc (process_deletion_queue): remove wrapper function + (close_all_files): call s->delqueue.process_queue instead of + going through wrapper. + * fhandler.cc (fhandler_base::close): call + s->delqueue.process_queue instead of using above wrapper. + * winsup.h: remove process_deletion_queue proto + * delqueue.h: up MAX_DELQUEUES_PENDING to 100 for now. Rename + v to dqueue for clarity. + * delqueue.cc: v renamed to dqueue throughout. Add FIXME + describing why this whole delqueue system needs rewriting. + +Fri Jan 9 13:18:44 1998 Geoffrey Noer <noer@cygnus.com> + + Remove some historical baggage: + * syscalls.cc (cygwin_set_attributes): remove commented-out code, + add FIXME since this function should go away next time an + incompatible change to cygwin.din is made. Stop including + include/sys/cygwin.h. + * include/sys/cygwin.h: remove cygwin_set_attributes proto. + Remove CYGWIN_FMODE_ALL_BINARY define. + * hinfo (hinfo_vec::init_std_file_from_handle): remove old + commented-out code + * path.cc (unmixedcaseify): delete commented-out function + (mixedcaseify): ditto + * strerror.cc (strerror): delete commented-out code section + +Tue Jan 6 18:51:40 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + Conform to POSIX method for sending SIGHUP to stopped processes. + * dcrt0.cc (do_exit): Use new kill_pgrp function to kill orphaned + children on group leader exit iff the children are stopped (per + POSIX). + * signal.cc (kill_worker): Negative signal now means to send + a SIGCONT after the signal, to wake up the target process. + (_kill): Break out pgrp handling into separate function. + (kill_pgrp): New function pulled from _kill to send signals + to processes in a given pgrp. + +Tue Jan 6 14:37:43 1998 Geoffrey Noer <noer@cygnus.com> + + patch from cgf@bbc.com (Chris Faylor): + * fhandler.cc (fhandler_base::open): include + FILE_FLAG_BACKUP_SEMANTICS in file_attributes when file is + a directory. Allows opening of directory as a file. Allows + use of handle to perform some operations on both directories and + files. + (fhandler_base::fstat): Loop when attempting to get volume serial + number. Works around an apparent Windows NT 3.51 bug. + * times.cc (utimes): use FILE_FLAG_BACKUP_SEMANTICS flag + to allow accessing directory times (may only work under NT; + until now it didn't work under either OS). + * winsup.h: Add O_DIROPEN constant. + +Mon Jan 5 19:18:01 1998 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: make winsup.h depend on winsup.h in accordance + with below + + patch from cgf@bbc.com (Chris Faylor): + * {*.cc, *.h}: Remove include files already present in winsup.h. + Change empty function parameter lists to (void) where appropriate. + + * fork.cc: Clean up include files. Minor change to CreateProcess + parameter list. + * signal.cc: Remove ifdef'ed stuff. + * smallprint.c: Add a necessary include file. + * winsup.h: Add a common include file. Add a function declaration + for kill_pgrp. + +Mon Jan 5 18:30:37 1998 Geoffrey Noer <noer@cygnus.com> + + Fix spoofing of directory inodes. + * syscalls.cc (hash_path_name): instead of initializing the + hash to zero, take the value of the initial hash as a new + argument. + (_stat_worker): fix up hash_path_name reference in light of above + * dirsearch.cc (opendir): initialize dir->__d_dirhash to the + hash of the full directory name so readdir can make use of it. + (readdir): compute d_ino by combining the directory hash + calculated by opendir with the hash of the filename. + * fhandler.cc: fix up hash_path_name reference in light of above + + * winsup.h: remove unnecessary protos for getkey, kbhit. Adjust + hash_path_name proto. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1999 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1999 new file mode 100644 index 000000000..f2da41f51 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-1999 @@ -0,0 +1,3562 @@ +Sat Dec 25 12:46:25 1999 Christopher Faylor <cgf@cygnus.com> + + * dlfcn.cc (dlsym): Use correct HANDLE type for GetProcAddress. + (dlclose): Ditto for FreeLibrary. + * fhandler_windows.cc (fhandler_windows::set_close_on_exec): Properly + coerce arguments to set_inheritance. + (fhandler_windows::fixup_after_fork): Ditto for fork_fixup. + * libcmain.cc (main): Simplify. + * select.cc (peek_windows): Properly coerce argument to PeekMessage. + +Sat Dec 25 12:30:25 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Eliminate unneeded .y SUFFIX. + * dcrt0.cc (__api_fatal): Make "C". + (do_global_ctors): Make __stdcall. + (getprogname): Ditto. + (insert_file): Ditto. + (globify): Ditto. + (build_argv): Ditto. + (do_exit): Ditto. + * debug.cc (regthread): Ditto. + (makethread): Ditto. + (threadname): Ditto. + (find_handle): Ditto. + (handle_list): Ditto. + (add_handle): Ditto. + * debug.h: Reflect changes to __stdcall. + * shared.h: Ditto. + * winsup.h: Ditto. + +Sat Dec 25 12:09:10 1999 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (symlink): Don't return error if target is a symlink to a + nonexistent file. + +1999-12-23 DJ Delorie <dj@cygnus.com + + * Makefile.in: add support for "make check" + * shared.cc: if $CYGWIN_TESTING is set, use a private shared area + * cygrun.c: new, used to isolate dll-in-test + * testsuite/*: new, rudimentary testsuite framework + +Wed Dec 22 01:05:44 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (globify): Properly handle embedded tildes in variable + names. Treat a c:\foo style path spec as "special", i.e., don't + interpret the backslashes as quoting characters. + +Fri Dec 17 10:49:13 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink): Return error if the target exists. + +Thu Dec 16 22:36:45 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc: Change method for accessing com in windows_device_names to + allow > 2 com ports. + +Thu Dec 16 00:49:30 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Only build winver.o and version.o when required. + +Sat Dec 11 11:06:45 1999 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::path_conv): Ensure that a trailing slash is added + to "x:" specifications. + +Fri Dec 10 20:22:41 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (WFSO): Make __stdcall. + (WFMO): Ditto. + * debug.h: Reflect above changes. + * exceptions.cc (sig_set_errno): Set errno to be in effect after a + signal handler. + (handle_sigsuspend): Use set_sig_errno to ensure that the correct errno + is set after a signal handler. + (interrupt_now): Accommodate default errno field in stack. + (intterupt_on_return): Ditto. + (sigreturn): Pop, test, and possibly restore saved errno on return from + signal handler. + * fhandler_console.cc (fhandler_console::read): Set errno to be in + effect after a signal handler. + * fhandler_serial.cc (fhandler_serial::raw_read): Ditto. + * select.cc (cygwin_select): Ditto. + (select_stuff:wait): Ditto. + (peek_serial): Ditto. + * syscalls.cc (_read): Ditto. + * wait.cc (wait4): Ditto. + * winsup.h (signal_dispatch): Add "saved_errno" field. + +Thu Dec 9 23:35:45 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (threadname_init): Use new_muto macro to set up a static + buffer for a muto. + (debug_init): Ditto. + (WFSO): Reinstate wrapper for WaitForSingleObject. + (WFMO): Reinstate wrapper for WaitForMultipleObject. + * debug.h: Declare the above two wrappers. + * exceptions.cc (events_init): Use new_muto macro to set up a static + buffer for a muto. + * sigproc.cc (sigproc_init): Ditto. + * sync.cc (muto::acquire): Don't bump waiters if we already own the + muto. + * sync.h (new): New operator. + (delete): Ditto. + (new_muto): New macro. + +Dec 08 23:50:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_nt_attribute): Add debug output. Correct behaviour + in case of NULL ACL. + * syscalls.cc (stat_worker): Allow remote drives to get stat info from + fh.fstat(). + * include/winnt.h: Add defines for W2K ACL control flags. + * include/cygwin/socket.h: Add missing PF_NETBIOS. + +Wed Dec 8 23:06:07 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Ensure that winver.o is a dependency for building the + dll. + * mkvers.sh: Attempt to call windres in a fashion that accommodates + older and newer versions. + * winver.c: Reorganize slightly to accommodate older versions of + windres. + * fhandler.cc (fhandler_disk_file::fstat): Avoid using Windows "inodes" + on disks which do not support them. + +Tue Dec 7 21:15:11 1999 Christopher Faylor <cgf@cygnus.com> + + * dll_init.cc (DllList::forkeeLoadDlls): Reverse order of Free/Load + Library calls to ensure that references are resolved. + * path.cc (mount_info::conv_to_win32_path): Ensure that returned + windows paths are always normalized regardless of whether they were in + windows format to begin with. + +Tue Dec 7 08:48:22 1999 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (parse_options): Properly detect end of known array. + +Mon Dec 6 22:32:04 1999 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Generate winver.o from winver.rc and various other things + from include/cygwin/version.h + * winver.rc: New file (adapted from donation by Mumit Khan + <khan@xraylith.wisc.edu>). + * configure.in: Find windres. + * configure: Regenerate. + * Makefile.in: Link winver.o into cygwin1.dll. + +Mon Dec 6 13:04:47 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * init.cc (dynamically_loaded): New global variable. + (dll_entry): Use. + * winsup.h (dynamically_loaded): Declare. + * dcrt0.cc (do_global_ctors): Likewise. + (set_os_type): Make static again. + (dll_crt0_1): Handle dynamically_loaded case. + * dll_init.cc (dll_dllcrt0_1): Delete. + (dll_dllcrt0): Handle dynamically_loaded case. + (dll_noncygwin_dllcrt0): Mark obsolescent. + * libccrt0.cc (cygwin_attach_noncygwin_dll): Delete. + * pinfo.cc (pinfo_init): Don't inherit parent fds if dynamically + loaded. + * include/cygwin/cygwin_dll.h (cygwin_attach_noncygwin_dll): Delete + prototype. + (_cygwin_noncygwin_dll_entry): Mark obsolescent. + +Mon Dec 6 11:09:41 1999 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Make threadsafe the default. + * configure: regenerate. + * utils/strace.cc: Fix a compiler warning. + +Sun Dec 5 15:49:43 1999 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (parse_options): Reinstate unions in parse_things, to + save space. + +Fri Dec 3 22:52:05 1999 Christopher Faylor <cgf@cygnus.com> + + Implement new signal-handling scheme which ensures that a program will + not be interrupted while in a system or cygwin DLL. + * Makefile.in: Add sync.o and dll_ofiles target. + * dcrt0.cc (alloc_stack_hard_way): Add more defensive code to ensure + that the stack is really grown. + (alloc_stack): Ditto. + (dll_crt0_1): Reorganize some initialization routines to ensure that + they occur after the heap has been initialized. + * debug.cc: Use muto for locks. Eliminate attempts to avoid being + interrupted by signals. + (threadname_init): New function. + (debug_init): Ditto. + * debug.h: Declare debug_init and threadname_init. + * exceptions.cc (stack_info::stack_info): Don't check for previous use + of get(). + (handle_sigsuspend): Simply using new signal-handling scheme. + (interruptible): New function. Determines if PC should be interrupted. + (interrupt_now): New function. Causes immediate signal dispatch. + (interrupt_on_return): New function. Causes signal dispatch on return + from cygwin or system routine. + (call_handler): Simplify to use new signal-handling scheme. + (set_process_mask): Use mask_sync muto to synchronize setting of + process signal mask. + (sig_handle_tty_stop): New function. Called when have to stop process + now. + (sig_handle): Simplify to use new signal-handling scheme. + (set_process_mask): Ditto. + (events_init): Allocate mask_sync muto. + (unused_sig_wrapper): New function. Encapsulates assembly language + signal handling support. + * fhandler.h (class select_stuff): Accommodate new signal-handling + scheme. + * fhandler_console.cc (fhandler_console): Simplify to use new + signal-handling scheme. + * fhandler_serial.cc (fhandler_serial::raw_read): Ditto. + * fhandler_termios.cc (bg_check): Ditto. + * fhandler_tty.cc (process_input): Ditto. + (fhandler_tty_slave::open): Ditto. + (fhandler_tty_slave::send_ioctl_request): Ditto. + * fork.cc: Ditto. + * path.cc (chdir): Ditto. + * select.cc: Ditto, throughout. + * shared.h: Eliminate unneeded signal enum. + * signal.cc (signal): Simplify to use new signal-handling scheme. + (sleep): Ditto. + (usleep): Ditto. + (sigprocmask): Ditto. + (sigaction): Ditto. + (pause): Use handle_sigsuspend to pause for signal. + * sigproc.cc: Change signal_arrived handle to global_signal_arrived + class. Change various mutex handles to mutos. + (proc_subproc): Simplify to use new signal-handling scheme. Use muto + for locking. + (get_proc_lock): Ditto. + (proc_terminate): Ditto. + (sig_dispatch_pending): Make a "C" function. Return status of pending + signals. + (sigproc_init): Initialize global_signal_arrived. Simplify to use new + signal-handling scheme. Initialize sync_proc_subproc muto. + (sig_send): Eliminate __SIGSUSPEND considerations. Simplify to use new + signal-handling scheme. + (__allow_sig_dispatch): Delete. + (__block_sig_dispatch): Delete. + (__get_signal_mutex): Delete. + (__release_signal_mutex): Delete. + (__have_signal_mutex): Delete. + (wait_sig): Simplify to use new signal-handling scheme. + * sigproc.h: Implement signal_arrived classes. + * smallprint.c (__small_vsprintf): Avoid printing a leading '*' in + function name with %F format. + * spawn.cc (spawn_guts): Simplify to use new signal-handling scheme. + (iscmd): Don't consider a filename to be a "command" unless it contains + a ':'. + * syscalls.cc (_read): Ditto. + (_open): Ditto. + (_close): Ditto. + * termios.cc (tcsendbreak): Ditto. + (tcdrain): Ditto. + (tcflush): Ditto. + (tcflow): Ditto. + (tcsetattr): Ditto. + (tcgetattr): Ditto. + * winsup.h: Reorganize include files. Add preliminary __sig_protect + implementation. + * cygwin/version.h: Bump current version to 1.1.0. + +Thu Dec 2 22:19:40 1999 Christopher Faylor <cgf@cygnus.com> + + * sync.cc (muto::muto): Use an event rather than a semaphore for wait + synchronization. + (muto::acquire): Rewrite to use an event and try to remove races. + (muto::release): Ditto. + +1999-12-02 DJ Delorie <dj@cygnus.com> + + * environ.cc (parse_options): switch to a static initializer; + templates are sensitive to g++ bugs. + +Fri Nov 26 12:04:23 1999 Christopher Faylor <cgf@cygnus.com> + + * net.cc (cygwin_bind): Ensure that non-Unix domain socket operations + return success correctly. + +Wed Nov 24 21:37:58 1999 Christopher Faylor <cgf@cygnus.com> + + * net.cc (cygwin_bind): Guard against incorrectly setting res to zero + when there is an error condition. + +Tue Nov 23 17:49:55 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::fhandler_base): Use better initialization + scheme. + * fork.cc (stack_base): Eliminate unneeded asm stuff. + * select.cc: Sprinkle in some comments. + * include/winnt.h: Add more CONTEXT. + +Nov 23 20:51:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_bind): Use struct sockaddr_un in AF_UNIX code. Set + errno to ENAMETOOLONG if length of pathname exceeds limit in AF_UNIX + code. Sets errno to EADDRINUSE in AF_UNIX code if file system socket + object already exists. + * syscalls.cc (setsid): Set errno to EPERM if current process is + already process group leader. + * uinfo.cc (internal_getlogin): Rearrange for better debug output. Set + pi->psid to NULL if SID can't be determined. + * include/cygwin/socket.h: Add AF_LOCAL and PF_LOCAL + (same as AF_UNIX) for POSIX compatibility. + * include/sys/un.h: Add UNIX_PATH_LEN define. Added SUN_LEN macro for + POSIX compatibility. + +Sun Nov 21 22:55:04 1999 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (parse_options): Return immediately after dealing with + NULL argument. Don't try to process it. + +Tue Nov 16 23:29:17 1999 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (kill_worker): Guard against NULL dereference when thread + safe. + +Sat Oct 30 00:59:38 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Some general cleanup. + * smallprint.c (__small_vsprintf): Accommodate new format for + __PRETTY_FUNCTION__. + +Wed Oct 27 16:13:36 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::from_registry): Don't allow the same posix path + into the mount table more than once. + * utils/mount.cc (main): Add some orthogonality to the options. + +Tue Oct 26 21:55:49 1999 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (environ_init): Turn off ntsec by default. + +Wed Oct 27 00:14:11 1999 J"orn Rennecke <amylaar@cygnus.co.uk> + + * fhandler.cc (fhandler_base::lseek): Take readahead into account. + +Tue Oct 26 16:46:54 1999 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_unlink): Return EISDIR when attempting to unlink a + directory. + +Mon Oct 25 18:05:23 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::read): Fix previous fix. + +Mon Oct 25 13:46:44 1999 Christopher Faylor <cgf@cygnus.com> + + * dll_init.cc (add): Avoid allocating name for "LINK"ed DLLs. + (DllList::forkeeLoadDlls): Only reload DLLs if they have been + dlopen'ed. + * grp.cc (parse_grp): Assign gr_mem when it is determined. + +Sun Oct 24 21:55:48 1999 Christopher Faylor <cgf@cygnus.com> + + * dll_init.cc (struct dll): Add module name. + (add): Add additional 'name' parameter for recording in dll structure. + (reserve_upto): New function. + (release_upto): Ditto. + (DllList::forkeeLoadedDlls): Ditto. + (DllList::forkeeStartLoadDlls): Remove. + (DllList::forkeeEndLoadedDlls): Ditto. + (DllNameIterator::*): Eliminate class. + (LinkedDllNameIterator::*): Ditto. + * dll_init.h: Reflect above changes. + * fork.cc (fork): Don't generate a list of dlls to load in the parent. + Let the child do it. Use new DllList::forkeeLoadDlls to load DLLs. + * smallprint.c (__small_vsprintf): No need for a sign on a Win32 error. + (small_printf): Move function here from strace(). + * strace.cc (small_printf): Move to smallprint.c + * include/sys/strace.h: Always declare small_printf. + +Sun Oct 24 02:22:13 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::read): Work around C bug. + +Tue Oct 19 22:10:21 1999 Christopher Faylor <cgf@cygnus.com> + + * dll_init.cc: Add some external symbols to allow thread-safe + compilation. + +Tue Oct 19 21:09:42 1999 Christopher Faylor <cgf@cygnus.com> + + Make minor changes throughout to accommodate new gcc merge. + * Makefile.in: Remvoe -fpermissive option when compiling using g++. + * dcrt0.cc (noload): Mark as "unused" to avoid a compiler warning. + * exceptions.cc (sigreturn): Make this "extern" since it essentially + *is* extern. + * fork.cc (sync_with_parent): Modify to cause the macro to be + considered void. + * heap.cc (sbrk): Remove debugging code. + * passwd.cc (getpass): Don't use fprintf to print the prompt. + * path.cc (mount_info::conv_to_win32_path): Accommodate compiler + warning. + * select.cc (cygwin_select): Experimental version of select which + handles fd_sets with non-standard FD_SETSIZE. + (select_stuff::wait): Ditto. + * termios.cc (tcgetattr): Avoid a compiler warning. + (cftospeed): Ditto. + (cftispeed): Ditto. + * uinfo.cc (netapi32_init): Ditto. + * winsup.h (api_fatal): Simplify and avoid a compiler warning. + * include/sys/strace.h (system_printf): Ditto. + (strace_printf_wrap): Modify to cause the macro to be considered void. + (strace_printf_wrap1): Ditto. + +1999-10-19 DJ Delorie <dj@cygnus.com> + + * Makefile.in (.cc.o): add -fpermissive to avoid g++'s conformance + madness. + * environ.cc (_findenv): rename to my_findenv to avoid newlib + prototype. + * syscalls.cc (logout): remove braces around _PATH_UTMP + +Sat Oct 16 22:53:02 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::cygdrive_posix_path): Properly terminate string + after Oct 11 change below. + +Fri Oct 15 23:02:39 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (stack_info): Reimplement stack handling routines in + new stack_info class. + (stack_info::brute_force): Just fill out the same structure as + StackWalk. + (stack_info::walk): Just fill out stack info. + (stack): Use stack_info class stuff to iterate over and display the + stack. + +Fri Oct 15 00:32:13 1999 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump some versions. + +Oct 5 11:45:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Delete calls to get_WHOEVER_sid. Move call to + uinfo_init() to the end of the function. + * fhandler.cc (get_file_owner): Substitute call to get_id_from_sid() + with call to get_uid_from_sid(). + (get_file_group): Substitute call to get_id_from_sid() with call to + get_gid_from_sid(). + * fork.cc (fork): Copy new pinfo members to child. + * grp.cc (parse_grp): Rewritten. Saves gr_passwd and all user names in + gr_mem. + (read_etc_group): Variable `group_sem' avoids endless loop. + * passwd.cc (read_etc_passwd): Variable `passwd_sem' avoids endless + loop. + * security.cc (get_sid): New function to generate SID from int values. + (get_ssid): New function to generate SID from string. + (get_pw_sid): New function to generate SID from pw_gecos entry. + (get_gr_sid): New function to generate SID from gr_passwd entry. + (get_admin_sid): Rewritten to avoid using heap space. + (get_system_sid): Ditto. + (get_creator_owner_sid): Ditto. + (get_world_sid): Ditto. + (get_id_from_sid): Try to read SIDs from /etc/passwd or /etc/group + files before using RID or Lookup... function. + (legal_sid_type): New function. + (lookup_name): Rewritten to use the logon server info, if any. + (alloc_sd): Try to use SID from /etc/passwd and /etc/group files before + call to lookup_name(). + (alloc_sd): New parameter for logon server. + (set_nt_attribute): Ditto. + (set_file_attribute): Ditto. + * shared.cc (sec_user): If SID is saved in myself, use it instead of + calling lookup_name(). + * shared.h: struct pinfo got extended user information. + * spawn.cc (spawn_guts): method for forcing reread /etc files changed. + (_spawnve): Copy new pinfo members to child. + * syscalls.cc (chown): Change call to set_file_attribute(). + (chmod): Ditto. + * uinfo.cc (internal_getlogin): New function. + (uinfo_init): Calls internal_getlogin() now. + (getlogin): Uses myself->username now. + * winsup.h: extern HANDLE netapi32_handle; Change prototypes for + set_file_attribute(), lookup_name(), get_id_from_sid(). New inline + functions get_uid_from_sid() and get_gid_from_sid(). + * utils/mkgroup.c: Adapt to the new ntsec features. + * utils/mkpasswd.c: Ditto. + +Thu Oct 14 23:46:03 1999 Christopher Faylor <cgf@cygnus.com> + + Replace calls to GetCurrentProcess() with hMainProc throughout. + * autoload.h: Implement LoadDLLinitnow() function to force the loading + of a DLL. + * cygwin.din: Export cygwin_stackdump. + * dcrt0.cc (dll_crt0): Set up hMainProc and hMainThread here. + * dll_init.cc (dll_dllcrt0_1): Ditto. + * environ.cc (parse_options): New "oldstack" option for forcing the use + of the old stack walking code. + * exceptions.cc (signals_init): Remove. + (err_printf): Remove. Use small_printf throughout. + (sfta): New helper function for StackWalk. + (sgmb): Ditto. + (stack_brute_force): Renamed from old stack walk function. Now uses + frame pointer from context handler. + (stack_walk): New function. Uses Windows API to walk the stack. + (stack): Reimplement to attempt to load imagehlp.dll. If this succeeds + use stack_walk() to display stack info, otherwise use + stack_brute_force. + (cygwin_stackdump): Temporary (?) function for displaying a stack dump + from the called location. + (stackdump): Accept new parameters for passing to stack(). + (handle_exceptions): Call stackdump with new parameters needed to walk + the stack. + * fhandler.cc (fhandler_base::read): Fix potential buffer overrun. Fix + end of buffer problems when \r is not followed by a \n. + (fhandler_base::lseek): Avoid flushing read ahead when not moving the + file pointer. + * fhandler_termios.cc (fhandler_termios::set_ctty): Add a debugging + statement. + * sigproc.cc (sigproc_init): Eliminate obsolete signals_init function. + * winsup.h: Add some declarations. + +Wed Oct 13 09:02:32 1999 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (readlink): Return errno correctly when it can't find the + target symlink. + +Tue Oct 12 13:02:08 1999 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (setsid): Only reset sid/pgid when NOT process group + leader. + * tty.cc (tty_list::allocate_tty): Don't set sid to myself. The first + tty open should do that. + +Mon Oct 11 23:13:29 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (noload): Issue appropriate Windows error. + * fhandler_termios.cc (fhandler_termios::ctty): Don't automatically set + sid, etc., unless the current pid associated with the tty's sid does + not exist. + * path.cc (mount_info::cygdrive_posix_path): Avoid copying beyond the + end of buffer or suffer garbage. + * pinfo.cc (pinfo_init): Restore sid behavior of a year ago. The sid + should be the same as the pid to be equivalent to UNIX. + (pinfo_list::operator []): Add more bounds checking. + +Sun Oct 10 14:08:30 1999 Christopher Faylor <cgf@cygnus.com> + + * select.cc (select): Return error if n > FD_SETSIZE. This is a + temporary fix. + +Sun Oct 10 13:56:14 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (iscygdrive_device): Be more precise in detecting when a + "cygdrive" device. This should allow 'mkdir -p' to work correctly. + +Fri Oct 08 08:55:31 1999 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (symlink_check_one): set errno to EINVAL on socket files + same as normal files. + +1999-10-06 DJ Delorie <dj@cygnus.com> + + * include/oaidl.h (IDispatch.GetIDsOfNames): Use DISPID* not DISPID + +1999-10-06 DJ Delorie <dj@cygnus.com> + + * exceptions.cc (err_printf): new function; print to stderr + without strace's clutter. The stacktrace functions use this, so + the stacktrace files should be cleaner. + (exception): Print segment registers also + (stack): include a peek at the function's arguments + +Tue Oct 5 16:33:17 1999 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::extend): Eliminate inappropriate test for boundary + condition. + +1999-10-04 DJ Delorie <dj@cygnus.com> + + * config/i386/longjmp.c: don't restore %fs (Paul Sokolovsky + <paul-ml@is.lg.ua>) + +1999-10-04 DJ Delorie <dj@cygnus.com> + + * localtime.c (tzsetwall): Handle Asian Windows strings correctly + (from Kazuhiro Fujieda <fujieda@jaist.ac.jp>). + +Sat Oct 2 23:00:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * include/lm*.h: Correct multiple problems in lan manager + header files. + +Sun Oct 3 14:29:53 1999 Christopher Faylor <cgf@cygnus.com> + + * sysdef/imagehlp.def: New file. Definitions for imagehlp.dll. + * include/imagehlp.h: Ditto. + * include/winbase.h: YA missing structure. + +Fri Oct 1 11:16:00 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Correct setting of FILE_DELETE_CHILD. + (get_file_attribute): Read ntea attributes only if ntsec is disabled. + * syscalls.cc (_unlink): Don't queue file into delqueue if DeleteFile + returns ERROR_ACCESS_DENIED. + +1999-09-30 Mumit Khan <khan@xraylith.wisc.edu> + + * init.cc (dll_entry): Remove static_load case. + * dcrt0.c (set_os_type): Make it externally visible. + * dll_init.cc (dll_dllcrt0_1): Update noncygwin initialization for + post-b20.1 code. + +1999-09-30 DJ Delorie <dj@cygnus.com> + + * times.cc: declare _timezone and _daylight properly + +Wed Sep 29 23:57:40 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Remove EXIT_SIGNAL mask when exiting. It is not + correct given changes to really_exit. + * select.cc (peek_serial): Work around apparent Windows bug. + +1999-09-29 Norbert Schulze <Norbert.Schulze@rhein-neckar.de> + + * times.cc (timezone): revert 'return TZ if set' patch. + * times.cc (timezone): uses now tzset() and _timezone. + * times.cc (gettimeofday): ditto. + * localtime.c (tzsetwall): no negative minutes if offset is negativ. + * localtime.c (tzsetwall): minutes place holder was missing if + minutes == 0 and seconds !=0 (h:0:s). + * localtime.c (tzsetwall): if timezone has no daylight saving + (tz.StandardDate.wMonth==0) generate no daylight saving parameters. + +Sat Sep 25 15:11:04 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_termios.cc (fhandler_termios::bg_check): Accept a new + argument to control whether we should worry about blocking signals. + * fhandler.h: Ditto. + * syscalls.cc (read_handler): Accept a new argument for passing to + bg_check. + (read): Inform read_handler if signals are blocked or not. + * termios.cc: Throughout, reorganize to always block signals before + calling bg_check. + +Sat Sep 25 13:36:06 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_termios::line_edit): Add an extra argument. + * fhandler_serial.cc (fhandler_serial::open): Maintain consisten + fAbortOnError state. + * fhandler_termios.cc (fhandler_termios::line_edit): Use new + "always_accept" argument to control whether input_done is set + regardless of canonical state. + * fork.cc (vfork): Duplicate "parent's" fd table. + * hinfo.cc (hinfo::dup_worker): New method. + (dup2): Use new dup_worker method. + (hinfo::fixup_after_fork): Lock dtable prior to operating on it. + (hinfo::vfork_child_dup): New method. Duplicates dtable for vfork. + (hinfo::vfork_parent_restore): New method. Restores dtable when vfork + exits. + * net.cc (set_winsock_errno): Make global. + * pipe.cc (pipe): Default mode to binary unless *explicitly* set to + text. + * select.cc (set_bits): Test that {read,write,except}_selected are + active before setting a bit. + (peek_pipe): Short circuit tests if we're not checking for readable + or "except"able handles. + (thread_socket): Use read check for exitsock as old method relied on + undocumented, unreliable behavior. + (start_thread_socket): Perform more setup on exitsock to improve thread + exit signalling. + (socket_cleanup): Connect to the exitsock to force thread_socket thread + exit. + * winsup.h (hinfo): Add preliminary vfork stuff. + * include/winsock.h: Add shutdown() how types. + * include/sys/socket.h: Add socketpair declaration. + +1999-09-22 DJ Delorie <dj@cygnus.com> + + * syscalls.cc (chown): never return ENOSYS - just pretend it + works. + +Wed Sep 22 00:47:56 1999 Christopher Faylor <cgf@cygnus.com> + + * select.cc (MAKEready): Need to initialize 'fd' or open tests in + peek fail. + +Mon Sep 20 17:07:37 1999 Christopher Faylor <cgf@cygnus.com> + + * smallprint.c (__small_vsprintf): Fix '%+' handling. + +Thu Sep 16 21:48:13 1999 Christopher Faylor <cgf@cygnus.com> + + * utils/cygcheck.cc (dump_sysinfo): Deal with a new compiler error. + * utils/strace.cc (make_command_line): Change to a void * argument, as + is required for SetConsoleCtrlHandler. + +Thu Sep 16 20:47:12 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (__api_fatal): Rearrange slightly. + * fhandler.h (set_ctty): Change to void. + * fhandler_termios.cc (fhandler_termios::set_ctty): Ditto. + * select.cc (thread_pipe): Change to a void * argument, as is required + for thread functions. + (thread_socket): Ditto. + (thread_serial): Ditto. + * include/winbase.h: Mark ExitProcess as noexit. + +Thu Sep 16 18:32:12 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (ctrl_c_handler): Make WINAPI, as required by + SetConsoleCtrlHandler. + +Thu Sep 16 17:48:05 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (thread_stub): Make WINAPI, as required by CreateThread. + * fhandler_tty.cc (process_input): Ditto. + (process_output): Ditto. + (process_ioctl): Ditto. + * select.cc (thread_pipe): Ditto. + (thread_serial): Ditto. + (thread_socket): Ditto. + * sigproc.cc (wait_proc): Ditto. + (wait_sig): Ditto. + * window.cc (winMain): Ditto. + +Wed Sep 15 20:58:37 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Let fatal signals through regardless of + signal_mutex. + * fhandler.h (fhandler_base): Make bg_check virtual. + (fhandler_termios::bg_check): Eliminate the second argument. + * fhandler_console.cc (fhandler_console::ioctl): Check for background + operation. + * fhandler_termios.cc (fhandler_termios::bg_check): Eliminate the + second argument. A negative arg 1 means the same thing. + * ioctl.cc (ioctl): Add debugging output. + * syscalls.cc (_write): Eliminate second argument to bg_check. + * termios.cc (tcsendbreak): Check for background operation. + (tcdrain): Ditto. + (tcflush): Ditto. + (tcflow): Ditto. + (tcsetattr): Reorganize on similar lines to above routine. + +Wed Sep 15 15:25:04 1999 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): Only set read_ready if bg_check returns <= 0. + (peek_console): Ditto. Correct PeekConsole conditional so that the for + loop breaks eventually. + +Wed Sep 15 00:21:40 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (set_console_handler): Allocate security stuff here + since it is needed earlier in the process now. Allocate a shared event + for use in synchronizing CTRL-C events that happen while the process is + still initializing. + (ctrl_c_handler): Use the above event to synchronize with the cygwin + startup process, waiting for the signal thread to come alive before + trying to send a signal. + (signals_init): Don't call set_console_handler() here, since it is now + handled much earlier in cygwin initialization. + * shared.cc (shared_init): Move out security setup. + * sigproc.cc (wait_sig): Activate the console_handler_thread_waiter so + that any waiting thread which is handling ctrl-c's will wake up and + send a signal, if appropriate. + +Tue Sep 14 23:49:39 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (ctrl_c_handler): Handle ctrl-c events ourself, using + the "UNIX way". + * fhandler_console (tty_list::get_tty): New function. + * shared.h: Add some additional things to tty_min class for handling + ctrl-c. + +1999-09-14 DJ Delorie <dj@cygnus.com> + + * dir.cc (rmdir): return ENOTDIR for regular files on 9x + +Tue Sep 14 00:01:59 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.h (ForceCloseHandle2): New macro. + * fhandler.cc (set_inheritance): Accept name of handle as optional + third argument. Use this in ForceCloseHandle2/ProtecHandle2. + * fhandler.h: Implement bg_check() method. + * fhandler_console.cc (get_tty_stuff): Initialize more tty stuff. + (fhandler_console::read): Check for background read. + * fhandler_termios.cc (fhandler_termios::bg_check): New function. + Performs appropriate action given background read or write. + * fhandler_tty.cc (fhandler_tty_slave::write): Replace background check + code with new method. + (fhandler_tty_slave::read): Ditto. + (fhandler_tty_common::set_close_on_exec): Pass output_mutex name to + set_inheritance. + * select.cc: Throughout check that the fd is still open before polling. + (peek_pipe): Check for background read. + (peek_console): Ditto. + * shared.h: Move ntty from tty into tty_min. + * syscalls.cc (read_handler): Check for background read. + (_write): Check for background write. + +Sat Sep 11 16:24:21 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (iscygdrive_device): New macro. + (mount_info::conv_to_win32_path): Only attempt "cygdrive" translation + when passed /cygdrive/something. + (mount_info::write_cygdrive_info_to_registry): Store in-memory copy of + cygdrive prefix automatically. + (mount_info::read_cygdrive_info_from_registry): Reorganize for new + write_cygdrive_info_to_registry functionality. + (mount): Ditto. + +Fri Sep 10 15:44:11 1999 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (pathconf): Make first arg 'const'. + +1999-09-10 DJ Delorie <dj@cygnus.com> + + * exec.cc (_execve): check for an empty environment + +Wed Sep 8 10:24:12 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Generalize test for initial zeroes in + exec/fork block. + * fhandler.cc (fhandler_disk_file::open): Don't attempt #! detection on + non-disk files. + * fhandler.h: Use generic status bit set/clear macros. Use bitmask for + fhandler_termios state. + * fhandler_console.cc: Rename "tty_stuff" to more descriptive + "shared_console_info". + (fhandler_console::read): Reset console state before a read if + appropriate. + (fhandler_console::open): Improve check for setting console state. + (fhandler_console::fixup_after_fork): Ditto. + (set_console_state_for_spawn): New function. + * fhandler_termios.cc (fhandler_termios::tcinit): Use new method for + determining if initialized. + * fhandler_tty.cc (fhandler_tty::init_console): Avoid sending handle to + init or it will be closed. + * fork.cc (per_thread::set): Make this method non-inline, temporarily. + * select.cc (peek_console): Call set_input_state to ensure that the + console is in the correct state. + * shared.h (child_info): Make zero element an array for future + tweaking. + (tty_min): Change initialized element to a bit field. Define bit field + macros for manipulating it. + * sigproc.cc (wait_sig): Wake up every half second in a (vain?) attempt + to work around Windows 98 hanging problem. + (wait_subproc): Ditto. + * spawn.cc (spawn_guts): Use new "set_console_state_for_spawn" prior to + starting a process. + * winsup.h: Define generic macros for manipulating a method's status + field. + (per_thread): Move inline method to fork. + +Mon Sep 6 13:36:34 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_tty_master::init_console): Remove retrieval + of stderr handle since it is not required for correct init operation. + * hinfo.cc (hinfo_init): Reorganize to accommodate potential closing of + console handles by fhandler_console::init. + (init_std_file_from_handle): Set standard handle as appropriate. + (hinfo::de_linearize_fd_arry): Ditto. + * fhandler_console.cc (fhandler_console::init): Conditionally close + handle only if it is valid. + +Sun Sep 5 22:43:21 1999 Christopher Faylor <cgf@cygnus.com> + + * utils/cygcheck.cc: Make sure that GetDiskFreeSpaceExA is defined as a + __stdcall function or the stack will suffer. For now, don't sort mount + output as more work copying the individual mntent elements is required. + +Sat Sep 4 19:01:00 1999 Christopher Faylor <cgf@cygnus.com> + + * include/glob.h: Ensure that glob*() functions can be properly accessed by + programs using the DLL. + +Sat Sep 4 18:49:04 1999 Christopher Faylor <cgf@cygnus.com> + + * heap.cc (heap_init): Tweak debugging output. + * sigproc.cc (sig_send): Catch obvious impossible values from + GetLastError. + +Sat Sep 4 18:43:49 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Protect against signal + dispatch. + (fhandler_tty_slave::write): Only wait a fixed amount of time to + receive a an output_done_event. + (fhandler_tty_slave::tcflush): Protect against signal dispatch. + +Sat Sep 4 18:30:42 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_sig): Temporarily remove OutputDebugString. It + seemed to be causing sporadic hangs. + (call_handler): Save and restore di and si. + (sigreturn): Ditto. + +Fri Sep 3 23:07:44 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_termios.cc (fhandler_termios::line_edit): Properly deal with + sending characters to slave when !iscanon. + +Fri Sep 3 18:15:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::fstat): Add S_ISCHR to mode bits. + * fhandler_tape.cc (fhandler_dev_tape::fstat): Erase setting of S_ISCHR + since it's set in fhandler_dev_raw::fstat now. + +Thu Sep 2 22:11:03 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::conv_to_win32_path): Fix problem with + calculating relative path at root. + +Wed Sep 1 23:24:43 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::fhandler_base): Don't use default binmode + for console. + +Wed Sep 1 20:51:05 1999 Christopher Faylor <cgf@cygnus.com> + + * smallprint.c (__small_vsprintf): Allow field width argument with 'l' + modifier. Consolidate processing of field width. + * uname.cc (uname): Eliminate space in "release" field. + +Tue Aug 24 10:46:24 1999 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * fhandler_console.cc (write_normal): Write '\n' corresponding to + DWN if the cursor is out of the window. + +Wed Aug 25 22:16:46 1999 Christopher Faylor <cgf@cygnus.com> + + * smallprint.c (rn): Deal with positive as well as negative signs. + (__small_vprintf): Handle '+', 'l', and '%' format types. + +Wed Aug 25 00:38:49 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Zero heap information in user_data to + work around mutant startup code. + +Tue Aug 24 00:03:22 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sig_send): One more end-of-process race detection. + +Mon Aug 23 21:37:07 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout, remove malloc.h. + * debug.cc: Initialize handle list so that it will not be copied on + fork. + * exceptions.cc (_sigreturn): Zero windows error on exit. It's + meaningless after a signal dispatch. + * fhandler_console.cc (fhandler_console::de_linearize): Improve error + messages. + * shared.h: Increment fork magic number. + * sigproc.cc (sigproc_terminate): Close all handles prior to calling + proc_terminate if running in signal thread. + (sig_send): Eliminate bogus ResetEvent on a semaphore. Add code for + potentially dealing with problems when this code is interrupted via a + signal dispatch. + * times.cc (timezone): Use __small_sprintf. + * uname.cc (uname): Ditto. Also use strcpy instead of sprintf where + appropriate. + +1999-08-23 DJ Delorie <dj@envy.delorie.com> + + * localtime.c: export timezone, daylight, tzname as _* + * times.cc: don't export timezone, daylight, tzname + (timezone): return TZ if set. + (cygwin_tzset): not needed. + +Thu Aug 19 13:46:47 1999 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork): Remove pinfo lock. It is in allocate_pid, now. + * spawn.cc (_spawnve): Ditto. + * pinfo.cc (pinfo_init): Ditto. + (lock_pinfo_for_update): Impreove debug output. + (pinfo_list::allocate_pid): Lock pinfo mutex here. + +1999-08-19 DJ Delorie <dj@cygnus.com> + + * Makefile.in (tooldir): If we're building natively, drop the + $(target_alias) on include and lib's install (i.e. /usr/include + instead of /usr/include/i686-cygwin). + +Thu Aug 19 01:11:25 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sig_send): Avoid a race with proc thread when executing + due to a signal. + +Wed Aug 18 16:37:59 1999 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * fhandler_console (fhandler_console::fillin_info): Avoid setting + scroll_region.Bottom when it is not known. + (fhandler_console::write_normal): Add various fixes for console + scrolling. + +Wed Aug 18 16:18:22 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc: Add more precise end-of-process detection. + +Wed Aug 18 00:03:47 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sig_send): Work around apparent Windows bug which + occasionally results in bogus error messages when a signal is + dispatched. + +1999-08-17 DJ Delorie <dj@cygnus.com> + + * localtime.c (tzsetwall): Deduce TZ more accurately. + +Tue Aug 17 18:00:03 1999 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): Correct detection of process group for + backgrounded processes. + +Tue Aug 17 10:24:49 1999 Christopher Faylor <cgf@cygnus.com> + + * include/winnt.h: Fix typo in IMAGE_FIRST_SECTION definition. + +Sun Aug 15 19:11:49 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * gcrt0.c (__eprol): Avoid namespace pollution. + (_monstartup): Turn into a constructor function and prevent multiple + invocations. + +Mon Aug 16 10:03:00 Corinna Vinschen <corinna@vinschen.de> + + * utils/mkgroup.c: Correct call to LookupAccountSid for retrieval of + 'None'. + +Mon Aug 16 00:24:29 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (locker): Improve signal mutex locking. + * exceptions.cc (sig_handle): Pass STOP signals to call_handler to + ensure honoring of signal_mutex. + (call_handler): Move STOP code here after acquistion of signal_mutex. + * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Track + lockers for debugging. + (fhandler_tty_common::__release_output_mutex): Ditto. + (fhandler_slave::write): Fix faulty signal blocking code. + * fork.cc (fork_copy): Remove ancient if 0. + (fork): Conditionalize "FORKDEBUG" under DEBUGGING. + * sigproc.cc (proc_terminate): Reduce pinfo lock time. + (sigproc_terminate): Set sig_loop_wait after getting signal_mutex. + (__get_signal_mutex): Reorganize for less strace output when not + DEBUGGING. + (__release_signal_mutex): Ditto. Reorganize case where !sig_loop_wait. + (have_signal_mutex): Returns true if current thread has the mutex. + * wait.cc (wait4): Change debugging message. + +Sat Aug 14 0:10:00 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::raw_read): Set correct errno from Win32 + error when ReadFile fails. + (fhandler_base::raw_write): In case of ERROR_DISK_FULL, return + bytes_written only if bytes_written > 0. + * errno.cc: Map ERROR_DISK_FULL to ENOSPC. + +Fri Aug 13 14:22:12 1999 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): Honor ignra argument. + +Fri Aug 13 00:45:00 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Ensure that hExeced is set to proper state + when parent has exited. + +Thu Aug 12 14:09:30 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (getsem): Fix typo which prevented sending signals to + other processes. + +Wed Aug 11 22:06:33 1999 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Export glob and globfree. + * glob.h: Move to include. + * Makefile.in: Correct glob.h dependencies. + +Wed Aug 11 19:41:04 1999 Sergey Okhapkin <sos@prospect.com.ru> + + * fhandler.cc (fhandler_disk_file::fstat): Check if the file is unix + domain socket. + (fhandler_disk_file::open): Call set_socket_p(). + * fhandler.h: Add new fhandler type flags (FH_LOCAL, FH_FIFO). + (fhandler_base): get/set_socket_p - new member functions. + (fhandler_socket::addr_family): Add new member, currently unused. + (fhandler_socket::get/set_addr_family): Add new functions to access + addr_family. + * include/sys/un.h: New file. + * net.cc: Include <sys/un.h> + (cygwin_socket): Always create socket of AF_INET family, store + argument's family. + (get_inet_addr): New static function. Converts AF_UNIX requests into + corresponding AF_INET requests. + (cygwin_sendto): Use get_inet_addr(). + (cygwin_connect): Likewise. + (cygwin_accept): Check for sockaddr length. + (cygwin_bind): Implement AF_UNIX. + * path.h (PATH_SOCKET): Add new enum value. + (path_conv::issocket): Add new member function. + (SOCKET_COOKIE): Add new define. + * syscalls.cc (chmod): Mark socket files with system file attribute. + +Wed Aug 11 17:22:46 1999 Corinna Vinschen <corinna@vinschen.de> + + * utils/mkgroup.c (main): Generate "None" group when + invoked via mkgroup -l. + +Tue Aug 10 21:30:31 1999 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): Handle type ahead where appropriate. + * sigproc.cc (proc_can_be_signalled): Revert to previous method for + determining signalability. + (getsem): Move PID_INITIALIZING test here. + * wait.cc (wait4): Improve debug output slightly. + +Mon Aug 9 23:27:44 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Add additional check for valid hExeced. + * exceptions.cc (call_handler): Implement a raceless way to track + pending_signals. + * signal.cc (kill_worker): Make calls from non-main threads synchronous + or signals from a tty thread don't work right. + * sigproc.cc (sig_send): Localize pending_signals assignment to only + the wait_sig thread. + (__get_signal_mutex): Don't attempt to grab a mutex if signal_mutex + hasn't been assigned yet. Add more strace debugging information when + -DDEBUGGING. + (__release_signal_mutex): Don't attempt to release a mutex if + signal_mutex hasn't been assigned yet. Add more strace debugging + output. + (wait_sig): Attempt to eliminate race in setting of pending_signals. + * spawn.cc (spawn_guts): Set hExeced to INVALID_HANDLE_VALUE so that it + will be obvious when a process is actually just an execed stub. + * strace.cc (strace_vsprintf): Output a "!" after the pid when + executing in an execed stub. + +Mon Aug 9 17:17:13 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout, eliminate in() and out() macros. + * winsup.h (tty_attached): Accept an argument indicating the pinfo + structure to query. + * exceptions.cc (really_exit): Cosmetic change. + * external.cc (fillout_pinfo): Use queried pinfo structure for + determining tty number, not *our* number. + * net.cc: More workarounds. + * path.cc (get_device_number): Supply argument to tty_attached. + * syscalls.cc (ctermid): Ditto. + * strace.cc (strace_dump): Remove. + * include/sys/strace.h: Eliminate obsolete stuff. + +Sun Aug 8 22:54:45 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Process all signals on return from a + signal dispatch. + * sigproc.cc (proc_can_be_signalled): Guard against waiting too long + when exiting. + (proc_exists): Don't report an exited process as "existing". + (proc_terminate): Close handle prior to testing for existence so that + proc_exists will not always return TRUE. Eliminate use of zap_subproc. + (stopped_or_terminated): Eliminate use of zap_subproc. + (zap_subproc): Delete. + +Sun Aug 8 22:17:36 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_tty_master::init): hThread must remain + open. Previous change to close it was wrong. + +Sun Aug 8 20:35:33 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc: Initalize NO_COPY variables. + * pinfo.cc (record_death): Don't be so insistent about getting + the pinfo lock. + * sigproc.cc (proc_terminate): Tighten the region protected by + the pinfo lock. + * spawn.cc (spawn_guts): Eliminate the pinfo lock when reparenting + as it is no longer required. + (_spawnve): Tighten the region protected by the pinfo lock. + +Sun Aug 8 18:26:51 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sig_send): Add more unfortunate guards against a + system call being interrupted by a signal dispatch. + +Sat Aug 7 15:38:42 1999 Christopher Faylor <cgf@cygnus.com> + + * security.cc (get_admin_sid): Ensure that returned buf is not copied + on a fork. + (get_system_sid): Ditto. + (get_create_owner_sid): Ditto. + (get_world_sid): Ditto. + +Sat Aug 7 15:17:25 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (process_input): Reset signal_arrived event prior to + calling console read as this is now a requirement for functions which + detect signal_arrived. + (fhandler_tty_master::write): Allow signals to operate prior to raising + SIGTTOU. + (fhandler_tty_master::read): Allow signals to operate prior to raising + SIGTTIN. + * select.cc (peek_pipe): Detect attempt to read from tty not in our + process group as a "read_ready" event. + * include/shellapi.h: Add missing defines. + * utils/ps.cc: Output windows pid as unsigned for Windows 9x. + +Sat Aug 7 14:30:00 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_creator_owner_sid): New function. + * shared.cc (sec_user): calls `get_creator_owner_sid' in creation + of the security attributes structure additionally. + +Fri Aug 6 13:04:40 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Allow failure from OpenProcess. The parent + may have exited due to 7/31 change. + +Thu Aug 5 22:54:07 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (wait_for_me): Break out as a common function to check + that the current process is ready to handle signals. + (proc_can_be_signalled): Treat myself differently. + +Thu Aug 5 21:24:20 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console): Don't call tcinit here. + (fhandler_console::read): Don't reset signal_arrived here. + * syscalls.cc (_read): Set it here instead. + * fhandler_termios.cc (fhandler_termios::line_edit): Only call + accept_input when input is ready. Ignore iscanon in this case. + * fhandler_tty.cc (fhandler_tty_slave::init): Don't call tcinit here. + +Thu Aug 5 16:02:25 1999 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (handle_output_debug_string): Ignore errors reading + from child memory as they seem to occur due to a process exiting. + (close_handle): New, defensive code. + +Thu Aug 5 13:32:43 1999 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (remove_handle): New function. + (add_child): Speed up slightly. + (proc_child): Use output of remove_child in CloseHandle. + +Thu Aug 5 12:38:50 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Don't protect subproc_ready if it is NULL. + (do_exit): Avoid calling close_all_files if exiting from exec stub. + * net.cc: Reorganize to work around some compiler bugs. + * spawn.cc (spawn_guts): Set hExeced only after child stuff has been + completely initialized. + * syscalls.cc (_open): Protect against signals. + * utils/strace.cc (warn): New function. + (add_child): Issue warning when can't duplicate child process handle. + +Wed Aug 4 21:35:28 1999 Christopher Faylor <cgf@cygnus.com> + + * psapi.h: New file. + +Thu Aug 4 10:28:00 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: Eliminate MALLOC_CHECK calls. + (lookup_name): New function simplifies the retrieval of user and group + names. + (alloc_sd): Call `lookup_name' instead of `LookupAccountName'. + * shared.cc (sec_user): Call `lookup_name' instead of + `LookupAccountName'. Eliminate 'free' call on stack space. + * winsup.h: Declare `lookup_name'. + +Wed Aug 4 16:24:02 1999 Christopher Faylor <cgf@cygnus.com> + + * a.out.h: Fix cut and paste from mime email typos. + +Mon Aug 2 19:08:48 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Fix utils dependency. Make clean more assertive. + * path.cc (mount_info::conv_to_win32_path): Fill in correct destination + when a device name is detected. + * syscalls.cc (chown): Always succeed when referencing a cygwin device. + (chmod): Ditto. + * net.cc (get_ifconf): Eliminate holdover from previous change. + +Mon Aug 2 13:07:44 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_global_ctors): Remove previous change. It was just + wrong. + +Sun Aug 1 23:21:28 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout rename 'slave_alive' handle to 'inuse'. + * shared.h: Implement tty_attached() macro to determine when an actual + tty is associated with the process. + (class tty): Add some methods for manipulating an "inuse" event that is + common to both master and slave parts of a tty. + * dcrt0.cc (do_exit): Use tty_attached() to determine if signal should + be sent to process group. + * external.cc (fillout_pinfo): Return -1 if tty is not attached (i.e, + attached to a console). + * fhandler.h: Move more stuff into fhandler_tty_common and out from sub + classes. + * fhandler_console.cc (fhandler_console::read): Send SIGWINCH signal to + *correct* process group. + (fhandler_console::open): Fix incorrect argument ordering in set_ctty. + (fhandler_console::de_linearize): Remove unneeded handle resets. + * fhandler_tty.cc (fhandler_tty_slave::open): Fix incorrect argument + ordering in set_ctty. Use tty create_inuse method to create inuse + event. + (fhandler_tty_slave::close): Delete. + (fhandler_tty_slave::dup): Delete. + (fhandler_tty_slave::write): Minor cleanup of flow of control. + (fhandler_tty_common::dup): Subsume fhandler_tty_slave dup method. + (fhandler_pty_master::fhandler_pty_master): Zero inuse field. + (fhandler_pty_master::open): Set inuse field. + (fhandler_tty_common::close): New, superclass method. + (fhandler_tty_common::set_close_on_exec): Handle inuse field. + (fhandler_tty_common::fixup_after_fork): Ditto. + (fhandler_tty_slave::set_close_on_exec): Delete. + (fhandler_tty_slave::fixup_after_fork): Delete. + * path.cc (get_device_number): Use tty_attached() to figure out + /dev/tty. + * select.cc (peek_console): Send SIGWINCH signal to *correct* process + group. + * tty.cc (tty::master_alive): New method. + (tty::create_inuse): New method. + +Sun Aug 1 16:23:22 1999 Christopher Faylor <cgf@cygnus.com> + + * net.cc (get_ifconf): Use alloca for temporary buffer. + +Sun Aug 1 01:38:20 1999 Christopher Faylor <cgf@cygnus.com> + + Modify de_linearize methods throughout to set unix and msdos path + names. + * dcrt0.cc (do_exit): Only remove shared memory when we're done with + it. + * exceptions.cc (try_to_debug): Move static variable outside of the + function so that it can more easily be set with gdb. + * fhandler_console.cc (fhandler_console::open): Handles are typically + hexadecimal in debugging output. + (fhandler_console::open): Do not open inherit console handles by + default. + (fhandler_console::dup): Just use open method to "duplicate" a console + handle. + (fhandler_console::fixup_after_fork): Do *not* close handles here since + they have not been inherited. + (fhandler_console::de_linearize): Ditto. + * utils/strace.cc (create_child): Correct debugging flags when not + tracking forked processes. + +Sat Jul 31 20:10:58 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_global_ctors): Ensure that ctors are not called more + than once per session. + * fork.cc (fork): Use sig_protect to protect against signals during + fork. + * pinfo.cc (lpfu): Show windows pid in debugging message as this is + generally more useful. + * pinfo.cc (unlock_pinfo): Issue an error if ReleaseMutex fails. + (pinfo::record_death): Actually unlock pinfo on exit rather than allow + ExitProcess to do this since ExitProcess can sometimes take a *long* + time. + * spawn.cc (spawn_guts): Ensure that pinfo is always unlocked. + +Thu Jul 29 23:43:24 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout, consolidate pgid processing for console and tty into + fhandler_termios and tty_min. + * debug.h: Make WF?O functions the defaults for dealing with Waits. + These functions attempt to work around signal interrupt problems. + * debug.cc: Ditto. + * exceptions.cc (call_handler): Don't wait a long time for second + attempt to get signal mutex. + * fhandler_console.cc (fhandler_console::open): Set the "controlling + tty". + * fhandler_termios.cc: Move the ctty and pgid functions here. + (fhandler_termios::line_edit): Fix debug output. + * fhandler_tty.cc (fhandler_tty_slave_write): Use sig_protect to + protect against output_mutex deadlock. + * fork.cc (get_vfork_val): Conditionalize with NEWVFORK. + * syscalls.cc (setsid): Add debugging output. + (setpgid): Reorganize and add debugging output. + * tty.cc (tty::init): Use a method to clear the sid. + +Thu Jul 29 23:42:53 1999 Christopher Faylor <cgf@cygnus.com> + + Patch from Egor Duda <deo@logos-m.ru>: + * grp.cc (read_etc_group): Use a default /etc/group entry when one + doesn't exist. + (getgrgid): Ditto. + * passwd.cc (read_etc_passwd): Use a default /etc/passwd entry when one + doesn't exist. + (search_for): Ditto. + * uinfo.cc (read_etc_group): Remove some defines. + * winsup.h: Move them here. + +1999-07-29 Bernd Schmidt <bernds@cygnus.co.uk> + + * Makefile.in (SUBDIRS_AFTER): Build mingw before utils. + * utils/Makefile.in (MINGW_LDFLAGS): Add "-B../mingw/" + + +Tue Jul 27 23:31:28 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc: Add experimental vfork_storage initialization. + (do_exit): Ditto. + * exec.cc: Use _spawnve throughout as a common interface for execing a + program. + * fork.cc (vfork): Add beginnings of true vfork support. + * path.cc (sort_by_posix_name): Remove special casing of zero length + names since they should now be eliminated earlier on. + (sort_by_native_name): Ditto. + (mount_info::del_item): Remove hole from mount table specifically, here + or suffer weird behavior. Suggested by Andrew Dalgleish + <andrewd@axonet.com.au>. + * shared.cc: Make SHAREDVER "unsigned" to avoid a compiler warning. + * spawn.cc : Accommodate additional argument to _spawnve, throughout. + (_spawnve): Make this a global function and take an hToken argument so + that it can be used by sexecve. Accommodate experimental vfork + functionality. + * winsup.h: Add initial support for per-thread vfork stuff. + * include/cygwin/version.h: Bump shared memory version number. + +Mon Jul 26 20:59:58 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (sort_by_posix_name): Report two zero length strings as being + equal or suffer an infinite loop. + (sort_by_native_name): Ditto. + * shared.cc (shared_info::initialize): Refuse to use a different DLL's + shared memory. + * shared.h: Fix mask for child_info sanity test. + +Sun Jul 18 16:30:31 1999 Christopher Faylor <cgf@cygnus.com> + + * security.cc: Various changes from Corinna. + +Sat Jul 17 22:33:45 1999 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork): Change DuplicateHandle slightly. + * security.cc (get_nt_attribute): Ignore error return from + set_process_privileges. + (set_nt_attribute): Ditto. + +Sat Jul 17 00:45:34 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.h: Fix ForceCloseHandle1 in non-debug case. + +Fri Jul 16 23:47:31 1999 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (proc_can_be_signalled): Accommodate different flavors of + myself. + * include/ddeml.h: Add missing struct. + * include/wingdi.h: Add missing defines. + +Fri Jul 16 23:01:30 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Attempt to cope when srcdir is a relative pathname. + * fork.cc (fork): Pass handle to parent process to fixup_after_fork. + Eliminate excess unlock_pinfos. + * hinfo.cc (hinfo::fixup_after_fork): Use inherited parent handle + rather than try to open the parent process explicitly. + * pinfo.cc (record_death): Cosmetic change. + * sigproc.cc (wait_sig): Add a debugging statement. + * winsup.h: Reflect change of argument for fixup_after_fork. + +Fri Jul 16 11:07:55 1999 Christopher Faylor <cgf@cygnus.com> + + * shared.h: Eliminate record_death_nolock. Just pass an argument to + record_death. + * pinfo.cc (record_death_nolock): Ditto. + * dcrt0.cc (__api_fatal): Use record_death with FALSE argument rather + than record_death_nolock. + * exceptions.cc (really_exit): Ditto. + * fork.cc (fork): Remove debugging statement. + +Wed Jul 14 22:08:52 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout, make parent_alive a local variable. Rename 'alive_parent' + to 'my_parent_is_alive'. + * autoload.h: Improve the description of the autoload mechanism. + * dcrt0.cc: Define parent_alive here. + (dll_crt0_1): When debugging, rotect handles inherited from fork/exec. + Force signal thread to finish initializing prior to calling main. + (dll_crt0): Reorganize child_info stuff to allow common initialization. + Accept parent_alive handle from invoker and ensure that this is not + inherited by other processes. + (do_exit): Ensure that exit_state is not duplicated by a fork. + (__api_fatal): Call 'try_to_debug' directly. + * debug.cc: Increase the size of the handle list. + (threadname): Add an optional argument to control locking. + * exceptions.cc (error_start_init): Make this a "C" function. + (try_to_debug): Ditto. Also, use Sleep rather than pause and loop so + that gdb can get in to interrupt things. + (sig_handle): + * external.cc (fillout_pinfo): Reorganize slightly and plan for the + future. + * fhandler.h: Add an argument to show the name of the handle for error + messages to fork_fixup. + * fhandler.cc (fhandler_base::fork_fixup): Ditto. + (set_inheriting): Rename a variable for clarity. + (fhandler_base::fixup_after_fork): Pass in the name of the handle to + fork_fixup. + * fhandler_tty (fhandler_tty_common:fixup_after_fork): Ditto. + (fhandler_tty_slave:fixup_after_fork): Ditto. + (fhandler_tty_master:fixup_after_fork): Ditto. + * fhandler_windows.cc (fhandler_windows::fixup_after_fork): Ditto. + * fhandler_console.cc (fhandler_console::open): Specifically open + console with ENABLE_PROCESSED_INPUT. + * fork.cc (sync_with_child): Call abort when DEBUGGING and there's an + error. + (resume_child): Ditto. Also, allow an ERROR_INVALID_HANDLE error if it + can't be duplicated as they seem to occur occasionally when the parent + copies the stack. + (fork): Use init_child_info to initialize structure passed to child. + Remove start time setting in favor of common function. Don't mess with + parent's parent_alive. + * heap.cc (sbrk): Simply code slightly. + * hinfo.cc (hinfo::dup2): Improve error handling. + * pinfo.cc (set_myself): Set start time here since it is called by + everything which sets myself. + (pinfo_init): Remove start_time setting in favor of common function. + * shared.h (pinfo): Reorganize so that signal stuff falls into section + of pinfo which is automatically zeroed when a new pid is initialized. + (PROC_MAGIC): Increment to detect cygwin1.dll's memory passing + disparities. + * sigproc.cc (proc_alive): Make this a function. Wait for target pid + to initialize. + (my_parent_is_alive): Rename from alive_parent. + (proc_can_be_signalled): Renamed from proc_alive macro. + (proc_exits): Use proc_can_be_signaleed(). + (proc_subproc): Don't put parent_alive in child. + (proc_terminate): Close hwait_subproc in a race-safe way. Ditto + sync_proc_subproc. + (sigproc_terminate): Always terminate proc_subproc thread first or it + may try to use signal thread as it is going away. Wait for signal + thread to exit. + (sig_send): Use proc_can_be_signalled(). + (init_child_info): New function. Initializes memory block passed by + spawn/fork. + (mutex_stack): Add thread name field. + (sig_wait): Set active state after all handles have been set up and + before protecting the handles. Use ForceCloseHandle to close + subproc_ready as it is now protected. Close signal_mutex here. + * sigproc.h: Accommodate alive_parent rename. + * spawn.cc Use init_child_info to initilize memory block passed to + subprocess. + * strace.cc (__system_printf): Write to screen before writing to strace + log. Only write to strace log if we're actually stracing. + * winsup.h: Declare the 'action on error' functions. + * utils/Makefile.in: (Patch from Egor Duda <deo@logos-m.ru>) Compile + strace using -mno-cygwin. + * utils/strace.cc: Allow ingw concession from Egor Duda. Attempt to + allow CTRL-C when stracing. + +Thu Jul 14 0:39:00 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Delete special handling of uid/gid 513. + +Thu Jul 13 15:01:00 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (get_file_owner): Fix typo. + * path.cc (path_conv::path_conv) : Change `return' to `goto end' in + case of SYMLINK_IGNORE is set. + +Mon Jul 5 21:33:00 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (WriteSD): Doesn't set errno if BackupWrite() + returns ERROR_INVALID_SECURITY_DESCR (which happens on FAT). + +Sat Jul 10 13:17:20 1999 Christopher Faylor <cgf@cygnus.com> + + * utils/strace.cc (error): Actually output error message. + (add_child): Duplicate inherited child process handle with all of the + privileges that we need. + +Fri Jul 9 01:37:23 1999 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 14 + in honor of snprintf and vnsprintf additions. + +Fri Jul 9 00:04:03 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::path_conv): Correct buffer overflow condition. + * fhandler_console.cc (fhandler_console::open): *Need* to enable + processed input or CTRL-C won't stop anything unless it's at a prompt. + (fhandler_console::input_tcsetattr): Ditto. + +Thu Jul 8 18:27:49 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add malloc debugging options. + * dcrt0.cc (api_fatal): Call abort when debugging so that the debugger + will pop up. + * debug.cc (close_handle): Unlock in pathological case. + * fhandler_console.cc (fhandler_console::read): Always respond to + windows size changes. + (fhandler_console::open): Always set things to ~ENABLE_PROCESSED_INPUT + so that we can control INTR character. Don't set pgid here. + (fhandler_console::input_tcsetattr): Turn on windows event so that we + can see screen resizes. + (fhandler_console::init): Don't set pgid here. + * fhandler_termios (fhandler_termios::tcinit): Set pgid here. + * fhandler.h: Fix set_has_acls method return. + * utils/strace.h: Pass CTRL-Cs to child process. + +Wed Jul 7 23:59:50 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Improve dependencies. + * autoload.h: Work around "function unused" messages for autoload init + functions. + * configure.in: Use CHECK_TOOL to find CC so that it will get the + proper host alias. + * configure: Regenerate. + * dcrt0.cc (do_exit): Minor reorganization of termination function + calls. + * debug.cc (close_handle): Issue an error when an attempt is makde to + close a handle with a name different from the one used to record it + previously. + * debug.h: Implement new macros for storing arbitrary handle names. + * exceptions.cc (handle_signal): Terminate the main thread when exiting + due to signal in signal thread. + * fhandler.h: Add an extra 'fd' argument to all ready_for_read methods. + * select.cc: Ditto, throughout. + * fhandler_console (get_tty_stuff): Protect the tty_stuff handle here. + * fhandler_termios.cc (fhandler_termios::line_edit): Accommodate fd + argument to ready_for_read. + * fhandler_tty.cc (fhandler_tty_master::init): Close an unneeded thread + handle. + * fork.cc (fork): Use standard name when protecting process handle. + * spawn.cc (spawn_guts): Ditto. + * shared.cc (open_shared_file_map): Protect cygwin_shared handle here. + * sigproc.cc: Throughout, close child process handle using standard + name. + * syscalls.cc (read_handler): Check that fd is still open prior to + performing an operation. Supply fd argument for ready_for_read. + * (_read): Supply fd argument for read_for_read. + * tty.cc (tty_list::terminate): Close unneeded handles as tty is + closing down. + (tty_list::allocate): Protect against signals. + +Mon Jul 5 14:52:40 1999 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Export new snprintf and vnsprintf functions courtesy of + Egor Duda <deo@logos-m.ru>. + +Sun Jul 4 23:54:43 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sigbegin): New function. Called prior to dispatching + to signal handler. + (sigreturn): New function. Called after signal handler returns. + (set_process_mask): Make stdcall. + (call_handler): Remove sigwrap asm stuff in favor of new + sigbegin/sigreturn scheme. + * winsup.h: Change set_process_mask declaration. + +Sun Jul 4 22:00:14 1999 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (stat_worker): Previous change to check for extension + found dots not in the filename part. Fix this. + +Sat Jul 3 23:22:55 1999 Christopher Faylor <cgf@cygnus.com> + + * include/wincon.h: Add some missing defines. + * environ.cc: Remove extern which is now in winsup.h. + * fhandler.cc (get_file_owner): Rename argument. Test for allow_ntsec. + (get_file_group): Ditto. + (fhandler_disk_file::fstat): Use new method inode checking. + * fhandler.h: Rename a method. + * security.cc (set_file_attribute): Take an additional argument to + determine if ntsec security setting should be used. + * dir.cc (mkdir): Pass acl info to set_file_attribute. + * syscalls.cc (chown): Ditto. + (chmod): Ditto. + * winsup.h: Define allow_ntsec here. + +Sat Jul 3 15:09:34 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_disk_file:;fstat): Move check of disk volume to + path_conv. Use new methods for determining if file system is ACL + capable. + (fhandler_disk_file::open): Set "has acls" flag here. + * fhandler.h: Store acl information in fhandler base class. + * path.cc (path_conv): Set acl information on successful return. + * path.h: Add acl info to path_conv class. + * security.cc (get_file_attribute): Set ENOSYS if can't get extended + attributes. + * syscalls.cc (chown): Pass acl information from path_conv to + get_file_attributes. + (chmod): Ditto. + (stat_worker): Ditto. + * uinfo.cc: Make all exported functions extern "C". + * winsup.h: Add rootdir() declaration. + +Fri Jul 2 15:13:08 1999 Christopher Faylor <cgf@cygnus.com> + + * autoload.h: New file. + +Thu Jul 1 23:16:34 1999 Christopher Faylor <cgf@cygnus.com> + + * net.cc (cygwin_gethostname): Use new win32_gethostname to + disambiguate between cygwin and winsock version. + * tty.cc (creat_tty_master): Disambiguate by using cygwin_gethostname + to find the hostname. + * winsup.h: Declare cygwin_gethostname. + +Thu Jul 1 22:36:31 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout, remove check for winsock initialization and indirect + references to winsock functions in favor of new dynamic DLL loading + method. + + * Makefile.in: Remove unneeded libraries. + * cygwin.din: Make gethostname == cygwin_gethostname like other network + functions. + * dcrt0.cc: Implement new "autoload" functionality for loading DLLs and + functions as they are needed. Add autoload functions for user32.dll. + (cygwin_dll_func_load): New function. + (dll_crt0): Issue a fatal error message if attempt to mix different + version DLLs is detected. + (api_fatal): Correct inexplicable use of buf + 8 when printing error + message into a buffer. + * fhandler.h: Cosmetic fixes. + * fhandler_tty.cc (fhandler_tty::close): Temporarily "if 0" out code + which sends EOF pulse to children. This should only happen when last + parent fd closes. + * heap.cc (sbrk): Implement new sbrk mechanism which returns memory to + Windows when top of heap decreases beyond a page boundary. + (getpagesize): New function. + * fork.cc (fork): Save new heap values in stuff passed to child. + * hinfo.cc (hinfo::build_fhandler): Don't do any checking on a handle + if the handle is NULL. Assume that it is a disk file. + * net.cc: Redo winsock functions to use dynamic loading scheme. + * shared.cc (shared_info::initialize): Cosmetic change. + * shared.h: Change magic number for memory block sent to child + processes. Accommodate new heap information in child_info. + * sigproc.cc (sig_dispatch_pending): Remove some memory debugging checks. + (__release_signal_mutex): Ditto. + * syscalls.cc (stat_worker): Don't attempt the .exe hack unless the + previous attempt to open the file resulted in an "ERROR_FILE_NOT_FOUND" + and the file did not already contain an extension. + * times.cc: Initialize static NO_COPY variables throughout or they will + not actually be NO_COPY. + * winsup.h: Rename heap fields in per_process to accommodate new sbrk. + Eliminate winsock stuff invalidated by dynamic loading change. + * include/winsock.h: Make this file C++ safe. + +Sun Jun 27 17:07:34 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.h: Don't define MALLOC_DEBUG by default. + * fhandler.cc (fhandler_base::set_name): Always set names to NULL. Add + more slop to end of win32_path_name. + (fhandler_base::de_linearize): Set names to NULL. They'll be assigned + by the caller. + (fhandler_disk_file::get_native): Delete. + * fhandler.h: Ditto. + * hinfo.cc (hinfo::de_linearize_fd_array): Set path names after the + structure has been "delinearized". + * malloc.cc: Add debugging versions of malloc functions. + * syscalls.cc (stat_worker): Eliminate static buffer for thread safety. + +Wed Jun 23 22:53:00 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::fstat): If get_file_attribute() + signals a nonexistant acl, fstat sets default attributes now. + +Wed Jun 23 10:22:56 1999 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 13. + +Wed Jun 23 10:39:07 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * cygwin.din (gamma, gammaf, lgamma, lgammaf): Export. + (j0,j0f,j1,j1f,jn,jnf): Export underscore versions as well. + +Mon Jun 21 21:34:06 1999 Christopher Faylor <cgf@cygnus.com> + + Sprinkle MALLOC_CHECK macro throughout. When turned on, this will give + a slightly better idea of where memory corruption occurs. Add slightly + modified versions of "error_start" code from Egor Duda + <deo@logos-m.ru>. + * Makefile.in: Add `utils' target. + * dcrt0.cc (do_exit): Attempt to detect loop conditions where do_exit + is called reentrantly and avoid the previously executed code in this + case. + * debug.h: Define MALLOC_CHECK macro for use with malloc debugging. + * environ.cc (environ_init): Add more slop at end of environ string + just to work around buggy programs. + (parse_options): Add error_start option to control core dumping or gdb + invocation. + * exceptions.cc (stackdump): New function. Dumps stack to stderr. + (error_start_init): New function. Initialize action on "core dumping" + error. + (handle_exceptions.cc): Use stackdump command to dump stack. Call + try_to_debug. + (set_process_mask): Must be __stdcall or compiler get's confused. + (sig_handle): Detect SIGQUIT and SIGABRT. Do a "stackdump" for these. + * fhandler.cc (get_file_owner): Add an argument to determine if + function should check for NT security. + (get_file_group): Ditto. + (fhandler_base::set_name): Don't free "fhandler_disk_dummy_name" path + names. + (rootdir): New function, pulled from the pages of syscalls.cc. + Determines the root dir of a given path. + (fhandler_disk_file::fstat): Get volume information of file in question + to determine if inodes are permanent and acls are available. This + replaces previous WinNT test. + (fhandler_base::~fhandler_base): free "fhandler_disk_dummy_name" path + names. + * fhandler.h: Change get_file_* declarations. + * fhandler_console.cc: Back out most of scroll fixes from April 17. + They caused weird scrolling behavior. + * fhandler_tty.cc (fhandler_pty_master::accept_input): Add debugging + message. + * security.cc (get_file_attribute): Add additional "check for ACL" + argument. + * path.cc (symlink_check_one): Use new argument to get_file_attribute. + * sigproc.cc (wait_subproc): Don't exit wait loop if WaitForMultipleObject + returns an error. Instead, loop for a while in case this is an expected + error. + * sigproc.h: Remove __stdcall from set_process_mask. + * spawn.cc (linebuf): Use initializers to set initial values. + (linebuf::append): Be defensive and ensure that enough space is + allocated for the new argument. + (linebuf::prepend): Ditto. + (spawn_guts): Correct logic which broke up program argument in a #! + script. + * syscalls.cc (chown): Use new argument to get_file_attribute. + (chmod): Use new argument to get_file_owner and get_file_group. + (stat_worker): Ditto. + (statfs): Break out code that determined the root directory of a given + path. Use new rootdir function instead. + * winsup.h: Reflect new get_file_attribute argument. + * include/sys/strace.h: Add "NOTALL" flag so that voluminous debugging + output can be avoided. + * utils/strace.cc: Honor NOTALL flag. Run at a higher priority. + +Mon Jun 14 18:33:08 1999 Christopher Faylor <cgf@cygnus.com> + + * syscalls.c (stat_worker): Consolidate calls to fh.fstat for both + directories and normal files. + * fhandler_tty.cc (fhandler_pty_master::close): Ensure that an "EOF + pulse" is sent to any executing child processes. + * path.cc (symlink_check_one): Check for ':\n' as well as '#!' to + determine if a file is executable. + +Mon Jun 14 16:04:00 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_pty_master::accept_input): Set read_retval + prior to performing a write to avoid a potential race condition. + * fhandler_termios.cc (fhandler_termios::line_edit): Don't set + read_retval here. It has to be set in an fhandler_tty accept_input. + * select.cc (peek_pipe): Fix typo which caused read_selected to be + tested twice rather than except_selected. + * shared.h (class tty_min): Remove read_retval from here. + (class tty) Put it here. + +Mon Jun 14 13:08:58 1999 Christopher Faylor <cgf@cygnus.com> + + * utils/Makefile.in: Consolidate and simplify. + +Mon Jun 14 12:43:32 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout, remove reliance on strace_* fields in pinfo class. Use + global instead. Remove STRACE_DUMP and STRACE_CACHE logic. + * pinfo.cc (set_myself): New function. + * dcrt0.cc (dll_crt0_1): Use the new function. + * environ.cc (parse_options): Remove strace environment variable logic. + (environ_init): Ditto. + * exceptions.cc (call_handler): Remove strace mutex considerations. + * fhandler_termios (fhandler_termios::line_edit): Remove STRACE_CACHE + logic. + * localtime.cc: Define 'lint' to eliminate warnings. + * smallprint.c (__small_vsprintf): Remove text formatting of windowss + errors. This is now done in the 'strace' program. + * strace.cc: Define 'strace_active' variable to control whether strace + should be carried out. + (strace_open): Delete. + (strace_init): Delete. + (get_strace_mutex): Delete. + (release_strace_mutex): Delete. + (strace_vsprintf): Preserve last error. + (strace_write): Communicate with strace program using + OutputDebugString. + (strace_dump): Delete. + (mark): Gut. + * winsup.h: Remove a declaration. Add a new one. + * include/sys/strace.h: Modify to accommodate new strace scheme. + * utils/Makefile.in: Build strace.exe + * utils/strace.cc: New file. + +Sat Jun 12 22:22:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::fstat): Must compute i-node numbers + via `get_namehash' for Windows 9x. + +Sat Jun 12 10:54:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::read): Returns correct value + if raw_read fails. + * fhandler_raw.cc: More trace output. + * fhandler_floppy.cc: Ditto. + * fhandler_tape.cc: Ditto. + +Thu Jun 10 14:01:05 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.c (handle_exceptions): Use ".stackdump" + extension instead of ".core". + * path.cc (mount_info::read_mounts): Prescan the mount lists + for /cygdrive stuff to delete rather than attempting to + delete it in the main "add mount loop". + (mount_item::getmntent): Fix "system"/"user" determination. + * winsup.h: Use void methods in thread classes where + appropriate. + +Wed Jun 9 23:16:04 1999 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Issue error if can't find version information. + +1999-06-09 DJ Delorie <dj@cygnus.com> + + * localtime.c: new file; public domain timezone handling routines. + * tz_posixrules.h: new file; POSIX default timezone data + * times.cc: comment out localtime, gmtime, replace tzset with + cygwin_tzset + * Makefile.in: add localtime.c + +Wed Jun 9 00:49:04 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Correctly handle #! processing when line + ends with white space. Also correctly handle scripts that do not + begin with #!. + +Mon Jun 7 17:04:36 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::open): Need to initialize + tc here, too. + (fhandler_console::init): Initialize tc earlier. + +Mon Jun 7 00:02:51 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_termios): Move tc initialization + into init method, etc. + (fhandler_tty_common): Ditto. + * fhandler_console.cc (fhandler_console::fhandler_console): + Move tc initialization to init method. + (fhandler_console::init): Initialize tc stuff here. + (fhandler_console::dup): Ditto. + (fhandler_console::fixup_after_fork): Ditto. + (fhandler_console::de_linearize): Ditto. + * fhandler_termios (tcinit): Rename constructor. + Accept force argument to force termios initialization. + * fhandler_tty.cc (fhandler_tty_master::init): Move tc initialization + to common_init. + (fhandler_tty_common::dup): Use tcinit () to initialize tc field. + * tty.cc (tty::common_init): Ditto. + +Sun Jun 6 22:19:09 1999 Christopher Faylor <cgf@cygnus.com> + + * tty.cc (tty_list::terminate): Add \n to output message. + (tty::init): Clear slave_opened field or we can't reopen + ttys. + +Fri Jun 4 23:58:17 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Reorganize + slightly to avoid a race with get_ttyp()->was_opened. + +1999-06-04 DJ Delorie <dj@cygnus.com> + + * times.cc (totimeval): scale sub properly. + (gettimeofday): don't bias by timezone. + +Thu Jun 3 13:24:17 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_tty_common): Add two new methods. + * fhandler_tty.cc: Use new {acquire,release}_output_mutex + methods throughout for output_mutex. + (fhandler_tty_common::__acquire_output_mutex): New method. + (fhandler_tty_common::__release_output_mutex): New method. + * shared.h (get_output_mutex): Rename to open_output_mutex. + +Wed Jun 2 16:06:26 1999 Geoffrey Noer <noer@cygnus.com> + + * utils/mkpasswd.c (main): account for long int args to printfs. + +Wed Jun 2 16:08:08 1999 Christopher Faylor <cgf@cygnus.com> + + * smallprint.c (__small_vsprintf): Conditionalize display of + textual messages under CYGWIN_TEXT_ERROR. + * ntea.cc: Remove debugging code. + +Wed Jun 2 16:04:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Call the functions `get_admin_sid', + `get_system_sid' and `get_world_sid' before heap initialization + to avoid heap fragmentation. + * security.cc (get_nt_attribute): Don't allocate memory + anymore. All memory is taken from stack. + (set_nt_attribute): Ditto. + (alloc_sd): Ditto. Change parameters to get a pointer to a + preallocated security descriptor and a pointer to it's length. + * shared.cc (sec_user): Don't allocate memory anymore. All + memory is taken from stack. Change parameters to receive a + pointer to a preallocated security buffer. + * shared.h: Change prototype for `sec_user' and `sec_user_nih'. + * sigproc.cc (getsem): Change call to `sec_user'. Additonally + buffer for `sec_user'. + * spawn.cc (spawn_guts): Ditto. + Change all error output in function `sec_user' and in module + `security.cc' from error text to error number output. + +Tue Jun 2 21:54:21 1999 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_if_flags): Change the UP and RUNNING state + of disconnected RAS interfaces to true. + +Thu Jun 1 22:47:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_system_sid): New function to create + a SID for the well known group of local system. + (alloc_sd): New function. + (alloc_sd): Give ALL permissions to `system'. + * shared.cc (sec_user): Give ALL permissions to `system'. + (sec_user): Provide additionalparameter for a second SID. + This is used for `CreateProcessAsUser' call. + (sec_user_nih): Ditto. + * shared.h: Change prototypes for `sec_user' and + `sec_user_nih'. + * spawn.cc (spawn_guts): Now using `sec_user' in + `CreateProcessAsUser' call, if ntsec is set. + +Thu Jun 1 14:17:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * utils/mkpasswd.c: Change to output native names of + well known groups `Everyone' (SID 0) and `system' (SID 18). + * utils/mkgroup.c: Ditto plus output of native name of + well known group `None' (SID 513). + +Mon May 31 22:10:57 1999 Christopher Faylor <cgf@cygnus.com> + + * path.h: Use bit mask flags in path_conv to save exec, + symlink, binary status. Use methods to access and set + these flags. + * fhandler.cc: Use methods to access path_conv flags + throughout. + * path.cc: (symlink-check_one): Accept a bitmask flags + variable to accommodate path_conv changes. + (path_conv::path_conv): Propagate path_flags from mount + table to path_conv class. Avoid walking the mount table + twice to find "binary" info. + (mount_info::conv_to_win32_path): Accept additional flags + argument. Don't add trailing slash if not required. + Fill out both paths when cygdrive. + (mount_info::cygdrive_win32_path): Change debugging output + slightly. + (mount_info::set_flags_from_win32_path): Generalize from + mount_info::binary_win32_path_p. + (mount_item::getmntent): Honor MOUNT_EXEC flag. + * shared.h: Add new method to mount_info class. + * include/sys/mount.h: Add a comment. + * utils/mount.cc: Accept -x to force a mountpoint to default + to executable permission. Rename automount stuff to cygdrive. + +Mon May 31 19:00:00 1999 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (environ_init): Set ntsec option by default + if running under NT. + * security.cc (set_nt_attribute): Delete superfluoues code. + * shared.cc (sec_user): Don't set owner in created security + descriptor. + * sigproc.cc (getsem): Use `sec_user' instead of `sec_user_nih'. + * spawn.cc (spawn_guts): Set security attribute of + `CreateProcess' to `sec_user' if ntsec is set, `sec_all_nih' + otherwise. + +Mon May 31 19:27:36 1999 Christopher Faylor <cgf@cygnus.com> + + Throughout, change "automount" to cygdrive. + Throughout, change mount flags from signed to unsigned. + + * path.cc (iscygdrive): New macro. + (normalize_posix_path): Tack a '/' on the end of constructed + path only if there isn't one there already. + (mount_info::init): Simplify slightly. + (mount_info::conv_to_win32_path): Don't search for automount + stuff in the mount table. Instead special case the cygdrive + handling so that it will always be acceptable to use /cygdrive + regardless of other mounts. + (mount_info::cygdrive_posix_path): Rename from + build_automount_mountpoint_path. Fully build a posix path + given inputs. + (mount_info::cygdrive_win32_path): New function. + (mount_info::conv_to_posix_path): Precalculate the length + of the pathbuf for multiple uses. Just use cygdrive_posix_path + to derive a /cygdrive/x/foo style path. + (mount_info::read_mounts): Don't read /cygdrive/x mounts from + the registry. Delete them. + (mount_info::from_registry): Read cygdrive info earlier for + subsequent use by other mount routines. + (mount_info::add_reg_mount): Cosmetic changes. + (mount_info::read_cygdrive_info_from_registry): Always add + trailing slash to cygdrive. Precalculate the length of the + cygdrive. + (mount_item::getmntent): Cosmetic changes. + (mount): Return EINVAL on attempt to add a mount point which + begins with the current cygdrive. + * path.h: Remove unused script_p from path_conv class. + * shared.h: Add cygdrive_length to mount_list. Add new + cygdrive_win32_path method. + * include/sys/mount.h: Use enums for MOUNT_ constants. + +1999-05-29 Keith Seitz <keiths@cygnus.com> + + * errno.cc (errmap): Map ERROR_NEGATIVE_SEEK to EINVAL. + +Fri May 28 21:43:56 1999 Christopher Faylor <cgf@cygnus.com> + + * times.cc (to_time_t): Rewrite slightly to avoid compiler + overoptimization. + +Fri May 28 21:10:33 1999 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (getsem): Set security attribute of process + semaphore to `sec_user_nih()', if ntsec is set, `sec_none_nih' + otherwise. + +Wed May 26 22:56:51 1999 Christopher Faylor <cgf@cygnus.com> + + Rename inuse_event and inuse_event_exists to "slave_alive" + throughout. + * shared.h: Eliminate inuse_event. Replace with a boolean. + Elminate slave_opened. + Add some function declarations used by new methods. + * fhandler_tty.cc (fhandler_pty_master::hit_eof): Use better + method for determining EOF for pty master. + (fhandler_tty_slave::open): Use method to acquire output_mutex. + Always create "inuse_event". Delete call to slave_opened. + (fhandler_tty_slave::write): Reorganize debugging output + slightly. + (fhandler_tty_master::close): Eliminate reference to inuse_event. + * tty.cc (tty_list::terminate): Eliminate call to slave_opened. + (tty_list::connect_tty): Use new exists() method to find out if + a tty exists. + (tty_list::allocate_tty): Rename argument for clarity. Use + new exists method to determine tty existence. + (tty::inuse): Delete. + (tty::init): Remove reference to inuse_event. + (tty::common_init): Ditto. + (tty::slave_opened): Delete. + * winsup.h: Move some function declarations to shared.h. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (WriteSD): Don't set errno, if BackupWrite() + returns ERROR_NOT_SUPPORTED. + * security.cc (set_nt_attribute): Change condition for + calling LookupAccountName() with domain name again. + * shared.cc (sec_user): Ditto. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * include/winnt.h: Temporary erased definitions of QuadPart + in LARGE_INTEGER and ULARGE_INTEGER. + * security.cc (set_nt_attribute): Set standard attributes so + that reading and writing attributes for user and administrators + isn't hindered. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (ReadSD): New function. + * security.cc (WriteSD): Ditto. + * security.cc (get_admin_sid): Moved from shared.cc. + * security.cc (set_process_privileges): Moved from syscalls.cc, + shortened, changed return typ to int. Sets errno now. + * security.cc (set_file_attributes): Return type changed to int. + * security.cc (get_file_attributes): Ditto. + * security.cc (set_nt_attributes): Ditto. Cares for setting + of S_ISVTX now. + * security.cc (get_nt_attributes): Ditto. + * syscalls.cc (rel2abssd): #if 0'ed. + * syscalls.cc (set_process_privileges): Moved to security.cc. + * syscalls.cc (chown): Rewritten. + * syscalls.cc (chmod): Change call order of the functions + set_file_attributes() and SetFileAttributesA(). + * fhandler.cc (fhandler_base::fstat): Change check for + return value of get_file_attributes(). + * ntea.cc (NTReadEA): returns TRUE now, if allow_ntea is unset. + * ntea.cc (NTWriteEA): returns TRUE now, if allow_ntea is unset. + * shared.cc (get_admin_sid): Moved to security.cc. + * path.cc (symlink_check_one): Change check for return value + of get_file_attributes(). + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_world_sid): Rewrite. + * security.cc (world_full_access): Delete. + * grp.cc: Use gid 0 as default gid. + * grp.cc (read_etc_group): Look for account name of world group. + * fhandler.cc (fhandler_base::open): Call `set_file_attribute' + only in case of disk file. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_file_attribute): Patched incorrect test + for symlink. + * security.cc (set_file_attribute): ditto. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: Special handling for user and/or administrators + permissions to write (extended) attributes. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: Don't allow 513(none) as user or group. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: new functions `set_nt_attribute()', `get_nt_attribute()' + and `set_file_attribute()' with additional parameters `uid' and `gid', + to support real NT security. + * winsup.h: Prototype for `set_file_attribute()' with four + parameters. + * dir.cc (mkdir): Calls `set_file_attribute()' now. + * syscalls.cc (chown): ditto. + * syscalls.cc (chmod): ditto, with correct uid/gid. + +Mon May 24 22:10:34 1999 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc: New function `get_admin_sid()' to get a SID + of the administrators group or of administrator. + New functions `sec_user()' and `sec_user_nih()' to get + SECURITY_ATTRIBUTES with all permissions for the user and + the administtrator group. + * shared.h: Prototypes for the above new functions `sec_user()' + and `sec_user_nih()'. + * sigproc.cc (getsem): Create process semaphore with + permissions set by `sec_user()'. + +Mon May 24 20:29:29 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::output_tcsetattr): + ONLRET was erroneously used in place of ONLCR. + (fhandler_console::read): Honor get_r_no_interrupt () so + that interrupts don't screw up tty reading. + * fhandler.h: Add some methods to fhandler_tty_master. + * fhandler_termios.cc (fhandler_termios::fhandler_termios): + ONLRET was erroneously used in place of ONLCR. + * fhandler_tty.cc (fhandler_tty_master::init): Associating + console capabilities with the tty capabilities is a bad + idea. Go back to using the console's own. + (fhandler_tty_master::fixup_after_fork): New method. + (fhandler_tty_master::de_linearize): New method. + (fhandler_tty_master::init_console): New method. + +Mon May 24 09:58:02 1999 Christopher Faylor <cgf@cygnus.com> + + * include/rapi.h: Add some more definitions. + +Sat May 22 21:45:01 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * scandir.cc (scandir): Handle errno correctly. Do preallocation to + reduce realloc calls. + (alphasort): Use strcoll, not strcmp. + +Sat May 22 19:03:47 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * dll_init.cc (DllList::recordDll): Forkee must reload dlopened + DLLs. Also use strcasematch, not strcmp to compare file name. + +Wed May 19 14:38:57 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (linebuf::prepend): Fix possible reference to + uninitialized memory. + * winsup.h: Remove WINSUP_NO_CLASS_DEFS workaround. + * libccrt0.cc: Ditto. + * utils/cygwin.cc: Ditto. + * utils/mount.cc: Ditto. + * utils/ps.cc: Ditto. + +Sun May 16 17:22:50 1999 Christopher Faylor <cgf@cygnus.com> + + * include/winnt.h: Revert the previous reversion. The problem + with this include file was completely misdiagnosed. + +Sun May 16 16:05:07 1999 Christopher Faylor <cgf@cygnus.com> + + * sysdef/rapi.def: New definition file for RAPI.DLL. + * include/rapi.h: Preliminary RAPI declarations. + +Sun May 16 15:37:15 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove more obsolete code. + +Fri May 14 19:30:53 1999 Christopher Faylor <cgf@cygnus.com> + + * include/winbase.h: Change conditional to correctly refer + to UNDER_CE rather than UNICODE. + * include/winnt.h: Update MIPS and SHx CONTEXT definitions. + +Tue May 11 21:19:59 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Restore previously removed + 'leave' command as its absence causes programs to crash. It + should never have been deleted. + +Tue May 11 12:04:02 1999 Norbert Schulze <Norbert.Schulze@rhein-neckar.de> + + * times.cc (timezone): Properly adjust for daylight savings time. + (gettimeofday): Ditto. + (localtime): Ditto. + (tzset): Ditto. + +Mon May 10 23:31:36 1999 Christopher Faylor <cgf@cygnus.com> + + * include/winnt.h: Revert to previous version. There are problems + with the previous checkin. + * fhandler_console.cc (fhandler_console::de_linearize): Add defensive + code to ensure that console handles are opened correctly. + +Sun May 9 22:31:31 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Forgot to remove a reference to the deleted targets + below. + +Fri May 7 17:28:12 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove obsolete code. + * exceptions.cc (set_process_mask): Make this a __stdcall. + * sigproc.h: Fix declaration of set_process_mask. + * include/winnls.h: Add new code page defines. + * include/winnt.h: Various fixes from Anders Norlander + <anorland@hem2.passagen.se>. + +Tue May 4 22:20:05 1999 Christopher Faylor <cgf@cygnus.com> + + * include/winnt.h: Fix CONTEXT pointer typedefs. + +Mon May 3 11:32:32 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * smallprint.c (__small_vsprintf): Display textual messages + for "%E" format type. + * dlfcn.cc (set_dl_error): Lose the "Win32 ". + +Sun May 2 12:22:17 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * utils/Makefile.in (EXE_LDFLAGS): Provide default. + +1999-04-30 DJ Delorie <dj@cygnus.com> + + * winsup.h (WINSUP_NO_CLASS_DEFS): if defined, don't include class + definitions (work around gcc bug) + * libccrt0.cc (WINSUP_NO_CLASS_DEFS): define + * utils/cygwin.cc (WINSUP_NO_CLASS_DEFS): define + * utils/mount.cc (WINSUP_NO_CLASS_DEFS): define + * utils/ps.cc (WINSUP_NO_CLASS_DEFS): define + +Thu Apr 29 13:55:57 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * shared.h (read_mounts): Change prototype to accept a reference + to reg_key, not a copy. + * path.cc (read_mounts): Likewise. + +Thu Apr 29 11:06:37 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * configure.in (EXE_LDFLAGS): Always add newlib if part of the + build tree. + * configure: Regenerate. + + * utils/Makefile.in (INCLUDES): Add newlib include directories. + (LDFLAGS): Replace this with + (ALL_LDFLAGS): this to avoid being overridden from higher level + Makefiles. + +Wed Apr 28 17:01:12 1999 Christopher Faylor <cgf@cygnus.com> + + * include/winnt.h: Add some handheld support. + * shared.cc (open_shared): Don't call OpenFileMapping with + a null name pointer. If the name is NULL it can't be opened. + +Fri Apr 23 00:28:38 1999 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Always clear memory in thread .create method or + suffer uninitialized pointers, etc. + +Wed Apr 21 03:56:54 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::fhandler_console): + Set fork_fixup flag to ensure that shared info is duplicated. + (get_tty_stuff): Ensure that tty_stuff is initialized. + (fhandler_console::fixup_after_fork): Really force tc and + tty_stuff initialization. Close console handles or suffer + handle leak. (needs to be fixed) + (fhandler_console::de_linearize): Force tc and tty_stuff + initialization. + +Mon Apr 19 14:54:46 1999 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 12. + +Sat Apr 17 15:35:34 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console (fhandler_console::fixup_after_fork): Make sure + that new shared memory for console is initialized. + (fhandler_console::scroll_screen): Set region bottom correctly. + (fhandler_console::write_normal): Fix win95 problem where attribute + was propagated to scrolled region. + * include/wingdi.h: Fix GOBJENUMPROC prototype. + +Wed Apr 7 20:00:00 1999 John Fortin (fortinj@ibm.net) + + * pthread.cc (pthread_suspend): New function. + (pthread_continue): Ditto. + * include/pthread.h: added pthread_suspend and pthread_continue + prototypes. + * cygwin.din: added above functions. + * thread.h: Add 'bool suspended' to class MTitem. Prototype + __pthread_suspend __pthread_continue. + * thread.cc (__pthread_suspend): New function. + (__pthread_continue): New function. + +Sun Apr 4 23:00:00 1999 John Fortin (fortinj@ibm.net) + + * pthread.cc (pthread_join): New function. + (pthread_detach): New function. + * include/pthread.h: added pthread_join and pthread_detach prototypes. + * cygwin.din: added above functions for exports. + * thread.h: Added char joinable to MTitem class. Add void * + return_ptr to ThreadItem class to receive pointer from pthread_exit + and pthread_join. Add __pthread_join and __pthread_detach prototypes. + * thread.cc: Change thread_init_wrapper to set item->return_ptr=ret + and comment out item->used = false. Need to look at this more. + (__pthread_join): New function. + (__pthread_detach): New function. + (__pthread_exit): Implement ( was NOT_IMP ). + * thread.cc (MTinterface::FindNextUnused) : Use joinable != 'Y' as + an additional conditional. We may need to use this info in + pthread_join. + +Mon Apr 5 23:09:06 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Change a variable name to minimize confusion. + * fhandler.h (fhandler_tty): Remove ttyp field in favor of get_ttyp + method. + * fhandler_tty.cc: Use get_ttyp () method to retrieve pointer to + tty device throughout. + (fhandler_tty_master::init): Point console tc at tty's tc so + that they share the same termios structure. + * select.cc (fhandler_tty_common::ready_for_read): Use get_ttyp + method. + * tty.cc (tty::common_init): Ditto. + +Mon Apr 5 00:22:30 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::char_command): Make + setting of scrolling region cause the cursor to be placed at + the beginning of the scrolling region. + * thread.cc (__pthread_kill): Defend against item->sigs being + uninitialized. + (__pthread_sigmask): Defened against item->sigs being uninitialized. + +Wed Mar 31 22:52:18 1999 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0): Restore pointer to shared console + terminfo structure. This allows subprocesses to set + sticky console attributes. + * fhandler_console.cc (get_tty_styff): New function. Returns + pointer to shared console terminfo structure, allocating shared + memory if required. + (fhandler_console::fhandler_console): Use get_tty_stuff(). + (fhandler_console::de_linearize): Ditto. + * fork.cc (fork): Save shared console handle for export to + subprocesses. + * spawn.cc (spawn_guts): Ditto. + * shared.cc (open_shared_file_map): Rewrite to use generic + open_shared() function. + (open_shared): New function. Generic shared memory open + used by console and cygwin shared memory. + * shared.h: Define new stuff used by above. + +Wed Mar 31 01:46:23 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_tty): Set tc = ttyp. + * fhandler_tty.cc (fhandler_tty_master::init): Ditto. + (fhandler_tty_common::dup): Ditto. + * tty.cc (tty::common_init): Ditto. + +Wed Mar 31 01:43:06 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::conv_to_win32_path): Reorganize to + correctly handle //x syntax. + +Tue Mar 30 14:42:05 1999 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (strace_vsprintf): Fix incorrect buffer reference. + +Mon Mar 29 22:46:16 1999 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (__lock): Return value for gcc bug workaround. + (__unlock): Ditto. + * fhandler_tty.cc (fhandler_tty_master::init): Remove extraneous + console initialization. Set termios to sensical values before + initializing the console. + (fhandler_tty_slave): Add some debugging output. + * strace.cc: Conditionalize stuff not required by STRACE_HHMMSS. + (strace_vsprintf): Remove dependency on time() for STRACE_HHMMSS. + +Mon Mar 29 10:50:00 Corinna Vinschen <corinna.vinschen@cityweb.de> + + * utils/passwd.c (GetPW): Correct cast in call to `NetUserGetInfo'. + +Sun Mar 28 16:54:57 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h: Remove tty_stuff field from fhandler_console + class. Use global instead to allow all console opens to + use same settings. + * fhandler_console.cc: Add new global. + (fhandler_console::tcgetattr): Use new global for initialization. + (fhandler_console::de_linearize): Ditto. + * fhandler_termios.cc (fhandler_termios::fhandler_termios): Don't + reinitialize an already initialized termios. Do not honor + CYGWIN=binmode for console output. It's too confusing. + * shared.h: Add `initialized' field to tty_min. + +Sun Mar 28 01:55:32 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_prefix_p_): Add defensive code. + (slash_drive_prefix_p): Use macro to detect whether a character + is a path separator. + (mount_info::conv_to_win32_path): Rewrite to correctly handle + relative paths. + * strace.cc (strace_printf): Remove extraneous save of LastError. + * winsup.h (per_thread): Return TlsSetValue value. This seems + to work around a g++ bug. + +Thu Mar 25 13:00:00 Corinna Vinschen <corinna.vinschen@cityweb.de> + + * fhandler_raw.cc (fhandler_dev_raw::dup): New method. + * fhandler_tape.cc (fhandler_dev_tape::dup(): Ditto. + * fhandler.h: Added prototypes for the formentioned methods. + +Wed Mar 24 23:00:00 Corinna Vinschen <corinna.vinschen@cityweb.de> + + * fhandler_raw.cc (fhandler_dev_raw::linearize): + Only calling base class implementation now. + * fhandler_raw.cc (fhandler_dev_raw::de_linearize): + Only calling base class implementation and allocating devbuf now. + * fhandler_tape.cc (fhandler_dev_tape::linearize): Erased. + * fhandler_tape.cc (fhandler_dev_tape::de_linearize): Erased. + * fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): + Additional call to `set_cb()'. + * fhandler_floppy.cc (fhandler_dev_floppy::fhandler_dev_floppy): + Ditto. + * fhandler.h: Erased prototypes for linearize and de_linearize + methods of class fhandler_dev_tape. + +Thu Mar 25 14:05:57 1999 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (pause): Make sure that signal has been dispatched + prior to pause returning. + +Wed Mar 24 20:04:21 1999 Christopher Faylor <cgf@cygnus.com> + + Change get_input_handle to get_io_handle throughout. + Change output_handle_ to output_handle throughout. + Use sys/termios.h only where needed. + * Makefile.in: Add new object. + * fhandler.cc (fhandler_base::puts_readahead): New function. + Adds a string to the read ahead buffer. + (fhandler_base::put_readahead): New function. Adds a character + to the read ahead buffer. + (fhandler_base::get_readahead): New function. Gets a character + from the read ahead buffer. + (fhandler_base::peek_readahead): New function. Returns character + at beginning or end of read ahead buffer. + (fhandler_base::set_readahead_valid): Augmented from fhandler.h. + (fhandler_base::eat_readahead): Eat a character from the read + ahead buffer. + (fhandler_base::de_linearize): Reset read ahead info. + (fhandler_base::read): Honor new read ahead mechanism. + (fhandler_base::fhandler_base): Don't set binmode to default + if it has already been explicitly set. + * fhandler.h: Add *BINSET flags to track whether the binary + mode has been turned on or off explicitly. + (fhandler_base): Add elements for new read ahead method. Remove + old `readahead_'. + (fhandler_termios): New base class. + (fhandler_console): Use fhandler_termios base class. + Add new de_linearize method. + (fhandler_tty_common): Rewrite to use fhandler_termios base class. + (fhandler_pty_master): Ditto. + (fhandler_tty_master): Ditto. + * fhandler_console (fhandler_console::read): Rewrite to use functions + from fhandler_termios and read ahead for line editing. + (fhandler_console::read1): Remove. + (fhandler_console::open): Interruptible I/O is now handled in the + read function. Mark this. + (fhandler_console::output_tcsetattr): Use ONLRET to control + binary behavior since it is more closely analgous. + (fhandler_console::input_tcsetattr): Don't set console flags if + there is no change or Windows 95 will eat input. + (fhandler_console::tcsetattr): Use ONLRET to control binary behavior + since it is more closely analgous. + (fhandler_console::fhandler_console): Accommodate fhandler_termios + base class. + (fhandler_console::init): Ditto. + (fhandler_console::igncr_enabled): Ditto. + (fhandler_console::char_command): Use new read ahead method. + (fhandler_console::de_linearize): New function. + * fhandler_serial.cc: Need additional include. + * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): + Accommodate fhandler_termios base class. + (fhandler_tty_master::init): Ditto. + (fhandler_tty_master::accept_input): New function. Sends + (possibly line-edited) input to slave. + (process_input): Use line editing capabilities of fhandler_termios + base class when processing input. + (fhandler_tty_slave::open): Accommodate fhandler_termios base class. + (fhandler_tty_slave::tcgetattr): Ditto. + (fhandler_tty_slave::ioctl): Ditto. + (fhandler_pty_master::fhandler_pty_master): Ditto. + (fhandler_pty_master::read): Ditto. + (fhandler_tty_slave::dup): Be more paranoid about setting output + handle in case of error. + * fhandler_tty.h: Accommodate new tty_min base class in tty class. + * hinfo.cc (hinfo::build_fhandler): Send tty 'unit' to constructor. + * select.cc (peek_console): Send resize event to window regardless + of tty setting. Eliminate ReadFile kludge. + * shared.h (tty_min): Rename termios field to avoid conflict. + * tty.cc (create_tty_master): Send tty number to build_fhandler. + (tty::common_init): Remove termios initialization. It's handled + via fhandler_termios, now. + * fhandler_termios: New file. Contains methods for dealing with + fhandler_termios class. + +Wed Mar 24 19:22:04 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Reorder to work around + gcc bug. + +Sun Mar 21 21:26:43 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_serial.cc (fhandler_serial::raw_read): Protect + against uninitialized variable. Output debug info if + ClearCommError fails. Clear overlapped I/O on error or + signal. + (fhandler_serial::tcflow): Output debug info at start of + routine. + (fhandler_serial::tcsetattr): Add more debugging output. + Avoid re-setting parameters if there has been no change. + Setting parameters via SetCommState seems to cause loss of + input on Windows 9[58]. + +Wed Mar 17 12:56:25 1999 Geoffrey Noer <noer@cygnus.com> + + * include/winbase.h: Fix AllocateAndInitializeSid proto. + +Tue Mar 16 21:55:12 1999 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Always wait for sig_send + to exit or races can result. + +Tue Mar 16 13:04:34 1999 Geoffrey Noer <noer@cygnus.com> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 11. + +Tue Mar 16 15:44:10 1999 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Export telldir/seekdir. + +Tue Mar 16 13:50:51 1999 Corinna Vinschen <corinna.vinschen@cityweb.de> + + * dir.cc: Change unused struct member __d_find_first_called to + __d_position for use in new functions. + (telldir): New function. Returns current position in DIR stream. + (seekdir): New function. Seeks to new position in DIR stream. + +Mon Mar 15 19:17:23 1999 Geoffrey Noer <noer@cygnus.com> + + * sysdef/comctl32.def: Add InitCommonControlsEx. + +Mon Mar 15 19:45:10 1999 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (mkdir): Remove final slash from a directory if + appropriate or windwows won't create the directory. + * errno.cc: Change text for EAGAIN to something a little + more sensical. + * exceptions.cc (call_handler): Add a debug message. + * fhandler.cc (fhandler_base::open): Don't attempt to set + the position of a com device. + * fhandler_serial.cc (fhandler_serial::raw_read): Reset + overlapped event if not armed. Don't attempt to find out + if characters are available if vmin_. + (fhandler_serial::raw_write): Clear pending I/O when + necessary. + (fhandler_serial::open): Set comm state to current rather + than zeroing. + (fhandler_serial::tcflush): Don't use "queue" as a flag. + TCI* defines are not bit masks. + * select.cc (peek_serial): Add debugging output. + * sigproc.cc (wait_sig): Minor cleanup. + * path.cc (nofinalslash): Make global. + * winsup.h: Ditto. + +Mon Mar 15 16:31:29 1999 Geoffrey Noer <noer@cygnus.com> + + * include/winnt.h: Add RID defs/protos from MSDN docs. + (SECURITY_*_RID, DOMAIN_*_RID*, etc.) + * include/richedit.h: Add missing SCF_* defines. + * include/commctrl.h: Add missing PBM_ defines, PBRANGE struct. + +Mon Mar 15 12:54:48 1999 Geoffrey Noer <noer@cygnus.com> + + * Makefile.in: Don't install include/Windows32 since it doesn't + exist any more. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 10. + +1999-03-12 DJ Delorie <dj@cygnus.com> + + * net.cc (gethostbyname): support a.b.c.d notation internally, + in case there's no DNS at least partial support is there. + +Thu Mar 11 21:27:41 1999 Jeff Johnston <jjohnstn@cygnus.com> + + * cygwin.din: Added references to new fast-math routines. + +Wed Mar 10 19:22:46 1999 Geoffrey Noer <noer@cygnus.com> + + * include/commdlg.h: Add missing PageSetupDlg defines. + +Tue Mar 9 14:28:14 1999 Geoffrey Noer <noer@cygnus.com> + + * include/*.h: Switch Win32 API header file set to the one written + by Anders Norlander <anorland@hem2.passagen.se>. Headers now + fit the standard Win32 API header layout and are more complete. + These correspond to Anders' headers, version 0.1.5. Please read + sysdef/README for more information. + * include/Windows32/*.h: Delete in favor of above definitions. + + Changes to support the above: + * fhandler_console.cc (fhandler_console::char_command): Add newly + needed cast to DWORD *. + * fhandler_serial.cc (fhandler_serial::raw_read): Make n, minchars + DWORDs. + * fhandler_tty.cc: Include limits.h. + (fhandler_pty_master::doecho): Second arg is now DWORD. + (fhandler_pty_master::process_input_to_sl): Make n, written DWORD. + (fhandler_pty_master::process_slave_outpu): Make n DWORD. + (fhandler_tty_slave::close): Make towrite, n DWORDs. + (fhandler_tty_slave::write): Make n DWORD. + * fhandler.h: Adjust fhandler_pty_master::doecho proto. + * hinfo.cc: Include file reordering. + * malloc.cc: Ditto. + * net.cc: Ditto. + * fhandler_tape.cc (get_ll): Need to reference .u in + LARGE_INTEGER usages. + * ntea.cc: Ditto. + * pinfo.cc: Include limits.h. + * spawn.cc: Ditto. + * uinfo.cc: Ditto. + * uname.cc (uname): sysinfo struct now has anon union. + Adjust sprintf for dwProcessorType being a long now. + * syscalls.cc: Include limits.h and lmcons.h. Throughout, + reference .u in LARGE_INTEGER usages. + (logout): Make rd a DWORD. + + * utils/mkgroup.c: Always include lmaccess.h and lmapibuf.h. + Include stdio.h. + (enum_groups): Adjust for longs in fprintfs. + (main): Ditto. + * utils/mkpasswd.c: Include lmaccess.h and lmapibuf.h. + (enum_users): Adjust for longs in fprintfs. + (main): Ditto. + (enum_local_groups): Ditto. + * utils/passwd.c: Remove many Win32 API defines now in new + Win32 headers. Include lmaccess.h, lmerr.h, lmcons.h, + lmapibuf.h. + (PrintPW): Adjust for longs in fprintfs. + +Wed Mar 3 21:14:45 1999 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (environ_init): Fix off-by-one error in initial + environment allocation. + * fhandler_serial.cc (fhandler_serial::tcflush): Use different + method for flushing since serial handles are now opened for + overlapped I/O. + * select.cc (cygwin_select): Make degenerate case interruptible. + * sigproc.cc (proc_exists): Recognize all kinds of myself pointers + as "existing". + +Tue Feb 16 23:00:48 1999 Christopher Faylor <cgf@cygnus.com> + + * include/Windows32/Functions.h: Correct two #ifndefs that were + switched. + +Mon Feb 15 22:41:54 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Fix incorrect arg length when + constructing new arguments for #!. + +Fri Feb 12 13:25:50 1999 Drew Moseley <dmoseley@cygnus.com> + + * Makefile.in (install-info): Test for file existence before installing. + +Fri Feb 12 13:17:49 1999 Corinna Vinschen <corinna.vinschen@cityweb.de> + + * fhandler.cc (fhandler_disk_file::fstat): Handles directories, + returns unique i-node number. + * syscalls.cc (stat_worker): On WinNT, stat_worker calls + fhandler_disk_file::fstat for directories, too. + +1999-02-10 DJ Delorie <dj@cygnus.com> + + * doc/doctool.c (scan_directory): check for opendir failing, + add closedir. + +Tue Feb 9 13:02:25 1999 Geoffrey Noer <noer@cygnus.com> + + * utils/mount.cc: Add fixme. + * doc/doctool.c: Correct typo in comment. + +Mon Feb 8 17:29:58 1999 Christopher Faylor <cgf@cygnus.com> + + * include/Windows32/UnicodeFunctions.h: Fix incorrect use of + BOOL -> WINBOOL. + * Windows32/ASCIIFunctions.h: Ditto. + +Fri Feb 5 09:38:25 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::add_item): Ensure that drive names + are added using X: notation. + +Thu Feb 4 00:28:58 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_prefix_p_): Recognize ':' as a path separator. + (mount_info::conv_to_posix_path): Detect case where a '/' has + to be added to a path being constructed. + (realpath): Ensure that the full path name is returned. + +Wed Feb 3 22:57:42 1999 Christopher Faylor <cgf@cygnus.com> + + * shared.h (mount_info): Add two separate arrays to track + reverse sorting of win32/posix paths. + * path.cc (sort_by_posix_name): New function. Sorts by + posix path. + (sort_by_native_name): Rename from sort_by_name. + (mount_info::conv_to_win32_path): Use native sort order + when iterating through mount table. + (mount_info::binary_win32_path_p): Ditto. + (mount_info::getmntent): Ditto. + (mount_info::conv_to_posix_path): Use posix sort order + when iterating through mount table. + (sort): Use two arrays to track sorting of mount table. + (mount_info::add_item): Simplify slightly. + +Wed Feb 3 15:17:54 1999 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Remove DATA attribute which was erroneously + added to __errno. + +Tue Feb 2 23:10:18 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc: Fix comment regarding UNC paths in mount table. + (mount_info::conv_to_win32_path): Add back code to handle + //<drive> paths for now. The plan is still to remove it again at + a later date. + (mount_info::slash_drive_to_win32_path): New. Convert a //<drive> + path to a Win32 path. Bring back from among the recently departed + path functions. + * shared.h: Add mount_info proto for slash_drive_to_win32_path. + +Tue Feb 2 22:52:43 1999 Geoffrey Noer <noer@cygnus.com> + + * include/lmaccess.h: Add stub. + * include/shlobj.h: Add stub. + +Tue Feb 2 22:34:06 1999 Christopher Faylor <cgf@cygnus.com> + + * shared.h: Change magic number associated with fork/exec + information as a temporary measure to eliminate strange + core dumps with multiple versions of cygwin1.dll. + +1999-02-02 Brendan Kehoe <brendan@cygnus.com> + + * Makefile.in (readme.txt): Add missing -I$(srcdir)/doc. + +Tue Feb 2 01:10:31 1999 Geoffrey Noer <noer@cygnus.com> + + * sysdef/*: Replace all files with new ones by Anders + Norlander <anorland@hem2.passagen.se>. Please read sysdef/README + for more information. + +Mon Feb 1 14:55:11 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (sort_by_name): Sort based on length of native_path + to ensure maximal match when converting from native -> UNIX. + * cygwin.din: Make more data variables DATA. + +Mon Feb 1 13:31:43 1999 Geoffrey Noer <noer@cygnus.com> + + * fhandler_tape.cc: Change all fhandler_tape private functions + to be named foo_bar_baz-style instead of FooBarBaz. Add some + parens around logical ors/ands for clarity. Respace. + * fhandler.h: Change protos here in light of above. + +Thu Jan 28 11:00:00 Corinna Vinschen <corinna.vinschen@cityweb.de> + + * errno.cc: Support for Windows errors ERROR_CRC and ERROR_NO_READY + and for error ENOMEDIUM. + +Wed Jan 27 01:05:39 1999 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (rmdir): Correct errno setting when attempting to rmdir + a non-directory. + +Tue Jan 26 17:36:12 1999 Geoffrey Noer <noer@cygnus.com> + + * registry.cc (reg_key::build_reg): Add FIXME. + +Tue Jan 26 01:30:48 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount_info::from_registry): Import old v1 mounts + only if current mount layout doesn't exist yet in both user + and system areas (when had_to_create_mount_areas == 2). + (mount_info::import_v1_mounts): New, was upgrade_v1_mounts. + (mount_info::from_v1_registry): Add missing comma in reg_key + creation call. + (mount_info::init): Init had_to_create_mount_areas to zero. + * external.cc (cygwin_internal): Fix reference to + upgrade_v1_mounts. + * shared.h: Change upgrade_v1_mounts proto to import_v1_mounts. + Add new had_to_create_mount_areas variable in mount_info class. + * registry.cc (reg_key::build_reg): Increment + had_to_create_mount_areas whenever we create a new mount area. + + * include/sys/mount.h: Don't define MOUNT_EXEC until we actually + implement this functionality. + + * utils/mount.cc (do_mount): Print warning messages after the + actual mount attempt so we don't see warnings when mount fails. + (usage): Change name of --upgrade-old-mounts flag to + --import-old-mounts. + (main): Ditto. + +Mon Jan 25 23:56:50 1999 Geoffrey Noer <noer@cygnus.com> + + * errno.cc (seterrno_from_win_error): New. Given a Windows + error code, set errno accordingly. + (seterrno): Just call seterrno_from_win_error with the + error code returned by a call to GetLastError. + * winsup.h: Define __seterrno_from_win_error. + * path.cc: Clean up more function description comments. + (mount_info::add_reg_mount): Don't need res, just return the + right values. + (del_reg_mount): Return int, not void. If we're deleting a + system mount, set errno to EACCES and return -1 if we don't + have a valid key handle. If mount delete fails, set errno + accordingly and return -1. Otherwise, return zero for success. + (cygwin_umount): Delete mount from registry first, only remove + from internal table if successful. + * shared.h: Make del_reg_mount proto return int. + +Mon Jan 25 22:40:15 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount_info::mount_slash): Add mount to registry + first, only add to internal table if successful. + (mount_info::conv_to_posix_path): Ditto. + (mount): Ditto. + (mount_info::add_reg_mount): Return int, not void. If we're + writing a system mount, first check if we have a valid key handle. + If we don't, set errno to EACCES and return -1. Otherwise return + zero for success. + * shared.h: Make add_reg_mount proto return int. + +Mon Jan 25 20:40:26 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount_info::init): Don't read automount info here. + (mount_info::from_registry): Read it here instead. Also, read + system registry info in KEY_READ mode. + (mount_info::read_mounts): Read mount info with KEY_READ access + permissions. + +Mon Jan 25 19:12:31 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc: Improve several function description comments. + (mount_info::init): Read automount information from the + registry before potentially automounting slash. + (mount_info::conv_to_posix_path): Create automount with + automount_flags flags. + (mount): Now flags is more than just a toggle so we + must check it in a different manner. And simply check + MOUNT_AUTO as the indicator. If we want to change the + automount_prefix, also change automount_flags as appropriate. + Fix args to syscall_printf. + (write_automount_info_to_registry): New. Was + write_automount_prefix_to_registry. + (read_automount_info_from_registry): New. Was + read_automount_prefix_from_registry. + * shared.h: Adjust protos for function renames just mentioned. + * include/sys/mount.h: Delete MOUNT_CHANGE_AUTOMOUNT_PREFIX + since we don't really need it. + * utils.cc (mount): Pass MOUNT_AUTO as indicator of desire to + change automount prefix. + (show_mounts): Change spacing so there's room for "system,auto" + in Type column. + +Mon Jan 25 13:17:40 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc: Change all references from "automount root" to + "automount prefix", avoiding potential nomenclature confusion + with the root of the file system. + (read_automount_prefix_from_registry): New. Was + read_automount_root_from_registry. + (read_automount_prefix_from_registry): New. Was + read_automount_root_from_registry. Also read the default + flags for automounts from registry at the same time. + (write_automount_prefix_to_registry): New. Was + write_automount_root_to_registry. Also set automount flags + in registry using new auto_flags arg. + (mount): Add flags arg to write_automount_prefix_to_registry call. + * shared.h: Add automount_flags variable to mount_info class. + Adjust protos for function renames listed above. + + * include/sys/mount.h: Comment out MOUNT_MIXED and MOUNT_SILENT + whose values could be reused now that we're using a new mount + layout. Change MOUNT_CHANGE_AUTOROOT to + MOUNT_CHANGE_AUTOMOUNT_PREFIX. + + * utils/mount.cc (change_automount_prefix): New. Was + change_automount_root. Add new flags argument so it's possible + to change the default automount flags. + (main): Option name change from --change-automount-root to + --change-automount-prefix. + (usage): Update in light of option changes. + * utils/umount.cc (remove_all_automounts): Also need to check + for mnt_type looking like "system,auto" now that it's possible + for automounts to be located in the system registry. + +Mon Jan 25 08:59:04 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (linebuf::add): Ensure that there is always + enough space for line being added. Always null terminate. + (linebuf::prepend): Ditto. + +Sat Jan 23 01:30:16 1999 Geoffrey Noer <noer@cygnus.com> + + Make mount.exe able to upgrade mounts: + * external.cc: Fix file description. + (cygwin_internal): Handle CW_READ_V1_MOUNT_TABLES case, in + which case call upgrade_v1_mounts to upgrade old registry + area mounts. + * external.h: Add CW_READ_V1_MOUNT_TABLES to enum. + * shared.h: Make upgrade_v1_mounts public. + + * utils/mount.cc: Include winsup.h, external.h, undef errno since + it's defined by winsup.h. + (usage): Add --upgrade-old-mounts option to usage info. + (main): Handle --upgrade-old-mounts flag by calling + cygwin_internal with the right constant. + +Sat Jan 23 00:40:17 1999 Geoffrey Noer <noer@cygnus.com> + + First pass at mount table backwards compatibility with v1 + mounts: + * path.cc (mount_info::from_registry): For now, upgrade from + old v1 mount registry area if nmounts==0 after reading new mount + areas. + (mount_info::read_v1_mounts): New function. Given a regkey, read + the mounts in the old v1 registry layout corresponding to the key. + A "which" arg tells us which registry we're reading so that we + can include MOUNT_SYSTEM when reading old system mounts. + (mount_info::from_v1_registry): New function. Retrieve old v1 + mount table area mounts. + (mount_info::upgrade_v1_mounts): New function. Retrieve old + v1 mounts, add them to the current registry mount location. + (mount_info::to_registry): New function. For every mount in + the internal mount table, add it to the correct registry. + * shared.h: Add protos for new mount_info functions -- + from_v1_registry, read_v1_mounts, upgrade_v1_mounts, to_registry. + Don't need class name in protos for + build_automount_mountpoint_path, write_automount_root_to_registry, + and read_automount_root_from_registry. + +Fri Jan 22 22:45:07 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Arg 2 missing from special case + command/cmd handling. + +Fri Jan 22 22:40:32 1998 Corinna Vinschen <corinna.vinsche@cityweb.de> + + * fhandler_raw.cc (fhandler_dev_raw::raw_read): bytes_to_read + corrected to multiple of 512 bytes instead of multiple to + devbufsiz. Insert break on ReadFile returned 0 Bytes. + +Fri Jan 22 15:50:49 1999 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Fix handling of CVS tag output. + * errno.cc: Mark exported data as __declspec(dllexport). + * times.cc: Ditto. + * fhandler.cc (fhandler_base::open): Yet another stab + at correcting handling of binmode/textmode ramifications. + * path.cc (hash_path_name): Make /. == '' for purposes + of generating a hash. + +Fri Jan 22 11:45:28 1999 Christopher Faylor <cgf@cygnus.com> + + * path.cc (slash_unc_prefix_p): Generalize to allow + either type of slash. + (mount_info::add_item): Don't disallow UNC specs in + the mount table. + * utils/Makefile.in: Always use current stub library. + +Fri Jan 22 08:52:36 1999 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (regopt): Use correct registry key for Program + Options given new mount layout. + * cygwin.din: export __mb_cur_max from newlib. + +Thu Jan 21 16:52:20 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc (cygwin_split_path): Adjust two FIXMEs. + (mount_info::write_automount_root_to_registry): Return int, + 0 on success, -1 if path is problematic. + (mount): Check return of write_automount_root_to_registry + and act appropriately. Do syscall_printf when adjusting automount + as well as regular mount. + * shared.h: mount_info::write_automount_root_to_registry now + returns an int. + * utils/mount.cc (main): don't sanity-check automount path + here, instead let the DLL take care of that. + +Thu Jan 21 17:12:26 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Rewrite argument handling for + cleaner, one-pass operation. + (linebuf::add): New method for adding arguments to end + of the argument list. + (linebuf::prepend): New method for pushing arguments on + the front of the argument list. + +Wed Jan 20 19:06:30 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc (mount_info::mount_slash): only call add_reg_mount if + add_item succeeded. + (mount_info::add_item): Fail if native path doesn't start with + <drive letter>: or if posix path doesn't start with a slash. + +Wed Jan 20 19:06:30 1999 Geoffrey Noer <noer@cygnus.com> + + * fhandler_raw.cc: Correct copyright date, reformat. + * fhandler_floppy.cc: Ditto. + * fhandler_tape.cc: Ditto. + +Wed Jan 20 17:54:02 1999 Geoffrey Noer <noer@cygnus.com> + + Remove //<drive>/ support. Add support for automounts in + user registry area. + * path.cc: Rewrite, reformat docs at top in light of removing + //<drive>/ support and new automount support. Add more function + description comments. + (slash_drive_prefix_p): Remove function. + (build_slash_drive_prefix): Ditto. + (slash_drive_to_win32_path): Ditto. + (mount_info::init): After everything else, read the automount_root + by calling read_automount_root_from_registry(). + (mount_info::mount_slash): Automount slash with MOUNT_AUTO. + (mount_info::conv_to_win32_path): Remove //<drive>/ support code. + (mount_info::build_automount_mountpoint_path): Construct the name + of an automount POSIX path, given automount_root and the Win32 + path that needs to be automounted. + (mount_info::conv_to_posix_path): Automount missing drive letter + and call conv_to_posix_path again if path isn't covered by the + mount table but starts with "<letter>:". + (mount_info::read_automount_root_from_registry): New function. + Read in the value of automount_root from the current_user + registry mount area. If there isn't one, use default of + "/cygdrive" and write that to the registry by calling + write_automount_root_to_registry(). + (write_automount_root_to_registry): Write a value of + automount_root to the user registry area. + (mount_info::del_item): Add new flags arg to specify which + registry to delete the mount from. + (mount_info::del_reg_mount): Ditto. + (mount_item::getmntent): Use mount_info mnt_foo strings to store + strings passed back in the mntent struct. Otherwise if you + delete a mount item while using getmntent, the pointer may + change on the user. Add ",auto" to mnt_type if MOUNT_AUTO flag is + set. + (mount): Add support to set auto_root to path if flags is set + to the special MOUNT_CHANGE_AUTOROOT flag otherwise do the normal + thing. + (umount): Call cygwin_umount with flags value of 0. + (cygwin_umount): New exported function. Same as umount but + takes an additional flag argument that specifies which registry + area from which umount should remove the mount point. + * cygwin.din: Export the cygwin_umount call. + * shared.h (mount_info): Add public automount_root string. + Add public proto for write_automount_root_to_registry(). + Add private protos for build_automount_mountpoint_path() and + read_automount_root_from_registry(). Add flags arg to del_item + and del_reg_mount protos. Add strings used by getmntent et al + including mnt_type, mnt_opts, mnt_fsname, mnt_dir. (Can't just + pass back pointers to mount paths because they may change as + a result of a umount call. + + * include/sys/mount.h: Add new MOUNT_AUTO and + MOUNT_CHANGE_AUTOROOT flags. Add proto for cygwin_umount + function. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 9. + + * utils/mount.cc: Change missing_dir_warning flag to force + and init to FALSE instead of TRUE. Throughout swap names and + setting as appropriate. Include errno.h. + (usage): Remove info about --reset. Add info for new + --change-automount-root option. + (main): Don't check the --reset flag. Call change_automount_root + if invoked with --change-automount-root. Only call do_mount + if !mount_already_exists unless force flag is TRUE. Otherwise + fail. + (mount_already_exists): New helper function. Returns 1 + if the mount point of the same registry location is already + mounted. + (reset_mounts): Remove function. + (change_automount_root): New function that changes the + automount root in the registry via Cygwin by passing the new + path to mount() with the special MOUNT_CHANGE_AUTOROOT flag. + * utils/umount.cc: Add progname, set to argv[0]. Include string.h. + (usage): New function to print out usage info. + (main): Loop through argcs. Handle new flags to remove all mounts + of a specific type including --remove-all-mounts, + --remove-user-mounts, --remove-system-mounts, and + --remove-auto-mounts. New flag to specify removing a system + mount. Call cygwin_umount instead of umount, providing flags + as appropriate. + (remove_all_mounts): New function. Remove all mounts in + both tables. + (remove_all_automounts): Remove all mounts marked auto. + (remove_all_user_mounts): Remove all user mounts, including auto + mounts. + (remove_all_system_mounts): Remove all system mounts. + + * registry.cc (reg_key::get_string): Fix description comment. + * strace.cc: Minor reformatting. + +Wed Jan 20 17:49:20 1999 DJ Delorie <dj@cygnus.com> + + * fhandler.cc (raw_write): Make sure that a disk full error + is properly signalled. + (fhandler_base::open): Only tapes are read/write, cd-roms may be + read-only (from Corinna). + +Wed Jan 20 10:46:48 Corinna Vinschen <corinna.vinschen@cityweb.de> + + [applied by DJ Delorie <dj@cygnus.com>] + + * fhandler_raw.cc (fhandler_dev_raw::writebuf): Writes only + as much bytes as needed, instead of full buffer size. + + * fhandler_tape.cc (fhandler_dev_tape::close): Corrected error + handling in case of error while writing buffer content to dev. + + * fhandler_floppy.cc (fhandler_dev_floppy::close): Ditto. + + * fhandler_tape.cc (fhandler_dev_tape::writebuf): Delete function + + * fhandler_floppy.cc (fhandler_dev_floppy::writebuf): Ditto. + + Patch suggested by Ron Parker <rdparker@butlermfg.org> + * path.cc (mount_info::conv_to_win32_path): Change the + recognition of UNC devices, to support also paths of type + `\\.\UNC\'. + + * fhandler_tape.cc (fhandler_dev_tape::close): Fixed rewind + to block 1 instead of block 0 on rewind tapes in case of + uncaught signal (e.g. Ctrl-C). + + * path.cc (get_raw_device_number): New static function, + checks path for windows raw device. + + * path.cc (get_device_number): Change for recognition of + windows raw device paths by calling `get_raw_device_number()'. + + * path.h: Change prototype for `get_device_number()'. + + * Makefile.in: Added file 'fhandler_raw.o' to dependencies. + + * include/cygwin/rdevio.h: New file to support ioctl commands + on random access raw devices. At the time only get/set buffersize + for raw_read/raw_write. + + * fhandler.h: Change class hierarchy. 'fhandler_dev_floppy' + and 'fhandler_dev_tape' are now derived classes of + 'fhandler_dev_raw', which is derived from 'fhandler_base'. + + * fhandler_raw.cc: New file for implementation of class + 'fhandler_dev_raw' which is now base class for support of + mass storage raw devices. + + * fhandler_dev_tape.cc: Rewritten. + + * fhandler_dev_floppy.cc: Rewritten. Now supporting correct + lseek (seeking only to positions on 512 byte boundaries, + like supported from WinNT). + + * Makefile.in: Added file 'fhandler_floppy.o' to dependencies. + + * fhandler_floppy.cc: New file to support raw devices + including multi volume operations. + + * fhandler.cc: Delete 'fhandler_dev_floppy' implementation. + + * fhandler.h: Extend class fhandler_dev_floppy. + + * fhandler_tape.cc: Rewrite for correct support + of multi volume operations. Supports Setmarks now. + + * fhandler.h: Add private method `clear()' to class + fhandler_dev_tape. + + * Makefile.in: Add file 'fhandler_tape.o' to dependencies. + + * path.cc (mount_info::conv_to_win32_path): Change the + recognition of UNC devices, to support devices, which + are not partitions, too. + + * fhandler.h: Extend struct 'fhandler_dev_tape' for tape support. + Add method 'fstat' to fhandler_dev_floppy to get S_ISBLK(). + + * fhandler.cc (fhandler_base::open): In any case 'access_' has to + be GENERIC_READ | GENERIC_WRITE for tapes, to allow tape control. + No 'SetFilePointer' for tapes. + + * fhandler_tape.cc: New file to support rewind (/dev/stX) and + norewind (/dev/nstX) tapes. Supports ioctl() calls, described + in... + + * include/sys/mtio.h, include/cygwin/mtio.h: New header files + for tape support. + +Sat Jan 16 21:59:36 1999 Geoffrey Noer <noer@cygnus.com> + + * registry.h: Delete; move contents into shared.h except for + posix_path_p() routine which disappears. + * {Makefile.in, environ.cc, net.cc, path.cc, registry.cc, + shared.cc}: No longer include registry.h. + * dcrt0.cc (dll_crt0_1): don't check posix_path_p() + + * include/mntent.h (struct mntent): Drop const from strings. + * include/sys/mount.h: Change MOUNT_GLOBAL flag that nobody has + used yet to MOUNT_SYSTEM. Add MOUNT_EXEC flag. + * include/cygwin/version.h: Bump CYGWIN_VERSION_MOUNT_REGISTRY to + 2. Change CYGWIN_INFO_CYGWIN_REGISTRY_NAME to "Cygwin". + Change CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME to "mounts v2". + + * registry.cc (reg_key::reg_key): Default key doesn't end in + "mounts" any more. + (reg_key::kill): Return error code from RegDeleteKeyA. + * path.cc: Reformat, reorder functionality, add comments + throughout. + (mount_info::init): Automount slash if it's not already mounted. + (mount_info::mount_slash): New private helper function. + (mount_info::binary_win32_path_p): Check flags to determine + if mount is binary or not, not binary_p. + (mount_info::read_mounts): Remove unneeded access argument. Use + RegEnumKeyEx to enumerate mount points in current registry + location where each key name returned is a posix_path mount + location. Use a subkey reg_key to read the posix_path's + corresponding native_path and flags. + (mount_info::from_registry): Access HKEY_LOCAL_MACHINE registry + with full access privs (which will fail if not administrator). + Fix registry path used to initialize HKEY_LOCAL_MACHINE reg_key. + (mount_info::to_registry): Delete function. Replaced by + add_reg_mount. + (mount_info::add_reg_mount): New function which adds a specified + mount point to the registry. + (mount_info::del_reg_mount): New function which deletes the + posix_path argument from the highest priority registry table it + can (first user, than system-wide). + (sort_by_name): If the two posix_paths are the same, then + differentiate between them looking at MOUNT_SYSTEM in their flags. + (mount_info::add_item): Also make sure that neither path is NULL. + Never claim mount point is busy: replace an existing posix_path + as long as it came from the same registry location. + (mount_info::del_item): Also make sure that neither path is NULL. + (mount_item::getmntent): Use mnt_type field to store user vs. + system registry location string. Cast all strings to char *. + Handle flags instead of binary_p. Change names of strings + returned in mnt_opts field. + (mount_item::init): Set flags, instead of dealing with binary_p + and silent_p. + (mount): Call add_reg_mount instead of to_registry. + (umount): Call del_reg_mount instead of to_registry. + (path_conv::path_conv): Remove reference to silent_p. + * path.h (path_conv): Remove silent_p. + + * utils/mount.cc: Add -s to usage (was a commented-out -g). + Or in MOUNT_SYSTEM if -s flag given. Add similar commented-out + support for future MOUNT_EXEC flag that will be added with -e. + (reset_mounts): Automount slash with zero for flags, not + MOUNT_SILENT which we no longer use for anything. + * utils/umount.cc: Also print out usage if the first argument + starts with a dash. + +Fri Jan 15 11:27:51 1999 DJ Delorie <dj@cygnus.com> + + * strace.cc: add macros to protect against buffer overruns + (strace_printf): increase buffer from 6000 to 1000 to build devo + * include/sys/strace.h: allow -DNOSTRACE again + +Fri Jan 15 11:27:51 1999 DJ Delorie <dj@cygnus.com> + + * dcrt0.cc (alloc_stack): add 16384 to work around Win95 page + fault during builds + * fork.cc (fork): try various things to avoid page faults during + win95 builds. + +Fri Jan 15 11:18:23 1999 DJ Delorie <dj@cygnus.com> + + * fhandler.cc (raw_write): check for disk full. + +Fri Jan 15 11:18:23 1999 DJ Delorie <dj@cygnus.com> + + * init.cc (dll_entry): if the DLL is being LoadLibrary'd, + initialize some things. + * heap.cc (_sbrk): detect uninitialized heap and initialize + * dcrt0.cc (user_data): initialize to something useful. + (do_global_ctors): make global for init.cc + +Thu Jan 14 02:16:44 1999 Geoffrey Noer <noer@cygnus.com> + + * dll_init.cc: Add missing FIXME in comment. + * fhandler_console: Ditto. + +Thu Jan 14 00:53:25 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (iscmd): New function. + (spawn_guts): Treat command /c and cmd /c as special + cases. Don't quote arguments to these programs if + there are exactly three arguments. + * dcrt0.cc (dll_crt0_1): Initialize exceptions prior + to fork to allow forked processes to "dump core". + * errno.cc (seterrno): No need for this to be extern "C". + * winsup.h: Ditto. + +Wed Jan 13 19:06:08 1999 Geoffrey Noer <noer@cygnus.com> + + * registry.cc: Add comments corresponding to various reg_key + functions, minor reformatting. + (reg_key::reg_key): Delete already-commented-out function + +Wed Jan 13 15:41:34 1999 DJ Delorie <dj@cygnus.com> + + * errno.cc (_sys_errlist): Add "extern" to work around new gcc + restrictions. + +Mon Jan 11 14:56:27 1999 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Fix problem with #! and relative + directories. + +Mon Jan 11 09:00:29 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::read1): Handle EOF as a + specific case. + +Sun Jan 10 23:44:22 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h: Define __fmode for convenience. Use throughout. + * environ.cc (parse_options): Use O_TEXT when nobinmode. + * fhandler.cc (fhandler_base::open): Don't honor __fmode + when disk file. Default to O_TEXT if no mode is specified. + (fhandler_base::fhandler_base): Don't honor __fmode when disk + file. Otherwise default to O_BINARY. + * pipe.cc (make_pipe): Default to O_BINARY if no mode specified. + +Sat Jan 9 20:58:34 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Correct previously messed up patch. + * thread.h: Add back a needed include. + * sigproc.cc (sigproc_init): Work around problem with older + compilers. + * wait.cc (wait4): Ditto. + * winsup.h (per_thread_waitq): Ditto. + * include/Windows32/CommonFunctions.h: Temporary change to + work around problems with older compilers. + +Fri Jan 8 12:53:53 1999 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (parse_options): Add "forkchunk" debug setting. + Takes a value which is used to limit the size of individual memory + copies in a fork. + * fork.cc (fork_copy): Rewrite slightly to allow copying of + individual chunks of memory rather than all in one gulp. + Controlled by chunksize global variable. + +Thu Jan 7 22:02:18 1999 Christopher Faylor <cgf@cygnus.com> + + patch from Corinna Vinschen <corinna.vinschen@cityweb.de>: + * utils/passwd.c: New file. + * utils/Makefile.in: Add dependencies for passwd. + * syscalls.cc (chmod): Change permission checking in case + of readonly test. + (stat_dev): Change default permission bits to allow writing + for all users. + (chown): Retry LookupAccountName with username set to domain\\username, + if returned SID-Type is not SidTypeUser. + + +Thu Jan 7 17:50:49 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::set_name): Fix bug which + disallowed '%' in a file name. + +Thu Jan 7 00:21:41 1999 Geoffrey Noer <noer@cygnus.com> + + * path.cc: Add comments. + * path.h: Correct file description comment. + +Tue Jan 5 16:07:15 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler_serial.cc (fhandler_serial::raw_read): Be more defensive + about not calling problematic functions when the overlapped I/O is + armed. Reset the overlapped event prior to calling read or suffer + an "operation aborted". + * select.cc (peek_serial): Ditto. + +Mon Jan 4 15:16:22 1999 Geoffrey Noer <noer@cygnus.com> + + Eliminate warnings: + * utils/mount.cc (show_mounts): make format a const char *. + * utils/ps.cc (main): make literal strings const char *s. + * utils/cygpath.cc (long_options): cast literal strings to char *s. + (main): + +Sun Jan 3 20:46:12 1999 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_console): Remove #if 0 around NT code workaround. + +Sat Jan 2 00:04:01 1999 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove include directories made obsolete by + recent changes to mmap.cc. Also remove libraries that appear + to be unnecessary for linking. + * mkvers.sh: Put contents of .snapshot-date, if available, into + the DLL. + +Fri Jan 1 22:44:49 1999 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_serial): Add flag to track state of + overlapped serial I/O. Add overlapped_setup method for common + setup of overlapped structure. + * fhandler_serial.cc (fhandler_serial::overlapped_setup): New + method. Sets up the overlapped structure for overlapped serial I/O. + (fhandler_serial::raw_read): Use overlapped_armed flag to avoid + calling functions which perform overlapped operations if overlapped + I/O is in already progress. This should only be the case if a + previous operation was interrupted or select has detected serial I/O. + (fhandler_serial::open): Use overlapped_setup. + (fhandler_serial::fixup_after_fork): Ditto. + (fhandler_serial::de_linearize): Ditto. + (fhandler_serial::dup): Ditto. + (fhandler_serial::tcsetattr): Fix typo which caused IGNPAR + to be ignored. + * hinfo.cc (hinfo::select_read): Set saw_error to zero explicitly + to avoid spurious reporting of select errors. + (hinfo::select_write): Ditto. + (hinfo::select_except): Ditto. + * select.cc (peek_serial): Use overlapped_armed to avoid calling + functions which perform overlapped operations if overlapped I/O + is already in progress. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2000 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2000 new file mode 100644 index 000000000..54494e610 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2000 @@ -0,0 +1,4150 @@ +Tue Dec 27 1:08:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add symbols for `getrlimit' and `setrlimit'. + * exceptions.cc (stackdump): Avoid creating stackdump when + `rlim_core' is 0. + * resource.cc: New global variable `rlim_core'. + (getrlimit): New function. + (setrlimit): Ditto. + include/cygwin/version.h: Bump minor API version to 32 due to + adding `getrlimit' and `setrlimit'. + include/sys/resource.h: Add defines, types and prototypes for + `getrlimit' and `setrlimit'. + +Mon Dec 25 22:18:42 2000 Christopher Faylor <cgf@cygnus.com> + + * autoload.h: Make DLL initializers global to avoid inlining. + * exceptions.cc (interrupt_setup): Reorganize arguments to allow use of + regparm. + (interrupt_now): Ditto. + (interrupt_on_return): Ditto. + (call_handler): Ditto. + +Mon Dec 25 13:36:44 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump DLL minor version number to 8. + +Wed Dec 20 13:37:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add load statement for SetSecurityDescriptorControl. + * security.cc (alloc_sd): Always set SE_DACL_PROTECTED flag on + Win2K and higher. + +Wed Dec 20 01:02:13 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (reset_signal_arrived): Make global to avoid inlining. + +Wed Dec 20 00:57:10 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_serial.cc (fhandler_serial::raw_read): Always find number of + bytes ready to be read whether overlapped_armed or not. + +Tue Dec 19 21:39:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (remove): New function, overriding the newlib + implementation. + +Tue Dec 19 16:26:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (struct parse_thing): Add entry for new CYGWIN option + `smbntsec'. + * path.cc (path_conv::check): Check path for being a remote path. + If so and `allow_smbntsec' is set to FALSE, set has_acls to FALSE. + * security.cc: Add global definition for `allow_smbntsec'. + * security.h: Add extern declaration for `allow_smbntsec'. + * fhandler.cc (fhandler_disk_file::open): Eliminate extern declaration + of `allow_ntsec'. + * syscalls.cc: Ditto. + +Fri Dec 15 18:54:42 2000 Bradley A. Town <townba@pobox.com> + + * fhandler_console.cc (read): Add support for xterm-style mouse event + reporting. + (fhandler_console::char_command): Honor mouse events. + (fhandler_console::open): Enable mouse input events. + (fhandler_console::input_tcsetattr): Ditto. + * select.cc (peek_console): Add check for mouse events. + +Fri Dec 15 17:23:17 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Calculate path name length overruns + more dynamically. + (normalize_win32_path): Ditto. + * Makefile.in: Avoid scanning the directory twice for *.d files. + +Thu Dec 14 23:37:51 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_console): Add additional argument to + char_command method. + * fhandler_console.cc (fhandler_console::read): Revert previously + misapplied patch. + (fhandler_console::char_command): Add a second argument. + (fhandler_console::write): Recognize when a '?' is found after a + <esc>[. + +Tue Dec 5 17:06:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_rexec): Eliminate superfluous call to + `set_socket_inheritance'. + * include/sys/socket.h: Add SUS defines for option values to `shutdown'. + +Sun Dec 10 17:19:04 2000 Christopher Faylor <cgf@cygnus.com> + + * include/sysexits: New file. + +2000-12-09 Egor Duda <deo@logos-m.ru> + + * autoload.cc: Autoload CharToOemA. + * dcrt0.cc (dll_crt0_1): Translate command line to OEM if current + codepage is OEM. + * environ.cc: Add new option 'codepage' to CYGWIN environment variable. + * fhandler_clipboard.cc (fhandler_clipboard::read): Read clipboard in + OEM mode if current codepage is OEM. + * fhandler_console.cc (fhandler_console::read): Only translate console + input if current codepage is ANSI. + * fhandler_console.cc (fhandler_console::write_normal): Translate + output data if current codepage is ANSI. + * pinfo.cc (codepage_init): New function. Setup current codepage from + CYGWIN environment variable and set codepage for file APIs. + * security.cc (read_sd): Translate file name to it if current codepage + is OEM. + * winsup.h: (sys_wcstombs,sys_mbstowcs): Use current codepage for + translations between multibyte and widechar string and vice versa. + +Sat Dec 9 16:29:45 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_win32_path): Check for explicit use of two slashes + at the beginning of a path. These should be treated specially + regardless of whether they are UNC paths or old-style //a paths. Avoid + adding cwd to a path if the path already begins with '/'. + +Fri Dec 8 22:21:01 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_win32_path): Reorganize logic to accommodate + chroot. Always check for MAX_PATH overrun. Avoid adding one too many + backslashes when src path begins with a slash. From Corinna Vinschen. + * winsup.h: Force demangling for dll_crt0 for newer compilers. + +Thu Dec 7 12:10:00 2000 Edward M. Lee <tailbert@yahoo.com> + + * cygwin.din: Declare strtok_r for the import lib. Already in the DLL. + +Wed Dec 6 15:39:18 2000 Earnie Boyd <earnie_boyd@yahoo.com> + + * include/sys/uio.h (readv): Correct prototype. + (writev): Ditto. + +Tue Dec 5 17:06:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/uio.h: Include <sys/cdefs.h>. Use __BEGIN_DECL and + __END_DECL. + Add declarations for `readv' and `writev'. + +Mon Dec 4 20:49:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Change `-nostartfiles' to `-nostdlib' to avoid + automatic linking with default libraries when linking new-cygwin1.dll. + Link with libgcc.a and libstdc++.a explicitly. + +Sun Dec 3 01:20:25 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_win32_path): Handle UNC paths better. + (slash_unc_prefix_p): Allow backslash UNC paths. + +Sun Dec 3 00:20:25 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove some extra cruft. + +Sun Dec 3 00:13:26 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use CXX to build the DLL. + * configure.in: Find correct c++ compiler. + * configure: Regenerate. + * path.cc (normalize_posix_path): Put correct drive at beginning of \foo style paths. + (chdir): Don't send non-posix path to cygcwd.set. + +Sat Dec 2 22:26:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_inet_addr ): Close AF_UNIX socket file after reading. + +Wed Nov 29 18:25:53 2000 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * cygheap.cc (chgheap_root::operator =): Check root dir properly. + +Thu Nov 29 18:11:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_inet_aton): Return nonzero if the address + is valid, zero if not according to Linux man page. + +Mon Nov 27 21:09:50 2000 Kelley Cook <kelley.cook@home.com> + + * mmap.cc (munmap): Check that mmap and munmap length match. + +Tue Nov 28 18:08:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::open): Check for buggy CreateFile + condition. + * path.cc (path_conv::check): Get file system type in call to + GetVolumeInformation to check for file systems with buggy CreateFile. + * path.h (enum path_types): Add PATH_HASBUGGYOPEN. + (class path_conv): Add methods `has_buggy_open' and + `set_has_buggy_open'. + +Sun Nov 26 16:26:14 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (is_at_eof): New function. + (fhandler_base::raw_read): Detect special case where last error == + ERROR_NOACCESS but the file is at EOF. Most UNIXes do not consider + this to be an error. + +Sun Nov 26 14:37:29 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump DLL minor version number to 7. + +Sat Nov 25 11:27:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump minor API version due to adding + inet_aton. + +Sat Nov 25 11:07:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_inet_aton): New function. + * cygwin.din: Export cygwin_inet_aton as inet_aton. + +Sat Nov 25 01:57:42 2000 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (mount_info::read_cygdrive_info_from_registry): Read system + cygdrive prefix with KEY_READ. + (mount_info::get_cygdrive_info): Ditto. + +Wed Nov 22 11:18:02 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: new-temp.a -> new-templib.a + +Mon Nov 20 17:04:43 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Quoting was still wrong. Keep trying to + fix it. + +Mon Nov 20 14:26:38 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): YA tweak for dealing with arcane rules of + quoting in "normal" Microsoft programs. + * child_info.h: Bump fork magic number. + * include/sys/mount.h: Add an entry for mixed mode. + +Fri Nov 17 12:28:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (normalize_posix_path): Special care for root directory + in case of files beginning with a dot. + +Fri Nov 17 12:28:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc (syslog): Add users SID to NT syslog entry. + +Thu Nov 16 15:59:58 2000 Bradley A. Town <townba@pobox.com> + + * fhandler_console.cc: New member variable `dwBufferSize' for `info'. + (fillin_info): Set `dwBufferSize' to the size of the console buffer. + (clear_screen): Use width of console buffer to calculate how many + spaces to clear. + +Thu Nov 16 15:24:45 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Make import library creation 'make -j2' friendly. + +Thu Nov 16 10:28:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (uinfo_init): Call `cygwin_set_impersonation_token' to + reset `cygheap->user.token' to INVALID_HANDLE_VALUE. + +Thu Nov 16 00:18:15 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interrupt_setup): Don't set signal mask here or races + occur with main thread. Set it in sigdelayed instead. + (sigreturn): Reflect change in stack order of ebp and flags. + (sigdelayed): Set stack frame correctly. Call set_process_mask here + with flags for last trapped signal. + (signal_dispatch): Add newmask. + * sigproc.cc (wait_sig): Eliminate ill-considered attempt to halt + looping signal processors. + * perthread.h (signal_dispatch): Add newmask field. + +Wed Nov 15 22:08:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (internal_getlogin): Change parameter list to reflect + that `token' is member of cygheap_user now. + (uinfo_init): Use modified internal_getlogin. + * syscalls.cc (seteuid): Ditto. + +Wed Nov 15 21:56:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h: Move `token' and `impersonated' from class _pinfo + to class cygheap_user. + * pinfo.h: Ditto. + * fork.cc (fork_child): Change usage of `token' and `impersonated' + accordingly. + (fork_parent): Ditto. + * security.cc (cygwin_set_impersonation_token): Ditto. + * sigproc.cc (proc_subproc): Ditto. + * spawn.cc (spawn_guts): Ditto. + * syscalls.cc (seteuid): Ditto. + * uinfo.cc (uinfo_init): Ditto. + +Wed Nov 15 9:59:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Revert patch to ignore chroot settings + on creating native Win32 environment. + +Wed Nov 15 01:44:37 2000 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (slow_pid_reuse): Off-by-one. + +Wed Nov 15 01:20:24 2000 Christopher Faylor <cgf@cygnus.com> + + Throughout use myself->ppid_handle rather than parent_alive. + * child_info.h (child_info): Eliminate parent_alive. + * dcrt0.cc (dll_crt0_1): Call fork_init for debugging pid creation. + * fork.cc (fork_child): Reflect change to fixup_mmaps_after_fork + arguments. + (slow_pid_reuse): New function to grab last 'n' pids to prevent pid + reuse. + (fork_parent): Move last_fork_proc into slow_pid_reuse. + fork_pids debugging. Eliminate unnecessary call to set_child_mmap_ptr. + (fork_init): New debugging function. + * mmap.cc (fixup_mmaps_after_fork): Renamed from + recreate_mmaps_after_fork. Rely on copied data after a fork. + (set_child_mmap_ptr): Eliminate. + * pinfo.h (_pinfo): Eliminate parent_alive, mmap_ptr and reflect above + changes. + * spawn.cc (spawn_guts): Eliminate vestiges of "old way" of sending new + hProc to parent process. + +Wed Nov 15 0:51:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_root::cygheap_root): New function. + (cygheap_root::~cygheap_root): Ditto. + (cygheap_root::operator=): Ditto. + (cygheap_user::~cygheap_user): Ditto. + (cygheap_user::set_name): Ditto. + (cygheap_user::set_logsrv): Ditto. + (cygheap_user::set_domain): Ditto. + (cygheap_user::set_sid): Ditto. + * cygheap.h (cygheap_root): New class. + (cygheap_user): Ditto. + (init_cygheap): Change type of `root' member to cygheap_root. + Add `user' member. + * dir.cc (opendir): Use new `cygheap_root' class. + * dcrt0.cc (dll_crt0_1): Use new `cygheap_user' class. + * fork.cc (fork_parent): Ditto. + * grp.cc (getgroups): Ditto. + * passwd.cc (search_for): Ditto. + * path.cc: Use new `cygheap_root' class throughout. + * pinfo.h (_pinfo): Remove `use_psid'. Move `username', `psid', + `logsrv', `domain', `orig_{uid,gid}' and `real_{uid,gid}' to + cygheap_user class. + * security.cc: Use new `cygheap_user' class throughout. + * shared.cc (sec_user): Ditto. + * sigproc.cc (proc_subproc): Remove copy statements for user + related information moved to `cygheap_user' class. + * spawn.cc (spawn_guts): Invalidate current chroot settings + when creating Windows environment. Use new `cygheap_user' class. + * syscalls.cc: Use new `cygheap_user' class throughout. + * uinfo.cc: Ditto. + (internal_getlogin): Change parameters to reflect the + move of user information to cygheap. + +Tue Nov 14 17:05:00 2000 Eric Fifer <efifer@dircon.co.uk> + + * dir.cc (rewinddir): Always set __d_position = 0, so next + call to readdir() will restart the directory scan. + +Tue Nov 14 00:51:28 2000 Christopher Faylor <cgf@cygnus.com> + + * cygheap.h (init_cygheap): New struct holding values that live in the + Cygwin heap. + * child_info.h (child_info): Change pointer type of cygheap to + init_cygheap. + * cygheap.cc (init_cheap): Point cygheap_max after contents of cygheap. + Move some stuff into cygheap.h. + * dir.cc (opendir): Change to use root and rootlen in cygheap rather + than in myself. + (mkdir): Change to use umask in cygheap rather than in myself. + * path.cc: Ditto, throughout. + * syscalls.cc (_open): Ditto. Change to use umask in cygheap rather + than in myself. + (chroot): Change to allocate root dir on the cygwin heap. + (umask): Change to use umask in cygheap rather than in myself. + (cygwin_bind): Ditto. + * sigproc.cc (proc_subproc): Don't copy umask or root stuff as this + happens automatically now. + * pinfo.h (_pinfo): Migrate stuff out of here and into init_cheap. + * dcrt0.cc (dll_crt0_1): Call cygheap_init later in startup for first + cygwin process. + +Sun Nov 12 23:01:35 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (get_device_number): Allow /dev/ttySn to designate a com + port. + +Sat Nov 11 23:55:19 2000 Christopher Faylor <cgf@cygnus.com> + + * path.h: Add __attribute__ ((regparm(x))) to commonly used functions. + * pinfo.h: Ditto. + * sigproc.h: Ditto. + * sync.h: Ditto. + +Fri Nov 10 13:48:44 2000 Bradley A. Town <townba@pobox.com> + + * dcrt0.cc: New global variable `ignore_case_with_glob'. + (dll_crt0_1): Disable case-insensitive globbing before calling `main'. + * environ.cc (glob_init): New static function to set or clear + `ignore_case_with_glob'. + (known): Changed "glob" entry to call `glob_init'. + * glob.c (match): Use case-insensitive globbing if needed. + +Thu Nov 9 14:30:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (readdir): Avoid reading from the beginning when + readdir is called after a previous call has returned NULL. + +Wed Nov 8 21:00:31 2000 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): Deal with pending newline in pty_master. + +Wed Nov 8 15:35:32 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (_addenv): malloc space for setenv if cygwin1.dll is used + in conjunction with older binaries. + (environ_init): Ditto. + +Wed Nov 8 08:49:27 2000 Jason Tishler <jt@dothill.com> + + * external.cc (get_cygdrive_info): New function. + * external.cc (get_cygdrive_prefixes): Change to use get_cygdrive_info + but toss the user and system flags. + * external.cc (cygwin_internal): Add new CW_GET_CYGDRIVE_INFO case. + * path.cc (mount_info::get_cygdrive_prefixes): Remove method. + * path.cc (mount_info::get_cygdrive_info): New method. Actually, + get_cygdrive_info is really an enhanced version of + get_cygdrive_prefixes renamed to get_cygdrive_info that also gets the + user and system flags. + * shared_info.h (get_cygdrive_prefixes): Remove method. + * shared_info.h (get_cygdrive_info): New method. + * include/cygwin/version.h: Bump minor API version due to adding + CW_GET_CYGDRIVE_INFO to cygwin_internal. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_GET_CYGDRIVE_INFO. + +Tue Nov 7 20:58:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add autoload statement for `WSASetLastError'. + * net.cc (cygwin_connect): Change error code to WSAEINPROGRESS + when connect returns WSAEWOULDBLOCK. + +Mon Nov 6 15:11:57 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (sigthread::init): Reinstitute sigthread lock as a critical + section. + (dll_crt0_1): Move sigthread lock initialization to earlier in startup. + * exceptions.cc (interrupt_on_return): Remove previous kludgy attempt + to detect an invalid frame. + (call_handler): Eliminate inner for loop. Grab signal critical section + lock where appropriate. + * sigproc.cc (proc_subproc): Restore uid setting. + * sigproc.h (sigthread): Reinstitute sigthread lock as a critical + section. + (sigframe): Grab the sigthread lock before clearing frame to avoid + having the signal thread use an invalid frame. + +Mon Nov 6 11:11:42 2000 Jason Tishler <jt@dothill.com> + + * path.cc (mount_info::read_cygdrive_info_from_registry): Use + CYGWIN_INFO_CYGDRIVE_PREFIX, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX, and + CYGWIN_INFO_CYGDRIVE_FLAGS. + * path.cc (mount_info::write_cygdrive_info_to_registry): Use + CYGWIN_INFO_CYGDRIVE_PREFIX and CYGWIN_INFO_CYGDRIVE_FLAGS. + * path.cc (mount_info::remove_cygdrive_info_from_registry): Ditto. + * path.cc (mount_info::get_cygdrive_prefixes): Use + CYGWIN_INFO_CYGDRIVE_PREFIX. + * include/cygwin/version.h: Add CYGWIN_INFO_CYGDRIVE_FLAGS, + CYGWIN_INFO_CYGDRIVE_PREFIX, and CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX. + +Mon Nov 6 11:10:44 2000 Jason Tishler <jt@dothill.com> + + * errno.cc (strerror): Change EAGAIN case to return "Resource + temporarily unavailable" instead of "No more processes". + +Mon Nov 6 01:04:35 2000 Christopher Faylor <cgf@cygnus.com> + + * child_info.h (child_info): Add pppid_handle for closing the parent's + parent handle. + * dcrt0.cc (_dll_crt0): Close parent's parent handle when spawned or + forked. + * debug.cc (add_handle): Correct erroneous reference to handle + structure when printing warning. + * exceptions.cc (interrupt_now): Always return 1. + (interrupt_on_return): Accept a sigthread argument. Check to see if + this argument has been trashed prior to setting up the stack return. + (call_handler): Add a loop around attempts to dispatch signals to + detect case where interrupt_on_return fails. + (_sigdelayed): Set up a temporary frame pointer prior to calling stuff + that could trigger an interrupt or the stack walking code will be very + confused. + * fork.cc (fork_parent): Move a lot of the setup of the child process + into proc_subproc. + * spawn.cc (spawn_guts): Ditto. Use ppid_handle to contact logical + parent when reparenting execed process. + * pinfo.h (_pinfo): Remember the logical handle of the parent process. + * sigproc.cc (proc_subproc): Record most stuff necessary for the _pinfo + structure that is inferrable from myself when adding children. + (wait_sig): Always set 'pending_signals' flag when about to kick off + the signal scanning loop. Reset it only if there are no pending + signals. + +Sun Nov 5 13:46:23 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo (wait_subproc): Son of neverending debug tweaking. + +Sun Nov 5 11:45:15 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo (wait_subproc): Neverending debug tweaking. + +Sun Nov 5 01:34:51 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (winpids:add): New method. + (winpids::enumNT): New method renamed from EnumProcessesNT. + Use add method to add elements to the lists. + (winpids::enum9x): New method renamed from EnumProcesses9x. + Use add method to add elements to the lists. + (winpids::enum_init): Accept 'winpid' parameter to control whether + to add all windows pids to the list. + (winpids::release): New method. + * pinfo.h (winpids): Reflect above changes. + * signal.cc (kill_pgrp): Ditto. + * external.cc (fillout_pinfo): Ditto. + +Sat Nov 4 22:07:03 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_sigsuspend): Record frame here for signalling. + (set_process_mask): Ditto. + +Sat Nov 4 14:24:10 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (wait_subproc): Still more debugging cleanup. + +Sat Nov 4 00:51:38 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (EnumProcessesNT): Avoid 0 pids. + (EnumProcesses9x): Ditto. + * sigproc.cc (remove_child): Eliminate. + (proc_subproc): Move remove_child stuff here. + (wait_subproc): Synchronize with proc_subproc when error occurs. Add + more debugging info. + * sigproc.h (procstuff): Add an entry. + * spawn.cc (spawn_guts): Add sigframe here. + +Fri Nov 3 20:07:14 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (wait_subproc): Refine debug output. + +Thu Nov 2 23:01:20 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (pinfo::init): Reverse order of setting status and pid info + in an execed process to avoid a race. + * sigproc.cc (wait_subproc): Print more info when a WFSO error occurs. + * automode.c: New file. + * syscalls.cc (close_all_files): Streamline slightly. + * cygheap.cc (ccalloc): Clear *entire* allocated array. + +Thu Nov 2 01:58:03 2000 Christopher Faylor <cgf@cygnus.com> + + * ntdll.h: Remove IO_COUNTERS definition since it is now in winnt.h. + +Thu Nov 2 00:10:23 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (EnumProcessesNT): New function. Eliminates dependence on + psapi.h. + (EnumProcesses9x): Rename from EnumProcessesW95. Change arguments to + be more useful for cygwin. + (winpids::init): Accommodate argument changes. + (enum_init): Ditto. + * pinfo.h (winpids): Make pidlist dynamically extendable by storing it + as a pointer and remembering the size. + * ntdll.h: Add extra definitions needed for EnumProcessesNT. Reformat + via 'indent'. + +Wed Nov 1 21:08:23 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Remove obsolete tests. + (sigreturn): Construct pseudo-frame-pointer so that signal handler can + figure out where to put return address when signals are coming in + quickly. + * path.cc (cwdstuff::get): Allow length 0 buffer length when buffer + when NULL. + +Tue Oct 31 18:12:56 2000 Christopher Faylor <cgf@cygnus.com> + + * path.h (has_exec_chars): Standard function for checking for + executable magic numbers. + * path.cc (symlink_info::check): Use the above function. + * fhandler.cc (fhandler_disk_file::open): Ditto. + +Tue Oct 31 17:57:52 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (_readlink): Return ENOENT when file does not exist. + +Tue Oct 31 23:35:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_raw): Add method `fixup_after_exec'. + +Tue Oct 31 22:39:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_raw): Add definition for method + `fixup_after_fork'. + * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Add + `set_need_fixup_after_fork' call. + (fhandler_dev_raw::~fhandler_dev_raw): Revert to user space + allocation. + (fhandler_dev_raw::open): Ditto. + (fhandler_dev_raw::dup): Ditto. Reset buffer pointer. + (fhandler_dev_raw::fixup_after_fork): New function. + * fhandler_tape.cc (fhandler_dev_tape::open): Revert to user space + memory allocation. + (fhandler_dev_tape::ioctl): Ditto. Change behaviour on MTSETBLK when + new size is 1. + +Tue Oct 31 20:56:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::open): Fix memory allocation. + Use Cygwin heap instead of user heap. + (fhandler_dev_tape::ioctl): Ditto. + +Tue Oct 31 12:00:06 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (enum_init): Don't suffer silently if we can't load the + process enumerators. + +Mon Oct 30 16:54:26 2000 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (kill_pgrp): Revert 25-Oct change. + (kill_worker): Ditto. + +Sun Oct 29 20:52:31 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump DLL minor version number to 6. + +Sat Oct 28 01:39:53 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Eliminate subdir stuff. + * configure: Regenerate. + * include/getopt.h (option): Make name field 'const'. + +Fri Oct 27 20:51:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: New file keeping all autoload stuff. + * Makefile.in: Add autoload.o to dependencies. + * dcrt0.cc: Move all autoload stuff to autoload.cc. + * fhandler_mem.cc: Ditto. + * net.cc: Ditto. + * uinfo.cc: Ditto. + +Fri Oct 27 11:37:20 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (wait_sig): Add braces to avoid confusion. + +Fri Oct 27 11:48:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: New file. + * Makefile.in: Add fhandler_socket.o to dependencies. + * fhandler.h: Change comment. + * net.cc Move all fhandler_socket methods to fhandler_socket.cc. + * winsup.h: Add declaration for `ws2_32_handle'. + +Thu Oct 26 11:51:59 2000 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::release): Check for socket. Change + cnt_need_fixup_before accordingly. + (dtable::dup2): Ditto. + (dtable::fixup_before_fork): New method. + (dtable::fixup_before_exec): Ditto. + * dtable.h (class dtable): Add member `cnt_need_fixup_before'. Add + definition for methods `dec_need_fixup_before', `inc_need_fixup_before', + `need_fixup_before', `fixup_before_exec' and `fixup_before_fork'. + * fhandler.h (class fhandler_base): Slight rearrangements. Add + definitions for methods `fixup_before_fork_exec'. + (class fhandler_socket): Eliminate superfluous constructor. + Add member `prot_info_ptr'. Add destructor. Add definitions for + methods `dup', `fixup_before_fork_exec', `fixup_after_fork' and + `fixup_after_exec'. + * fork.cc (fork_parent): Care for file types which need a fixup + before fork. Start child in suspended state then. + * net.cc: New global variable `ws2_32_handle' and `wsadata'. + (fdsock): Check for Winsock version. Call `set_socket_inheritance' + only if Winsock version < 2.0. Care for `need_fixup' count in fdtab. + (cygwin_socket): Eliminate call to `set_socket_inheritance'. + (cygwin_accept): Ditto. + (cygwin_rcmd): Ditto. + (cygwin_rresvport): Ditto. + (cygwin_rexec): Ditto. + (socketpair): Ditto. + (fhandler_socket::fhandler_socket): Set `need_fork_fixup'. Allocate + space for the WSAPROTOCOL_INFOA struct used in fixup. + (fhandler_socket::~fhandler_socket): New destructor. + (fhandler_socket::fixup_before_fork_exec): New method. + (fhandler_socket::fixup_after_fork): Ditto. + (fhandler_socket::dup): Ditto. + (wsock_init): New static function. + (LoadDLLinitfunc (wsock32)): Rearranged. + (LoadDLLinitfunc (ws2_32)): New function. + (dummy_autoload): Add autoload statemants for `WSADuplicateSocketA' + and `WSASocketA'. + * spawn.cc (spawn_guts): Care for file types which need a fixup + before exec. Start child in suspended state then. + +Wed Oct 25 20:49:59 2000 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (kill_pgrp): Don't limit sending of signals to stopped + processes when sig < 0. + (kill_worker): Only send SIGCONT to stopped processes when sendSIGCONT. + +Wed Oct 25 13:56:39 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sig_handle): Just make sure that wait_sig loops when + receiving a SIGCONT. Don't block waiting for completion that will + never occur. + +Wed Oct 25 09:59:14 2000 Christopher Faylor <cgf@cygnus.com> + + * dtable.cc (dtable::fixup_after_exec): Use variable rather than + constantly indexing into fds array. + (dtable::fixup_after_fork): Ditto. + +Wed Oct 25 10:43:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fcntl): Treat O_NONBLOCK and OLD_O_NDELAY + as exactly the same. If one is set, both are set. + * net.cc (fhandler_socket::fcntl): Ditto. + +Tue Oct 24 23:58:35 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Remove debugging statement. + +Tue Oct 24 23:45:09 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (do_exit): Don't bother looking for pgrp children to send + SIGHUP if process has never created any children. + * fork.cc (fork): Set flag indicating that there is another process + with our process group. + * spawn.cc (spawn_guts): Ditto. + * pinfo.h (set_has_pgid_children): New methods for setting when process + has children in its process group. + * syscalls.cc (setpgid): Clear has_gid_children if pgid changes. + +Tue Oct 24 20:38:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: New file. + * fhandler_mem.cc: Move ntdll.dll specific definitions and + declarations to ntdll.h. + * sysconf.cc (sysconf): Add support for _SC_NPROCESSORS_CONF, + _SC_NPROCESSORS_ONLN, _SC_PHYS_PAGES and _SC_AVPHYS_PAGES. + +Tue Oct 24 20:00:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fcntl): Behave properly when passed + previous version of O_NDELAY. + * syscalls.cc: Move OLD_O_NDELAY to winsup.h. + * winsup.h: Define OLD_O_NDELAY now. + +Mon Oct 23 21:47:55 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (signal_exit): Kill any executing child process if + we're dying. + * path.h: Remove unneeded extern. + * spawn.cc (std_suffixes): Make static. Don't set dwProcessId here + since it makes the process unsignalable. Set strace flag that this is + an execed process stub. + * strace.cc (strace::vsprntf): Use strace flag to indicate when to + visually flag that this is an exec stub. + * include/sys/strace.h (strace): Add 'execing' flag. + +Mon Oct 23 16:43:33 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (proc_subproc): Don't send a false positive if WNOHANG and + no processes are available for waiting. + +Mon Oct 23 22:27:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fcntl): Setting flags in F_SETFL + branch according to Linux documentation. + +Mon Oct 23 21:43:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc (_fcntl): Rearrange as wrapper function. Move all + functionality except F_DUPFD to fhandler classes. + * fhandler.cc (fhandler_base::fcntl): New method. + * net.cc (fhandler_socket::fcntl): Ditto. + * fhandler.h (class fhandler_base): Add method prototype for fcntl(). + (class fhandler_socket): Ditto. + +Mon Oct 23 12:44:35 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (proc_subproc): Correctly handle flags for WNOHANG case. + +Mon Oct 23 10:00:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: Eliminate C++ comments throughout. + +Sun Oct 22 23:33:00 2000 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork): Set sigframe here, since it can pause for a + considerable amount of time. + * environ.cc (_addenv): Add debugging. + * fhandler.cc: Eliminate unneeded include. + * smallprint.c: Ditto. + +Sun Oct 22 12:07:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo_init): Eliminate call to `set_process_privileges'. + * security.cc (write_sd): Call `set_process_privileges' on the first + call to `write_sd'. + (set_process_privileges): Eliminate adjusting SE_BACKUP_NAME privilege. + +Sat Oct 21 16:57:23 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (pinfo::init): Make PID_EXECED signal creation as well as + PID_IN_USE. + +Sat Oct 21 01:52:54 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Don't do the reparenting step if we notice + that the child has exited prior to sending the subprocess_ready signal + (?). + +Sat Oct 21 00:46:36 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_console): Remove tcsetpgrp. + * fhandler_console.cc (fhandler_console::tcsetpgrp): Eliminate. + * fork.cc (fork_parent): Avoid returning same pid twice in a row + regardless of OS. + * pinfo.cc (pinfo::init): Rename create argument to flags and treat it + as such. + * signal.cc (set_sigcatchers): New function. + (signal): Use set_sigcatchers to increment or decrement sigcatcher + tracker. + (sigaction): Ditto. Add debugging output. + * spawn.cc (spawn_guts): Always quote first argv[0] argument when it's + a COMSPEC shell. + +2000-10-20 DJ Delorie <dj@redhat.com> + + * times.cc (to_time_t): pass zero time as epoch + * fhandler.cc (fstat): copy atime/ctime from mtime if they're zero + +Thu Oct 19 23:31:41 2000 Christopher Faylor <cgf@cygnus.com> + + * external.cc (fillout_pinfo): Pass PID_NOREDIR flag to pinfo init to + avoid finding execed processes twice. + * signal.cc (kill_pgrp): Ditto. + * spawn.cc (spawn_guts): Avoid passing first argument to CreateProcess + when running a windows shell so that CreateProcess will locate the + shell. Reorganize so that correct error is returned when CreateProcess + fails. + +Thu Oct 19 13:55:31 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (sigthread::init): Correct overzealous ifdef. + * exceptions.cc (call_handler): Avoid calling sigthread acquire lock. + * sigproc.h (sigthread): Comment out lock for now. + * sync.cc (muto::acquire): Add a minor optimization. + +2000-10-18 DJ Delorie <dj@redhat.com> + + * Makefile.in: add miscfuncs.cc + * miscfuncs.cc: new, miscellaneous functions + * winsup.h: define table-driven tolower/toupper + * environ.cc: use them + * fhandler_console.cc: ditto + * fhandler_termios: ditto + * path.cc: ditto + (strncasematch, strcasematch, strcasestr): move to miscfuncs.cc + +Wed Oct 18 20:50:27 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sigthread): Eliminate locking for now since per thread + signalling is not available. + * dcrt0.cc (sigthread::init): Ditto. + (dll_crt0_1): Move set_process_privileges call (temporarily?) to + pinfo_init. + (pinfo_init): Only call set_process_privileges when allow_ntsec. + +2000-10-18 DJ Delorie <dj@redhat.com> + + * dcrt0.cc (dll_crt0_1): init cygcwd before forkee branch + + * environ.cc (conv_start_chars): Cache a table of "first + characters" for environment variables needing conversion. + (getwinenv): Use it. + (environ_init): Create it, also check first chars for TERM and + CYGWIN. + + * path.cc: Use lookup table for case insensitive comparisons. + +Wed Oct 18 00:48:49 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Make signal pending if sigsave.sig is + still active. + * syscalls.cc (_read): Don't clear errno. + * sigproc.cc (wait_sig): Don't scan the waiting process list after a + SIGCHLD if there are no zombies to reap. + * winsup.h: Use __builtin_strcmp. + * environ.cc (posify): Don't initialize len unless it is required + (from DJ Delorie <dj@redhat.com>). + +Tue Oct 17 14:50:31 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (proc_subproc): Remove unneeded test for correct process + in PROC_ADDCHILD. Return 0 when terminated child has just been + reparented. + (wait_subproc): Only send SIGCHLD when proc_subproc returns != 0. + * strace.cc (strace::vsprntf): Only strip .exe extension from program + name. + +2000-10-16 Charles Wilson <cwilson@ece.gatech.edu> + + * fhandler_clipboard.cc: new file + * Makefile.in: include fhandler_clipboard.o in DLL_OFILES list. + * fhandler.h: add FH_CLIPBOARD to the devices enum. + (fhandler_dev_clipboard): new + * path.cc (windows_device_names): add "\\dev\\clipboard" + (get_device_number): check for "clipboard" + * dcrt0.cc: declare a few more functions from winuser.h + * dtable.cc (dtable::build_fhandler): check for FH_CLIPBOARD in + switch(). + +Mon Oct 16 21:36:57 2000 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (add_handle): Issue warning on attempts to add the same + handle more than once. + * fhandler_tty.cc (fhandler_tty_slave::open): Protect some handles. + (fhandler_tty_common::close): Use proper name when closing handles. + (fhandler_pty_master::close): Don't close to_slave or from_slave since + they've already been closed earlier in the function. + * sigproc.cc (proc_subproc): Don't protect vchild->hProcess. Expect + that the caller will do this, instead. + * tty.cc (tty_list::terminate): Use proper name when closing handles. + (tty::make_pipes): Protect some handles. + +Mon Oct 16 18:37:22 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove some obsolete stuff. + * dcrt0.cc (dll_crt0_1): Call signal_fixup_after_exec where appropriate. + Set myself->uid from parent version. + Just use ThreadItem Init method. Close or store hexec_proc as appropriate. + (_dll_crt0): Store user_data->forkee here so that proper tests can be made + subsequently. + (do_exit): Remove hExeced stuff. + * environ.cc (environ_init): Accept environ count as well as environ pointer. + * environ.h: Reflect above change. + * pinfo.cc (pinfo_init): Ditto. Accept environ count. + (fixup_in_spawned_child): Remove. + * spawn.cc (spawn_guts): Move signal code to dll_crt0_1. Don't suspend + execing process since it is no longer necessary. Store envc. + * exceptions.cc (signal_fixup_after_exec): New function. + (call_handler): Remove hExeced test. + * child_info.h (cygheap_exec_info): Store envc as well as envp. + (child_info_spawn): Store hexec_proc so that it can be closed in child. + * path.cc (normalize_posix_path): Avoid intermediate use of temporary cwd buf. + (normalize_win32_path): Ditto. + (cwdstuff::get_initial): Always set lock. + * sigproc.h: Remove hExeced. + * strace.cc (strace::vsprntf): Modify to accommodate for lack of hExeced. + * thread.cc (MTinterface::Init): Merge Init1 and ClearReent into this method. + (MTinterface::Init1): Eliminate. + (MTinterface::ClearReent): Eliminate. + * thread.h: Reflect above changes. + * include/sys/strace.h (strace): Make microseconds() public. + +Sun Oct 15 21:54:52 2000 Christopher Faylor <cgf@cygnus.com> + + Make various functions 'regparm', throughout. + * pinfo.h (_pinfo): Inline simple signal manipulation functions. + Requires inclusion of thread.h which was removed from .cc files, where + appropriate. throughout. + * pinfo.cc: Eliminate signal manipulation functions. + (_pinfo::exit): Calculate total rusage for exiting process here. + * cygheap.cc (size2bucket): Eliminate. + (init_buckets): Ditto. + (_cmalloc): Calculate size and bits in a loop rather than going through + a function call. + (_crealloc): Use stored array index to calculate allocated size. + * spawn.cc (spawn_guts): Use _pinfo exit method to exit, calculating + cpu usage. + +Sat Oct 14 21:24:16 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (set_console_handler): Don't allocate + console_handler_thread_waiter. It is obsolete. + (ctrl_c_handler): Don't use console_handler_thread_waiter. + * path.cc (hash_path_name): Fix handling of relative names. Make case + insensitive. + * path.h (suffix_info): Use initializers. + * pinfo.h (_pinfo): Avoid initializers for null case. + * resource.cc (fill_rusage): Zero rest of rusage structure. + * security.cc (set_process_privileges): Don't reopen parent process. + Just use hMainProc. + * signal.cc (signal): Track when a signal handler has been used. + (sigaction): Ditto. + * sigproc.cc (pchildren): Use default initializer. + (zombies): Ditto. + (sigproc_terminate): Avoid closing handles that will be closed on exit + anyway. + (wait_sig): Send signal to "parent" on EXECing, not FORKing. + (wait_subproc): Send SIGCHLD here rather than in proc_wait to avoid + potential muto conflicts. + * sigproc.h (sigthread): Don't initialize to zero. It's the default. + * spawn.cc (spawn_guts): Fill in resources from exec parent prior to + termination. + * sync.h (muto): Don't initialize to zero. + * syscalls.cc (close_all_files): Use one lock around entire loop and + call fhandler close/release stuff directly. + (_read): Don't use ready_for_read if there are not signal handlers + active. + +Sat Oct 14 12:24:24 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Fix display of "title". + (do_exit): Use pinfo exit method to exit. + (__api_fatal): Ditto. + * exceptions.cc (signal_exit): Ditto. + * fork.cc (fork_child): Remove debugging stuff. Use pinfo_fixup_after + fork in place of exec_fixup_after_fork. + * pinfo.cc (pinfo_fixup_after_fork): New method. + (pinfo_fixup_in_spawned_child): Ditto. + (_pinfo::exit): New method. + (_pinfo::init): Remove recursion. Detect pathological case where pinfo + structure already exists for new pid. + * pinfo.h (_pinfo): Reorganize slightly. Add new method and new + function declarations. + * sigproc.cc (proc_exists): Previous simplification was a little to + simple. Try harder to detect if a process exists. + (proc_terminate): Use PID_EXITED setting to determine if process is + still around. + (WFSO): Remove debugging statement. + (WFMO): Ditto. + * spawn.cc (exec_fixup_after_fork): Eliminate. + (spawn_guts): Always set old_title to NULL. Is it really needed? Move + hexec_proc to pinfo.cc. Call pinfo_fixup_in_spawned_child to eliminate + handle link after a spawn. + * include/sys/cygwin.h: Remove PID_NOT_IN_USE. Add PID_EXITED. + +Sat Oct 14 10:54:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add symbol hstrerror. + * net.cc: Change meaning of member `s' of struct host_errmap. + (set_host_errno): Fix error in loop condition. + (hstrerror): Ditto. + (herror): Add appropriate functionality. + * include/netdb.h: Add declaration of hstrerror. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 29. + +Sat Oct 14 01:45:25 2000 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cygheap_fixup_in_child): Don't page round cygheap copied + from parent. + * dcrt0.cc (do_exit): Don't cleanup pinfo on exit. That happens + automatically now. + * exceptions.cc (signal_exit): Ditto. + * fork.cc (fork_parent): Use stack_here value passed in from fork(). + (fork): Figure out top of stack here and pass it to fork_parent. + * pinfo.cc (_pinfo::record_death): Eliminate. + * pinfo.h (_pinfo): Ditto. + * sigproc.cc (proc_exists): Simplify. + (proc_terminate): Ditto. + (remove_zombie): Don't cleanup pinfo stuff. + (wait_sig): Send subproc_ready signal whether execed or spawned. + * spawn.cc (spawn_guts): Always create subproc_ready event. Use it for + both exec and spawn. + (_spawnve): Send proper mode to spawn_guts when mode != _P_OVERLAY. + +Thu Oct 12 23:11:05 2000 Christopher Faylor <cgf@cygnus.com> + + * dtable.cc (dtable::fixup_after_fork): Revert thinko below. + * pinfo.cc (set_myself): Show pid in initial strace line. + +Thu Oct 12 17:58:03 2000 Christopher Faylor <cgf@cygnus.com> + + * child_info: Bump child_info "version". + (child_info): Move some fields from child_info_spawn to here. + * cygheap.cc: Make cygheap pointers NOCOPY. + * dcrt0.cc (dll_crt0_1): Copy cygwin heap here regardless of whether + we've been forked or execed. + * dtable.cc (dtable::fixup_after_fork): Just release close-on-exec fds. + * exceptions.cc (stackdump): Respond to C warning. + * fork.cc: Reorganize to minimize stack copying. + (fork_child): New function. + (fork_parent): Ditto. + (sync_with_child): Don't suspend the forkee. + (sync_with_parent): Ditto. Make into a function. + * heap.cc (heap_init): Add some debugging output. + * path.cc (path_conv::check): Add an assertion. + (has_suffix): Ditto. + * security.cc (get_pw_sid): Defend against NULL. + * sigproc.cc (proc_subproc): Fix debugging output. + (wait_sig): Ditto. + * strace.cc: Make statics NO_COPY throughout. + (strace::vsprntf): Defend against NULL. + +Thu Oct 12 00:25:29 2000 Christopher Faylor <cgf@cygnus.com> + + * errno.cc (seterrno_from_win_error): Fix debugging output. + * fhandler.cc (fhandler_base::fstat): Move to inline method in + fhandler.h. + (fhandler_base::set_io_handle): Ditto. + * fhandler.h (fhandler_base): Make some methods inline. + * fhandler_console.cc (fhandler_console::write_normal): Make buffer + larger. + * sigproc.h (sigframe::sigframe): Actually use set ebp parameter + correctly. + * spawn.cc (spawn_guts): Set dwProcessId when exec'ing. Just exit + immediately after reparenting. + * syscalls.cc: Sprinkle sigframe stuff throughout. + * wait.cc (wait4): Set signal frame here. + +Tue Oct 10 19:54:06 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (__api_fatal): Don't rely on small_printf to display errors. + Always display problems to the console, if possible. + +Tue Oct 10 15:21:10 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (cwdstuff::get): Set EINVAL when length is zero. + +Mon Oct 9 14:07:04 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::cygdrive_posix_path): Handle e:foo construction + correctly. + +Mon Oct 9 16:44:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mem.cc (fhandler_dev_mem::fhandler_dev_mem): + Fix debug output. + +Mon Oct 9 15:58:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mem.cc: Eliminate unused include statements. + (fhandler_dev_mem::fhandler_dev_mem): Check for 9X/ME. + +Mon Oct 9 15:11:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_mem): Erase member `init_phase' and + member function `init'. + * fhandler_mem.cc: Add typedefs for NT internal data types + `SYSTEM_INFORMATION_CLASS' and `SYSTEM_BASIC_INFORMATION'. + Add prototype for `NtQuerySystemInformation' function. + (fhandler_dev_mem::fhandler_dev_mem): Takes over initialization task + from `init'. Use `NtQuerySystemInformation' function to evaluate the + size of physical memory instead of interval search. + (fhandler_dev_mem::init): Eliminated. + (fhandler_dev_mem::open): Don't call `init'. + (fhandler_dev_mem::read): Eliminate check for `init_phase'. + (dummy_autoload): Add load statement for `NtQuerySystemInformation'. + +Sun Oct 8 22:38:40 2000 Christopher Faylor <cgf@cygnus.com> + + * dtable.cc (set_std_handle): Use std_consts array to control + SetStdHandle 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. + +Sat Oct 7 13:59:15 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_base): Remove obsolete _rpos and _rsize + elements. + * 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. + +Sat Oct 7 19:25:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_mem): Add methods mmap, munmap and msync. + 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. + +Fri Oct 6 23:21:29 2000 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_read): Behave properly when passed previous version of + O_NDELAY. Fix up debugging output. + +Thu Oct 5 20:34:48 2000 Christopher Faylor <cgf@cygnus.com> + + * net.cc (set_socket_inheritance): Rename from duplicate_socket. Use + NT 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. + +Thu Oct 5 14:58:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * 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. + +Thu Oct 5 01:52:43 2000 Christopher Faylor <cgf@cygnus.com> + + * net.cc: General cleanup. + (fdsock): Return pointer to created fhandler_socket. + (cygwin_socket): Use pointer returned by fdsock. Return correct errno + when fd < 0. + +Thu Oct 5 00:48:40 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Add extra debugging. + * sigproc.h (wait_sig): Fill in frame pointer, by default, prior to + calling or suffer confusion due to September 7 change below. + +Wed Oct 4 23:10:27 2000 Christopher Faylor <cgf@cygnus.com> + + * include/netinet/tcp.h: Remove winsock.h include. + * include/sys/cygwin.h: Move windows specific reference within + conditional. + +Thu Oct 5 1:13:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/mman.h: Add missing MAP_FAILED macro. + +Wed Oct 4 18:48:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_mem): Add method `init'. Add members + `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. + +Mon Oct 2 22:15:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc: Add LoadDLLFunc statement for RegEnumValueA(). + * net.cc: Change comments related to get_ifconf. + (get_2k_ifconf): Eliminate `type' variable. Eliminate `sa' parameter. + (get_nt_ifconf): Ditto. + (get_9x_ifconf): Ditto. Rewritten. + (get_ifconf): Change calls to OS specific functions. + +Mon Oct 2 15:15:01 2000 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (sigaction): Allow new action == oldaction. + +Mon Oct 2 11:05:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mem.cc: Load ntdll functions via autoload method. + (load_ntdll_funcs): Eliminated. + +Sun Oct 1 16:36:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mem.cc (load_ntdll_funcs): Add missing __stdcall qualifiers. + +Sun Oct 1 22:20:39 2000 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cygheap_init): Born again function. + (_cmalloc): Reorganize to accommodate 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. + +Sun Oct 1 2:56:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add fhandler_mem.o to the dependencies. + * 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. + +Sat Sep 30 00:43:42 2000 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (init_cheap): Set aside space for heap walk pointer. + (_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. Accommodate new argument to cygheap_fixup_in child. + * fork.cc (fork): Accommodate extra argument to cygheap_fixup_in_child. + * dcrt0.cc (dll_crt0_1): Ditto. Remove call to cygheap_init. + +Fri Sep 29 21:49:27 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_info::check): Set executable bit for a file if the + first two characters are 'MZ' to mirror spawn_guts check. + +Sat Sep 30 03:34:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h: Add `winME' to os_type symbols. + * dcrt0.cc (set_os_type): Identify Windows ME systems. + * (host_dependent_constants::init): Care for winME. + * uname.cc (uname): Ditto. + +Thu Sep 28 01:46:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_ifconf): Code cleanup. Split. Call os dependent + 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. + +Wed Sep 27 01:10:07 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Attempt to accommodate archaic windows quoting + mechanism when dealing with '\' and '"'. + +Mon Sep 25 20:47:04 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (quoted): Fix problem where ' quoted strings were skipped. + * 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. + +2000-09-25 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (av::dup_maybe): Make function void rather than void *. + * 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'. + +Tue Sep 19 09:46:36 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Use actual program argument passed in for + argv[0] as originally suggested by Kazuhiro Fujieda + <fujieda@jaist.ac.jp>. + +Mon Sep 18 23:17:19 2000 Christopher Faylor <cgf@cygnus.com> + + * path.h: Create new input path flag PATH_NEEDDIR. + * 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. + +Mon Sep 18 19:44:08 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_tty_slave::write): Correct typo which + caused resetting of windows error to ERROR_IO_DEVICE to be ignored. + +Mon Sep 18 17:15:37 2000 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (mount_info::read_mounts): Don't delete mount entries of + which mount 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. + +Sun Sep 17 22:18:39 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Return 0 if given an address in + uncommitted memory. + +2000-09-16 Egor Duda <deo@logos-m.ru> + + * signal.cc (sleep): If interrupted by signal, return the + requested time minus the time actually slept. + +Fri Sep 15 22:30:40 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Just "core dump" if SIGSEGV in + signal thread. + * external.cc (fillout_pinfo): Fix compiler warning. + * sigproc.h: Eliminate special asm naming for sig_dispatch_pending. + * sigproc.cc (sig_send): Remove debugging statements. + +Wed Sep 13 14:56:47 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (av): Hide 'calloced' field and limit cstrduping to class + methods only. + (spawn_guts): Use methods for manipulating most newargv stuff. + +2000-09-13 Egor Duda <deo@logos-m.ru> + + * child_info.h (child_info_spawn::~child_info_spawn): Avoid + memory leaks in cygheap. + * spawn.cc (spawn_guts): Ditto. + +Wed Sep 13 14:28:03 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (quoted): Return next character after a quoted string when + not doing special quote processing. Also ensure that non-NULL is + returned in all circumstances. + +Wed Sep 13 10:26:16 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Ensure that argv[0] is correctly set to the + full path when a script is detected. Suggested by Kazuhiro Fujieda + <fujieda@jaist.ac.jp>. + +Tue Sep 12 22:33:30 2000 Christopher Faylor <cgf@cygnus.com> + + * external.cc (fillout_pinfo): Handle explicit pids correctly. + +Tue Sep 12 14:37:32 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Fix more slashdot madness. + +Tue Sep 12 12:29:29 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Make clean target remove *.d. + +Mon Sep 11 13:19:15 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Correctly deal with a "." parameter. + +Sun Sep 10 20:23:35 2000 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (init_cheap): Just use any old address for the cygwin + heap. + * exceptions.cc (signal_exit): Don't terminate the main thread. Just + try to exit in this thread really quickly. + * signal.cc (kill_pgrp): Fix typo which caused pinfo structure to be + assigned incorrectly. + +Sun Sep 10 12:40:49 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Initialize thread and debug stuff before + handling exec/fork. + * dtable.cc (dtable::fixup_after_exec): Always clear out the read ahead + buffer whether closing or adjusting. + * path.cc (chdir): Avoid a compiler warning. + +Sat Sep 9 23:29:17 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Use the full path for cwd_win32. Consider attempts + to chdir to strings of dots > 2 to be an error. Pass 'dir' argument to + cygcwd.set. + (cwdstuff::set): Need to treat arguments from chdir differently. + * path.h (cwdstuff): Add an argument to set. + +Fri Sep 8 11:50:09 2000 Christopher Faylor <cgf@cygnus.com> + + * lib/_cygwin_crt0_common.cc: Add missing header files. + +Thu Sep 7 23:07:21 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sigframe::set): Eliminate second argument. Default bp to + current frame pointer rather than using this within the function, which + is unstable when this method is not inlined. + * net.cc: Eliminate use of second argument to sigframe.set throughout. + * select.cc (cygwin_select): Ditto. + * sigproc.cc (sig_send): Ditto. + +Thu Sep 7 22:45:16 2000 Christopher Faylor <cgf@cygnus.com> + + Break out more header info into separate files. Use appropriate + header files throughout. + * shared.h: Remove. + * cygwin_version.h: New file. + * delqueue.h: New file. + * environ.h: New file. + * host_dependent.h: New file. + * perprocess.h: New file. + * registry.h: New file. + * security.h: New file. + +Thu Sep 7 12:14:43 2000 Christopher Faylor <cgf@cygnus.com> + + Split out tty and shared_info stuff into their own headers and use + throughout. Include sys/termios.h for files which need it. + * tty.h: New file. + * shared_info.h: New file. + * fhandler.h: Move inline methods that rely on tty stuff to + fhandler_console.cc. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Set + output_done_event immediately after reading data to speed up tty output + processing. + (process_output): Set write_error to errno or zero. + (fhandler_tty_slave::write): Check previous write error prior to + writing to slave end of pipe. This allows tty output to be slightly + less synchronous. + * fhandler_console.cc (fhandler_console::tcsetpgrp): Moved here from + fhandler.h. + (fhandler_console::set_input_state): Ditto. + +Wed Sep 6 21:11:13 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (signal_exit): Reset all mutos owned by the main + thread. + * fhandler.h: Define *_output_mutex macros for serializing tty output. + (fhandler_termios): Remove restart_output_event. Define dummy output + mutex methods. + (fhandler_pty_master): Remove unneeded fixup_after_fork method. + * fhandler_termios.cc (fhandler_termios::line_edit): Acquire + output_mutex when CTRL-S is hit. Release it on CTRL-Q. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Remove + inappropriate OutputStopped test here. Just use the output mutex. + (fhandler_pty_master::fhandler_pty_master): Remove obsolete reference + to restart_output_event. + (fhandler_tty_common::close): Ditto. + (fhandler_pty_master::set_close_on_exec): Ditto. + (fhandler_pty_master::fixup_after_fork): Delete. + * tty.cc (tty::common_init): Ditto. + * sync.cc (muto::reset): New method. + * sync.h: Declare above method. + +Wed Sep 6 16:56:38 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc: Add include file for proper definitions. + * spawn.cc: Ditto. + * winsup.h: Define cfree to avoid newlib pollution. + +Wed Sep 6 14:11:51 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (CFLAGS): Ensure that -MD is always added even when + CFLAGS is overwritten. + +Wed Sep 6 02:40:12 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (cwdstuff::get_initial): Keep caching alive. + (mount_info::conv_to_win32_path): Fill out relative path in failing + case. + +Tue Sep 5 21:36:15 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Deal with error return from cygcwd.get. + (normalize_win32_path): Ditto. + (mount_info::conv_to_win32_path): Ditto. + (cwdstuff::get): Set buf to NULL on error. + +Tue Sep 5 17:49:34 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (readlink): 'max' should be a 'min' or we'll suffer + buffer overflow. + +Mon Sep 4 22:53:58 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (cwd_win32): Eliminate. + (cwd_posix): Eliminate. + (cwd_hash): Eliminate. + (cwdstuff::init): Rename from cwd_init. + (cwdstuff::fixup_after_exec): Rename from cwd_fixup_after_exec. + (cwdstuff::get): Rename from get_cwd_inner. + (normalize_posix_path): Eliminate cwd argument. Just calculate when + necessary. + (normalize_win32_path): Ditto. + (mount_info::conv_to_win32_path): Eliminate cwd retrieval here. + (mount_info::conv_to_posix_path): Ditto. + (hash_path_name): Accommodate additional methods in cwdstuff. + (get_cwd_win32): Eliminate. + (getcwd): Use cwdstuff methods. Properly handle case where buf == NULL + and len < 0. + (cwdstuff::get_hash): New method. + (cwdstuff::get_initial): New method. + (cwdstuff::set): New method. + (cwdstuff::get): New method. + (cwdstuff::copy): New method. + * path.h: Move cwdstuff struct here. Add a bunch of stuff to cwdstuff. + Make cygcwd an extern. + * spawn.cc (spawn_guts): Use copy method to get copies of cwd info to + pass to execed process. + * dcrt0.cc (dll_crt0_1): Use cygcwd methods for cwd initialization. + +2000-09-03 Egor Duda <deo@logos-m.ru> + + * path.cc (readlink): Check if buffer length is positive. + Truncate output to buffer length. Don't terminate buffer + with '\0'. + +Sun Sep 3 00:38:40 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (environ_init): Don't free the new environment table after + we've just copied stuff to it. + +Sun Sep 3 00:07:32 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add cygheap.o. + * child_info.h: Add specific exec class. + * cygheap.h: New file. Contains declarations for cygwin heap. + * cygheap.cc: New file. Implements cygwin heap functions. + * dcrt0.cc (quoted): Simplify due to new method for passing arguments + between cygwin programs. + (alloc_stack_hard_way): Attempt to handle overlapped stack. + (dll_crt0_1): Move child_info processing here. Accommodate new method + for passing arguments between cygwin programs. Initialize cygwin heap. + Establish __argc and __argv variables. + (_dll_crt0): Move most of child_info processing to dll_crt0_1. + (cygwin_dll_init): Remove duplication. + * dtable.cc (dtable::extend): Allocate dtable using cygwin heap. + (dtable::build_fhandler): Ditto for fhandler type being constructed. + (dtable::dup_worker): Free new fhandler from cygwin heap on error. + (dtable::select_*): Don't assume that this == fdtab. + (dtable::linearize_fd_array): Delete. + (dtable::delinearize_fd_array): Delete. + (dtable::fixup_after_exec): New file. + (dtable::vfork_child_dup): Use cygwin heap. + (dtable::vfork_parent_restore): Ditto. + * dtable.h: Remove obsolete methods. Add new method. + * environ.cc (posify): Eliminate already_posix parameter and logic. + (envsize): New function. + (_addenv): Use envsize. + (environ_init): Accept an argument pointing to an existing environment + list. If supplied, allocate space for this in the the program's heap. + * fhandler.cc (fhandler_base::operator =): Move here from fhandler.h. + Use cygwin heap to allocate filenames. + (fhandler_base::set_name): Allocate/free names from cygwin heap. + (fhandler_base::linearize): Delete. + (fhandler_base::de_linearize): Delete. + (fhandler_base::operator delete): Free from cygwin heap. + (fhandler_base::~fhandler_base): Ditto. + * fhandler.h: Accommodate elimination of *linearize and other changes + above. + * fhandler_console.cc (fhandler_console::fixup_after_exec): Rename from + de_linearize. + * heap.h: New file. + * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Use cygwin + heap for name. fhandler_tty::fixup_after_exec): Rename from + de_linearize. + * fork.cc (fork): Call cygheap_fixup_in_child. + * heap.cc: Use declarations in heap.h. + * malloc.cc: Sprinkle assertions throughout to catch attempts to + free/realloc something from the cygwin heap. + * path.cc: Throughout, eliminate use of per-thread cache for cwd. Use + cwd_* functions rather than cwd_* variables to access cwd_win32 and + cwd_posix. + (cwd_win32): New function. + (cwd_posix): New function. + (cwd_hash): New function. + (cwd_fixup_after_exec): New function. + * path.h: Accommodate path.cc changes. + * pinfo.cc (pinfo_init): Accept a pointer to an environment table. + Pass this to environ_init. Eliminate old 'title' tests. + * pinfo.h: Accommodate above change in argument. + * spawn.cc (struct av): New method for building argv list. + (av::unshift): New method. + (spawn_guts): Allocate everything that the child process needs in the + cygwin heap and pass a pointer to this to the child. Build argv list + using new method. Eliminate delinearize stuff. + * thread.h: Eliminate _cwd_win32 and _cwd_posix buffers. + * winsup.h: Eliminate obsolete functions. Add envsize() declaration. + +2000-09-02 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Remove "make check" support. It is now in + winsup/Makefile.in. + +Fri Sep 1 21:17:03 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (mychild): New function. + (proc_subproc): Use mychild() to determine if a specific pid is valid + for wait()ing. + +Fri Sep 1 16:57:44 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sigproc_init): Create wait_sig_inited without auto-reset + to avoid potential races. + (init_child_info): Avoid unneeded test. + +Fri Sep 1 16:51:26 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (proc_info): Rename proc_exists which takes a pid to + "pid_exists". + * shared.h: Split out "child_info" stuff into a new header file and + use where necessary. + Declare pid_exists. + * child_info.h: New file. + +Thu Aug 31 16:06:21 2000 Christopher Faylor <cgf@cygnus.com> + + * errno.cc (set_errno_from_win_error): Actually use arguments to + strace_printf. + +2000-08-30 DJ Delorie <dj@redhat.com> + + * times.cc (gettimeofday): use GetSystemTimeAsFileTime to avoid a + conversion + (FACTOR): correct value + (genf): set milliseconds to zero, DOW to 4. + +2000-08-29 Egor Duda <deo@logos-m.ru> + + * grp.cc (getgroups): fail with EINVAL if array is not large + enough to hold all supplementary group IDs. + +Mon Aug 28 22:03:21 2000 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (_raise): New function. + * exceptions.cc (unused_sig_wrapper): Remove _raise. + * sigproc.h (class sigframe): Default frames to skip to zero or suffer + from exuberant optimization. + * fhandler_tty.cc (fhandler_tty::write): Set appropriate errno when + WriteFile to pipe fails. + +Fri Aug 25 23:44:48 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.h (pinfo): Un-inline release. + * pinfo.cc (pinfo::release): Move here from pinfo.h. + * sigproc.cc (proc_terminate): Remove bogus 'pinfo child' which caused + strange destruction of random regions of memory when destructor was + invoked. + +Fri Aug 25 21:25:32 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Move set_os_type. + (_dll_crt0): To here. + (cygwin_dll_init): And here. + * external.cc (fillout_pinfo): Use more foolproof method for scanning + for pids. + * pinfo.cc (set_myself): Eliminate myself_identity.init. + * sigproc.cc (wait_sig): Do it here instead to reduce the amount of + time where there could potentially be two processes with the same pid. + * spawn.cc (spawn_guts): Eliminate duplicate initialization. + * include/sys/cygwin.h: Mark unused PID_* elements. + +Fri Aug 25 21:49:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * exec.cc (_execve): Change definition according to declaration in + newlib/libc/include/sys/unistd.h. + +Thu Aug 24 22:17:19 2000 Christopher Faylor <cgf@cygnus.com> + + * external.cc (cygwin_internal): Add CW_INIT_EXCEPTIONS to allow cygwin + exception handling on threads not created by cygwin. + * sigproc.cc (proc_terminate): Don't release pinfo structs since we are + exiting. + * include/sys/cygwin.h: Add CW_INIT_EXCEPTIONS. + +Thu Aug 24 17:16:14 2000 Christopher Faylor <cgf@cygnus.com> + + * select.cc (cygwin_select): Correct logic for "always_ready" fds or + when there is no wait specified. + * syslog.cc (pass_handler::set_message): Zero the buffer prior to + setting it. + +2000-08-24 Egor Duda <deo@logos-m.ru> + + * include/cygwin/core_dump.h: New file, contains structures used in + cygwin core core files. + * include/sys/procfs.h: New file, needed to autoconfigure cygwin core + dumps support in bfd. + +Thu Aug 24 13:50:15 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (parse_thing): nobinmode should force O_TEXT. + (regopt): Use correct path to find LOCAL_MACHINE registry options. + * fhandler.cc (fhandler_base::open): Set binary mode only when binmode + == O_BINARY. + * pipe.cc (pipe): Pipe handling should rely on binmode not _fmode now + that the two are different. + +Thu Aug 24 13:21:09 2000 Christopher Faylor <cgf@cygnus.com> + + * include/sys/cygwin.h (strace_printf_wrap): Force printing when + _STRACE_SYSTEM. + (strace_printf_wrap1): Ditto. + +Thu Aug 24 12:30:17 2000 Christopher Faylor <cgf@cygnus.com> + + * debug.h: Allow some debug defines for use in header files. + +Wed Aug 23 23:00:24 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Move exception list and constructor stuff + earlier in the process. Use new second argument to set_myself. + (cygwin_dll_init): Initialize exception list and constructor stuff + here. + (_dll_crt0): And here. Also, deal with inherited pinfo shared memory + region from parent. + * pinfo.cc (set_myself): Accept a second argument signifying the a + shared memory region, passed from an execing parent. + (pinfo_init): Ditto. + * pinfo.h: Ditto. + * shared.h (child_info): Add a handle field to pass to child. + * spawn.cc (spawn_guts): Create a shared handle to pass to an execed + child. + * winsup.h: Remove extraneous declaration. + +Wed Aug 23 10:51:57 2000 Christopher Faylor <cgf@cygnus.com> + + * include/sys/cygwin.h: Protect class definitions. + +Tue Aug 22 13:57:36 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_info::check): Clear error on each iteration of + extension check. + +Tue Aug 22 11:23:59 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Don't include '.d' file if there are none generated yet. + +Tue Aug 22 11:08:11 2000 Christopher Faylor <cgf@cygnus.com> + + * include/sys/cygwin.h: Declare some thread classes. + * include/mntent.h: Avoid declaring functions. + +Tue Aug 22 01:08:01 2000 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Eliminate inclusion of most of the cygwin .h files. Use .h + files only in sources which require them. + * Makefile.in: Generate dependencies with -MD option. + +Mon Aug 21 23:49:05 2000 Christopher Faylor <cgf@cygnus.com> + + * cygerrno.h: New file. Use this throughout whenever errno + manipulation is required. + * errno.cc: Use DWORD to hold Windows errors. + (geterrno_from_win_error): New function. + (seterrno_from_win_error): Use geterrno_from_win_error to convert + supplied windows error (suggested by Corinna Vinschen). + * path.cc (symlink_info): Add error element. + * path.cc (path_conv::check): Remove errno setting. Use new + symlink_info errno element to set path_conv error, where appropriate. + (symlink_info::check): Set error element rather than attempting to + manipulate errno. Add more checks for trailing / and /.. even though + they are currently useless. Avoid setting EINVAL. + +Mon Aug 21 23:49:05 2000 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (normalize_posix_path): Correct check for trailing /. + +2000-08-21 DJ Delorie <dj@redhat.com> + + * include/cygwin/cygwin_dll.h (DECLARE_CYGWIN_DLL): hinstance, + not handle. + +Fri Aug 18 11:11:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::dup2): Extend fdtab if newfd is out of current + allocated bounds. + +Sat Aug 12 01:47:28 2000 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Properly trap exit removal of temp file. Remove debugging + statement. + +Sat Aug 12 01:37:56 2000 Christopher Faylor <cgf@cygnus.com> + + * poll.cc: Make winsup.h the first include file, re 2000-08-02 change. + +Sat Aug 12 01:33:12 2000 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Split out dtable definitions into separate header file. + * dtable.h: New file. + * sigproc.h: Eliminate pinfo.h usage here. Use it in source files that + need it. + +Sat Aug 12 01:08:11 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use dtable.o rather than hinfo.o. + +Sat Aug 12 00:47:11 2000 Christopher Faylor <cgf@cygnus.com> + + Rename hinfo -> dtable. Name the former dtable array 'fdtab'. + +Fri Aug 11 14:47:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * poll.cc: Allow any descriptor and any number of descriptors. + Allocate fd_set struct sdynamically. + +Fri Aug 11 14:47:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * poll.cc: Add bounds checking for file descriptors. Return POLLNVAL + if fd is invalid. Return POLLERR for each valid fd if cygwin_select + returned with error. + include/sys/poll.h: Change POLLERR comment according to above change. + +Thu Aug 10 21:54:29 2000 Christopher Faylor <cgf@cygnus.com> + + * syslog.cc (syslog): Use a less malloc-intensive method for allocating + the buffer. Also fix a buffer overrun. + +Thu Aug 10 15:31:39 2000 Christopher Faylor <cgf@cygnus.com> + + * winsup.h: Change strchr inline for strange gcc problem. + * select.cc (select_stuff::wait): Bounds check w4 array. + +Thu Aug 10 15:17:53 2000 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (readdir): Ensure that errno is *only* set when we've run out + of filenames. + * fhandler.cc (fhandler_disk_file::fstat): Use modern method for saving + errno, making it effective for the whole function. + +Tue Aug 8 22:25:39 2000 Christopher Faylor <cgf@cygnus.com> + + * select.cc (allocfd_set): Zero allocated fd_set. + (cygwin_select): Move fd_set copying logic from ::wait to here. Use + common return through sell.poll. + (select_stuff::wait): Just return success or failure and let caller + fill in fd_set. + * pinfo.h (pinfo): Eliminate self-referential pointer to sidbuf since + pinfo structure exists at random locations now. + * fork.cc (fork): Use 'use_psid' element to control when the psid is + relevant. + * shared.cc (sec_user): Ditto. + * spawn.cc (spawn_guts): Ditto. + * uinfo.cc (internal_getlogin): Ditto. + * syscall.cc (seteuid): Ditto. Set use_psid element. + +Tue Aug 8 13:20:00 2000 Bob Wilson <bwilson@tensilica.com> + + * fhandler_serial.cc (tcsendbreak): "sleeptime" argument to usleep() + must be in units of microseconds, not milliseconds. + +Mon Aug 7 00:11:35 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/cygwin_dll.h: Remove extraneous (and incorrect) + declarations. + +Fri Aug 4 00:00:46 2000 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::find_unused_handle): Just check for table entry == + NULL since we are already bounds checked by default. + * thread.cc (ResourceLocks::Lock): Streamline this function since it is + called a lot. + (ReleaseResourceLock): Ditto. + +Thu Aug 3 20:44:39 2000 Christopher Faylor <cgf@cygnus.com> + + * select.cc (fhandler_console::select_read): Call set_cursor_maybe + since select may block and cursor may not be visible. + * select.cc (fhandler_console::select_write): Ditto. + * select.cc (fhandler_console::select_except): Ditto. + +Thu Aug 3 09:01:14 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Set + length field correctly when "need_nl". + +Wed Aug 2 22:58:07 2000 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (vfork): Store complete stack frame in vfork_save structure + for later recovery. + * spawn.cc (spawn_guts): Reorganize slightly to consolidate handling + when there is a CreateProcess error. + (_spawnve): Only longjmp back to vfork handling when a process has been + successfuly started. + * winsup.h (vfork_save): Extend to include frame info. Remove obsolete + cpplus conditionals. + +Wed Aug 2 15:14:51 2000 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (strace::prntf): Make second argument the function name, + rather than use special format options. + (strace::vprntf): Ditto. + (getfunc): New function. + * include/sys/strace.h: Reflect above changes. + * smallprint.c (__small_vsprintf): Eliminate '%F' formatting. + * pinfo.cc (set_myself): Modify for new strace::prntf parameter. + * errno.cc (seterrno_from_win_error): Ditto. + * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto. + * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Ditto. + +Wed Aug 2 13:20:04 2000 Christopher Faylor <cgf@cygnus.com> + + * regexp/regexp.c: Add winsup.h. + +2000-08-02 DJ Delorie <dj@redhat.com> + + * winsup.h: take out protections of environ, errno, allow C use + * *.cc: put winsup.h before other headers (for __INSIDE_CYGWIN__); + use cur_environ() instead of just environ + * times.cc: remove import protections + * glob.c: add winsup.h + * localtime.c: ditto + * smallprint.c: ditto + * Makefile.in: don't __INSIDE_CYGWIN__ as it messes up profiling. + +Wed Aug 2 11:22:53 2000 Christopher Faylor <cgf@cygnus.com> + + * include/sys/strace.h: Fix strace definition. + +Tue Aug 1 23:37:08 2000 Christopher Faylor <cgf@cygnus.com> + + * strace.h: Add kludgy workarounds to avoid using deprecated methods + for variable argument macros when possible. + * sigproc.cc: Throughout, use sigproc_printf rather than sip_printf. + * strace.cc (strace::prntf): Remove 'active' check, since callers are + supposed to ensure this. + (__system_printf): Remove. Subsumed by strace::prntf. + * winsup.h: Define "NEW_MACRO_VARARGS" to indicate when to use new + macro varargs capability. + +Sun Jul 30 13:54:35 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc: Remove VK_DIVIDE detection. + (get_nonascii_key): Simplify previous patch to return ascii char if it + is non-zero. Add a second "temporary buffer" argument to help with + thread safety. + * select.cc (peek_console): Pass a temporary buffer argument to + get_nonascii_key. + +Sat Jul 29 14:32:12 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc: Add VK_DIVIDE detection. Return virtual keycode + if it is not detected and it is less than ' '. + +Sat Jul 29 13:33:49 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Avoid trailing dot calculation when chdir == '/' + or we end up with an empty string. + +Sat Jul 29 12:11:33 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump DLL minor version number to 5 due + to all of the changes below. + +Sat Jul 29 12:01:32 2000 Christopher Faylor <cgf@cygnus.com> + + Redefine process structure to avoid a fixed size table. Redefine + pinfo/_pinfo classes. Use these throughout. + * dcrt0.cc (dll_crt0_1): Accommodate set_myself argument change. + (__api_fatal): Accommodate _pinfo::record_death argument change. + * exceptions.cc (really_exit): Ditto. + (sig_handle_tty_stop): Use pinfo constructor to access process info. + (events_init): Don't create pinfo_mutex since it is no longer required. + * external.cc (fillout_pinfo): Use winpids class to iterate over all + system pids. + (cygwin_internal): lock_pinfo_for_update and unlock_pinfo are now + noops. + * fhandler_termios.cc (fhandler_termios::set_ctty): Use pinfo + constructor to access process info. + * fork.cc (fork): Reorganize to initialize child info after the child + has started since that is when we know the child's winpid, which is + necessary to allocate the pinfo shared memory. + * mmap.cc (recreate_mmaps_after_fork): Change arg type to _pinfo. + * pinfo.cc: Rename pinfo methods to _pinfo throughout. Eliminate + pinfo_list stuff. + (set_myself): Accept a pid argument now. Call pinfo initializer to + initialize myself. Detect when this is an "execed" process and create + an "indirect" pid block. + (pinfo_init): Accommodate set_myself arg change. + (procinfo): Remove. + (pinfo::lock_pinfo): Remove. + (pinfo::unlock_pinfo): Remove. + (pinfo::init): New method. Allocates shared memory space for process + pinfo structure. + (pinfo::record_death): Don't call locking functions. + (cygwin_winpid_to_pid): Simplify by using new pinfo constructor. + (EnumProcessesW95): New function for iterating over processes on + Windows 95. + (winpids::winpids): New constructor for winpids class. Sets up a list + of process ids. + (enum_init): Initialize w95/wnt pid enumerators. + * shared.cc (shared-info::initialize): Remove pid initialization. + * shared.h: Move pinfo stuff into pinfo.h. + (class shared_info): Remove pinfo_list element. + * signal.cc (kill_worker): Use pinfo constructor to access process + info. + (kill_pgrp): Ditto. Use winpids methods to access list of processes. + * sigproc.cc: Throughout, modify to use _pinfo where appropriate. + (proc_exists (pid_t)): New function. Determines if a process exists + based on the pid. + (proc_exists (_pinfo *p): Use new proc_exists function above. + (proc_subproc): Copy pinfo stuff around rather than _pinfo pointers. + Try to be careful about releasing shared memory when we don't need it + anymore. Remove pinfo locks. + (remove_zombies): Remove pinfo memory when zombie is going away. + * sigproc.h: Reflect _pinfo/pinfo changes in sigproc.cc. + * spawn.cc (spawn_guts): Eliminate pinfo *child argument. Reorganize + to only initialize child pinfo after process has been started and we + know the windows pid. + (_spawnve): Reflect spawn_guts changes. + * syscalls.cc (setpgid): Use pinfo constructor to access process info. + (getpgid): Ditto. + (internal_getlogin): Use _pinfo. + * winsup.h: Eliminate pinfo_mutex. Eliminate spawn_guts declaration + since it is static now. Reflect set_myself argument change. + * include/sys/cygwin.h: Add some PID_* enums to accommodate new pinfo + stuff. + +Sat Jul 29 12:13:27 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Update minor version for cygdrive changes + below. + +Sat Jul 29 11:59:29 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (parse_thing): Make binmode a DWORD. + * hinfo.cc (hinfo::init_std_file_from_handle): Use 'binmode' to + determine default open mode. + * winsup.h: Declare binmode. + +Sat Jul 29 00:16:35 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/cygwin_dll.h: Update for modern compilers. + * lib/cygwin_crt0.c: Inexplicably need to define alloca for newer + compilers. + * fhandler.h (fhandler_console): Add new method. + * fhandler.cc (fhandler_console::set_cursor_maybe): New method. + (fhandler_console::read): Set cursor if it has moved to make it + visible. + +Thu Jul 27 22:54:28 2000 Jason Tishler <jt@dothill.com> + + * dcrt0.cc (dummy_autoload): Add load statement for RegDeleteValueA. + * external.cc (get_cygdrive_prefixes): New function. + (cygwin_internal): Add CW_GET_CYGDRIVE_PREFIXES case. + * path.cc (mount_info::read_cygdrive_info_from_registry): Read system + cygdrive prefix if user one is undefined. + (mount_info::write_cygdrive_info_to_registry): Write cygdrive prefix to + the appropriate registry hive. Overwrite in-memory copy of cygdrive, + if appropriate. + (mount_info::remove_cygdrive_info_from_registry): New method. + (mount_info::get_cygdrive_prefixes): New method. + (cygwin_umount): Remove cygdrive prefix, if appropriate. + * registry.cc (reg_key::killvalue): New method. + * shared.h (class reg_key): Add killvalue, + remove_cygdrive_info_to_registry, and get_cygdrive_prefixes + declarations. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_GET_CYGDRIVE_PREFIXES. + +Thu Jul 27 23:33:32 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump DLL minor version number to 4. + +2000-07-27 DJ Delorie <dj@redhat.com> + + * testsuite/winsup.api/winsup.exp: ignore stdout by default + * testsuite/winsup.api/crlf.c: non-verbose by default + + * winsup.h: prune out windows headers we don't normally need + * assert.cc: add wingdi.h and winuser.h + * fhandler_console.cc: ditto + * fhandler_windows.cc: ditto + * select.cc: ditto + * spawn.cc: ditto + * strace.cc: ditto + * tty.cc: ditto + * window.cc: ditto + * hinfo.cc: add winsock.h + * syscalls.cc: add winnls.h + * uinfo.cc: ditto + +Thu Jul 27 10:24:36 2000 Egor Duda <deo@logos-m.ru> + + * fhandler.cc (fhandler_disk_file::fstat): Allow block calculation to + succeed for files >= 2GB and <= 4GB. + +Wed Jul 26 16:05:04 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (signal_exit): Renamed from "really_exit". Always sets + EXIT_SIGNAL bit and reorganizes exit value for backwards cygwin + handling. + (handle_exceptions): Call signal_exit. Set "core dumped" bit. + (sig_handle): Call signal_exit. Set "core dumped" bit appropriately. + +Wed Jul 26 20:44:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (posify): Revert previous patch. + (_addenv): Remove check_null_empty_path from here. + (putenv): Call check_nullempty_path. + (setenv): Call check_nullempty_path for name as well here. + Don't report an error if value is empty string. + (environ_init): Revert usage of newp. + +Wed Jul 26 14:32:38 2000 Egor Duda <deo@logos-m.ru> + + * syscalls.cc (stat_worker): Make stat return correct st_blocks for + files with size bigger than 2Gb and less than 4Gb + +Wed Jul 26 17:43:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (lookup_name): Search on local machine first if + myself->domain is not empty. + +2000-07-26 DJ Delorie <dj@cygnus.com> + + * fhandler_console.cc (fhandler_console::read): Explicitly set cursor + to make it visible while waiting in WaitForMultipleObjects. + +Wed Jul 26 10:59:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc: Change name of passwd_in_memory_p to passwd_state. + Change type to enum. Change storage class to static. Adjust comments. + (read_etc_passwd): Set passwd_state to different values when loaded + from file in contrast to being emulated. + (search_for): Return default passwd entry if passwd is emulated or + it's a request for the current user. Otherwise return NULL. + +Tue Jul 25 21:50:42 2000 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (statfs): Use path_conv method to convert input path. + +Tue Jul 25 21:40:51 2000 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_link): Avoid extraneous call to + cygwin_conv_to_win32_path. + +Tue Jul 25 21:11:15 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (_addenv): New function. Subsumes functionality of + putenv/setenv. Does not allocate space for putenv case. + (putenv): Use _addenv to add a value to the environment. + (setenv): Ditto. + (environ_init): Don't malloc space for each entry in the environment + table. Just use the space from GetEnvironmentStrings. + (posify): Don't free the src argument since it is no longer malloced. + +Mon Jul 24 21:10:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (_link): Corrected previous patch. + +Mon Jul 24 13:26:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_random): Add members for managing + pseudo randomness. + * fhandler_random.cc: Rearrange. Use pseudo random number generator + as entropy source if system entropy isn't available and if device is + used as /dev/urandom. Allow initializing device by calling write(). + +Sun Jul 23 23:11:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h: Add comment. + +Sun Jul 23 20:00:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_raw): Add private member `varblkop' + to be set when variable blocksize mode is on. + * fhandler_raw.cc: Eliminate `\n' from trace output. + (clear): Set `varblkop' to 0. + (dup): Copy varblkop as well. + (writebuf): Care for variable blocksize. + (open): Ditto. + (raw_read): Ditto. + (raw_write): Ditto. + * fhandler_tape.cc (open): Ditto. + (ioctl): Ditto. Some cleanups. + +Sat Jul 22 18:40:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Kazuhiro Fujieda <fujieda@jaist.ac.jp>. + * winsup.h: Add new macros sys_wcstombs and sys_mbstowcs. + * syscalls.cc (_link): Replace calls to mbstowcs by call to + sys_mbstowcs. + * uinfo.cc (internal_getlogin): Replace calls to wcstombs and + mbstowcs by calls to sys_wcstombs and sys_mbstowcs. Replace + usage of constants by meaningful defines. Use result of + GetSystemDirectory for HOMEPATH and HOMEDRIVE as a last resort. + +Fri Jul 21 21:33:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (span_guts): Retrieve security attributes before setting + psid to NULL. + +Fri Jul 21 12:03:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (acl_worker): Use stat_suffixes in call to path_conv + just as in `stat_worker'. + +Wed Jul 19 22:24:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Don't restore impersonation in case + of _P_OVERLAY. Clean up slightly. Accommodate comments. + +Wed Jul 19 22:11:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * shared.h (class pinfo): New members `root' and `rootlen'. + * syscalls.cc (chroot): Set new root for process. + * path.cc (getcwd_inner): Add parameter to force use of + new root from chroot() call. + (ischrootpath): New macro. + (normalize_posix_path): Care for changed root dir. + (normalize_win32_path): Ditto. + (getcwd_inner): Ditto. + (chdir): Eliminate trailing path component consisting + entirely of dots. + * fork.cc (fork): Copy pinfo members regarding chroot(). + * spawn.cc (_spawnve): Ditto. + * dir.cc (opendir): Don't use computed win32 path if + chroot() took place. + +Mon Jul 17 22:21:34 2000 Christopher Faylor <cgf@cygnus.com> + + * dll_init.cc (dll_list::alloc): Fix debugging output. + +Mon Jul 17 14:57:53 2000 Christopher Faylor <cgf@cygnus.com> + + Throughout, eliminate third argument to path_conv and use new PC_* + constants for second argument. + * dcrt0.cc (dll_crt0_1): Reorganize to allow more initialization prior + to returning due to dynamic loading. + * path.h: Generalize SYMLINK_* constants to PC_*. + (path_conv): Create a new method. Fold third argument into second. + * dll_init.cc (dll_list::alloc): Try harder to find space to allocate + dll struct. + (dll_dllcrt0): Don't check sanity if we've already called dll_crt0. + * path.cc (path_conv::check): Don't check for a null or empty path + unless specifically told with a flag setting. + (check_null_empty_path): New function, adapted from macro. + * syscalls.cc (_rename): Use already-determined file attributes rather + than checking again. + * lib/cygwin/cygwin_attach.dll.c (cygwin_attach_dll): Use a static + per_process structure since this is apparently supposed to be zeroed. + * lib/cygwin_crt0.c (cygwin_crt0): Zero per_process structure sent to + older DLLs. + +Mon Jul 17 19:39:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Eric Fifer <EFifer@sanwaint.com> + * poll.cc (poll): Fix erroneous negations. + +Mon Jul 17 17:56:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (setenv): Use __cygwin_environ instead of + environ after reallocating environment space. + +Sun Jul 16 20:23:21 2000 Christopher Faylor <cgf@cygnus.com> + + * _cygwin_crt0_common.cc: Undef 'environ' or suffer compiler error. + +Sun Jul 16 16:03:00 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc: Use new definition of "environ" throughout. + (environ_init): Explicitly initialize __cygwin_environ. + (cur_environ): New function. Detects when user has updated + their environment. + * exec.cc: Use 'environ' define throughout rather than __cygwin_environ. + * spawn.cc: Ditto. + * winsup.h: Declare cur_environ, main_environ, environ. + +Sun Jul 16 13:23:04 2000 Christopher Faylor <cgf@cygnus.com> + + * acconfig.h: Add support for NEWVFORK. + * config.h.in: Ditto. + * configure.in: Add --enable-vfork option. + * configure: Regenerate. + * dcrt0.cc (quoted): Detect and fix up quoted backslashes. + * sigproc.cc (proc_subproc): Correctly name handle of newly added child + process to avoid erroneous debugging messages about closing the wrong + handle. + +Sun Jul 16 02:30:09 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Use \ for quoting '"'. + * dcrt0.cc (quoted): Understand \ quoting for '"'. + +Sun Jul 16 00:32:58 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (build_argv): Strip quotes from argv[0] since it should + never be globified. + +Sat Jul 15 00:32:41 2000 Christopher Faylor <cgf@cygnus.com> + + * dll_init.cc (dll_list::alloc): Round correctly. Use VirtualAlloc + since shared file mapping is unnecessary. + (dll_list::detach): Release memory via VirtualFree since there we no + longer use shared file mapping. + +Fri Jul 14 22:40:22 2000 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::linearize_fd_array): Make max_used_fd an int so that + we can detect when there are no fds to pass. + * dcrt0.cc (host_dependent_constants::init): Revert Sat Mar 18 01:32:04 + 2000 change. + (dll_crt0_1): Set "cygwin_finished_initializing" flag. + (dll_crt0): Don't perform memcpy if uptr is already set to internal + structure. + (_dll_crt0): Remember location of programs envptr. + * dll_init.h (per_module, dll, dll_list): Revamp. + * dll_init.cc: Revamp. Use new classes. + * fork.cc (fork): Use new revamped dll, dll_list, and per_module stuff. + * environ.cc: Use __cygwin_environ throughout rather than the + user_data->envptr. + * exec.cc: Ditto. + * spawn.cc: Ditto. + * winsup.h: Declare update_envptrs, cygwin_finished_initializing. + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Revert previous + change. + * lib/cygwin_attach_dll.cc (cygwin_attach_dll): Always pass in own + per_process structure or we end up overwriting information from the + main program. + +Wed Jul 12 00:46:00 2000 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (thread_stub): Use impure_ptr in place of reent_data. + * dll_init.cc (dll_dllcrt0): Replace erroneous use of local symbol with + correct __cygwin_user_data->impure_ptr. + +Wed Jul 12 00:01:03 2000 Christopher Faylor <cgf@cygnus.com> + + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Don't reset + environ if already set. + +Mon Jul 10 19:07:03 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::read): Unicode interface + to ReadConsoleInput only exists on W2K, so use workaround from + Kazuhiro Fujieda <fujieda@jaist.ac.jp>. + +Mon Jul 10 11:30:00 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (install): Install textmode.o as well as binmode.o. + * fhandler_console.cc (fhandler_console::read): Use UNICODE when + reading from the console and translate to ASCII from that. + +Sun Jul 9 21:52:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Close handle `hToken' only if it's not + copied from myself->token. + * syscalls.cc (seteuid): Replace CopySid by memcpy which is foolproof + here. + +Sun Jul 9 01:19:06 2000 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Export _getmode and getmode to allow querying of binary + state of an fd. + * external.cc (cygwin_internal): Add handling of perfile_table setting. + * fhandler.cc (perfile_table): New global. + (fhandler_base::get_default_fmode): New method to return a file's + default mode based on its name. + (fhandler_base::open): Use get_default_mode method to determine a + file's mode. Record file mode in file flags. + * fhandler.h (fhandler_base): Declare get_default_fmode + * syscalls.cc (getmode): New function. + * sys/cygwin.h (__cygwin_perfile): New structure. + (cygwin_getinfo_types): Move outside of WINVER conditional. + (per_process): Move inside of WINVER conditional. + +Sat Jul 8 00:15:01 2000 Christopher Faylor <cgf@cygnus.com> + + * external.cc (cygwin_internal): Export __cygwin_user_data. + * include/sys/cygwin.h: Allow definition of per_process even when not + compiling with C++. + (cygwin_getinfo_types): Add CW_USER_DATA. + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Get + __cygwin_user_data pointer from cygwin_internal. If it doesn't exist, + return failure. Use either this pointer or passed in pointer + throughout. Clear forkee. + * lib/crt0.h: Accommodate argument changes to _cygwin_crt0_common. + * lib/cygwin_attach_dll.c (cygwin_attach_dll): Reorganize to allow use + of newer binaries with older DLLs. Detect older DLLs when + _cygwin_crt0_common returns 0 and allocate space for a per_process + structure on the stack. + * lib/cygwin_crt0.c (cygwin_crt0): Ditto. + +Fri Jul 7 10:31:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h: Hide internal data types in per_process + when not __INSIDE_CYGWIN__. + +Wed Jul 5 18:56:58 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (__cygwin_user_data): Initialize. + (dll_crt0_1): Eliminate user_data initialization. + (dll_crt0): Set up impure_ptr_ptr for older executables. + (cygwin_dll_init): Eliminate user_data initializations. + (__api_fatal): Don't check for user_data initialization. + * dll_init.cc (struct dll): Store entire contents of per_process rather + than just a pointer. + (add): Ditto. + (initOneDll): Don't check for user_data initialization. + (DllList::recordDll): Store contents of per_process argument. + (DllList::detachDll): Pass address of per_process field. + (DllList::initAll): Ditto. + (DllList::doGlobalDestructorsOfDlls): Ditto. + (DllListIterator::operator *): Ditto. + (dll_dllcrt0): Default to __cygwin_user_data if arg is NULL. + * include/sys/cygwin.h: Reorganize per_process to eliminate obsolete + fields and accommodate new way of initializing. + * lib/_cygwin_crt0_common: Initialize _impure_ptr from + __cygwin_user_data.impure_ptr. + +2000-07-04 Vadim Egorov <egorovv@mailandnews.com> + + * exceptions.cc (try_to_debug): Prevent recursive spawning of JIT + debugger. Treat special event from debugger as command to continue. + +Mon Jul 4 19:29:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * poll.cc (poll): Zero out `open_fds' as well. + +Mon Jul 4 1:22:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump API minor version to 24. + +2000-07-04 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * security.cc (read_sd): Eliminate OemToChar. + +Mon Jul 4 18:57:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * poll.cc: New file. Implement `poll' system call. + * include/poll.h: Ditto. + * include/sys/poll.h: Ditto. + * Makefile.in: Add poll.o as dependency. + * cygwin.din: Add poll and _poll symbols. + +2000-07-04 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * dcrt0.cc (dll_crt0_1): Eliminate SetFileApisToOEM and CharToOem. + * (dummy_autoload): Add functions used in fhandler_console. + * fhandler_console.cc (fhandler_console::read): Use ENCHANCED_KEY flag + to distinguish extended keys. Translate an input character from the + OEM code page to the ANSI code page. + * (fhandler_console::write_normal): Translate output characters from + the ANSI code page to the OEM code page. + * syscalls.cc (_link): Use MultiByteToWideChar instead of OemToCharW. + +Mon Jul 3 16:09:16 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (stack_info::walk): Use method to find offset. + (handle_exceptions): Be more assertive in finding ebp for use under + W2K. Create a dummy stack frame for cases where program is dying and a + stack dump is being output. + (sig_handle): Fill out a GetThreadContext for use with a user-generated + "core dump". + +Mon Jul 3 10:53:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h: Remove SOCK_PACKET define since it's + not supported by Windows sockets. + +Sun Jul 2 21:50:48 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (user32_init): Add primitive guard against concurrent + attempts to call this function. Also add temporary debugging code to + display a message if the function is called multiple times. + (api32_init): Ditto. + +Sun Jul 2 10:39:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h: Define MAX_SID_LEN and new MAX_HOST_NAME. + * fork.cc (fork): Use above defines instead of numerical constants. + * shared.cc (sec_user): Ditto. + * shared.h (class pinfo): Ditto. + * syscall.cc (seteuid): Ditto. + * spawn.cc (_spawnve): Ditto. Eliminate conditional. + (spawn_guts): Set child->uid = USHRT_MAX when user context will be + changed in child process. + * uinfo.cc (uinfo_init): Check for myself->uid instead of myself->psid + to avoid reloading of /etc/passwd on process startup if ntsec is off. + Use above defines instead of numerical constants. + * security.cc: Move define for MAX_SID_LEN to winsup.h. + +Sun Jul 2 1:57:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (uinfo_init): Eliminate calls to read_etc_group() + and read_etc_passwd(). + +2000-06-28 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * assert.cc (__assert): Reduce dependency on newlib. + * exec.cc: Eliminate unnecessary inclusion of ctype.h. + * glob.c: Ditto. + * hinfo.cc: Ditto. + * init.cc: Ditto. + * strace.cc: Ditto. + * tty.cc: Ditto. + * grp.cc (parse_grp): Eliminate atoi. + * passwd.cc (grab_int): Ditto. + * grp.cc (getgroups): Eliminate str{n,}casecmp. + * path.cc (get_raw_device_number): Ditto. + * path.cc (sort_by_native_name): Ditto. + * spawn.cc (iscmd): Ditto. + * uinfo.cc (internal_getlogin): Ditto. + +Sat Jul 1 11:43:32 2000 Christopher Faylor <cgf@cygnus.com> + + * binmode.c (cygwin_premain0): Fix erroneous clearing of bit. + * textmode.c (cygwin_premain0): Ditto. + +Sat Jul 1 00:24:04 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (_dll_crt0): Renamed from dll_crt0 (). + * winsup.h: Accommodate above change. + * cygwin.din: Ditto. + * lib/cygwin_crt0.c: Ditto. + +Fri Jun 30 23:21:40 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use variables rather than configure constructs where + appropriate. + (LIBCOS): Find additional stub library stuff in their own subdirectory. + * dcrt0.cc: Convert user_data pointer to static __cygwin_user_data + area. + (do_global_ctors): Check magic_bisquit for initialization. + (dll_crt0_1): First group of premain functions prior to fd + initialization. Run second group before calling main. + (dll_crt0 ()): New function, called from new initialization code. + (dll_crt0 (per_process *uptr)): Call new dll_crt0 () function on + initialization. + * debug.cc (thread_stub): Initialize bottom of stack with per-thread + info. + * environ.cc (parse_thing): Use binmode global to control + CYGWIN=binmode behavior. + * fhandler.cc (fhandler_base::open): Allow explicit setting of __fmode + to O_BINARY or O_TEXT to override disk mount settings. + * libcmain.cc: Move to lib subdirectory. + * libccrt0.cc: Ditto. + * dll_main.cc: Ditto. + * dll_entry.cc: Ditto. + * getopt.c: Ditto. + * thread.cc (thread_init_wrapper): Call ExitThread explicitly rather + than returning, as a preliminary step towards placing per thread info + at the bottom of the stack. + * winsup.h: Move per_process class to include/sys/cygwin.h. Declare + new dll_crt0(). + * include/cygwin/version.h: Bump API minor version. + * binmode.c: New file. + * textmode.c: Ditto. + * perthread.h: Ditto. + * lib/_cygwin_crt0_common.cc: Ditto. + * lib/crt0.h: Ditto. + * lib/cygwin_attach_dll.c: Ditto. + * lib/cygwin_crt0.c: Ditto. + * lib/dll_entry.cc: Ditto. + * lib/dll_main.cc: Ditto. + * lib/getopt.c: Ditto. + * lib/libcmain.c: Ditto. + * lib/premain0.c: Ditto. + * lib/premain1.c: Ditto. + * lib/premain2.c: Ditto. + * lib/premain3.c: Ditto. + +Wed Jun 28 19:36:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (seteuid): Initialize pi.token before calling + internal_getlogin(). + * uinfo.cc (internal_getlogin): Use impersonation token instead + of process token in case of active impersonation. Add some comments. + (uinfo_init): Initializing myself->token and myself->impersonated + before calling internal_getlogin(). Add some comments. + +Mon Jun 26 18:32:41 2000 Christopher Faylor <cgf@cygnus.com> + + * windows.cc (setitimer): Round up when < 1000 usecs. + +Mon Jun 26 17:34:54 2000 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::dup2): Eliminate compiler warning. + +Mon Jun 26 11:25:29 2000 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::dup2): Guard against out of bounds newfd. + +Sat Jun 24 23:43:06 2000 Christopher Faylor <cgf@cygnus.com> + + * grp.cc (read_etc_group): Open file in text mode. + * pwd.cc (read_etc_passwd): Ditto. + * shared.h: Bump PROC_MAGIC. + +Sat Jun 24 19:30:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork): Fix error in copying SID pointer. + * spawn.cc (_spawnve): Ditto. + * passwd.cc: Remove static from `passwd_in_memory_p'. + (read_etc_passwd): Remove static. + * uinfo.cc: Move global declaration of `read_etc_group' and + `group_in_memory_p' into `uinfo_init'. + (internal_getlogin): Try to get SID from current process first. + (uinfo_init): Don't set uid and gid if `myself' has a valid SID. + Only load /etc/passwd and /etc/group in that case. + +Sat Jun 24 12:29:59 2000 Christopher Faylor <cgf@cygnus.com> + + * shared.cc (shared_info::initialize): Improve error message clarity. + * mkvers.sh: Eliminate debugging output. + +Thu Jun 22 17:50:59 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Autogenerate cygwin.def when appropriate. + * include/sys/cygwin.h: Correct prototype. + +Thu Jun 22 17:05:04 2000 Christopher Faylor <cgf@cygnus.com> + + * include/sys/cygwin.h: Don't define parts of this file that rely on + Windows headers unless the Windows header was previously included. + +Thu Jun 22 20:45:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * registry.cc (load_registry_hive): Use HKEY_USERS when checking + for existing user hive. + Use MAX_PATH instead of numerical constant for array size. + Use return code of RegLoadKeyA instead of GetLastError for error output. + +Thu Jun 22 14:27:04 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add new-libcygwin.a back to all_host target. + +Wed Jun 21 14:32:42 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add *.def to clean operation. + +Wed Jun 21 13:18:23 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add *.exe to clean operation. + +Wed Jun 21 01:02:38 2000 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Fix sed usage for older seds. + +Tue Jun 20 20:46:28 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Don't touch winver_stamp if mkvers.sh was unsuccessful. + +Tue Jun 20 17:41:30 2000 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Fix problem with handling of CVS tags causing .rc syntax + errors. + +Tue Jun 20 13:38:12 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Change to build the DLL during a cross-compiler build. + +Mon Jun 19 20:46:33 2000 Christopher Faylor <cgf@cygnus.com> + + * select.cc (socket_cleanup): Shutdown I/O on dummy sockets prior to + closing them. + +Mon Jun 19 19:35:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc: Add load statements for `GetSidIdentifierAuthority' + and `RegLoadKeyA'. + * registry.cc (get_registry_hive_path): New function. + (load_registry_hive): Ditto. + * security.cc (convert_sid_to_string_sid): New function. + (get_ssid): Renamed to `convert_string_sid_to_sid'. + (get_pw_sid): Call `convert_string_sid_to_sid' instead of `get_ssid'. + (get_gr_sid): Ditto. + (get_admin_sid): Ditto. + (get_system_sid): Ditto. + (get_creator_owner_sid): Ditto. + (get_world_sid): Ditto. + * shared.h: New prototypes for `get_registry_hive_path' and + `load_registry_hive'. + * spawn.cc (spawn_guts): Set child->psid to NULL to force calling + `internal_getlogin' from child process in case of changing user context. + Call `load_registry_hive' in case of changing user context. + (_spawnve): Copy user infos only if user context remains the same. + * uinfo.cc: Add load statement for `NetUserGetInfo'. + Remove load statement for `NetGetDCName'. + (internal_getlogin): Rewrite to speed up process startup + and to correct user environment in case user context changes. + (uinfo_init): Call internal_getlogin only if myself->psid is NULL, + that is user context changes. + * winsup.h: Add prototypes for `convert_sid_to_string_sid', + `convert_string_sid_to_sid' and `get_pw_sid'. + +Sun Jun 18 13:42:50 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (set_name): Don't use 'unix' as name since this is defined + by gcc now. + * fhandler.cc (set_name): Ditto. + +2000-06-17 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * winsup.h (isabspath): Don't report `C:foo' as an absolute path. + +Sat Jun 17 13:51:48 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Detect "cross-hosting" situation and set appropriate + variables in Makefile to avoid building excess stuff. + * configure: Regenerate. + * Makefile.in: Accommodate above change. + +Sat Jun 17 19:52:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo_init): Revert previous patch. + +Sat Jun 17 13:29:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo_init): Add missing initializers. + * uinfo.cc (internal_getlogin): Request domain infos only + when ntsec is ON. + +Fri Jun 16 19:27:27 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Just use library files from this tree when building + cygrun.exe. + * path.cc (chdir): Don't set cache to offending chdir. Change comment + to reflect current reality. + +Fri Jun 16 20:55:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Define symbols for `cygwin_logon_user' and + `cygwin_set_impersonation_token'. + * dcrt0.cc (dll_crt0_1): Eliminate superfluous conditional + statements. + Add load statements for `ImpersonateLoggedOnUser', `LogonUserA' + and `RevertToSelf'. + * fork.cc (fork): Care for correct impersonation of parent + and child process. + * security.cc (cygwin_set_impersonation_token): New function. + (cygwin_logon_user): Ditto. + shared.h (class pinfo): New members `orig_uid', `orig_gid', + `real_uid' nad `real_gid'. + spawn.cc (spawn_guts): Care for impersonation when starting + child process in a different user context. + * syscalls.cc (setgid): Call `setegid' now. Set real_gid. + (setuid): Call `seteuid' now. Set real_uid. + (seteuid): Functionality moved from setuid to here. Care for + correct impersonation. + (setegid): Functionality moved from setgid to here. + * uinfo.cc (uinfo_init): Initialization of additional pinfo + members. + (getuid): Return real uid. + (getgid): Return real gid. + (geteuid): Return effective uid. + (getegid): Return effective gid. + include/sys/cygwin.h: Add prototypes for `cygwin_logon_user' and + `cygwin_set_impersonation_token'. + include/cygwin/version.h: Bump API minor version to 22. + +Thu Jun 15 15:43:50 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Convert path to POSIX if it seems to + be a Windows path. + +2000-06-15 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (mount_info::add_item): Eliminate a trailing backslash + included in a native path starting with '//[A-Za-z]/...'. + * path.cc (mount_info::del_item): Accept a native path as its target. + +Wed Jun 14 23:47:19 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (conv_envvars): Detect and convert all environment + variables used by libiberty's choose-temp.c + +Tue Jun 13 12:41:41 2000 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (mount_info::add_item): The previous patch can't handle + the case of overwriting a mount entry. + +Tue Jun 13 00:17:04 2000 Christopher Faylor <cgf@cygnus.com> + + * thread.h: Shorten "current_directory" variables to "cwd_*" + throughout. + * path.cc: Ditto. + (normalize_posix_path): Add some extra debugging info. + (chdir): Ditto. Store chdir'ed posix and MS-DOS directory names in + "cache" here rather than trying to derive them later. + +Sun Jun 11 15:57:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_random.cc (read): Call CryptAquireContext with + CRYPT_VERIFYCONTEXT. + +Thu Jun 8 22:49:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Erase two lines checked in + by mistake. + +Thu Jun 8 15:53:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::open): Check for directory + to set O_DIROPEN on directories anyway. + +2000-06-07 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (mount_info::init): Eliminate the mount_slash feature. + (mount_slash): Eliminated. + (mount_info::read_mounts): Eliminate looking up existing entries. The + loop for deleting cygpath entries is done only when such entries exist. + (mount_info::from_registry): Eliminate sorting. + (mount_info::add_item): Call add_reg_mount if necessary. Check nmounts + more precisely. Use strcasematch in looking up existing entries. + (mount_info::del_item): Call del_reg_mount if necessary. Use + strcasematch. Use memmove instead of memcpy. + (mount_info::import_v1_registry): Everything is done in this method. + (mount_info::to_registry): Eliminated. + (mount_info::from_v1_registry): Eliminated. + (cygwin_umount): Simply call del_item. + * shared.h: Modify the declaration of add_item and del_item. Remove the + declaration of from_v1_registry. + +Wed Jun 7 23:56:10 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump DLL minor version number to 3. + +2000-06-07 DJ Delorie <dj@cygnus.com> + + * cygwin.din: add cygwin_dll_init + * dcrt0.cc (cygwin_dll_init): new + (dll_crt0_1): short circuit if manually loaded + * path.cc (mount_info::init): don't init if manually loaded + +Wed Jun 7 13:47:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/netinet/in_systm.h: New file. + * include/cygwin/in_systm.h: Ditto. + +Thu Jun 1 01:55:45 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc: Remove unneeded include. + * dcrt0.cc: Wrap LoadDLLfunc stuff in dummy function. + * init.cc: Ditto. + * uinfo.cc: Ditto. + +2000-05-31 DJ Delorie <dj@cygnus.com> + + * include/cygwin/version.h: use decimal, NOT octal + +Wed May 31 16:40:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::open): Check for executable + even if ntsec is on if filesystem doesn't support ACLs. + +Wed May 31 15:57:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc: Use LoadDLLfuncEx for loading Crypto API functions + with parameter `notimp' set to 1. + +Tue May 30 16:58:33 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::conv_to_win32_path): Previous patch was too + aggressive in adding a trailing slash. + +Mon May 29 20:31:01 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove libadvapi32.a. + * autoload.h: Add additional field to autoload block for handling + unimplemented functions. + (LoadDLLfuncEx): New function which accepts additional parameter for + controlling unimplemented function behavior. + (LoadDLLfunc): Use LoadDLLfuncEx. + * dcrt0.cc: Use new arguments for LoadDLLfunc. Add advapi32 routines. + (noload): Rewrite in assembler. Handle new unimplemented function + type. + * exceptions.cc: Eliminate another vestige of StackWalk stuff. + * net.cc: Use new arguments for LoadDLLfunc. + * uinfo.cc: Ditto. + +Mon May 29 20:18:47 2000 Christopher Faylor <cgf@cygnus.com> + + * config.h.in: Remove obsolete define. + * path.h (isdrive): New macro. + * dcrt0.cc (globify): Use new macro to determine if a string refers to + an MS-DOS drive. + * environ.cc (winenv): Ditto. + * spawn.cc (find_exec): Ditto. + * path.cc (get_raw_device_number): Ditto. + (mount_info::conv_to_posix_path): Ditto. + (chdir): Ditto. + (cygwin_posix_path_list_p): Ditto. + (cygwin_split_path): Ditto. + (path_conv::check): Move tmp_buf to beginning of function since it can + be used earlier in the loop. Use tmp_buf rather than 'root' to hold + root information. + (mount_info::conv_to_win32_path): Add trailing slash to end of mount + path when it translates to a drive. Add defensive code to avoid + writing beyond the end of 'dst'. + +Sat May 27 15:57:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_random.cc (read): Use CRYPT_MACHINE_KEYSET in + call to CryptAcquireContext() to serve users that did not + log in interactively. + +Fri May 26 11:16:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_BAD_NET_NAME to errno ENOSHARE. + +Fri May 26 02:23:35 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sigframe::set): Accept a default frame pointer. + * sigproc.cc (sig_send): Use passed in frame pointer, if appropriate. + +Thu May 25 17:44:25 2000 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (rmdir): Use file attributes that have already been discovered + by path_conv. + +2000-05-25 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * dir.cc (rmdir): Correct the manner in checking the target directory. + +Wed May 24 21:59:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (writable_directory): Comment out previous code, + return always 1 for now. + (mkdir): Call set_file_attribute explicitely with S_IFDIR mode bit. + * syscalls.cc (chown_worker): Ditto. + (chmod): Ditto. + * security.cc (get_nt_attribute): Fix error in debug output. + Never set FILE_DELETE_CHILD for files. + Construct appropriate inherit attribute according to file type. + +2000-05-23 DJ Delorie <dj@cygnus.com> + + * syscalls.cc (_cygwin_istext_for_stdio): New, for newlib + * include/cygwin/version.h: Bump API number for detect old + programs using old getc/putc macros + +2000-05-23 DJ Delorie <dj@cygnus.com> + + * dir.cc (writable_directory): handle root directories + +Tue May 23 10:09:26 2000 Christopher Faylor <cgf@cygnus.com> + + * uname.cc (uname): Use a "s" to denote a snapshot to avoid confusion + with the number "5". + +Tue May 23 10:01:07 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::conv_to_posix_path): Avoid putting a trailing + slash on a directory name when the ms-dos path spec is a root directory + of a device. + * registry.cc (reg_key::build_reg): Set 'key_is_invalid' flag rather + than using an INVALID_HANDLE_KEY. + (reg_key::get_int): Test for key validity before performing registry + operations. + (reg_key::set_int): Ditto. + (reg_key::get_string): Ditto. + (reg_key::set_string): Ditto. + (reg_key::kill): Ditto. + (reg_key::~reg_key): Ditto. + +Tue May 23 01:13:33 2000 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Use snapshot date as build date since it is more + interesting. + * uname.cc (uname): Detect if this is a snapshot build and add an "S" + to the version number. Report the snapshot date as the release date. + +Mon May 22 17:11:25 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (regopt): Scan HKLM if HKCU scan fails. + +Mon May 16 23:39:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (rmdir): Care for misleading error messages + when trying to remove a directory on a samba share. + Eliminate superfluous else branch. + * syscalls.cc (_rename): Additional check for ERROR_FILE_EXISTS + if MoveFile fails. + +Sun May 21 20:51:44 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Move uinfo_init call to before sigproc_init to + avoid a race. + (noload): Add an extra argument for debugging. + * uinfo.cc (uinfo_init): Eliminate test for multiple calls. + (getlogin): Assume that uinfo_init has already been called. + +Sat May 20 01:34:57 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Add an argument to control whether + function just checks for validity. Flag module handle == 0 as + noninterrupible. + (call_handler): Always acquire and release ebp lock. Loop for only a + fixed amount of time attempting to grab mutos and find an interruptible + PC. + +2000-05-19 DJ Delorie <dj@cygnus.com> + + * syscalls.cc (setmode): change mode of any matching FILE* also. + +Thu May 18 17:28:19 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Remove external.h dependency. + * dcrt0.cc (sigthread::init): Move here from sigproc.h. + * sigproc.h (sigthread): Move init to dcrt0.cc. + +Thu May 18 01:28:02 2000 Christopher Faylor <cgf@cygnus.com> + + * select.cc (thread_pipe): Add paranoid check to ensure thread + termination. + * external.cc: Eliminate obsolete include. + * getopt.c (getopt_long): Fix compiler warning. + * shared.h: Moved PID_ definitions to include/sys/cygwin so that they + can be used by external programs. + * include/sys/cygwin.h: Move external definitions here. Include + sys/resource.h to avoid having to do this everywhere. + +Thu May 18 01:04:02 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sigframe): Don't set frame info unless tid matches this + thread id. + +Wed May 17 23:13:32 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Initialize mainthread stuff here before + anything needs it. + * sigproc.cc (sigproc_init): Move mainthread initialization out of + here. + * sigproc.h (sigthread): Add init() method. + (sigframe): Don't try to initialize muto. + * sync.cc: Undef WaitForSingleObject to avoid recursion. + +2000-05-17 DJ Delorie <dj@cygnus.com> + + * testsuite/winsup.api/crlf.c: New + * testsuite/winsup.api/iospeed.c: New + +Wed May 17 01:05:52 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::cygdrive_posix_path): Don't add trailing slash + if referring to something like c:\. + * dcrt0.cc (dll_crt0_1): Move uinfo initialization prior to sig_send + initialization to give signal thread a chance to finish. + * debug.cc (WFSO): Move to sigproc.cc + (WFMO): Ditto. + * exceptions.cc (interruptible): Allocate slightly more space for + directory just for paranoia's sake. + (call_handler): Eliminate nonmain argument. Determine if main thread + has set a frame pointer and use it if so. + (sig_handle): Eliminate nonmain argument. + * net.cc: Record frame information in appropriate routines throughout. + * select.cc (select): Ditto. + * sigproc.cc: Use sigthread structure to record mainthread id + throughout. + (sig_send): Record frame information for signal handler. + (wait_sig): Reflect argument change in sig_handle. + (WFSO): Move here and record frame information for signal handler. + (WFMO): Ditto. + * sigproc.h: Implement new "sigthread" class. Implement "sigframe" + class for manipulating signal frame info. + * thread.cc (__pthread_kill): Use standard _kill() function rather than + calling sig_send directly. + * winsup.h: Eliminate ebp element from signal_dispatch class. + +Tue May 16 23:39:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by John Rowley <wjr@bgs.ac.uk> + * fhandler_tape.cc (fhandler_dev_tape::ioctl): Check + for filemark feature on MTWEOF operation. + +Tue May 16 11:49:13 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/in.h (AF_INET6): Use correct in6_addr struct. + +Mon May 15 00:35:35 2000 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump DLL minor version number to 2. + +Sun May 14 23:41:24 2000 Christopher Faylor <cgf@cygnus.com> + + * shared.h: Bump PROC_MAGIC. + * include/cygwin/version.h: Bump API minor to accommodate two recent + exports. + +2000-05-13 Mumit Khan <khan@xraylith.wisc.edu> + + * include/cygwin/socket.h (AF_INET6): Use same value as winsock2. + +2000-05-12 Mumit Khan <khan@xraylith.wisc.edu> + + * include/cygwin/in.h (struct in6_addr): Fix spelling. + * include/cygwin/socket.h (AF_INET6, PF_INET6): Define macros. + (AF_MAX, PF_MAX): Bump to 32 to leave room for future expansion. + +Fri May 12 21:35:54 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (build_argv): Remove unneeded variable. + * select.cc (peek_pipe): Don't check for "ready" if it's already set. + (peek_console): Ditto. + (peek_serial): Ditto. + (peek_socket): Ditto. + (peek_windows): Ditto. + +Fri May 12 20:31:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (write_file, read_file): New wrapper functions + for WriteFile and ReadFile to get rid of ERROR_MEDIA_CHANGED + and ERROR_BUS_RESET in case of first access to tape. + (fhandler_dev_raw::raw_write): Use write_file instead of WriteFile. + (fhandler_dev_raw::raw_read): Use read_file instead of ReadFile. + +Fri May 12 01:04:57 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (DLL_OFILES): Sort. + * fhandler_tty.cc (fhandler_tty_slave::send_ioctl_request): Eliminate. + (fhandler_tty_slave::ioctl): Rewrite to avoid races. + +2000-05-11 Mumit Khan <khan@xraylith.wisc.edu> + + * mmap.cc (list::erase): Increment loop counter. + (map::erase): Likewise. + +Thu May 11 00:54:00 2000 Charles Wilson <cwilson@ece.gatech.edu> + + * cygwin.din: insure that regsub() is included in + cygwin1.dll + +Tue May 9 18:59:41 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use appropriate VARIABLE to refer to cygwin.def in load + line. + +Thu May 9 23:53:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::puts_readahead): Change + while condition to disallow wild runs. + +Thu May 9 15:24:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by <lha@stacken.kth.se> + * window.cc (setitimer): Check for overflow condition + in tv_sec. + +Thu May 9 0:47:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Eric Fifer <EFifer@sanwaint.com> + * errno.cc: Change mapping of ERROR_BAD_PATHNAME to ENOENT. + +Thu May 9 0:47:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink::info): Treat non readable files + as normal non symlink files. + +2000-05-08 Paul K. Fisher <pfisher@plexware.com> + + * include/pthread.h (pthread_detach): Add missing prototype. + (pthread_join): same. + +2000-05-08 DJ Delorie <dj@cygnus.com> + + * fhandler.cc (lock): use signed math to allow checking ranges + properly. + +Sat May 6 23:22:25 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (insert_file): Eliminate unused parameter. + (build_argv): Ditto. + * exceptions.cc (stack): Eliminate unused parameters. + (stackdump): Ditto. + (cygwin_stackdump): Reflect above changes. + (sig_handle): Ditto. + * fhandler.cc (fhandler_base::set_inheritance): Use kludge to avoid + unused parameter warning. + +2000-05-06 Mumit Khan <khan@xraylith.wisc.edu> + + * include/wchar.h (wcscmp, wcslen): Fix prototypes. + * syscalls.cc (wcslen, wcscmp): Adjust. + +Fri May 5 23:32:07 2000 Christopher Faylor <cgf@cygnus.com> + + * errno.cc (errmap): Correct DIRECTORY mapping to ENOTDIR. + +2000-05-04 Mumit Khan <khan@xraylith.wisc.edu> + + * Makefile.in (install): Install profile startup and library. + +Wed May 3 21:54:11 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Use -gstabs+ as compile debug option. This seems to + promote better handling of symbols. + * configure: Regenerate. + * delqueue.cc (delqueue_list::process_queue): Allow ERROR_ACCESS_DENIED + to indicate that a file is being shared under Windows 95. + * syscalls.cc (_unlink): Use full path name. Take special action for + Windows 95. Assume that an ERROR_ACCESS_DENIED indicates a sharing + violation unless it's on a remote drive. Punt if there is an + ERROR_ACCESS_DENIED on a remote drive. + +Wed May 3 18:07:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_BAD_NETPATH to new errno ENOSHARE. + (_sys_errlist): Add entry for ENOSHARE. + (strerror): Add case for ENOSHARE. + * syscalls.cc (stat_worker): Check for errno ENOSHARE. + +Wed May 3 17:28:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add dependencies for fhandler_random.o + * fhandler.h: Add device type FH_RANDOM. Add class + fhandler_dev_random. + * fhandler_random.cc: New file. Implementation of + fhandler_dev_random. + * hinfo.cc (build_fhandler): Add case for FH_RANDOM. + * path.cc: Add device names for random devices to + windows_device_names. + (get_device_number): Add if branch for random devices. + (win32_device_name): Add device name generation for + random devices. + winsup.h: Include <wincrypt.h>. + +2000-05-02 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (mount_info::conv_to_win32_path): Previous patch + failed to set flags on a win32 path. + +Tue May 2 11:34:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (read_sd): Return 1 on success because we + can't rely on the returned SD size from GetFileSecurity. + +Tue May 2 2:22:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc: Add dynamic load code for `OemToCharA' from user32.dll. + * security.cc (read_sd): Call `OemToCharA' to make + `GetFileSecurity' happy on filenames with umlauts. + +Wed Apr 26 23:23:23 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_win32_path): Don't add a trailing slash when one + already exists. + (mount_info::conv_to_win32_path): Use existing code for dealing with + relative path names when input is already a win32 path. + +2000-04-26 DJ Delorie <dj@cygnus.com> + + * Makefile.in (install): install regexp.h + +Wed Apr 26 16:20:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat_worker): Previous patch could succeed + in stating a non-existant file. + +Wed Apr 26 01:07:16 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Allocate slightly more space for + directory name check. Windows 95 seems to null-terminate the directory + otherwise. + (interrupt_on_return): Issue a fatal error if we can't find the + caller's stack. + +Tue Apr 25 16:50:54 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (find_exec): Accept a path_conv argument rather than a + buffer so that the caller can find things out about a translated path. + (perhaps_suffix): Ditto. + (spawn_guts): Allocate path_conv stuff here so that we can find out + stuff about the translated path (this is work in progress). + * environ.cc (environ_init): Accept an as-yet unused argument + indicating whether we were invoked from a cygwin parent or not. + (winenv): Ditto. + (posify): Accept an argument indicating whether the path has already + been translated. + * dlfcn.cc (check_access): Provide a path_conv buffer to find_exec. + * exec.cc (sexecvpe): Ditto. + * path.cc (path_conv::check): Rename from path_conv::path_conv. + (mount_item::getmntent): Recognize "Cygwin executable" bit. + (symlink_info::check): Remove debugging statements. + * path.h (class path_conv): Add iscygexec method. Rewrite constructor + to call "check" method to allow multiple operations on a path_conv + variable. + * pinfo.cc (pinfo_init): Pass argument to environ_init. + * shared.h: Bump PROC_MAGIC. + * winsup.h: Reflect above changes to function arguments. + * include/sys/mount.h: Add MOUNT_CYGWIN_EXEC type. + +Thu Apr 25 21:35:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat_worker): Previous patch failed to stat + each drives root dir on 9X. + +Thu Apr 25 16:37:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::open): Check for allow_ntsec + when determining exec flag. + * path.cc (symlink_info::check): Remove call to get_file_attribute(). + * security.cc (read_sd): Rename, ditto for variables to conform + to common naming convention. Use GetFileSecurity() instead of + BackupRead() to avoid permission problems when reading ACLs. + (write_sd): Same renaming as for read_sd(). + (alloc_sd): Change default permissions according to Linux permissions + for group and world when write permission is set. + * syscalls.cc (stat_worker): Avoid different permission problems + when requesting file informations. + +Thu Apr 25 10:50:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * net.cc: Avoid a warning in declaration inet_network. + +Mon Apr 24 17:38:25 2000 Thorsten Otto <t.otto@germanynet.de> + + * fhandler_console.cc (fhandler_console::read): Detect extended keycode + information for Windows 9x so that function keys will work correctly. + +2000-04-24 Vadim Egorov <egorovv@mailandnews.com> + + * net.cc (cygwin_inet_network): new function. + * cygwin.din (inet_network): new export + +Fri Apr 21 10:37:08 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Previous two patches were still + incorrect so rewrite this function to deal with trailing dots. + (mount_info::conv_to_win32_path): Just check for '/' where appropriate. + Eliminate nofinalslash call since it is handled in normalize_posix_path + now. + +Thu Apr 20 17:32:42 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Search further for stack info to + accommodate Windows 95. + +Thu Apr 20 16:39:18 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Previous change failed to take root + access into account. + +Thu Apr 20 11:26:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (_link): Check new link path for trailing dot. + +Thu Apr 20 00:32:03 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_base::hclose): New virtual method. + (fhandler_base::set_inheritance): Make this a method so that we can use + the appropriate close methods. + * fhandler.cc (fhandler_base::set_inheritance): Ditto. + * path.cc (normalize_posix_path): Eliminate /. trailing path + component. + +Wed Apr 20 0:19:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (setuid): Allow switching user context after + successful call to ImpersonateLogedOnUser (NT only). + (setgid): Ditto. + (seteuid): Call setuid. + (setegid): Call setgid. + +Wed Apr 19 22:00:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (internal_getlogin): Use NetGetDCName() instead + of NetGetAnyDCName(). + +Mon Apr 17 12:08:47 2000 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * syscalls.cc (_rename): Try MoveFile() at first before + MoveFileEx(..., MOVEFILE_REPLACE_EXISTING). + +Tue Apr 18 19:15:29 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (globify): Don't use \ quoting when apparently quoting a DOS + path spec, even within a quoted string. + +Sun Apr 16 18:54:21 2000 Christopher Faylor <cgf@cygnus.com> + + * init.cc (dll_entry): Use better check for determining when to set + thread specific stuff. + * syscalls.cc (_unlink): Continue with chmod'ing file even if + DELETE_ON_CLOSE succeeds, if file still exists. + +Fri Apr 14 23:51:15 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (keytable): Add support for keypad 5 key, which + MS seems to think is equivalent to VK_CLEAR. + * debug.cc (thread_stub): Eliminate initialization of reent stuff. + * init.cc (dll_entry): Move it here. + +Thu Apr 13 18:32:26 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (insert_file): Avoid freeing previously allocated argument + list. + * path.cc (symlink_info::check): Rename from symlink_check_one. Use + new symlink_info struct for communication. + (path_conv::path_conv): Use symlink_info structure for communication + with symlink_info::check. Fix typo which resulted in symbolic links + always being resolved. + (readlink): Use stat_suffixes array when resolving a link. + * syscalls.cc (stat_suffixes): Make global. + +Thu Apr 13 20:50:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump minor api to reflect export change. + +Thu Apr 13 8:48:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (conv_to_win32_path): Detect a win32 path + if path contains backslashes. + * cygwin.din: Add symbol for `lacl'. + * security.cc (ReadSD): Add debug output. + (acl_worker): New static function. + (acl): Call acl_worker now. + (lacl): New function. + (facl): Call acl_worker now. + * include/cygwin/acl.h: Add prototype for `lacl'. + +Wed Apr 12 18:48:33 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::path_conv): Ensure that suffix is correctly + copied to path when we've found a symlink but aren't following + symlinks. + +Sat Apr 8 00:46:14 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_disk_file::fstat): Allocate enough space for + root dir determination or overflow an array. + +Sat Apr 8 00:08:53 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sigsave): Copy on fork so that we can restore correct + behavior in forked process. + (interruptible): Flag as interruptible when running in main process + module. + (interrupt_setup): Save return address and address of return address. + (signal_fixup_after_fork): New function. Uses above two values to + restore proper behavior to forked process. + (interrupt_on_return): Pass return address address to interupt_setup. + (interrupt_now): Pass NULL for return address address to + interrupt_setup. + * fork.cc (fork): Call signal_fixup_after_fork. + * shared.h: Lint cleanups. + * winsup.h: Ditto. + +Mon Apr 3 14:10:44 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (select_stuff): Eliminate use of 'total'. + * select.cc (cygwin_select): Ditto. + (select_stuff::wait): Use maximum size for w4 rather than calculating + what will fit. + +Mon Apr 03 13:58:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (parse_grp): Save empty array instead of + NULL in gr_mem if no supplementary group is given. + +Sun Apr 02 16:02:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (chown_worker): Use previous uid/gid if + new uid/gid is -1. + +Fry Mar 31 22:55:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (chown_worker): New static function with + chown functionality. + (chown): Call chown_worker with SYMLINK_FOLLOW. + (fchown): New function. Call chown_worker with SYMLINK_FOLLOW. + (lchown): New function. Call chown_worker with SYMLINK_IGNORE. + * cygwin.din: Add symbols for fchown, lchown. + +Fry Mar 31 11:18:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink): Call `set_file_attribute()' and + `SetFileAttributeA()' instead of `chmod()' to set + uid/gid correct. + +Wed Mar 29 22:49:56 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (select_record): Explicitly zero elements of this class. + (select_stuff): Ditto. + * select.cc (cygwin_select): Eliminate memset zero of sel. + +Tue Mar 28 16:45:42 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use default rules when compiling cygrun.o. + * dcrt0.cc (host_dependent_constants::init): Limit non-NT platforms to + 32K chunks when copying regions during a fork. + * path.cc (symlink_check_one): Add temporary debugging output. + Simplify PATH_EXEC test. + * syscalls.cc (stat_suffixes): Null terminate this list. + +Sat Mar 25 20:46:39 2000 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_check_one): Recognize symlink settings from the + mount table. + * path.h: Make PATH_SYMLINK an alias for MOUNT_SYMLINK. + * syscalls.cc (stat_worker): Use extension search mechanism in + path_conv to look for .exe rather than trying to special case it here. + * mount.h: Make MOUNT_SYMLINK a real option. + +Sat Mar 25 00:22:32 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc: Add TMPDIR to the list of environment variables which are + converted to POSIX format. + * sigproc.cc (proc_terminate): Don't attempt to delete when a muto + pointer is NULL. + +Sun Mar 19 12:01:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat_worker): Set st_nlink to 1 on remote drives. + +Sat Mar 18 23:04:27 2000 Christopher Faylor <cgf@cygnus.com> + + * times.cc: Fix extern declarations for variables that are exported but + used by this modules. + +Sat Mar 18 01:32:04 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (host_dependent_constants::init): Eliminate DELETE flag + from shared constant. + +Sat Mar 18 01:24:25 2000 Christopher Faylor <cgf@cygnus.com> + + * delqueue.cc (delqueue_list::queue_file): Add some debugging. + * path.h (class path_conv): Add a char * operator for the most common + case. + * syscalls.cc (_unlink): Rewrite to use FILE_FLAG_DELETE_ON_CLOSE when + possible (i.e., on NT). + +Fri Mar 17 18:16:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Eric Fifer <EFifer@sanwaint.com> + * fhandler.cc (fhandler_base::open): Call set_file_attribute() + only if a file is really created. + +Thu Mar 16 14:15:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_process_privileges): Remove `static'. + (get_nt_attribute): Returns uid and gid additionally. Remove call + to set_process_privileges(). + (get_file_attribute): Returns uid and gid additionally. Don't + call ntea if ntsec is ON. + (set_nt_attribute): Remove call to set_process_privileges(). + Don't call ntea if ntsec is ON. + (acl): Remove call to set_process_privileges(). + * dcrt0.cc (dll_crt0_1): Call set_process_privileges(). + * winsup.h: New prototype for set_process_privileges(), + changed prototype for get_file_attribute(). + * fhandler.cc (get_file_owner): Discard function. + (get_file_group): Ditto. + (fhandler_disk_file::fstat): Discard calls to get_file_owner() and + get_file_group(). + * path.cc (path_conv::path_conv): New debugging output for result + of GetVolumeInformation(). + (mount_info::conv_to_win32_path): Call backslashify() with pathbuf + instead of src_path. + * syscalls.cc (chown): Reformat slightly. + (chmod): Replace get_file_owner() and get_file_group() calls + by a call to get_file_attribute(). Discard local variable has_acls. + Reformat slightly. + (stat_worker): Root dir check now done by a call to rootdir(). + Don't call num_entries() on remote drives. + Discard local variable has_acls. + +Wed Mar 15 20:38:06 2000 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc: Map ERROR_NOACCESS to EFAULT. + +Wed Mar 15 14:25:38 2000 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Restore dependency on signal_arrived. It's + needed to wake up the WaitForSingleObject. + +Tue Mar 14 23:41:16 2000 Christopher Faylor <cgf@cygnus.com> + + Pipe changes throughout suggested by Eric Fifer <EFifer@sanwaint.com> + * debug.cc (threadname_init): Pass name of lock as arg 2 of new_muto. + * malloc.cc (malloc_init): Ditto. + * sigproc.cc (sigproc_init): Ditto. + * exceptions.cc (events_init): Ditto. + (call_handler): Eliminate special case for hExeced. Report locked + thread in debugging output. + * fhandler.cc (fhandker_pipe::fhandler_pipe): Propagate device type to + base class. + * fhandler.h (fhandler_pipe): Ditto. + * hinfo.cc (hinfo::build_fhandler): Pass specific type of pipe to + constructor. + * spawn.cc (spawn_guts): Eliminate dependency on signal when waiting + for subprocess. + * strace.cc: Remove obsolete #ifdef. + * sync.cc (muto::muto): Save the name of the muto. + (muto:~muto): Also release the muto. + * sync.h: Add a muto name field. + * select.cc (peek_pipe): Avoid doing a PeekNamedPipe on the write end + of a pipe. + +Sun Mar 12 01:14:33 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::get_readahead_into_buffer): New function. + * fhandler.h: Declare new function. Add extra argument to + process_slave_output. + * fhandler_console.cc (fhandler_console::read): Move read ahead code to + new function. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Move + common code here. + (fhandler_tty_slave::read): Understand readahead. + (fhandler_pty_master::read): Move code to process_slave_output. + * select.cc (peek_pipe): Avoid performing certain checks when non-read + and on inappropriate fh types. + +Sat Mar 11 22:47:43 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::read): Don't even think about + breaking on interrupt if executing in a "cygwin" thread. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): + Streamline, simplify code. + * sigproc.cc (sig_send): Remove debugging statement. + +Fri Mar 10 13:20:50 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc: Set wait_sig priority to normal. + +Fri Mar 10 13:03:06 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (wait_sig): Add addtional debugging output. + +Thu Mar 9 15:25:01 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc: Eliminate oldstack CYGWIN option. + * exceptions.cc (sfta): Eliminate obsolete function. + (sgmb): Eliminate obsolete function. + (class stack_info): Remove MS method for walking the stack. + (stack_info::init): Just initialize required fields. + (stack_info::brute_force): Rename to stack_info::walk. + (handle_exceptions): Pass derived frame pointer to sig_send. + (interrupt_setup): Clear saved frame pointer here. + (interrupt_on_return): thestack is no longer a pointer. + (call_handler): Accept a flag to indicate when a signal was sent from + other than the main thread. Use saved frame pointer for determining + where to place signal handler call. + (sig_handle): Accept "nonmain" argument. Pass it to call_handler. + * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Change + debugging output slightly. + * (fhandler_tty_common::__release_output_mutex): Ditto. + (fhandler_tty_slave::read): Fix a comment, remove a goto. + * sigproc.cc (sig_send): Accept an optional frame pointer argument for + use when suspending the main process. sigcomplete_main is an autoreset + event now. Save frame pointer for non-main operation. + (wait_sig): Make sigcomplete_main an autoreset event. Eliminate + NOSIGQUEUE. Pass rc to sig_handle to signify if this was a nonmain + process. + * sigproc.h: Reflect change to sig_send argument. + * syscalls.cc (swab): Eliminate swab function since it is now available + in newlib. + * winsup.h (signal_dispatch): Change CONTEXT cx to DWORD ebp. + +Tue Mar 7 13:31:10 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sig_send): Eliminate sync_sig_send synchronization since + it didn't seem to affect the "bash hangs" problem. + +Tue Mar 7 13:17:56 2000 Christopher Faylor <cgf@cygnus.com> + + * mcount.c: Remove strace.h include. + +Tue Mar 7 00:29:34 2000 Christopher Faylor <cgf@cygnus.com> + + Throughout use strace class in place of individual functions and + variables. + * cygwin.din: Eliminate _strace_wm. + * sigproc.cc (wait_sig): Temporarily add more debugging output. + * include/cygwin/version.h: Bump minor api to reflect export change. + +Sun Mar 5 01:17:05 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Streamline to use only one call to + ResumeThread. + * sigproc.cc (sig_send): Use a muto around the ReleaseSemaphore. + Remove priority setting since it didn't solve anything. + +Tue Feb 29 00:46:09 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (sig_send): Temporarily set priority to highest while + sending a signal. + +Mon Feb 28 11:23:29 2000 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (set_myself): Add build date to strace output. + +Mon Feb 28 11:17:30 2000 Eric Fifer <EFifer@sanwaint.com> + + * sigproc.cc (proc_subproc): Only clear wait event when not attending + to a signal. + +Mon Feb 28 00:08:09 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Remove --enable-strace-hhmmss option. + * configure: Regenerate. + +Sun Feb 27 23:11:57 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (set_os_type): Record OS name string. + (getprogname): Eliminate obsolete function. + (dll_crt0_1): Move initial strace initialization output to set_myself. + * exceptions.cc (interruptible): Add debugging output. + (interrupt_setup): New function. + (interrupt_now): Use interrupt_setup to set up common interrupt handler + stuff. + (interrupt_on_return): Ditto. + (call_handler): Move signal_arrived arm and clear threads to region + where signalled thread is suspended or suffer races. + * pinfo.cc (set_myself): Output interesting information when strace is + first initialized. Initialize progname here. + * sigproc.cc (sig_dispatch_pending): Modify to ensure that flush signal + are sent synchronously. + * strace.cc (strace_vsprintf): Move code into strace program. + * uname.cc (uname): Use 'osname' global to construct cygwin name + + Windows type + version. + +Fri Feb 25 19:26:42 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Make a little more structured. + (call_handler): Allow signals to be sent even if signalled thread is + stopped. Change order of signal_arrived arming/waiting threads + clearing to eliminate a race. + (reset_signal_arrived): New helper function. + * malloc.cc (malloc_init): Use mutos so that signal handler can keep + track of who owns the lock. + (__malloc_lock): Ditto. + (__malloc_unlock): Ditto. + * sync.h (new_muto): Actually use a muto for the "buffer". + * Makefile.in: Fix a dependency. + +2000-02-25 DJ Delorie <dj@cygnus.com> + + * Makefile.in: fix "make check" support and cygrun. + +Thu Feb 24 15:56:00 2000 Christopher Faylor <cgf@cygnus.com> + + * syscalls.c (_read): Clear errno before doing any read operation. + +Thu Feb 24 14:45:06 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Use new muto linked list to look for + all potential mutos owned by suspended thread. Clear waiting threads + while thread is stopped. + (proc_subproc): Clarify debugging output. + * sync.h (class muto): Add 'next' field. + (new_muto): Keep linked list alive. + +Thu Feb 24 00:59:15 2000 Christopher Faylor <cgf@cygnus.com> + + Fix final round of gcc warnings relating to unused parameters. + * debug.cc (iscygthread): New function. + * debug.h: Declare it. + * exceptions.cc (set_process_mask): Flush pending signals. + (handle_sigsuspend): No need to flush pending signals. + (call_handler): Refine previous tests of muto ownership. Only clear + wait()'s when we have definitely responded to a signal. + * fhandler_console.cc (fhandler_console::read): Don't set EINTR if + executing in a "cygwin" thread. + * sigproc.cc (proc_subproc): Use second argument to control whether + CLEARWAIT actually sets "signalled" flag. + * sync.h (muto): Add 'unstable' method. + +Wed Feb 23 21:59:44 2000 Christopher Faylor <cgf@cygnus.com> + + * hinfo.cc (hinfo::extend): Clean up debugging output. + +Wed Feb 23 21:34:58 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Change method for determining if + something is interruptible. + (call_handler): Avoid suspending a thread if it owns a muto. Only set + signal_arrived if the thread was actually interrupted. + (events_init): Initialize module information needed by interruptible(). + * init.cc (dll_entry): Record module handle of main for use by + interruptible(). + (proc_subproc): Reorganize handling of terminated child so that the + bulk of the processing comes from the signal thread. + (wait_sig): Force processing of waiting threads if SIGCHLD is not + processed. + +Tue Feb 22 23:06:01 2000 Christopher Faylor <cgf@cygnus.com> + + Respond to more g++ warnings relating to initializing structures. + +Mon Feb 21 18:36:37 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (set_inheritance): Revert previous patch which got rid of + 'name' parameter. + +Mon Feb 21 00:19:40 2000 Christopher Faylor <cgf@cygnus.com> + + Respond to a multitude of new g++ warnings. + +Sun Feb 20 22:10:21 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (getwinenv): Make __stdcall. + (winenv): Ditto. + * malloc.cc (strdup): New function. Occludes newlib version. + (_strdup_r): Ditto. + * winsup.h: Reflect above __stdcall changes. + +Sun Feb 20 21:31:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::fstat): Modify get_file_attribute + return value if FILE_ATTRIBUTE_READONLY is set. + +Thu Feb 17 11:00:23 2000 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (environ_init): Cosmetic change. + +Mon Feb 7 16:50:44 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: cygrun needs libshell32.a. + +Sun Feb 6 22:17:58 2000 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (proc_subproc): Simplify case for when a child process is + stopped since new signal handler ensures the desired behavior. + +Sun Feb 6 21:52:33 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Fix install target so that directories will be created + when necessary. + +Sun Feb 6 18:12:17 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: exceptions.cc should depend on autoload.h. + * exceptions.cc: Undef DECLSPEC_IMPORT prior to including imagehlp.h to + avoid defining StackWalk as "import". + (call_handler): Minor optimizations. + (sig_handle_tty_stop): Fix typo in previous checkin. + * sigproc.cc (sigproc_init): Ditto, for signal_arrived initialization. + +Sat Feb 5 15:37:37 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (isquote): Convert to inline function. + +Sat Feb 5 00:26:01 2000 Christopher Faylor <cgf@cygnus.com> + + Throughout, rename global_signal_arrived to signal_arrived. + Throughout, eliminate use of arm_signals and __signal_arrived. + Throughout, revert to use of simple call to WaitForSingleObject or + WaitForMultipleObjects. + * debug.h: Eliminate obsolete function declaration. + * exceptions.cc (sigWaitForSingleObject): Eliminate obsolete function + definition. + * fhandler.h: Reflect change to select_stuff wait method. + * fhandler_tape.cc (get_ll): Accommodate new w32api LARGE_INTEGER + definition. + * ntea.c (NTReadEARaw): Ditto. + (NTWriteEA): Ditto. + * security.cc (ReadSD): Ditto. + (WriteSD): Ditto. + * syscalls.cc (_link): Ditto. + * uname.cc (uname): Eliminate PPC switch. + +2000-02-01 Salvador Eduardo Tropea <salvador@inti.gov.ar> + + * include/io.h: add return type to setmode() + +2000-01-27 DJ Delorie <dj@cygnus.com> + + * include/netdb.h (h_errno): change __imp_ to dllimport + * cygwin.din (reent_data): add DATA + +Thu Jan 27 01:07:14 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_handler): Add debugging output. + * select.cc (MAKEready): Arm signals earlier. + * sigproc.cc (__signal_arrived:arm): Move debugging version of this + method here. + (__signal_arrived::release): Ditto. + * sigproc.h: Recognize debugging versions of above two methods. + (arm_signals::WaitForMultipleObjects): Don't release signal lock unless + signal arrived. + (arm_signals::WaitForMultipleSingleObject): Ditto. + (arm_signals::MsgWaitForMultipleObjects): Ditto. + +Thu Jan 27 00:19:26 2000 Christopher Faylor <cgf@cygnus.com> + + * sync.h (new_muto): Workaround change in gcc behavior. + +Wed Jan 26 12:57:13 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Ensure that all required libraries are built prior + to linking cygrun.exe. + +Tue Jan 25 21:26:57 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sig_handle): Crudely work around potential problem + when main thread has a lock but is killed by a fatal signal. + * fhandler_tty.cc (fhandler_pty_master::write): Don't perform line + editing on the pty master (so why do we need the second argument to + line_edit, then?) + * thread.cc: Reformat to GNU standards. + +2000-01-11 DJ Delorie <dj@cygnus.com> + + * ROADMAP: new + +2000-01-11 DJ Delorie <dj@cygnus.com> + + * fhandler_zero.cc: new, emulate /dev/zero + * testsuite/winsup.api/devzero.c: new, test /dev/zero + * Makefile.in: build fhandler_zero.o + * fhandler.h: add support for /dev/zero + * hinfo.cc: ditto + * path.cc: ditto + +2000-01-11 DJ Delorie <dj@cygnus.com> + + * mmap.cc (mmap): MSDN says *one* of FILE_MAP_*, fix flags for + MAP_PRIVATE. + +Mon Jan 10 01:11:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (acl_access): New function. + * syscalls.cc (access): Call acl_access if ntsec is on. + +Mon Jan 10 01:11:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (get_file_owner): Use of ReadSD() instead of + GetFileSecurity(). + (get_file_group): Ditto. + +Sun Jan 9 15:43:07 2000 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (struct thread_start): Add a flag to determine whether a + field is in use. Eliminate thread_start_ix since it was not + thread-safe. + (thread_stub): Use notavail flag to control whether the entry in + start_buf can be reused. + (makethread): Ditto. + +Sun Jan 9 20:18:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Rearrange order of ACE creation. + (setacl): Optimize creation of ACEs related to inheritance. Code + cleanup. + (aclcheck): Disable check for existance of DEF_)CLASS_OBJ. + +Sat Jan 8 18:42:32 2000 Christopher Faylor <cgf@cygnus.com> + + * mkvers.h: Reorg fix. + +Sat Jan 8 20:00:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add new acl API calls. + * grp.cc (getgroups): Change to work for any username. + * security.cc (get_id_from_sid): Change to work with acl API. + (is_grp_member): New function. + (get_nt_attribute): Rewritten. + (add_access_allowed_ace): New function. + (add_access_denied_ace): Ditto. + (alloc_sd): Rewritten. + (setacl): New function. + (getace): Ditto. + (searchace): Ditto. + (getacl): Ditto. + (acl): Ditto. + (facl): Ditto. + (aclcheck): Ditto. + (acecmp): Ditto. + (aclsort): Ditto. + (acltomode): Ditto. + (aclfrommode): Ditto. + (acltopbits): Ditto. + (aclfrompbits): Ditto. + (permtostr): Ditto. + (acltotext): Ditto. + (permfromstr): Ditto. + (aclfromtext): Ditto. + * syscalls.cc (access): Set errno again when needed. + * include/cygwin/acl.h: New file. + * include/sys/acl.h: Ditto. + +Sat Jan 8 14:46:19 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add cygwin DLL specific CFLAGS define. + +Fri Jan 7 21:01:57 2000 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interrupt_on_return): Properly coerce assignment of + sigsave.func. + +2000-01-07 Mumit Khan <khan@xraylith.wisc.edu> + + * acconfig.h: New file. + * configure.in Add check for memset builtin. + (AC_CONFIG_HEADER): Use. + (STRACE_HHMMSS): Define instead of substituting. + (_MT_SAFE): Likewise. + (_CYG_THREAD_FAILSAFE): Likewise. + (DEBUGGING): Likewise. + (MT_SAFE): Substitute as a yes/no variable. + * Makefile.in: Remove DEBUGGING, STRACE_HHMMSS, and THREAD_FAILSAFE + variables and add DEFS. Update usage of MT_SAFE to reflect yes/no + values. Add config.h to winsup.h dependency. + (CFLAGS_CONFIG): Update. + (INCLUDES): Prepend `-I.'. + * utils/Makefile.in (INCLUDES): Likewise. + * winsup.h: Conditionally include config.h. + * thread.cc: Likewise. + * config.h.in: Generate new file. + * configure: Regenerate. + + +Fri Jan 7 16:21:01 2000 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0): Allow signal handling for dynamically loaded + case. + +Thu Jan 6 00:30:12 2000 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_check_one): Initialize local variable `unixattr' + before calling `get_file_attribute'. + * syscalls.cc (chown): Ditto. + * security.cc (get_nt_attribute): Eliminate attribute copying from + world to user/group in case of missing ACEs. + (alloc_sd): Set special rights for administrators group only if it's + neither owner nor group. + * utils/mkpasswd.c: Create entry for local group administrators (SID + 544). + +Thu Jan 6 00:21:31 2000 Christopher Faylor <cgf@cygnus.com> + + Change function calls to __stdcall throughout. + * exceptions.cc (handle_exceptions): Probe stack for return address to + use with new signal method. Fill out sigsave.cx with this information. + (call_handler): Use sigsave.cx if it is available, rather than trying + to find the context of the main thread. + (interrupt_on_return): Use address of context rather than + pass-by-reference. + (interrupt_now): Ditto. + +Thu Jan 6 00:21:31 2000 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgroups): Return supplementary groups now. + * include/limits.h: Define NGROUP_MAX as 16 now. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2001 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2001 new file mode 100644 index 000000000..140b2a9e9 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2001 @@ -0,0 +1,5337 @@ +2001-12-31 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Strip path when installing library. + +2001-12-30 Christopher Faylor <cgf@redhat.com> + + * include/getopt.h: Fix define. + +2001-12-30 Christopher Faylor <cgf@redhat.com> + Ralf Habacker <Ralf.Habacker@freenet.de> + + * speclib: New file. + * Makefile.in: Create library versions of automode.o, textmode.o, and + binmode.o for easier use on command line. Create libpthread.a, libm.a, + and libc.a with subsets of exports found in libcygwin.a. + +2001-12-30 Ralf Habacker <Ralf.Habacker@freenet.de> + + * cygmagic: Eliminate unneeded use of 'tr' and 'bc'. + +2001-12-30 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (open_local_policy): Use POLICY_EXECUTE instead of + enumerating user rights. + +2001-12-29 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (open_local_policy): Initialize lsa handle to NULL. + Request only needed access rights in call to LsaOpenPolicy(). + (create_token): Check for NULL lsa pointer. + +2001-12-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add symbols for endutent(), getutent(), getutid(), + getutline(), setutent() and utmpname(). + * syscalls.cc (setutent): New function. + (endutent): Ditto. + (utmpname): Ditto. + (getutent): Ditto. + (getutid): Ditto. + (getutline): Ditto. + * include/cygwin/version.h: Bump API minor version. + +2001-12-26 Christopher Faylor <cgf@redhat.com> + + * cygmagic: Add define name to warning. + * dcrt0.cc (_dll_crt0): Check for changes in child_info size. + (multiple_cygwin_problem): Avoid "proc" errors when testing. Just + assume new cygwin proc. + * shared_info.h (mount_info): Add 'cb' element for sanity checks. + (shared_info): Ditto. + * child_info.h (child_info): Add fhandler_union_size element for sanity + checking. + * shared.cc (open_shared): Detect shared region size mismatch between + parent and child. + (shared_info::initialize): Detect shared region size mismatch with + expectation. + (memory_Init): Ditto. + * sigproc.cc (init_child_info): Correctly set cb in passed structure. + * shared.cc (open_shared): + +2001-12-26 Christopher Faylor <cgf@redhat.com> + + * include/getopt.h: Protect a declaratin. + +2001-12-26 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_cond::Signal): Use a separate flag for signal + detection and broadcast semantics. + (__pthread_cond_dowait): Ditto. + * thread.h (pthread_cond): New flag for testing when a waiter has + woken. + +2001-12-26 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Quote arguments to shell scripts. + (clean): Remove new *_magic.h autogenerated files. + +2001-12-25 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Autogenerate some header files which provide magic + numbers. Force dependencies for files which depend on autogenerated + headers to ensure that they are always built. + * child_info.h (child_info): Add new fields to accommodate new magic + number header stuff. + * dcrt0.cc: Rely on "child_info_magic.h" to ensure that correct + child_info magic numbers are used. + (dll_crt0_1): Temporarily remove _cygwin_testing_magic test. + (_dll_crt0): Do more testing on magic numbers from fork_info structure. + Call "multiple_cygwin_problem" where appropriate. + (multiple_cygwin_problem): Rename from multiple_cygwin_die. Issue a + warning or die, as appropriate based on cygwin version/magic number + mismatch. + * pinfo.cc (pinfo::exit): Don't attempt to dereference `this' if it + doesn't exist. This can happen when a fatal error occurs early in + process initialization. + * shared.cc: Rely on "shared_info_magic.h" to accommodate that new + magic number header stuff. + (shared_info::initialize): Use new magic number stuff, for shared + region. + (memory_init): Ditto, for mount table. + * shared_info.h: Accomodate new magic number stuff for shared region + and mount table. + * sigproc.cc: Rely on "child_info_magic.h" to accommodate new magic + number header stuff. + (init_child_info): Initialize new fields in child_info) to accomodate + magic numbers. + * winsup.h: Rename multiple_cygwin_die to multiple_cygwin_problem. + * include/cygwin/version.h: Define macros for manipulating version + magic. + * cygmagic: New shell script for generating magic numbers. + +2001-12-20 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump API minor version for below changes. + +2001-12-19 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (VPATH): Add regex directory. + (NM): new variable. + (OBSOLETE_FUNCTIONS): Ditto. + (NEW_FUNCTIONS): Ditto. + (install-headers): Install regex.h. + (install-man): New target. + (install): Use new target. + (DLL_OFILES): Add v8_reg* stuff. + (new-cygwin1.dll): Eliminate stamp-cygwin-lib creation. + (libcygwin.a): Remove obsolete functions from import lib. Add new functions. + * configure.in: Detect 'nm' tool. + * configure: Regenerate. + * cygwin.din: Export posix_reg* functions. Eliminate export of v8 reg* functions. + This is now handled in object files themselves. + * regex/*: New files. + * regexp/v8_*.c: New files, renamed from non v8_ equivalents. + +2001-12-17 Corinna Vinschen <corinna@vinschen.de> + + * include/getopt.h: Don't define getopt_long() and friends when + included through unistd.h. + +2001-12-17 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::init_std_file_from_handle): Avoid initializing + using an invalid handle. + +2001-12-16 David Billinghurst <David.Billinghurst@riotinto.com> + + * include/limits.h: Define LLONG_MIN, LLONG_MAX, ULLONG_MAX. + +2001-12-11 Christopher Faylor <cgf@redhat.com> + + * include/getopt.h: Add HAVE_DECL_GETOPT to save pain elsewhere. + +2001-12-10 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_serial::ev): New class member. + * fhandler_serial.cc (fhandler_serial::raw_read): Use class member for + event status. + * select.cc (peek_serial): Ditto. + +2001-12-07 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Use full path name for determining + attributes when /cygdrive/x/foo. + +2001-12-06 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Reset FH_CYGDRIVE if iterating through + path. + +2001-12-06 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Don't complain if /dev/x/foo when x + doesn't exist. + (mount_info::conv_to_win32_path): Keep translating when a /cygdrive is + found. Don't attempt to translate to a device name when devn == + FH_CYGDRIVE. + (cygwin_conv_to_win32_path): Set buffer to empty on error. + (cygwin_conv_to_full_win32_path): Ditto. + + * window.cc: Include unistd.h to verify definitions. + +2001-12-05 Christopher Faylor <cgf@redhat.com> + + * dir.cc (opendir): Detect error return from build_fhandler_from_name. + +2001-12-04 David Rothenberger <daveroth@acm.org> + + * net.cc (cygwin_getsockopt): Dereference optlen pointer when passing + to __check_null_invalid_struct_errno. + +2001-12-03 Christopher Faylor <cgf@redhat.com> + + * net.cc (cygwin_getsockopt): Allow NULL optval. + (cygwin_setsockopt): Ditto. + (cygwin_recvfrom): Allow NULL from. + + * path.cc (mount_info::read_cygdrive_info_from_registry): Don't write + cygdrive to registry if it doesn't exist. + +2001-12-03 Christopher Faylor <cgf@redhat.com> + + * path.cc (mount_info::conv_to_win32_path): Avoid returning error if + cygdrive == '/'. + (mount_info::cygdrive_win32_path): Return 0 if invalid cygdrive path. + +2001-11-30 Christopher Faylor <cgf@redhat.com> + + * debug.cc (makethread): Eliminate unneeded function call. + * miscfuncs.cc (tls_ix): Predefine. + * perthread.h (set_reent): Eliminate. + (get_reent): Ditto. + * winbase.h (my_tlsalloc): Use global stack base pointer. Set newly + allocated location to NULL. + (my_tlssetvalue): Use global stack base pointer. + (my_tlsgetvalue): Ditto. + +2001-11-27 Christopher Faylor <cgf@redhat.com> + + * winsup.h: Reorganize to avoid use of experimental stuff. + * shortcut.cc: Move winsup.h first in include order. + +2001-11-27 Christopher Faylor <cgf@redhat.com> + + * cygwin.din (ualarm): New export. + * dcrt0.cc (_dll_crt0): Add experimental tls storage declaration. + (dll_crt0): Ditto. + * debug.cc (thread_stub): Ditto. + * thread.cc: Minor cleanup. + (__pthread_create): Add experimental tls storage declaration. + * miscfuncs.cc: Define tls index. + * winsup.h: Declare experimental tls storage. + + * window.cc (alarm): Use old timer return from setitimer. + (ualarm): New function. From Alexandr V. Shutko. + +2001-11-26 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (libcygwin.a): Use ar commands to build libcygwin.a since + adding an archive doesn't work the way we want it to. + +2001-11-24 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Avoid reporting + inaccessible drives. + +2001-11-24 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_hstrerror): Allow s == NULL. + (cygwin_rcmd): Add parameter checking. + (cygwin_rexec): Ditto. + +2001-11-24 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_inet_ntoa): Add parameter checking. + (cygwin_inet_network): Return INADDR_NONE instead of 0 in case of + EFAULT. + (cygwin_hstrerror): Add parameter checking. + (cygwin_rresvport): Ditto. + (socketpair): Ditto. + * winsup.h (check_null_str): Add extern declaration. + +2001-11-24 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Tighten FH_CYGDRIVE check to avoid + matching trailing component, like other devices. + +2001-11-24 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (IsDebuggerPresent): Make conditional load since it is + not available everywhere. + + * path.cc (mount_info::conv_to_win32_path): Only consider /cygdrive to + be FH_CYGDRIVE, not /cygdrive/x. + +2001-11-24 Christopher Faylor <cgf@redhat.com> + + * net.cc (inet_makeaddr): Revert previous change. + +2001-11-23 Christopher Faylor <cgf@redhat.com> + + * path.cc (chdir): Allow 'cd /cygdrive'. + +2001-11-23 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::vfork_parent_restore): Add debugging statement. + + * exceptions.cc (try_to_debug): Spin only as long as we don't have a + debugger attached. + + * fhandler.h (fhandler_base::set_nohandle): New method. + (fhandler_base::get_nohandle): New method. + * fhandler.cc (fhandler_base::dup): Avoid duplicating handle if there + is no handle. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set nohandle + flag on dummy fd. + +2001-11-23 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Make intermediate library for eventual inclusion in + libcygwin.a + + * fhandler.h (fhandler_pipe::fhandler_pipe): Remove default argument + setting since it is no longer used. + + * miscfuncs.cc (check_null_str): New function. + (check_null_str_errno): Ditto. + * net.cc: Add defensive buffer checking throughout. + (cygwin_sendto): Protect against invalid fd. + (cygwin_recvfrom): Ditto. + (cygwin_getpeername): Ditto. + (cygwin_recv): Ditto. + (cygwin_send): Ditto. + * winsup.h: Declare a new function. + +2001-11-23 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (set_bits): Fix conditional for setting fd in exceptfds. + * dtable.cc (dtable::build_fhandler): Create fhandler_pipe using + correct device type. + * path.cc (get_devn): Set correct pipe device type from device name. + +2001-11-22 Christopher Faylor <cgf@redhat.com> + + * path.cc (conv_path_list): Fix wild indexing into path due to + conflicting methods for setting src pointer. + + * dir.cc (opendir): Only pass path_conv argument to opendir, since name + is already part of the fhandler. + * dtable.cc (dtable::build_fhandler): Accomodate new FH_CYGDRIVE type. + * fhandler.cc (fhandler_base::opendir): Nuke name argument. + * fhandler.h: Add FH_CYGDRIVE to "device" enum. + (fhandler_base::opendir): Nuke name argument. + (fhandler_disk_file::opendir): Ditto. + (fhandler_disk_file::fhandler_disk_file): Declare new method which + passes devtype through. + (fhandler_cygdrive): Add elements for tracking drives. + (fhandler_cygdrive::set_drives): Declare new method. + (fhandler_cygdrive::iscygdrive_root): Declare new method. + (fhandler_cygdrive::opendir): Declare new method. + (fhandler_cygdrive::readdir): Declare new method. + (fhandler_cygdrive::telldir): Declare new method. + (fhandler_cygdrive::seekdir): Declare new method. + (fhandler_cygdrive::rewinddir): Declare new method. + (fhandler_cygdrive::closedir): Declare new method. + (fhandler_cygdrive::fstat): Declare new method. + * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file): + Define new method which passes devtype through. + (fhandler_disk_file::open): Tweak debug output. + (fhandler_disk_file::opendir): Nuke first argument. Use info from + path_conv and class rather than calling fstat. + (fhandler_cygdrive::set_drives): New method. + (fhandler_cygdrive::iscygdrive_root): New method. + (fhandler_cygdrive::opendir): New method. + (fhandler_cygdrive::readdir): New method. + (fhandler_cygdrive::telldir): New method. + (fhandler_cygdrive::seekdir): New method. + (fhandler_cygdrive::rewinddir): New method. + (fhandler_cygdrive::closedir): New method. + (fhandler_cygdrive::fstat): New method. + * path.cc (iscygdrive_device): Assume cygdriveness is already verified. + (path_conv::check): Treat FH_CYGDRIVE "method" as a special case, + setting file attributes as needed. + (mount_info::conv_to_win32_path): Allow stand-alone /cygdrive, meaning + "the directory which contains all of the drives on the system". + (fillout_mntent): Use cyg_tolower for conversions. + (mount_info::cygdrive_win32_path): Replace unused argument with unit + number. + * shared_info.h (mount_info::cygdrive_win32_path): Reflect argument + change. + +2001-11-21 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (DLL_OFILES): Add fhandler_disk_file.o. + * cygheap.h (cygheap_fdnew::operator =): New operator. + * dir.cc: Add invalid struct checking throughout. Use methods for all + directory manipulation throughout. + * fhandler.cc: Move fhandler_disk_file stuff to own file. + (fhandler_base::opendir): New method. + (fhandler_base::readdir): New method. + (fhandler_base::telldir): New method. + (fhandler_base::seekdir): New method. + (fhandler_base::rewinddir): New method. + (fhandler_base::closedir): New method. + * fhandler_disk_file.cc: New file. + * fhandler.h (fhandler_base): Declare new virtual methods. + (fhandler_disk_file): Ditto. + (fhandler_cygdrive): New class. + + * path.cc (conv_path_list): Use strccpy to break apart path. + +2001-11-17 Nick Duffek <nick@duffek.com> + + * path.cc (conv_path_list): Copy source paths before modifying them. + +2001-11-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::clear): Don't reset unit. + * fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): Add debug + output. + +2001-11-15 Egor Duda <deo@logos-m.ru> + + * include/pthread.h (PTHREAD_COND_INITIALIZER): Define. + * thread.cc (__pthread_cond_destroy): Add support for + PTHREAD_COND_INITIALIZER. + (__pthread_cond_init): Ditto. + (__pthread_cond_broadcast): Ditto. + (__pthread_cond_signal): Ditto. + (__pthread_cond_dowait): Ditto. + (__pthread_mutex_init): Handle PTHREAD_MUTEX_INITIALIZER correctly, + don't return error when it's passed as parameter. + * winsup.h (check_null_invalid_struct): Call correct function. + +2001-11-14 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc: Add stdlib.h include for alloca declaration. + * poll.cc: Ditto. + * termios.cc: Ditto. + +2001-11-14 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_write): Only allow zero length when fd is valid. + +2001-11-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::fstat): Add setting access time + and creation time to last modification time for files on filesystems + not supporting multiple timestamps. + (fhandler_disk_file::fstat_helper): Set access time and creation + time in incoming Windows structure instead of in stat buf to avoid + incorrectly overwriting Epoch timestamp. + +2001-11-14 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h: Remove alloca definition since it's now defined through + inclusion of stdlib.h. + * lib/cygwin_crt0.c: Ditto. + +2001-11-13 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_write): Allow zero length as per SUSv2. + +2001-11-13 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (mkdir): Add HIDDEN file attribute if file has leading dot + and HIDDEN_DOT_FILES is defined. + * fhandler.cc (fhandler_base::open): Ditto. + * path.cc (symlink): Ditto. + * syscalls.cc (_rename): Ditto and remove HIDDEN file attribute if + new filename does not begin with a dot. + +2001-11-12 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::read): Revert 2001-10-23 + change to only honor keydown events. + +2001-11-11 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump version to 1.3.6. + +2001-11-10 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::build_fhandler): Don't increment console fd count + if new operation fails. Increment fork_fixup field here. + (dtable::dup2): Don't increment fork_fixup field here. + * net.cc (fdsock): Ditto. + +2001-11-08 Corinna Vinschen <corinna@vinschen.de> + + * select.cc: Set errno using set_sig_errno() throughout. + * signal.cc (signal): Always set SA_RESTART flag. + * syscalls.cc (_read): Revert previous patch. + +2001-11-08 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (fhandler_tty_slave::ready_for_read): Return 0 on EBADF. + * syscalls.cc (_read): If ready_for_read() failed, save errno from + being overwritten by signal handler call. + +2001-11-07 Corinna Vinschen <corinna@vinschen.de> + + * lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset + is not set. + +2001-11-06 Christopher Faylor <cgf@redhat.com> + + * select.cc (fhandler_tty_slave::ready_for_read): Correct inverted + not_open test. + +2001-11-05 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump version to 1.3.5. + +2001-11-05 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::find_empty): Add input parameter check. + +2001-11-04 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::build_fhandler): Fix debug_printf to avoid SEGV + due to incorrect parameter placement. + +2001-11-04 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_pipe::broken_pipe): Renamed from saweof. + (fhandler_pipe::set_eof): Reflect above change. + * pipe.cc (fhandler_pipe::fhandler_pipe): Ditto. + (fhandler_pipe::read): Ditto. + (fhandler_pipe::hiteof): Ditto. + +2001-11-04 Christopher Faylor <cgf@redhat.com> + + * pipe.cc (fhandler_pipe::read): Narrow eof return to just the "broken + pipe" test. + +2001-11-04 Christopher Faylor <cgf@redhat.com> + + * select.cc: Add more comments throughout. Use bool 'true' where + appropriate throughout. + (fhandler_socket::select_read): Remove duplicate setting for *_ready + which inadvertently overrode previous, correct setting. + (fhandler_socket::select_write): Ditto. + +2001-11-03 Christopher Faylor <cgf@redhat.com> + + * select.cc (verify_console): New function. + (verify_windows): Ditto. + (fhandler_console::select_read): Really do need to verify that there is + something to read. + (fhandler_console::select_windows): Ditto. + +2001-11-03 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_base::ready_for_read): Remove unused argument. + (fhandler_tty_slave::ready_for_read): Ditto. + (select_record): Remove poll, initialize peek. + * select.cc: Remove all poll functions, throughout. Change second + argument of peek_* functions to 'bool' throughout. Specifically + initialize *_ready variables throughout. + (select_stuff::poll): Subsume previous poll functionality. + (peek_pipe): Don't grab guard mutex when in select loop. + select()/read() is racy by design so there is no need to worry about a + race in select(). + (fhandler_base::ready_for_read): Remove unused argument. + (fhandler_tty_slave::ready_for_read): Ditto. + * syscalls.cc (_read): Eliminate third argument in ready_for_read call. + +2001-11-03 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_supplementary_group_sidlist): New function. + (get_group_sidlist): Call get_supplementary_group_sidlist() to + retrieve list of supplementary groups SIDs from /etc/group and + add them to the user's group list. + +2001-11-03 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::read): Return just read ahead characters + if slow device. + * fhandler.h (fhandler_base::set_eof): New virtual method. + (fhandler_pipe::set_eof): New method. + * pipe.cc (fhandler_pipe::fhandler_pipe): Clear saweof flag. + (fhandler_pipe::read): Return immediately if hit eof. + (fhandler_pipe::hit_eof): Return true if saweof flag is set. + * select.cc (peek_pipe): Don't call PeekNamedPipe if we couldn't grab + the guard mutex. + +2001-11-02 Egor Duda <deo@logos-m.ru> + + * dll_init.h (class dll_list): Reorder functions to avoid compiler + "can't inline" warnings. + * security.h (class cygsid): Ditto. + * sigproc.cc (get_proc_lock): Ditto. + * sigproc.h (class sigframe): Ditto. + * sync.h (class muto): Ditto. + +2001-11-02 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_base::get_guard): Actually MAKE virtual as + previously indicated. + * pipe.cc (make_pipe): Remove extraneous set_errno. + * syscalls.cc (_open): Ditto. + * select.cc (peek_pipe): Need to check that there is still something to + read from the pipe after acquiring the mutex since another + process/thread could have eaten the input before we got to acquiring + the lock. (Thanks to Nick Duffek for this inspiration.) + +2001-11-01 Christopher Faylor <cgf@redhat.com> + + * fhandler.h: Change Windows 'BOOL's to c++ 'bool's for all variables. + * select.cc (fhandler_base::ready_for_read): Set read_ready to zero + prior to testing it or it will be uninitialized. + + * Makefile.in (CFLAGS): Move setting to Makefile.common. + +2001-11-01 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_fdmanip::isopen): Set appropriate errno if fd not + open. + * select.cc (fhandler_base::ready_for_read): Release an open guard + mutex when exiting with an error condition. + * syscalls.cc (_read): Check frequently for closed fd as a kludge until + something better is invented. + +2001-11-01 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::build_fhandler): Issue internal error on unknown + device. + * fhandler.cc (fhandler_base::close): Show both name and handle in + debugging output. + + * fhandler.h (fhandler_base::get_guard): New virtual method. + (fhandler_pipe::get_guard): New method. + (fhandler_socket::ready_for_read): Delete declaration. + (fhandler_pipe::ready_for_read): Ditto. + (fhandler_serial::ready_for_read): Ditto. + (fhandler_console::ready_for_read): Ditto. + (fhandler_tty_common::ready_for_read): Ditto. + (fhandler_windows::ready_for_read): Ditto. + (struct select_record::peek): Declare new method. + * select.cc (MAKEready): Delete. + (peek_pipe): Use get_guard method to retrieve potential guard mutex + handle. + (fhandler_base::ready_for_read): Rewrite as generic ready-for-read + handler. Should only be called for "slow" devices. + (fhandler_socket::ready_for_read): Delete definition. + (fhandler_pipe::ready_for_read): Ditto. + (fhandler_serial::ready_for_read): Ditto. + (fhandler_console::ready_for_read): Ditto. + (fhandler_tty_common::ready_for_read): Ditto. + (fhandler_windows::ready_for_read): Ditto. + (fhandler_pipe::select_read): Fill in new peek record in select_record + structure. + (fhandler_console::select_read): Ditto. + (fhandler_tty_common::select_read): Ditto. + (fhandler_serial::select_read): Ditto. + (fhandler_socket::select_read): Ditto. + (fhandler_socket::select_read): Ditto. + (fhandler_tty_slave::ready_for_read): Check for tty not open. Set + errnos appropriately. + * syscalls.cc (_read): Allow ready_for_read to set errno. + + * pinfo.cc (pinfo::init): Return spawn/NO_WAIT process as valid if it + is initializing. + * sigproc.cc (getsem): Adjust wait for process to initialize downward + to avoid huge waits. + +2001-10-31 Christopher Faylor <cgf@redhat.com> + + * environ.cc: Set reset_com to false to mimic linux behavior more + closely. + +2001-10-31 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::vfork_child_dup): Revert impersonation + before duplicating fhandler. + +2001-10-30 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (signal_exit): Weight the odds against the main thread + running when signal thread is exiting. + +2001-10-30 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (sigproc_terminate): Don't signal main thread when exiting. + * sigproc.h (sigframe): Decorate some methods with `inline'. + (new_muto): Coerce pointer to new to void *. + +2001-10-30 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::fork_fixup): Pass old handle to + setclexec_pid. + +2001-10-30 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_fdmanip::cygheap_fdmanip): Clear fh. + (cygheap_fdmanip::isopen): New method. + * syscalls.cc (_read): Avoid accessing closed fd. + + * path.h (fe_types): New enum. + (path_conv::set_path): New method. + (find_exec): Change null_if_not_found argument to something more + generic. + * spawn.cc (find_exec): Default to returning the POSIX path rather than + the windows path, unless instructed otherwise. + (spawn_guts): Force call to find_exec to use native paths. + * dlfcn.cc (check_path_access): Accommodate new find_exec arguments. + * environ.h (win_env::get_posix): New method. + +2001-10-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::close): Add error handling. + +2001-10-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): Revert previous change. + +2001-10-30 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::dup2): Add some debugging. Use methods from + passed in class rather than cygheap->fdtab. + * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add + more debugging output. + (fhandler_socket::dup): Allocate new space for prot_info_ptr for + duplicated entry. + (fhandler_socket::close): Loop closesocket() as long as WSAEWOULDBLOCK + is returned. + * syscalls.cc (stat_worker): Always delete fh if it has been created. + +2001-10-29 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (is_group_member): Call NetLocalGroupGetMembers() for + local machine only. + (get_user_local_groups): Ditto for NetLocalGroupEnum(). + +2001-10-29 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::set_name): Set namehash here to catch + name changes. + (fhandler_base::open): Remove namehash setting. + (fhandler_base::fstat): Subtract 1 from arbitrary time setting to avoid + strange ls -l granularity problem. + +2001-10-29 Christopher Faylor <cgf@redhat.com> + + * select.cc (MAKEready): Remove extraneous select_read. + +2001-10-29 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (internal_getlogin): Set environment variable $HOME + from either /etc/passwd or $HOMEDRIVE/$HOMEPATH if necessary. + +2001-10-29 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_serial::fhandler_serial): Change to only accept + unit argument. + * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto. + (fhandler_serial::open): Avoid else when previous clause is a return(). + * path.cc (get_devn): Alias /dev/ttyS0 -> /dev/com1, etc. + (get_device_number): Reallow standalone "com1" as a valid name for + /dev/com1. + +2001-10-26 Christopher Faylor <cgf@redhat.com> + + * select.cc (MAKEready): Check for read_ready in loop since select_read + could set it. + (peek_socket): Check ready/write/except specifically since they could + have been set even prior to peek_socket call. + +2001-10-24 Christopher Faylor <cgf@redhat.com> + + * shared_info.h (MOUNT_VERSION): Change to a smaller, still arbitrary + number. + * shared.cc (open_shared): Accept a number to denote the shared memory + region. + (memory_init): Use shared memory version as part of the object name of + the shared region. Ditto for the mount table. + * path.cc (CYGWIN_REGNAME): New define used in place of + CYGWIN_INFO_CYGWIN_REGISTRY_NAME throughout. + * external.cc (cygwin_internal): Implement CW_[GS]ET_CYGWIN_REGISTRY_NAME. + * cygheap.h (init_cygheap::cygwin_regname): New element. + +2001-10-23 Christopher Faylor <cgf@redhat.com> + + Ensure that all fhandler_*::read definitions are __stdcall throughout. + * fhandler.cc (fhandler_base::set_inheritance): Be more defensive in + debugging code. + * fhandler.h: Adjust regparms throughout to reflect passing 'this' + parameter. + * fhandler_console.cc (fhandler_console::read): Remove unneeded test. + Only honor "key down" events. + * miscfuncs.cc (strcasestr): Reorganize for efficient code use. + (check_null_empty_str_errno): Ditto. + (__check_null_invalid_struct_errno): Ditto. + (__check_invalid_read_ptr_errno): Ditto. + * syscalls.cc (_read): Return 0 when length == 0, as per Single UNIX + Specification. + +2001-10-22 Christopher Faylor <cgf@redhat.com> + + * debug.cc (set_errno): Return value of errno that was set, just like + the macro. + (setclexec_pid): Replace old handle with new handle. + * debug.h: Reflect change in arguments for setclexec_pid. + * fhandler.cc (fhandler_base::set_inheritance): Ditto. + (fhandler_base::fork_fixup): Ditto. + * cygerrno.h: Reflect return value change for set_errno. + +2001-10-22 Christopher Faylor <cgf@redhat.com> + + Remove 'cb' parameter and modify fhandler_* constructors throughout. + * dtable.cc (dtable::build_fhandler): Remove debugging output which + uses 'cb'. + * exec.cc (execvp): New function. + (execvpe): Ditto. + * fhandler.cc (fhandler_base::fhandler_base): Use constructor + initialization. + * fhandler.h (fhandler_tty_common::fhandler_tty_common): Ditto. + * fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard): + Ditto. + * fhandler_console.cc (fhandler_console::fhandler_console): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Ditto. + * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto. + * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Ditto. + (fhandler_tty_slave::fhandler_tty_slave): Ditto. + (fhandler_pty_master::fhandler_pty_master): Ditto. + * fhandler_windows.cc (fhandler_windows::fhandler_windows): Ditto. + +2001-10-22 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Ian Ray <ian.ray@nokia.com>: + * syscalls.cc (seteuid): Unset environment variables HOMEDRIVE and + HOMEPATH before calling internal_getlogin(). + * uinfo.cc (internal_getlogin): Use default HOMEPATH and HOMEDRIVE + from environment if both are present, else query NetUserGetInfo(). + +2001-10-22 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_2k_ifconf): Change multiple IP address naming scheme + to Linux style. + +Sun Oct 21 19:04:37 2001 Alexander Gottwald <ago@informatik.tu-chemnitz.de> + + * net.cc (get_2k_ifconf): Added support for multiple IP addresses on + one interface. + +2001-10-22 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (__check_invalid_read_ptr_errno): Return error, if any. + +2001-10-21 Christopher Faylor <cgf@redhat.com> + + * resource.cc (fill_rusage): Perform paranoid zero structure passed to + GetProcessMemoryInfo. + +2001-10-22 Robert Collins <rbtcollins@hotmail.com> + + * autoload.cc: Autoload GetProcessMemoryInfo. + * resource.cc (fill_rusage): Calculate ru_maxrss and ru_majflt entries. + (Bug report on this from Guido Serassio in the squid project). + This requires including psapi.h. + +2001-10-20 Christopher Faylor <cgf@redhat.com> + + * dll_init.cc (dll_list::alloc): Increase retry count to 1000. + +2001-10-20 Christopher Faylor <cgf@redhat.com> + + * miscfuncs.cc (__check_invalid_read_ptr_errno): New function. + * syscalls.c (_write): Validate that write buffer is accessible for + reading, not writing. + * winsup.h: Declare new function, increase regparmization of check_* + functions. + +2001-10-19 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (getcwd): Allow len == 0 when buf == NULL. + +2001-10-18 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_read): Validate input pointer. + (_write): Ditto. + (system): Ditto. + +2001-10-16 Frederic Devernay <Frederic.Devernay@sophia.inria.fr> + + * poll.cc (poll): Call cygwin_select() if any fd is valid. + +2001-10-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::open): Eliminate compatibility + code since no Win32 device names are used anymore. + * fhandler_tape.cc (fhandler_dev_tape::tape_set_blocksize): Allow + 0 as blocksize to indicate variable blocksize. + * path.cc (win32_device_name): Generate NT internal device names + using upper/lower case names for readability. + Generate \DosDevices\<letter>: device name for mount table + compatibility devices. + +2001-10-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::tape_status): Report + EOTWarningZoneSize in get->mt_eotwarningzonesize. + * include/cygwin/mtio.h: Define DEFTAPE. + (struct mtget): Add member `mt_eotwarningzonesize'. Add a comment. + * include/cygwin/version.h: Bump API minor version to 47. + +2001-10-16 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::fork_fixup): Guard against compiler + warning. + +2001-10-16 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add load statement for `NtOpenFile'. + * fhandler.h (fhandler_dev_raw::get_unit): New method. + (fhandler_dev_tape::norewind): Eliminate. + (fhandler_dev_tape::is_rewind_device): New method. + * fhandler_raw.cc (fhandler_dev_raw::open): Open new + fixed device name devices using NT internal method. + Keep calling fhandler_base::open() for old mount table + device mapping compatibility devices. + (fhandler_dev_raw::fstat): Eliminate. Settings are done + by fhandler_base::fstat() already. + * fhandler_tape.cc: Remove `norewind' usage throughout. + * ntdll.h: Define FILE_SYNCHRONOUS_IO_NONALERT. + Define struct _IO_STATUS_BLOCK. + Declare NtOpenFile(). + * path.cc (get_raw_device_number): Add new approach for + using fixed device names. + (win32_device_name): Ditto. + (get_device_number): Ditto. Require POSIX path to begin + with "/dev/". + (mount_info::conv_to_win32_path): Call win32_device_name() + instead of get_device_number() after evaluating mount points + to allow changing the win32 destination path again. + * security.cc (str2buf2uni): Remove `static' to be able to + call function from fhandler_dev_raw::open(). + * wincap.cc: Set flag has_raw_devices appropriately. + * wincap.h: Add flag has_raw_devices. + +2001-10-16 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_fdget::cygheap_fdget): Remove debugging operation + from set_errno. + +2001-10-16 Christopher Faylor <cgf@redhat.com> + + * mmap.cc (mmap): Assign 'fh' from cygheap_fdget. Use 'fh' everywhere. + +2001-10-15 Christopher Faylor <cgf@redhat.com> + + * cygerrno.h (set_errno): Define more informative version of this + function for debugging. + (__set_errno): Declare when DEBUGGING. + * cygheap.h (cygheap_fdget::cygheap_fdget): Add a flag to control when + errno is set. + * debug.cc (__set_errno): New function. + * fcntl.cc (_fcntl): Fix so that correct fd is used for second argument + to dup2. + * syscalls.cc (_cygwin_istext_for_stdio): Don't set errno here when + using cygheap_fdget. + +2001-10-15 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::fork_fixup): Don't protect handle. + + * dlfcn.cc: Fix to confirm to coding standards. + + Reorganize includes throughout to accommodate new cygheap.h usage. + * cygheap.h (cygheap_fdmanip): New class: simplifies locking and + retrieval of fds from cygheap->fdtab. + (cygheap_fdget): Ditto. + (cygheap_fdnew): Ditto. + * fcntl.cc (_fcntl): Use new method to lock fdtab and retrieve info. + * ioctl.cc (ioctl): Ditto. + * mmap.cc (mmap): Ditto. + * net.cc: Ditto, throughout. + * passwd.cc (getpass): Ditto. + * path.cc (fchdir): Ditto. + * pipe.cc (make_pipe): Ditto. + * sec_acl.cc (facl): Ditto. + * syscalls.cc: Ditto, throughout. + * termios.cc: Ditto, throughout. + +2001-10-15 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Use `wProcessorLevel' unless OS sets it wrong. + Use `dwProcessorType' then instead. + * wincap.cc: Set flag has_valid_processorlevel appropriately. + * wincap.h: Add flag has_valid_processorlevel. + +2001-10-14 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::build_fhandler_from_name): Use PC_FULL to + determine path name. + * path.cc (fchdir): Remove rel -> abs path conversion. + +Sun Oct 14 08:10:12 2001 Gary R. Van Sickle + + * fork.cc (fork_parent): Correct the "unable to allocate + forker_finished event" error message. It named the wrong event before. + +2001-10-13 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (load_wsock32): Declare dummy function to force loading + of winsock. + * fhandler.cc (fhandler_base::set_inheritance): Make debugging output + more verbose. + * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Force loading + of winsock32 if winsock2 not available. + * net.cc (set_socket_inheritance): Use DuplicateHandle in all cases to + set inheritance correctly. + (fdsock): Use winsock2_active macro to determine when to set socket + inheritance. Remove fdtab resource locking since this function should + already be protected. + (cygwin_accept): Simplify logic. Ensure that fdtab unlock is not + called inappropriately. + (cygwin_rcmd): Use fdtab locking. + (cygwin_rresvport): Ditto. + (cygwin_rexec): Ditto. + * select.cc (peek_socket): Set errno appropriately if winsock select + fails. + +2001-10-13 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * winsup.h: Declare check_pty_fds. + * syscalls.cc (check_pty_fds): Rename from check_ttys_fds. Also check + pty master. + (setsid): Use check_pty_fds. + * dtable.cc (dtable::dec_console_fds): Add check on pty fds. + +2001-10-13 Ralf Habacker <Ralf.Habacker@freenet.de> + + * fhandler_dsp.cc (fhandler_dsp::ioctl): Return 0 for successful + SNDCTL_DSP_GETBLKSIZE operation. + +2001-10-13 Christopher Faylor <cgf@redhat.com> + + Remove obsolete 'name' arg from fhandler_* constructors throughout. + * winsup.h (winsock_active): New macro. + (winsock2_active): Ditto. + * autoload.cc (wsock_init): Use new macros to decide if winsock or + winsock2 is loaded. + (nonexist_wsock32): Dummy function to force winsock load. + (nonexist_ws2_32): Dummy function to force winsock2 load. + * fhandler.h (fhandler_socket::fstat): Declare new method. Currently + unused. + * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Check + that winsock2 is active before trying WSADuplicateSocketA. + (fhandler_socket::fixup_after_fork): Add extra check for + winsock2_active. Otherwise use iffy procedures for Windows 95. + (fhandler_socket::fixup_after_exec): Add debugging. + (fhandler_socket::dup): Add debugging. + (fhandler_socket::fstat): New method. + (fhandler_socket::set_close_on_exec): Attempt to perform iffy stuff on + Windows 95. + + * errno.cc (_sys_nerr): Work around compiler strangeness. + + * pinfo.cc (winpids::add): Add extra element at end of allocated array + for setting to NULL. + (winpids::enumNT): Ditto. + (winpids::init): Don't modify pidlist if it hasn't been allocated + (possibly due to malloc problem). + +2001-10-12 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (wsock_init): Reorganize slightly to accommodate a new + compiler. + +2001-10-11 Egor Duda <deo@logos-m.ru> + + * net.cc (cygwin_sendto): Use correct socket address when sending + data to AF_UNIX socket. + +Wed Oct 10 16:10:41 2001 Alexander Gottwald <ago@informatik.tu-chemnitz.de> + + * net.cc (get_95_ifconf): Using other registry values pointing to + correct networkdevice identification for Windows95. + +Tue Oct 9 22:22:45 2001 Christopher Faylor <cgf@cygnus.com> + + Throughout, rename PROC_FORK1 to PROC_FORK. + * child_info.h: Rename PROC_* to _PROC_*. Define PROC_* with + additional testing magic. Eliminate old PROC_FORK and rename + PROC_FORK1 to PROC_FORK. + * dcrt0.cc (_cygwin_testing_magic): New variable. Added to magic + number in proc_info. + (alloc_stack): Eliminate old PROC_FORK test. + (dll_crt0_1): Ditto. Use _PROC_* enums for test. Subtract + _cygwin_testing_magic from child_proc_info->type so that normal cygwin + programs invoked by test suite programs do not consider themselves to + be in a cygwin environment. + (_dll_crt0): Ditto. Move environment checks to initial_env function to + conserve on stack space. + (initial_env): New function. Checks for testing and debugging + environment variables. + * init.cc (cygwin_hmodule): Move declaration. + * winsup.h: Declare variables used for cygwin testing. + +Tue Oct 9 19:17:53 2001 Christopher Faylor <cgf@cygnus.com> + + * uinfo.cc (internal_getlogin): Reorganize slightly to minimize work in + default condition. + +Tue Oct 9 18:53:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::open): Add missing case clash check. + +Mon Oct 8 01:47:27 2001 Christopher Faylor <cgf@cygnus.com> + + * dtable.cc (dtable::build_fhandler): Allocate correct amount for given + fhandler class. + * fhandler.h (fhandler_union): Properly define rather than relying on + fhandler_console being "big enough". + +Mon Oct 8 00:25:18 2001 Christopher Faylor <cgf@cygnus.com> + + * external.cc (fillout_pinfo): Reset counter whenever we initialize the + pid list. + +Sun Oct 7 17:16:05 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Don't eat a '.' after a '\\' since it + has special meaning on NT. + + * syscalls.cc (access): Use stat_worker. + +Fri Oct 5 21:01:14 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::fork_fixup): Protect dup'ed handle and + record it as non-inheritable for debugging purposes in case there is a + subsequent fork or exec. + * fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Allow + fork_fixup to call ProtectHandle. + +Fri Oct 5 14:22:47 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (get_raw_device_number): Correct length arguments for + wdeveqn. + +Fri Oct 5 11:05:32 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (getcwd): Allow NULL first argument. + +Fri Oct 5 00:31:35 2001 Christopher Faylor <cgf@cygnus.com> + + * heap.h (inheap): Check for NULL. + +Thu Oct 4 23:17:49 2001 Christopher Faylor <cgf@cygnus.com> + + Add second path_conv * argument to fstat()s throughout. + * fhandler.h: Change read and fstat to regparm/stdcall throughout. + (fhandler_base::fstat): Just declare. Don't define. + (fhandler_disk_file::fstat_helper): Declare. + * fhandler.cc (fhandler_base::fstat): Move here from fhandler.h, adapt + from former stat_dev(). + (fhandler_disk_file::fstat): Move most of the disk-file-specific logic + from stat_worker to here. Use fstat_helper to derive final fstat + output. + (fhandler_disk_file::fstat_helper): New method, renamed from former + fstat method. + (num_entries): Moved here from syscalls.cc. + * fhandler_mem.cc (fhandler_dev_mem::fstat): Use base class to + initialize most stuff. Invert has_physical_mem_access test for + establishing permissions. + * fhandler_raw.cc (fhandler_dev_raw::fstat): Eliminate unneed test and + memory clearing. Use base class to initialize most stuff. + * syscalls.cc (stat_dev): Eliminate. + (stat_worker): Simply call fstat method to generate fstat output. Move + all device specific code to appropriate fstats. + + * dir.cc (opendir): Pass correct arg to stat_worker to allow following + symlinks. + +Thu Oct 4 21:37:57 2001 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (perhaps_suffix): Return NULL on non-existence of file as + well as "directoryness". Previous code modified on 2001/09/30 actually + had an arguable bug which was unmasked by the change on that day. + +Thu Oct 4 20:52:42 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Return ENOTDIR when leading device and + trailing component. + +Thu Oct 4 18:49:23 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (stat_worker): Make global. Accept path_conv parameter + for passing information back to caller. + * winsup.h: Declare stat_worker. + * dir.cc (opendir): Use stat_worker rather than stat and pass path_conv + parameter to stat_worker for later inspection. + +2001-10-04 Karellen (karellen@boreworms.com) + + * syslog.cc (syslog): Teach syslog about syslog priorities other than + LOG_ERR, LOG_WARNING and LOG_INFO + +Thu Oct 4 15:50:03 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Don't perform file system or rootdir + checks on devices. + +Wed Oct 3 19:40:36 2001 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Don't close hexec_proc if it is NULL. + + * fork.cc (vfork): Add debugging statements. + + * path.cc (get_device_number): Make static. Rewrite to inspect both unix + and windows paths. + (get_raw_device_number): Just check for parts of raw device that we + care about. + (get_devn): New function, pulled from get_device_number. + (win32_device_name): Accommodate arg changes to get_device_number. + (mount_info::get_device_number): Call get_device_number on translated + Windows path. + + * spawn.cc (spawn_guts): Don't treat P_VFORK differently from P_NOWAIT. + Add handle to child's shared region to child so that it will be + preserved if the parent goes away. + * fhandler.h: Throughout, simplify to one open method for all fhandler + classes, requiring a path_conv first element. + * fhandler.cc (fhandler_base::open): Remove obsolete method. + Generalize to require path_conv * as first argument. + (fhandler_disk_file::open): Remove obsolete method. + (fhandler_disk_file::open): Use path_conv pointer rather than + reference. + * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Use new open + method. + (fhandler_dev_clipboard::open): Accommodate new argument for open + methods. + * fhandler_console.cc (fhandler_console::open): Ditto. + (fhandler_console::dup): Use new open method. + (fhandler_console::fixup_after_fork): Ditto. + (fhandler_console::fixup_after_exec): Ditto. + * fhandler_dsp.cc (fhandler_dev_dsp::open): Accommodate new argument for + open methods. + * fhandler_floppy.cc (fhandler_dev_floppy::open): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. + * fhandler_random (fhandler_dev_random::open): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::open): Ditto. + * fhandler_serial.cc (fhandler_serial::open): Ditto. + * fhandler_tape.cc (fhandler_dev_tape::open): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + (fhandler_pty_master::open): Ditto. + * fhandler_windows.cc (fhandler_windows::open): Ditto. + * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. + * fhandler_socket.cc (fhandler_socket::set_connect_secret): Accommodate + new argument for open methods. + * syscalls.cc (_open): Ditto. + (stat_worker): Ditto. + +Tue Oct 2 23:49:18 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cfree): Remove malloc debugging probe. + * dlmalloc.c (errprint): Remove abort() call which causes interesting + error message printing to abort prematurely. + * environ.cc: Sprinkle MALLOC_CHECKs liberally throughout. + (_addenv): Allocate two empty elements at end of environ to + (apparently) work around problems with some buggy applications. + (winenv): Avoid calling alloca if no forced environment variable is + present. + + * exceptions.cc (open_stackdumpfile): Don't print "Dumping stack trace + to..." when running in a cygwin environment (i.e., the parent is a + cygwin process). + + * dtable.cc (dtable::init_std_file_from_handle): Move device type + detection code from build_fhandler here since it is only used by this + function. + (dtable::build_fhandler_from_name): New method. Renamed from + dtable::build_fhandler. + (dtable::build_fhandler): Use build_fhandler_from_name. + (cygwin_attach_handle_to_fd): Ditto. + * syscalls.cc (_open): Ditto. + (stat_worker): Ditto. + * dtable.h (dtable::build_fhandler_from_name): Rename declaration from + dtable::build_fhandler. + +Mon Oct 1 16:52:23 2001 Christopher Faylor <cgf@cygnus.com> + + * dtable.h (dtable::build_fhandler): Make path_conv parameter + non-optional. + (dtable::init_std_file_from_handle): Eliminate name parameter. + * dtable.cc (stdio_init): Don't pass bogus name to + init_std_file_from_handle. The function will figure out the name + itself. + (dtable::init_std_file_from_handle): Eliminate name parameter. Assume + that we're always called with an appropriate fd. Pass name as NULL if + we can't simply figure it out from context. + (cygwin_attach_handle_to_fd): Pass path_conv argument to + build_fhandler. + (dtable::build_fhandler): Make path_conv argument mandatory. Eliminate + specific call to get_device_number. With unknown device names, set + name from handle context for parsing by path_conv. + (dtable::build_fhandler): Pass path_conv argument to build_fhandler. + * path.h (path_conv::set_isdisk): Set disk device type. + (path_conv::is_device): Don't consider FH_DISK a "device". + * syscalls.cc (_open): Pass path_conv argument by reference. + (stat_worker): Ditto. + (_rename): Use path_conv operators. Add bounds to DeleteFile/MoveFile + for loop. + +Mon Oct 1 14:25:00 2001 Charles Wilson <cwilson@ece.gatech.edu> + + * cygwin.din: export strtoll and strtoull + +Sun Sep 30 22:51:41 2001 Christopher Faylor <cgf@cygnus.com> + + Add "path.h" include throughout, where needed. Use new path_conv + methods and operators to simplify testing for directory and attributes, + throughout. + * path.h (path_conv::exists): New method. + (path_conv::has_attribute): Ditto. + (path_conv::isdir): Ditto. + (path_conv::DWORD &): New operator. + (path_conv::int &): Ditto. + * dir.cc (rmdir): Eliminate a goto. + * dtable.cc (dtable::build_fhandler): Accept opt and suffix info for + path_conv.check. Return fh == NULL on path_conv error. Pass unit to + set_name as appropriate. + (dtable::reset_unix_path_name): New method. + * dtable.h (dtable): Declare new method. Reflect arg changes to + build_fhandler. + * fhandler.cc (fhandler_disk_dummy_name): Eliminate. + (fhandler_base::set_name): Expect paths to be NULL. Build + unix_path_name from win32_path_name when it is a device. + (fhandler_base::reset_unix_path_name): New method. + (fhandler_base::raw_read): Report EISDIR when ERROR_INVALID_FUNCTION + or ERROR_INVALID_PARAMETER and reading a directory. + (fhandler_disk_file::fstat): Don't call stat_dev since we should now + never be calling fhandler_disk_file methods with devices. + (fhandler_base::fhandler_base): Clear {unix,win32}_path_name. + (fhandler_base::~fhandler_base): Always free {unix,win32}_path_name. + (fhandler_disk_file::fhandler_disk_file): Remove set_no_free_names + kludge. + (fhandler_disk_file::open): Ditto. + * fhandler.h (fhandler_base::no_free_names): Eliminate. + (fhandler_base::set_no_free_names): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Don't set + unix_path_name here. + * path.cc (fchdir): Lock fd table throughout. Use new + dtable::reset_unix_path_name method to reset path. + * syscalls.cc (stat_worker): Reorganize to always call fstat method. + Pass path_conv method to fhandler_*::open. + (chroot): Elminate a goto. + +Sun Sep 30 17:37:43 2001 Christopher Faylor <cgf@cygnus.com> + + * environ.cc (winenv): Allocate exact amount of space needed for forced + windows environment variable rather than just using MAX_PATH. + +Sun Sep 30 17:10:18 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Depend on stamp to ensure rebuilding. Remove stamp file + when we've just built the DLL. + +Mon Oct 1 00:34:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_cond_dowait): Hopefully eliminate a race on multiple thread + wakeups. + +Sat Sep 29 18:26:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * pthread.cc (pthread_cond_timedwait): Deleted - exported from thread.cc. + (pthread_cond_wait): Deleted - exported from thread.cc. + * thread.cc (pthread_cond::BroadCast): Update to use the new syntax for + verifyable_object_isvalid (). + (pthread_cond::Signal): Ditto. Also attempt to fix the lost signal race + with pthread_cond::TimedWait(). + (check_valid_pointer): Change definiton to void const *. + (verifyable_object_isvalid): Add new parameter to allow identification of + static initializers, and return a enum rather than magic numbers. + (__pthread_create): Ditto. + (__pthread_cleanup): Ditto. + (__pthread_attr_init): Ditto. + (__pthread_attr_getinheritsched): Ditto. + (__pthread_attr_getschedparam): Ditto. + (__pthread_attr_getschedpolicy): Ditto. + (__pthread_attr_getscope): Ditto. + (__pthread_attr_setdetachstate): Ditto. + (__pthread_attr_getdetachstate): Ditto. + (__pthread_attr_setinheritsched): Ditto. + (__pthread_attr_setschedparam): Ditto. + (__pthread_attr_setschedpolicy): Ditto. + (__pthread_attr_setscope): Ditto. + (__pthread_attr_setstacksize): Ditto. + (__pthread_attr_getstacksize): Ditto. + (__pthread_attr_destroy): Ditto. + (__pthread_join): Ditto. + (__pthread_detach): Ditto. + (__pthread_suspend): Ditto. + (__pthread_continue): Ditto. + (__pthread_getschedparam): Ditto. + (__pthread_getsequence_np): Ditto. + (__pthread_key_create): Ditto. + (__pthread_key_delete): Ditto. + (__pthread_setschedparam): Ditto. + (__pthread_setspecific): Ditto. + (__pthread_getspecific): Ditto. + (__pthread_cond_destroy): Ditto. + (__pthread_cond_init): Ditto. + (__pthread_cond_broadcast): Ditto. + (__pthread_cond_signal): Ditto. + (__pthread_condattr_init): Ditto. + (__pthread_condattr_getpshared): Ditto. + (__pthread_condattr_setpshared): Ditto. + (__pthread_condattr_destroy): Ditto. + (__pthread_kill): Ditto. + (__pthread_mutex_init): Ditto. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutexattr_getprotocol): Ditto. + (__pthread_mutexattr_getpshared): Ditto. + (__pthread_mutexattr_gettype): Ditto. + (__pthread_mutexattr_init): Ditto. + (__pthread_mutexattr_destroy): Ditto. + (__pthread_mutexattr_setprotocol): Ditto. + (__pthread_mutexattr_setprioceiling): Ditto. + (__pthread_mutexattr_getprioceiling): Ditto. + (__pthread_mutexattr_setpshared): Ditto. + (__pthread_mutexattr_settype): Ditto. + (__sem_init): Ditto. + (__sem_destroy): Ditto. + (__sem_wait): Ditto. + (__sem_trywait): Ditto. + (__sem_post): Ditto. + (__pthread_cond_dowait): New function, contains core logic from + __pthread_cond_wait and __pthread_cond_timedwait. Decrement (*cond)->waiting + before reentering the cond access mutex to allow detection of lost signals. + (__pthread_cond_timedwait): Rename to pthread_cond_timedwait, and call + __pthread_cond_dowait after calculating the wait length. + (__pthread_cond_wait): Rename to pthread_cond_wait, and call + __pthread_cond_dowait. + * thread.h: New enum for use with verifyable_object_isvalid. + Remove the extern exporting of __pthread_cond_timedwait and __pthread_cond_wait. + +Fri Sep 28 21:18:50 2001 Christopher Faylor <cgf@cygnus.com> + + * pipe.cc (fhandler_pipe::fixup_after_fork): New method. + * fhandler.h (fhandler_pipe::fixup_after_fork): Declare new method. + +Fri Sep 28 03:23:04 2001 Christopher Faylor <cgf@cygnus.com> + + * passwd.cc (read_etc_passwd): Bother with unlocking when not + in cygwin initialization. + * grp.cc (read_etc_group): Ditto. + +Fri Sep 28 02:57:03 2001 Christopher Faylor <cgf@cygnus.com> + + * passwd.cc (read_etc_passwd): Don't bother with locking when + in cygwin initialization since there is only one thread. + * grp.cc (read_etc_group): Ditto. + +Fri Sep 28 01:50:09 2001 Christopher Faylor <cgf@cygnus.com> + + * pipe.cc (fhandler_pipe::hit_eof): Return correct value when there is + no EOF event available. + +Sat Sep 28 00:34:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Move setting the access after evaluating fd. + Remove useless comment. Explain copy-on-write problem of 9x + more detailed. Don't set access to FILE_MAP_COPY on 9x only + when anonymous mapping is requested. + (fhandler_disk_file::mmap): Remove useless device check. + Add debug output. + +Fri Sep 27 07:35:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in: Only stamp winver_stamp on success. + +Wed Sep 26 16:02:35 2001 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): REALLY only grab mutex when we actually got + something from the pipe. + +Tue Sep 25 21:25:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_cond::BroadCast): Use address with verifyable_object_isvalid(). + (pthread_cond::Signal): Ditto. + (__pthread_create): Ditto. + (__pthread_cleanup): Ditto. + (__pthread_attr_init): Ditto. + (__pthread_attr_getinheritsched): Ditto. + (__pthread_attr_getschedparam): Ditto. + (__pthread_attr_getschedpolicy): Ditto. + (__pthread_attr_getscope): Ditto. + (__pthread_attr_setdetachstate): Ditto. + (__pthread_attr_getdetachstate): Ditto. + (__pthread_attr_setinheritsched): Ditto. + (__pthread_attr_setschedparam): Ditto. + (__pthread_attr_setschedpolicy): Ditto. + (__pthread_attr_setscope): Ditto. + (__pthread_attr_setstacksize): Ditto. + (__pthread_attr_getstacksize): Ditto. + (__pthread_attr_destroy): Ditto. + (__pthread_join): Ditto. + (__pthread_detach): Ditto. + (__pthread_suspend): Ditto. + (__pthread_continue): Ditto. + (__pthread_getschedparam): Ditto. + (__pthread_getsequence_np): Ditto. + (__pthread_key_create): Ditto. + (__pthread_key_delete): Ditto. + (__pthread_setschedparam): Ditto. + (__pthread_setspecific): Ditto. + (__pthread_getspecific): Ditto. + (__pthread_cond_destroy): Ditto. + (__pthread_cond_init): Ditto. + (__pthread_cond_broadcast): Ditto. + (__pthread_cond_signal): Ditto. + (__pthread_cond_timedwait): Ditto. + (__pthread_cond_wait): Ditto. + (__pthread_condattr_init): Ditto. + (__pthread_condattr_getpshared): Ditto. + (__pthread_condattr_setpshared): Ditto. + (__pthread_condattr_destroy): Ditto. + (__pthread_kill): Ditto. + (__pthread_mutex_init): Ditto. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutexattr_getprotocol): Ditto. + (__pthread_mutexattr_getpshared): Ditto. + (__pthread_mutexattr_gettype): Ditto. + (__pthread_mutexattr_init): Ditto. + (__pthread_mutexattr_destroy): Ditto. + (__pthread_mutexattr_setprotocol): Ditto. + (__pthread_mutexattr_setprioceiling): Ditto. + (__pthread_mutexattr_getprioceiling): Ditto. + (__pthread_mutexattr_setpshared): Ditto. + (__pthread_mutexattr_settype): Ditto. + (__sem_init): Ditto. + (__sem_destroy): Ditto. + (__sem_wait): Ditto. + (__sem_trywait): Ditto. + (__sem_post): Ditto. + (verifyable_object_isvalid): Recieve a pointer to a pointer for verification. + (__pthread_mutexattr_getprotocol): Fix typo in magic number. + (__pthread_mutexattr_getpshared): Ditto. + (__pthread_mutexattr_gettype): Ditto. + * thread.h (verifyable_object_isvalid): Change prototype to recieve a pointer to a + pointer for verification. + * include/pthread.h: Fix typo for __cleanup_routine_type typedef. (Contrib from Net). + +Tue Sep 25 02:09:42 2001 Christopher Faylor <cgf@redhat.com> + + * select.cc (fhandler_tty_common::ready_for_read): Rewrite to correctly + call peek_pipe. + +Mon Sep 24 18:46:39 2001 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_pipe): Only grab mutex when we actually got something + from the pipe. + +Mon Sep 24 17:41:03 2001 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_pipe::hit_eof): New method. + (writepipe_exists): New class element. + (orig_pid): Ditto. + (id): Ditto. + (is_slow): Eliminate. + * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance on + writepipe_exists, if it exists. + (fhandler_pipe::hit_eof): New method, modelled after tty. + (fhandler_pipe::dup): Duplicate writepipe_exists, if it exists. + (make_pipe): Set up a dummy event for pipes on windows 9x. The + nonexistence of this event means that the write side of the + pipe has closed. + (_dup): Move to syscalls.cc + (_dup2): Ditto. + + * dtable.cc (dtable::build_fhandler): Fill out set_names here, if + appropriate. + * syscalls.cc (_open): Call set_names in build_fhandler. + +Sun Sep 23 16:55:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (_open): Set name in fhandler object after successful + creation. + (stat_dev): Set device type to block device in FH_FLOPPY case. + +Sun Sep 23 11:15:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::build_fhandler): Initialize unit when using + optional path_conv argument. + +Sat Sep 22 17:33:45 2001 Christopher Faylor <cgf@cygnus.com> + Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::build_fhandler): Accept an optional path_conv + argument. If available, use this to calculate path name and device + number. + * dtable.h (dtable): Reflect above change. + * fhandler.h (fhandler_base): Declare virtual method which accepts + path_conv rather than path string as first argument. + * fhandler.cc (fhandler_base::open): Define above new method. + * syscalls.cc (_open): Set aside a path_conv variable for use in + build_fhandler and subsequent call to open. + +Sat Sep 22 12:44:57 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (setup_handler): Always relinquish lock after we've + interrupted. + * fhandler.cc: Move pipe methods to pipe.cc. + * fhandler.h (fhandler_pipe): Add new methods. + * fork.cc (sync_with_parent): Make error messages more informative. + * pipe.cc (fhandler_pipe::fhandler_pipe): Move here from fhandler.cc. + (fhandler_pipe::lseek): Ditto. + (fhandler_pipe::set_close_on_exec): New method. + (fhandler_pipe::read): Ditto. + (fhandler_pipe::close): Ditto. + (fhandler_pipe::dup): Ditto. + (make_pipe): Create the guard mutex on the read side of the pipe. + * select.cc (peek_pipe): Use guard_mutex to discover if we have the + right to read on this pipe. + (fhandler_pipe::readh_for_read): Pass the read pipe guard mutex to + peek_pipe. + * syscalls.cc (_read): Always detect signal catchers, for now. + + * debug.cc (makethread): Eliminate hack to make thread inheritable. + * sigproc.cc (subproc_init): Don't use hack to make thread inheritable. + +Thu Sep 20 16:48:44 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::set_inheritance): Just use + DUPLICATE_CLOSE_SOURCE to change inheritance. Eliminate all other + logic dealing with closed handles. + * fhandler.h (fhandler_base::set_inheritance): Reflect above change. + * fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Ditto. + +Thu Sep 20 13:34:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::fixup_after_exec): Close + socket only when not using Winsock2. + +Thu Sep 20 13:20:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::fixup_after_exec): Remove inline + implementation. + (fhandler_dev_raw::fixup_after_exec): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::fixup_after_fork): Don't + duplicate buffer on fork to avoid memory leak. + (fhandler_dev_raw::fixup_after_exec): New implementation equal to + former fixup_after_fork() implementation. + * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Do + nothing when not using Winsock2. + (fhandler_socket::fixup_after_exec): New implementation. + (fhandler_socket::set_close_on_exec): Never call set_inheritance(). + +Thu Sep 20 9:55:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::set_inheritance): If available, + use SetHandleInformation() to set inheritance. + * wincap.cc: Set flag has_set_handle_information_on_console_handles + appropriately. + * wincap.h: Add flag has_set_handle_information_on_console_handles. + +Wed Sep 19 12:24:09 2001 Christopher Faylor <cgf@cygnus.com> + + * lib/getopt.c (__progname): Don't declare if not compiling for cygwin. + +Wed Sep 19 18:07:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * lib/getopt.c (getopt_long): Avoid compiler warning. + +Wed Sep 19 11:52:42 2001 Christopher Faylor <cgf@cygnus.com> + + * lib/getopt.c: Use __progname==__argv[0] when not compiling for cygwin. + + * scandir.cc (scandir): Use correct default when compar == NULL. + +Wed Sep 19 17:49:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Revert + memory allocation to use cmalloc again. + +Tue Sep 18 21:04:26 2001 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din (__argv): Export. + (__argc): Ditto. + (__progname): Ditto. + * include/getopt.h (getopt_long): constify arguments. + * lib/getopt.c: Import new file from NetBSD. + +Tue Sep 18 18:21:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Don't reuse anonymous memory in MAP_FIXED case. + +Mon Sep 17 17:29:25 2001 Christopher Faylor <cgf@cygnus.com> + + * include/io.h: Add access declaration. + +Mon Sep 17 14:04:27 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (rmdir): Set cwd to some other location if attempting to + rmdir current working directory. + +Sun Sep 16 23:04:31 2001 Christopher Faylor <cgf@cygnus.com> + + * dtable.h (not_open): Assure inline. + * fhandler.h (operator []): Make const. + +Sun Sep 16 23:02:57 2001 Robert Collins <rbtcollins@hotmail.com> + + * sync.cc (muto::~muto): Fix typo which stopped muto event handle from + ever being closed. + +2001-09-16 Egor Duda <deo@logos-m.ru> + + * path.cc (symlink): Check arguments for validity. + (getcwd): Ditto. + * syscalls.cc (ftruncate): Ditto. + * times.cc (times): Ditto. + * uname.cc (uname): Ditto. + +Sat Sep 15 22:54:49 2001 Christopher Faylor <cgf@cygnus.com> + + * net.cc (dup_servent_ptr): Detect old Windows 95 misaligned structure + and realign appropriately. + +Sat Sep 15 00:28:40 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Generate libcygwin.a during the link pass rather than as + a separate dlltool step. + * dcrt0.cc (_dll_crt0): pppid_handle could be NULL. Don't close it if + so. + +Fri Sep 14 20:48:18 2001 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (dll_crt0_1): Create vfork main storage here so that it can + be queried in waitsig later. + * sigproc.cc (wait_sig): Don't deliver a signal if in a vfork. + * sigproc.h (sigframe::init): New method. + (sigframe): Use init. + * perthread.h: Declare main_vfork. + * fork.cc (vfork): Deliver all signals on parent return from vfork. + +Fri Sep 14 10:21:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (_dll_crt0()): Don't call wincap.init() here. + +Fri Sep 14 00:37:54 2001 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (vfork): Avoid recursive vforks. + +Fri Sep 14 00:18:52 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_pipe::is_slow): Return true only if pipes are + reliable (i.e., not Win9x). + * wincap.cc: Make statics NO_COPY to avoid fork overhead. + +Thu Sep 13 23:01:00 2001 Christopher Faylor <cgf@cygnus.com> + + * grp.cc (read_etc_group): Just reuse group_buf storage for subsequent + reread of /etc/group. + * passwd.cc (read_etc_passwd): Just reuse passwd_buf storage for + subsequent reread of /etc/passwd. + +Thu Sep 13 20:46:05 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (dup_now): New function. + (cygheap_setup_for_child): Accept new argument controlling whether to + delay copying of cygheap to shared memory region. + (cygheap_setup_for_child_cleanup): Accept new arguments controlling + whether to copy cygheap at this point. + * cygheap.h: Reflect above changes. + * fork.cc (fork_parent): Break copying of cygheap into two parts when + fork_fixup is required so that the child can see the parent's changes. + (vfork): Do stack cleanup prior to forcing a fork error. + * spawn.cc (spawn_guts): Ditto. + +Thu Sep 13 17:14:59 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (ccalloc): Pass correct length to creturn so that + cygheap_max is correctly calculated. + +Wed Sep 12 21:06:38 2001 Christopher Faylor <cgf@cygnus.com> + + * sync.cc (muto::acquire): Fix while/if typo. + +Wed Sep 12 23:06:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincapc::init): Simplify W2K/XP case. + +Wed Sep 12 23:02:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincapc::init): Set os name to "NT" on XP, too. + +Wed Sep 12 19:00:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Build wincap.o. + * wincap.cc: New file. + * wincap.h: Ditto. + * autoload.cc: Add dynamic load statement for `CreateHardLinkA'. + * dcrt0.cc (os_being_run): Eliminated. + (osname): Ditto. + (iswinnt): Ditto. + (set_os_type): Ditto. + (dll_crt0_1): Call wincap.init() instead of set_os_type(). + (_dll_crt0): Ditto. + * environ.cc (set_chunksize): New function. + (parse_thing): `forkchunk' setting now invokes function `set_chunksize'. + * fork.cc (chunksize): Eliminated. Moved to be member of wincap. + * host_dependent.h: Removed. + * syscalls.cc (_link): Try using `CreateHardLinkA' first, if available. + * cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc, + environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc, + fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h, + security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc, + times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap + capability check throughout. + * winsup.h: Include wincap.h. Eliminate extern declarations of + `os_being_run' and `iswinnt'. Eliminate `os_type" definition. + * include/cygwin/version.h: Bump version to 1.3.4. + +Wed Sep 12 01:03:36 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_signal_handler_now): Add additional guard against + inappropriately calling signal handler. + * syscalls.cc (_read): Reset errno if not exiting due to signal. + +Wed Sep 12 13:03:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * autoload.cc (LoadDLLfuncEx): Auto load TryEnterCriticalSection - it's + an NT only call. + * thread.cc (pthread_cond::TimedWait): Use critical sections for NT. + (pthread_cond::fixup_after_fork): Don't detect bad apps. + (pthread_mutex::pthread_mutex): Use critical sections for NT. + (pthread_mutex::~pthread_mutex): Ditto. + (pthread_mutex::Lock): Ditto. + (pthread_mutex::TryLock): Ditto. + (pthread_mutex::UnLock): Ditto. + (pthread_mutex::fixup_after_fork): Ditto. Also do not detect bad apps. + (__pthread_mutex_trylock): Move WIN32 specific test into the class + method. + (__pthread_mutex_destroy): Prevent dereferencing passed pointer without + valid address. + * thread.h (pthread_mutex): Use critical sections for NT. + +Tue Sep 11 21:55:37 2001 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sigframe::unregister): Return true/false whether this + frame is capable of responding to signals. + * exceptions.cc (sigframe::call_signal_handler): Don't call signal + handler if it is not armed for this thread. + +Tue Sep 11 11:23:10 2001 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Remove cygwin_getshared. + * shared.cc: Ditto. + * include/cygwin/version.h: Bump API minor number. + +Tue Sep 11 11:14:11 2001 Dmitry Timoshkov <dmitry@baikal.ru> + + * dtable.cc (dtable::build_fhandler): Fix incorrect test for socket. + +Tue Sep 11 21:22:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_cond::~pthread_cond): Fix incorrect use of + InterlockExchangePointer. + (pthread_mutex::~pthread_mutex): Ditto. + (semaphore::~semaphore): Ditto. + +Tue Sep 11 18:15:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * dcrt0.cc (cygwin_finished_initializing): Copy _mtinterf on fork. + * fork.cc (fork_child): Fixup thread-related structures after fork. + * thread.cc (MTinterface::Init): Initialise the new mutex, condition + and semaphore lists. + (MTinterface::fixup_after_fork): Iterate through each list and fixup + the objects. + (pthread_cond::pthread_cond): Add this to the condition list. + (pthread_cond::~pthread_cond): Remove this from the condition list. + (pthread_cond::fixup_after_fork): Recreate as best we can the pre-fork + state. + (pthread_mutex::pthread_mutex): Add this to the mutex list. + (pthread_mutex::~pthread_mutex): Remove this from the mutex list. + (pthread_mutex::fixup_after_fork): Recreate as best we can the pre-fork + state. + (semaphore::semaphore): Store the initial value, and add this to the + semaphore list. + (semaphore::~semaphore): Remove this from the semaphore list. + (semaphore::Post): Increment the current semaphore value. + (semaphore::TryWait): Decrement the current semaphore value. + (semaphore::Wait): Ditto. + (semaphore::fixup_after_fork): Recreate the pre-fork state as best we + can. + * thread.h (pthread_mutex): New members to allow fixup_after_fork. + (pthread_cond): Ditto. + (semaphore): Ditto. + (MTinterface): New list heads for tracking conds and semaphores. + +Sun Sep 9 22:11:27 2001 Christopher Faylor <cgf@cygnus.com> + + * dtable.cc (dtable::fixup_after_fork): Use SetStdHandle appropriately + on inherited fds. + +Sun Sep 9 20:09:11 2001 Christopher Faylor <cgf@cygnus.com> + + * sigproc.cc (NZOMBIES): Reduce substantially to minimize memory use. + +Mon Sep 10 08:28:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.h (MT_Interface): Remove pshared mutex array. Add a + threadsafe list for mutex tracking (for fixup after fork). + * thread.cc (MTInterface::Init): Remove pshared mutex array. + (pthread_mutex::pthread_mutex): Remove pshared mutex functionality. + Fail with EINVAL on attempts to use pshared functionality. + (__pthread_mutex_getpshared): Remove. + (__pthread_cond_timedwait): Remove pshared mutex functionality. + (__pthread_cond_wait): Ditto. + (__pthread_mutex_init): Ditto. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutexattr_setpshared): Ditto. + +Sun Sep 9 23:09:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h (pwdgrp_check::set_last_modified): Call GetFileTime() + instead of GetFileInformationByHandle(). + +Sun Sep 9 15:59:53 2001 Christopher Faylor <cgf@cygnus.com> + + * heap.h (inheap): Rewrite macro to accommodate removal of brk macros + below. + +Sun Sep 9 15:02:44 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cygheap_fixup_in_child): Clear cygheap->base so that heap + is not forced to start at the same place in execed process. + * heap.cc: Remove brk* macros for clarity throughout. + * heap.h: Ditto. + * shared.cc (shared_info::initialize): Move heap_chunk test into + heap_chunk_size(). + (heap_chunk_size): Check for chunk size here. Don't go to registry if + heap_chunk_in_mb is already set. + + * smallprint.c (console_printf): Add Windows 95 concessions. + +Sun Sep 9 13:01:06 2001 Christopher Faylor <cgf@cygnus.com> + + * child_info.h (PROC_MAGIC): Bump magic number. + +Sun Sep 9 18:36:00 2001 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (init_cygheap::etc_changed): New method to signal + a change in /etc. + * cygheap.h (struct init_cygheap): Add member `etc_changed_h' + and method `etc_changed'. + * grp.cc (enum grp_state): Eliminate. + (class grp_check): Ditto. + (group_state): Define as `class pwdgrp_check'. + (parse_grp): Remeber path and modification time of /etc/group file. + * passwd.cc (enum_pwd_state): Eliminate. + (class pwd_check): Ditto. + (passwd_state): Define as `class pwdgrp_check'. + (read_etc_passwd): Remember path and modification time of /etc/passwd + file. + * pwdgrp.h: New file. + (enum pwdgrp_state): Substitutes `pwd_state' and `grp_state'. + (class pwdgrp_check): Substitutes `pwd_check' and `grp_check'. + +Sun Sep 9 14:31:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump API minor version to 45 according + to adding the gamm*_r functions. + +Sat Sep 8 23:32:18 2001 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork_parent): Stop malloc activity while fork is in control + of the heap. + * sigproc.cc (NZOMBIES): Rename from ZOMBIEMAX for clarity. + (zombies): Revert to original behavior. Allocating zombie array + resulted in performance hit. + * winsup.h: Declare malloc lock routines. + +Fri Sep 7 21:35:35 2001 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Add gamm*_r function exports. + +Fri Sep 7 17:11:11 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.h (init_cygheap): Move heap pointers here. + * include/sys/cygwin.h (perprocess): Remove heap pointers. + * dcrt0.cc (__cygwin_user_data): Reflect obsolete perprocess stuff. + (_dll_crt0): Don't initialize heap pointers. + (cygwin_dll_init): Ditto. + (release_upto): Use heap pointers from cygheap. + * heap.h: Ditto. + * fork.cc (fork_parent): Ditto. Don't set heap pointers in ch. + (fork_child): Remove obsolete sigproc_fixup_after_fork. + * shared.cc (memory_init): Reorganize so that cygheap initialization is + called prior to regular heap since regular heap uses cygheap now. + * sigproc.cc (proc_subproc): Eliminate zombies allocation. + (sigproc_init): Move zombies alloation here. Don't free up array on + fork, just reuse it. + (sigproc_fixup_after_fork): Eliminate. + * sigproc.h: Ditto. + * include/cygwin/version.h: Reflect change to perprocess structure. + +Fri Sep 7 10:53:34 2001 Jason Tishler <jason@tishler.net> + + * poll.cc (poll): Change implementation to only call select() when no + invalid file descriptors are specified. + +Fri Sep 7 10:27:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * include/limits.h: Define PIPE_BUF. + * syscalls.cc (fpathconf): Use PIPE_BUF instead of numerical constant. + (pathconf): Ditto. + +Thu Sep 6 20:04:05 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Ensure that + prot_info_ptr is zeroed for later use. + +Thu Sep 6 14:03:49 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cygheap_fixup_in_child): Don't consider a NULL bucket as + a candidate for deletion. It is actually the end of a linked list + chain. + + * exceptions.cc (open_stackdumpfile): Default to "unknown" program name + if myself->progname hasn't been filled out yet. + +Thu Sep 6 01:16:44 2001 Christopher Faylor <cgf@cygnus.com> + + Move appropriate variables to NO_COPY segment, throughout. + +Thu Sep 6 00:40:35 2001 Christopher Faylor <cgf@cygnus.com> + + Remove initialization of static or global values to zero, throughout. + This just needlessly grows the size of the DLL. + * tty.cc (tty::alive): Make inuse handle non-inheriting on open, just + for thread safety. + +Wed Sep 5 23:36:03 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.h (init_cygheap): Move bucket array here from cygheap.cc. + * cygheap.cc: Throughout use bucket array from cygheap. + + * sigproc.cc (proc_subproc): Dynamically allocate zombie buffer to save + DLL space. + (sigproc_fixup_after_fork): Free zombie array after a fork. + * sigproc.h (sigproc_fixup_after_fork): Declare. + +2001-09-06 Egor Duda <deo@logos-m.ru> + + * dir.cc (mkdir): Expand buffer for security descriptor to 4K to avoid + stack corruption. + * fhandler.cc (fhandler_base::open): Ditto. + * path.cc (symlink): Ditto. + +Wed Sep 5 21:35:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc: Change copyright to include 2001. + +Wed Sep 5 12:12:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_floppy::lseek): Remove iswinnt check. + +Wed Sep 5 11:34:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::close): Change 2MSL value + according to MSDN. + +Wed Sep 5 10:14:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_connect): Add WSAEALREADY and WSAEINVAL handling + for non-blocking sockets. + +Tue Sep 4 22:42:13 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (ctrl_c_handler): Only send SIGINT when we have a + controlling terminal and we are the head of the process group. + +Tue Sep 4 16:48:14 2001 Christopher Faylor <cgf@cygnus.com> + + * thread.cc (InterlockedExchangePointer): Don't define if it already + exists. + +Tue Sep 4 22:14:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Eliminate os specific retrieving of x86 + processor type. + +2001-09-04 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * fhandler_console.cc (fhandler_console::char_command): Save the cursor + position relative to the top of the window. + * fhandler_cc (fhandler_console::write): Ditto. + +Mon Sep 3 21:06:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (opendir): Write version information to __d_dirent->d_version. + +Mon Sep 3 18:34:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add `dirfd'. + * dir.cc (dirfd): New function. + (opendir): Open a directory file descriptor and save it in + __d_dirent->d_fd. + (closedir): Close directory file descriptor. + * include/cygwin/version.h: Bump API minor version to 44. + +Sun Sep 2 22:09:31 2001 Christopher Faylor <cgf@cygnus.com> + + * child_info.h: Modify magic number. + * dcrt0.cc (_cygwin_testing): Define. + (_dll_crt0): Set _cygwin_testing if CYGWIN_TESTING environment variable + exists. Don't issue "conflicting versions" error if _cygwin_testing is + true. + * shared.cc (shared_name): Use _cygwin_testing global rather than + testing the environment. + * syscalls.cc (_write): Remove debugging info. + +Sat Sep 1 01:37:13 2001 Christopher Faylor <cgf@cygnus.com> + + * tty.cc (tty::create_inuse): Eliminate unneeded argument. + * tty.h: Reflect above change. + * fhandler_tty.cc: Reflect argument reduction in tty::create_inuse, + throughout. Always make inuse inheritable. + +Sat Sep 1 01:10:07 2001 Christopher Faylor <cgf@cygnus.com> + + * debug.cc (mark_closed): Rename from debug_mark_closed and make + static. + (setclexec_pid): New function for marking saved handle as + close-on-exec. + (delete_handle): New function. + (debug_fixup_after_fork): New function. + * debug.h: Declare new functions, remove obsolete ones. + * fork.cc (debug_fixup_after_fork): Call to cleanup close-on-exec + handles. + + * fhandler.cc (fhandler_disk_file::close): Minor reorg. + (fhandler_base::set_inheritance): Set flag appropriately for debugging + when close-on-exec so forked process can delete closed handles. + * tty.h (open_output_mutex): Eliminate unneeded argument. + (open_input_mutex): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::open): reflect open_*_mutex + argument changes. + * fhandler.h (fhandler_socket): Make saw_shutdown_* functions type + bool. + * tty.cc (tty::get_event): Eliminate unneeded argument. + (tty::common_init): Reflect change to get_event. Events should always + be inherited. + +Fri Aug 31 21:39:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (create_token): Change initialization of `exp' to comply + with new LARGE_INTEGER definition in winnt.h. + +Fri Aug 31 13:58:51 2001 Christopher Faylor <cgf@cygnus.com> + + * cygwin.sc: Revert to previous NO_COPY behavior. + * winsup.h: Ditto. + * sigproc.cc: Ditto. + * autoload.cc: Ditto. + +Fri Aug 31 00:56:26 2001 Christopher Faylor <cgf@cygnus.com> + + * cygwin.sc: New file -- linker script for building cygwin DLL. + * Makefile.in: Use linker script to control location of cygheap. + * cygheap.cc (buckets): Make static. + (init_cheap): Remove special iswinnt handling. Allocate cygheap at a + fixed location. Display more info when allocation fails. + (cygheap_fixup_in_child): Try harder to move cygheap to correct + location. Display more info when allocation fails. + * fhandler.h (fhandler_socket): Add macros for tracking socket shutdown + state. + * net.cc (cygwin_shutdown): Set appropriate shutdown value for future + use. + * select.cc (select_stuff::cleanup): New method. + (cygwin_select): Call cleanup explicitly to avoid a race. + (select_stuff:~select_stuff): Call cleanup chain via cleanup method. + (fhandler_socket::select_read): Set *_ready when shutdown has been + called on the socket. + (fhandler_socket::select_write): Ditto. + (fhandler_socket::select_except): Ditto. + + * winsup.h: Move NO_COPY to "COMMON" section. + * autoload.cc (wsock_started): Avoid initializing NO_COPY value. + * sigproc.cc: Remove initialization from NO_COPY variables. + (sigproc_init): Initialize sig_loop_wait here, rather than via + initialization. + (subproc_init): Initialize proc_loop_wait here, rather than via + initialization. + +Thu Aug 30 10:19:00 2001 Christopher Faylor <cgf@cygnus.com> + + * select.cc (select_read): Add setting read_ready flag. + (select_write): Add setting write_ready flag. + +Wed Aug 29 00:40:42 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Avoid splitting off leading '/' in path + component when building a symlink. + +Wed Aug 29 0:45:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * resource.cc (getrlimit): Return actual values on RLIMIT_STACK. + +Tue Aug 28 16:37:17 2001 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (rmdir): Report ENOENT when file doesn't exist rather than + ENOTDIR. + +Mon Aug 27 11:58:19 2001 Christopher Faylor <cgf@cygnus.com> + + * select.cc (cygwin_select): Ensure that arguments are zeroed on + timeout. + (select_stuff::wait): Ditto. + +2001-08-24 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * syscalls.cc (check_tty_fds): New function. Check whether there is a + fd referring to pty slave. + (setsid): Don't detach console if the process has a pty slave. + +Fri Aug 24 8:54:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (free_addr_list): Add define for symmetry. + (free_hostent_ptr): Use free_addr_list to free h_addr_list element. + +Thu Aug 23 16:00:09 2001 Jason Tishler <jason@tishler.net> + + * net.cc (dup_addr_list): New static function. + (dup_hostent_ptr): Use dup_addr_list instead of dup_char_list in order + to handle embedded null characters. + +Wed Aug 22 22:23:14 2001 Christopher Faylor <cgf@cygnus.com> + + * dtable.cc (dtable::dup2): Allow extension of fd table by dup2. + * syscalls.cc: Minor code cleanup. + (fpathconf): Check for bad fd before doing anything else. + * termios.cc (tcsetattr): Don't convert to new termios if bad fd. + (tcgetattr): Minor debugging tweak. + +Wed Aug 22 23:41:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_inet_ntoa): Rearrange previous patch to use + thread local buffer space when compiled thread safe. + (cygwin_getprotobyname): Ditto. + (cygwin_getprotobynumber): Ditto. + (cygwin_getservbyname): Ditto. + (cygwin_getservbyport): Ditto. + (cygwin_gethostbyname): Ditto. + (cygwin_gethostbyaddr): Ditto. Move near to cygwin_gethostbyname. + * thread.h (struct _winsup_t): Add pointers for above used buffer space. + * passwd.cc (getpwduid): Remove initializing passwd. + (setpwent): Ditto. + (endpwent): Ditto. + (setpassent): Ditto. + +Wed Aug 22 13:41:09 2001 Christopher Faylor <cgf@cygnus.com> + + * smallprint.c (console_printf): New function. + * dcrt0.cc (dll_crt0_1): Use console_printf for debugging output. + * debug.cc (debug_mark_closed): New function. + (close_handle): Use debug_mark_closed. + * debug.h: Declare new functions. + * dtable.cc (dtable::build_fhandler): Remove unneeded extern. + * spawn.cc: Cosmetic changes. + * winsup.h: Define NO_COPY for C files, too. Declare a global. + +Wed Aug 22 17:31:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (free_char_list): New static function. + (dup_char_list): Ditto. + (free_protoent_ptr): Ditto. + (dup_protoent_ptr): Ditto. + (free_servent_ptr): Ditto. + (dup_servent_ptr): Ditto. + (free_hostent_ptr): Ditto. + (dup_hostent_ptr): Ditto. + (cygwin_inet_ntoa): Use local static buffer to allow propagating of + the result to child processes. + (cygwin_getprotobyname): Ditto. + (cygwin_getprotobynumber): Ditto. + (cygwin_getservbyname): Ditto. + (cygwin_getservbyport): Ditto. + (cygwin_gethostbyname): Ditto. + (cygwin_gethostbyaddr): Ditto. + +Mon Aug 20 11:56:19 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (init_cheap): Allocate cygheap in shared memory for Windows NT. + +Thu Aug 16 09:38:59 2001 Jason Tishler <jason@tishler.net> + + * fhandler_socket.cc (fhandler_socket::create_secret_event): Relax + security of secret_event so AF_UNIX socket clients can connect to + servers even if running under a different user account. + (fhandler_socket::check_peer_secret_event): Ditto. + +Thu Aug 16 16:26:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * resource.cc (getrlimit): Return getdtablesize () as current limit + on RLIMIT_NOFILE. + * syscalls.cc (getdtablesize): Return OPEN_MAX if current dtable size + is less than OPEN_MAX, the current dtable size otherwise. + * sysconf.cc (sysconf): Return getdtablesize () on _SC_OPEN_MAX. + +Thu Aug 16 16:17:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * resource.cc (getrlimit): Return OPEN_MAX as current limit + on RLIMIT_NOFILE. + * syscalls.cc (getdtablesize): Return OPEN_MAX. + * sysconf.cc (sysconf): Return OPEN_MAX on _SC_OPEN_MAX. + * include/limits.h (OPEN_MAX): Define as 256. + +Wed Aug 15 12:43:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (utimes): Revert previous change. Just open the + file using FILE_WRITE_ATTRIBUTES instead of GENERIC_WRITE + on NT/W2K. + +Wed Aug 15 12:18:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_nt_attribute): Return always -1 in case of + a failure. + * times.cc (utimes): On NTFS with ntsec ON, change the file's + security descriptor temporarily to acquire write access if + opening the file failed. + +Wed Aug 15 9:42:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::is_nonblocking): New method. + (fhandler_base::set_nonblocking): Ditto. + * fhandler.h (fhandler_base): Declare new methods `is_nonblocking' and + `set_nonblocking'. + * fhandler_socket.cc (fhandler_socket::ioctl): Use `set_nonblocking'. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): + Use `is_nonblocking'. + (fhandler_tty_slave::read): Ditto. + (fhandler_tty_slave::ioctl): Use `set_nonblocking'. + (fhandler_pty_master::ioctl): Ditto. + * net.cc (cygwin_sendto): Fallback to winsock 1 functionality + in case of nonblocking IO. + (cygwin_recvfrom): Ditto. + (cygwin_recv): Ditto. + (cygwin_send): Ditto. + * syscalls.cc (_read): Use `is_nonblocking'. + +Tue Aug 14 11:05:26 2001 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump API version. + +2001-08-14 Egor Duda <deo@logos-m.ru> + + * spawn.cc (spawn_guts): Enable appropriate privilege before + loading user's registry hive. + +Mon Aug 13 22:34:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fcntl): Use new O_NONBLOCK_MASK define. + * fhandler.h: Move definitions of O_NOSYMLINK, O_DIROPEN and + OLD_O_NDELAY from winsup.h to here. Add O_NONBLOCK_MASK define. + * fhandler_socket.cc (fhandler_socket::close): Add hack to allow + a graceful shutdown even if shutdown() hasn't been called by the + application. Add debug output. + (fhandler_socket::ioctl): Set fhandler's NONBLOCK flag according + to FIONBIO setting. + (fhandler_socket::fcntl): Use new O_NONBLOCK_MASK define. Actually + set `request' before using it. + * fhandler_tty.cc: Use new O_NONBLOCK_MASK define throughout. + (fhandler_tty_slave::ioctl): Set fhandler's NONBLOCK flag according + to FIONBIO setting. + (fhandler_pty_master::ioctl): Ditto. + * net.cc (wsock_event::prepare): Compare WSACreateEvent return code + with `WSA_INVALID_EVENT' according to MSDN. + * syscalls.cc (_read): Use new O_NONBLOCK_MASK define. + +Wed Aug 8 15:24:59 2001 Christopher Faylor <cgf@cygnus.com> + + * include/wchar.h: Define __need_wint_t. + +Wed Aug 8 11:46:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Revert to setting inheritance attribute for + permissions given to directories. Never set inheritance on NULL ACE. + +Tue Aug 7 18:11:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Don't set FILE_DELETE_CHILD for group + if S_ISVTX attribute is given. + * dir.cc (mkdir): Allow immediate setting of S_ISUID, S_ISGID and + S_ISVTX attribute. + * syscalls.cc (_open): Ditto. + +Tue Aug 7 16:24:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (mkdir): Set security attributes correctly for + CreateDirectoryA () call if ntsec is on. Don't call + set_file_attributes () then. + * fhandler.cc (fhandler_base::open): Ditto for CreateFileA () call. + * path.cc (symlink): Ditto. + * security.cc (set_security_attribute): New function. + * security.h: Add declaration for `allow_ntea' and + `set_security_attribute'. + +Tue Aug 7 10:54:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (class grp_check): New class. Make `group_state' + a member of class grp_check. + (read_etc_group): Free former allocated memory on reread. + * passwd.cc (class pwd_check): New class Make `passwd_state' + a member of class pwd_check. + (read_etc_passwd): Free former allocated memory on reread. + +Tue Aug 7 01:13:58 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (get_tty_stuff): Don't initialize shared memory + console area if it is already initialized. + + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Augment debugging + info. + +Mon Aug 6 19:58:43 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cygheap_root::set): Avoid treating '/' specially. + + * fhandler.cc (fhandler_base::fcntl): Only set specific O_NDELAY style + flag passed in from application. + * fhandler_socket.cc (fhandler_socket::fcntl): Ditto. + * fhandler.h: Set constant for future use. + * winsup.h: Define OLD_O_NDELAY only for old programs. + * include/cygwin/version.h: Define + CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK. + +Sat Aug 4 16:52:03 2001 Christopher Faylor <cgf@cygnus.com> + + Throughout, change check for running under Windows NT to 'iswinnt'. + * dcrt0.cc (set_os_type): Set 'iswinnt' appropriately. + * cygheap.cc (init_cheap): Revert to using VirtualAlloc for allocating + cygheap. + (cygheap_setup_for_child_cleanup): New function. Standard function to + call after calling CreateProcess to cleanup cygheap info passed to + child. + (cygheap_fixup_in_child): Copy cygheap from shared memory into + allocated space under Windows 9x or if can't relocate shared space + under NT. + * cygheap.h: Declare new function. + * spawn.cc (spawn_guts): Use cygheap_fixup_in_child. + * fork.cc (fork_parent): Ditto. + * winsup.h: Declare iswinnt. + +2001-08-04 Egor Duda <deo@logos-m.ru> + + * dtable.cc (dtable::release): Avoid messing with console when + closing socket. + +Fri Aug 3 14:02:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_accept): Allow NULL peer and len parameters. + * include/cygwin/socket.h: Define socklen_t as int. + +Fri Aug 3 13:04:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fchdir): Set the fhandler's path to absolute value to ensure + changing to the correct directory even if the fhandler originally + points to a relative path. + +Thu Aug 2 17:59:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_file_attribute): Clean up. Don't call + `set_nt_attribute' when ntsec isn't set. + +Sat Jul 28 22:30:55 2001 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (alloc_stack_hard_way): Make half-hearted attempt to deal + with growing stack under Windows 95. + +Fri Jul 27 12:36:07 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Add install-lib and install-headers. + +Fri Jul 27 12:28:12 2001 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Export sys_errlist, sys_nerr. + * include/cygwin/version.h: Bump minor version number. + +Fri 27 Jul 2001 10:29:00 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_user_primary_group): Fix compiler warning. + (alloc_sd): Add DELETE permission for user when S_IWUSR is given. + +Thu Jul 26 16:43:39 2001 Pieter de Visser <pieterdv@knoware.nl> + + * thread.cc (__pthread_equal): Invert return value so that true is + returned when threads are equal. + +Thu Jul 26 15:50:38 2001 Charles Wilson <cwilson@ece.gatech.edu> + Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Export __signgam. + * include/cygwin/version.h: Bump minor version number. + +Thu Jul 26 15:19:50 2001 Christopher Faylor <cgf@cygnus.com> + + Throughout, reorganize header file inclusion to put security.h prior to + fhandler.h. + * fhandler.h (fhandler_base::get_inheritance): New method. + * fhandler_socket.cc (fhandler_socket::create_secret_event): Use proper + close-on-exec inheritance when creating. + (fhandler_socket::check_peer_secret_event): Create handle as + non-inheritable. + +2001-07-25 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * syscalls.cc (setsid): Detach process from its console if the current + controlling tty is the console and already closed. + * dtable.h (class dtable): Add members to count descriptors referring + to the console. + * dtable.cc (dtable::dec_console_fds): New function to detach process + from its console. + (dtable::release): Decrement the counter of console descriptors. + (dtable::build_fhandler): Increment it. + * exception.cc (ctrl_c_handler): Send SIGTERM to myself when catch + CTRL_SHUTDOWN_EVENT. + +Tue 24 Jul 2001 02:28:00 PM Trevor Forbes <t4bs@hotmail.com> + + * thread.cc (verifyable_object_isvalid): Don't validate + PTHREAD_MUTEX_INITIALIZER pointer as it will cause an exception + in IsBadWritePtr() when running GDB. + +Wed 25 Jul 2001 23:46:00 Corinna Vinschen <corinna@vinschen.de> + + * localtime.c: Changed whole file to become C++ clean. Rename to + localtime.cc. + * localtime.cc (tzload): Preserve errno. + +Fri 20 Jul 2001 11:15:50 PM EDT Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cygheap_fixup_in_child): Attempt Win95 workaround. + * dtable.cc (dtable::dup_worker): Add debugging output. + (dtable::vfork_child_dup): Correctly set close_on_exec. + * fhandler.cc (fhandler_base::fork_fixup): Don't mess with handle if + there is no need to get it from the parent. + * fhandler_tty.cc (fhandler_tty_common::close): Add debugging output. + +Fri 20 Jul 2001 09:15:00 Mark Bradshaw <bradshaw@staff.crosswalk.com> + + * dir.cc (readdir): Protect FindNextFileA against INVALID_HANDLE_VALUE. + +Wed 18 Jul 2001 01:00:47 PM EDT Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (_cmalloc): Use correct constants for size calculation. + * dcrt0.cc (dll_crt0_1): Move uid initialization earlier. + * fork.cc (fork_parent): Move cygheap_setup_in_child to just prior to + CreateProcess so that all contents of cygheap are copied. + * spawn.cc (spawn_guts): Ditto. + +Wed 18 Jul 2001 12:54:17 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_user_groups): Call Net function with NULL server + name under specific error conditions. + (is_group_member): Ditto. + (get_user_local_groups): Ditto. + (get_user_primary_group): Ditto. + +Wed 18 Jul 2001 11:56:00 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (_unlink): Explicitly check for non-existant file. + +Tue 17 Jul 2001 10:19:00 Corinna Vinschen <corinna@vinschen.de> + + * delqueue.h: Remove obsolete file. + +Mon 16 Jul 2001 10:47:17 PM EDT Christopher Faylor <cgf@cygnus.com> + + * child_info.h: Bump magic number. + (class child_info): Add an element. + * cygheap.cc (init_cheap): Allocate cygwin heap in shared memory area. + (cygheap_fixup_in_child): Map cygwin heap, passed from parent via + shared memory into correct address. + (cygheap_setup_for_child): New function. + * cygheap.h: Declare new functions. + * dcrt0.cc (dll_crt0_1): Accommodate new cygheap_fixup_in_child + arguments. Avoid protecting subproc_ready unless it is spawn/nowait. + * fork.cc (fork_parent): Use new cygheap_setup_for_child function to + setup cygwin heap info. Close passed cygheap shared memory handle. + * spawn.cc (spawn_guts): Ditto. Also, reorganize to avoid + synchronization between parent and child in non-P_OVERLAY case. + * sigproc.cc (wait_sig): Only signal subproc_ready when execing. + +Mon 16 Jul 2001 15:21:00 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc: Add missing Copyright date 2001. + +Mon 16 Jul 2001 00:11:00 Corinna Vinschen <corinna@vinschen.de> + + Change well_known_admin_sid to well_known_admins_sid throughout. + * sec_acl.cc (setacl): Never set DELETE permission. Set + FILE_DELETE_CHILD only on readable and executable directories. + * sec_helper.cc: Add constructor for `well_known_null_sid'. + * security.cc (get_nt_attribute): Set S_ISVTX for directories if + FILE_WRITE_DATA and FILE_EXECUTE but not FILE_DELETE_CHILD is set. + Add evaluation of S_ISVTX, S_ISGID and S_ISUID from NULL ACE. + (alloc_sd): Never set DELETE permission. Set FILE_DELETE_CHILD + only on readable and executable directories. + Add creation of NULL ACE for S_ISVTX, S_ISGID and S_ISUID permissions. + * security.h: Add extern declaration for `well_known_null_sid'. + +Fri 13 Jul 2001 08:08:49 PM EDT Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (stat_worker): Simplify previous change. + +Fri Jul 13 13:13:09 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_unlink): Correct (?) logic which determines when + to report an access violation and when to queue file for eventual + deletion. + (stat_worker): Check for invalid buf argument. + +Tue Jul 10 23:01:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fhandler_disk_file::mmap): Try to open file mappings + by a unified name when running under 9x/ME. If that failes, create + the file mapping using the unified name. + +Mon Jul 9 10:43:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (internal_getlogin): Add pointer check. + +Mon Jul 9 10:05:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Don't set inheritance attribute for + permissions given to directories. + +Thu Jun 28 22:19:08 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Return 0 for success. + +Wed Jun 27 22:19:07 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Add signal protection here since + retrieving info about remote shares can take some time. + +Wed Jun 27 23:30:00 2001 Robert Collins <rbtcollins@hotmail.com> + Christopher Faylor <cgf@cygnus.com> + + Change check_null_empty_path* to check_null_empty_str* throughout. + * path.h (check_null_empty_str_errno): Convert to a function prototype. + * path.cc (check_null_empty_str): Move to miscfuncs.cc. + * miscfuncs.cc (check_null_empty_str_errno): New function. + (__check_null_invalid_struct): Ditto. + (__check_null_invalid_struct_errno): Ditto. + (check_null_empty_str): Change from VirtualQuery to IsBadWritePtr. + * thread.cc (check_valid_pointer): Ditto. + * resource.cc (getrlimit): Use check_null_invalid_struct macro for + checking validity of pointer. + (setrlimit): Ditto. + +Tue Jun 26 16:59:16 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_disk_file::fstat): Don't rely on exactly 3 + characters being read for executable test since we could be checking + for less than that. + * syscalls.cc (stat_worker): Try opening the file the "correct" way + first so that #! processing can potentially happen. If that fails, + then use "query open" method. + + * spawn.cc (spawn_guts): Delay processing of signal until after we've + notified parent about reparenting. + +Tue Jun 26 10:47:24 2001 Christopher Faylor <cgf@cygnus.com> + + * mmap.cc: Clean up *ResourceLock calls throughout. + +Tue Jun 26 22:10:00 2001 Robert Collins rbtcollins@hotmail.com + + * thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well + as WAIT_ABANDONED. + (__pthread_cond_timedwait): Calculate a relative wait from the abstime + parameter. + +Sun Jun 24 17:38:19 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interrupt_setup): Move actions from setup_handler to + here. + (setup_handler): Move actions after a successful interrupt to + interrupt_setup. + * fork.cc (vfork): Augment debugging output. + * sigproc.cc (proc_subproc): Ditto. + * spawn.cc (spawn_guts): Ditto. Correctly fill out progname when spawn + NO_WAIT. Call signal handler when a signal arrives. + * sigproc.h: Declare a function. + +Fri Jun 22 16:50:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h class fhandler_socket): Declare new method + `set_close_on_exec'. + * fhandler_socket.cc (fhandler_socket::set_close_on_exec): + New method. + +Fri Jun 22 16:12:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::tape_erase): Set size + parameter to value expected by GetTapeParameters(). + +Thu Jun 21 22:01:39 2001 Marius Gedminas <mgedmin@delfi.lt> + + * fhandler_console.cc (fhandler_console::read): Detect AltGr more + robustly on WinNT. + +2001-06-22 Robert Collins <rbbtcollins@hotmail.com> + + * thread.cc (__pthread_cond_timedwait): Lock the waiting mutex before + the condition protect mutex to avoid deadlocking. (Found by Greg Smith). + (__pthread_cond_wait): Ditto. + +2001-06-30 Egor Duda <deo@logos-m.ru> + + * fhandler.cc (fhandler_base::open): Work around windows bug when + CreateFile() with dwDesiredAccess == 0 called on remote share returns + valid handle even if file doesn't exist. + +2001-06-20 Egor Duda <deo@logos-m.ru> + + * fhandler_socket.cc (fhandler_socket::signal_secret_event): New + function. + * fhandler.h: Declare it. + * fhandler_socket.cc (fhandler_socket::create_secret_event): Don't + signal secret event immediately. + (fhandler_socket::check_peer_secret_event): Do it after peer event + was opened. + * net.cc (cygwin_connect): Or if socket is non-blocking. + (cygwin_accept): Ditto. + +Mon Jun 18 17:09:25 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_tty_slave::init): Revert 2001-06-16 change. + + * fork.cc (fork_copy): Print more debugging info. + (fork_parent): Change order of arguments to accomdate buggy gcc. + (fork): Ditto. + +Sun Jun 17 18:54:46 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_unlink): Reorganize to try harder to delete file with + DeleteFile and to recover more gracefully if FILE_FLAG_DELETE_ON_CLOSE + doesn't work properly. + +Sat Jun 16 13:06:49 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sig_handle_tty_stop): Reset PID_STOPPED if not + actually stopping. + * fhandler_console.cc (fhandler_console::fixup_after_fork): Don't set + controlling terminal if just inheriting a handle. + (fhandler_console::fixup_after_exec): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::init): Ditto. + * signal.cc (kill_worker): Set appropriate errno if proc_exists + determines that process does not really exist. + +Fri Jun 15 14:34:19 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Deal more robustly with foo/ behavior. + +Fri Jun 15 11:15:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::tape_status): Set size + parameter to value expected by GetTapeParameters(). + +Thu Jun 14 20:19:46 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_disk_file::fstat): Properly set executable bits + for directory when !ntsec && !ntea. Also move common code prior to + call to get_attributes. + +Fri June 15 09:25:00 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_cond::Signal): Release the condition access + variable correctly. + +2001-06-14 Egor Duda <deo@logos-m.ru> + + * fhandler.cc (fhandler_base::open): Set win32 access flags to 0, when + requested. + * fhandler.h: New status flag FH_QUERYOPEN. + (fhandler::get_query_open): New function. + (fhandler::set_query_open): Ditto. + * syscalls.cc (stat_worker): Request query-only open mode. + +2001-06-12 Egor Duda <deo@logos-m.ru> + + * environ.cc (set_file_api_mode): New function. Move setting + of file APIs mode (OEM/ANSI) here. + (codepage_init): From here. + * winsup.h (set_file_api_mode): Declare it. + * fork.cc (fork_child): Set file APIs mode in forkee. + +Mon Jun 11 14:19:49 2001 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc: Use autoloaded ToolHelp functions throughout for Win9x. + * autoload.cc: Autoload ToolHelp functions. + + * sigproc.cc (proc_subproc): Incorporate SIGCHLD == SIG_IGN special + handling of zombie processes. Ensure that zombie processes which are + at the end of the zombie array are properly cleaned up. + +Mon Jun 11 11:18:56 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Fix call to path_conv constructor so that it REALLY + doesn't check for the null/non-empty path. + +Sun Jun 10 23:34:09 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::update_fs_info): Don't consider remote drives to + be NTFS. Set root_dir before invoking GetDriveType (from Kazuhiro + Fujieda <fujieda@jaist.ac.jp>). Eliminate extra checks for rootdir. + +Sun Jun 10 20:19:47 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Pre-check path for validity before eating trailing + space. Then, ensure that path_conv doesn't check the path for validity + again. + +Sun Jun 10 12:56:00 2001 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sigdelayed): Ensure that signal is cleared as + the last operation or suffer races. + * sigproc.cc (proc_subproc): Deal with zombie array overflow. + +Sun Jun 10 11:56:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add fchdir symbols. + * path.cc (chdir): Guard against invalid parameter. + (fchdir): New function. + * include/cygwin/version.h: Bump API minor version to 40. + * uinfo.cc (internal_getlogin): Remove unused variable. + +Sat Jun 9 23:20:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (seteuid): Set environment variables USERNAME and + USERDOMAIN before impersonation to workaround a LookupAccountSid() + misbehaviour. + * uinfo.cc (internal_getlogin): Revert most of the previous change. + Don't set environment variables USERNAME and USERDOMAIN. That's + the job of seteuid() now. Try to get logon server from Lsa + only if logon server isn't already known. + +Thu Jun 7 15:54:32 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_cond::Broadcast): Don't print error messages on + invalid mutexs - user programs are allowed to call + pthread_cond_broadcast like that. + (__pthread_cond_timedwait): Initialise themutex properly. + (__pthread_cond_wait): Initialise themutex properly. + +Tue Jun 5 19:56:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::dup): Allocate space for + savebuf on Cygwin heap. + (fhandler_console::char_command): Ditto. Use correct values for size. + +2001-06-05 Egor Duda <deo@logos-m.ru> + + * security.h (NTWriteEA): Change prototype. + * ntea.cc (NTReadEA): Don't check for global ntea setting, now + it's caller responsibility. + (NTWriteEA): Ditto. + * security.cc (get_file_attribute): Read attribute from EA only + if 'ntea' is enabled. + (set_file_attribute): Ditto. + * path.h: (class path_conv): Add members to store file system + information. + (path_conv::get_drive_type): New function. + * syscalls.cc (stat_worker): Use it. + * path.cc (path_conv::update_fs_info): New functions. + (path_conv::check): Get file system information from device where + file resides. On NTFS, try to read symlink contents from EA. + (get_symlink_ea): New function. + (set_symlink_ea): Ditto. + (symlink): Store symlink in extended attribute, if possible. + +Tue Jun 5 11:18:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::fstat): Always reset file position + to original value after checking for executable magic. + +Mon Jun 4 16:21:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_user::cygheap_user): Initialize token to + INVALID_HANDLE_VALUE. + * uinfo.cc (uinfo_init): Close token handle if needed. + +Sun Jun 3 20:52:13 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (normalize_posix_path): Revert .. check removed by previous + changes. + * cygheap.h: Temporarily declare path_prefix_p here. + +Mon Jun 4 0:14:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (wsock_event): Add destructor. + +Sun Jun 3 09:49:55 2001 Robert Collins <rbtcollins@hotmail.com> + + * dlfcn.cc (dlclose): Do not call FreeLibrary if the symbol to close + was obtained by dlopen(NULL,...). + +Sat Jun 2 23:11:52 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (sleep): Try to be a little more accomodating of signal + arrival. Ensure that the signal handler is called. + +Sat Jun 2 14:07:28 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (cygheap_root::cygheap_root): Remove constructor. + (cygheap_root::~cygheap_root): Remove destructor. + (cygheap_root::operator =): Remove. + (cygheap_root::set): New method. + * cygheap.h (cygheap_root): Reflect above changes. Store root info in + mount-like structure. + (cygheap_root:posix_ok): New method. + (cygheap_root::ischroot_native): Ditto. + (cygheap_root::unchroot): Ditto. + (cygheap_root::exists): Ditto. + (cygheap_root::posix_length): Ditto. + (cygheap_root::posix_path): Ditto. + (cygheap_root::native_length): Ditto. + (cygheap_root::native_path): Ditto. + * dir.cc (opendir): Remove special chroot test. + * path.cc (path_prefix_p): Remove front end. + (normalize_posix_path): Reorganize chroot tests to accommodate new + convention of allowing paths using posix chroot prefix. + (path_conv::check): Pass a "already ran normalize" option to + conv_to_win32_path. Return if there is an error from this function. + (mount_info::conv_to_win32_path): Add extra argument. Don't call + normalize_posix_path if caller has already done so. Substitute chroot + setting, if any, for root translation. Add chroot checking to final + output step. + * shared_info (mount_info): Accommodate additional argument to + conv_to_win32_path. + * syscalls.cc (chroot): Store both normalized posix path and native + path in chroot. + +Fri Jun 1 10:57:19 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Really make sure that isspace gets only an unsigned + char. + +Fri Jun 1 13:45:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (_rename): Handle the case that `foo' is renamed to + `bar' while `bar.lnk' is an existing shortcut-symlink. + +Thu May 31 15:57:57 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_disk_file::fstat): Avoid clearing S_IFMT bits + since we've already pre-cleared everything anyway. + +Wed May 30 23:51:32 2001 Earnie Boyd <earnie_boyd@yahoo.com> + + * path.cc (chdir): Always send unsigned chars to isspace since newlib's + isspace doesn't deal well with "negative" chars. + +Wed May 30 23:51:32 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_disk_file::open): Propagate remote status of + file garnered from path_conv. Move #! checking to fstat. + (fhandler_disk_file::fstat): Reorganize st_mode setting to eliminate + duplication. Move check for #! here from fhandler::open. + + * fhandler.h (fhandler_base::isremote): New method. + (fhandler_base::set_isremote): Ditto. + (fhandler_base::set_execable_p): Also record "don't care if executable + state". + (fhandler_base::dont_care_if_execable): New method. + * path.cc (path_conv::check): Clear new flags. Appropriately set + vol_flags, drive_type, and is_remote_drive. + * path.h: Add new flags and methods for manipulating them. + * syscalls.cc (_unlink): Use isremote() to determine if a path is + remote rather than calling GetDriveType. + (stat_worker): Ditto. + * security.cc (get_file_attribute): Or attribute with result of + NTReadEA to be consistent with get_nt_attribute. + +Tue May 29 19:02:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (cygsid::getfrompw): Change parameter to `const'. + (cygsid::getfromgr): Ditto. + * security.cc: Use `sys_mbstowcs' and `sys_wcstombs' throughout. + (extract_nt_dom_user): Try to get user and domain from SID in + pw->pw_gecos first. + * security.h (class cygsid): Change parameter of getfrompw() and + getfromgr() to `const'. + * uinfo.cc (internal_getlogin): Change order for evaluating user + information in winNT case. Drop usage of NetWkstaUserGetInfo(). + +Mon May 28 21:34:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * shortcut.c (check_shortcut): Treat only Cygwin shortcuts as symlinks. + +Fri May 25 11:07:07 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_info::check): Correctly set 'ext_tacked_on'. Use + this to determine if user specified 'foo.lnk' explicitly. Reorganize + slightly to get rid of one goto. + +Fri May 25 10:15:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Add a check to return correctly + if incoming `*.lnk' file is not a symlink. + +Thu May 24 15:46:50 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (slash_drive_prefix_p): Remove. + (mount_info::slash_drive_to_win32_path): Ditto. + (mount_info::conv_to_win32_path): Remove slash drive prefix check. + (mount_info::add_item): Ditto. + (mount_info::del_item): Ditto. + * shared_info.h (mount_info): Remove slash_drive_to_win32_path + declaration. + +Thu May 24 01:17:33 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Bump repeat count for debugging + kick out. + + * fhandler.h (fhandler_dev_dsp): Add a fixup_after_exec. + * fhandler_dsp.cc (class Audio): Add TOT_BLOCK_SIZE to enum. + (operator new): New. + (bigwavebuffer): Declare using TOT_BLOCK_SIZE to avoid buffer overruns. + (Audio::Audio): Optimize slightly. + (fhandler_dev_dsp::open): Allocate s_audio using static buffer. + (fhandler_dev_dsp::fixup_after_exec): New function. Ditto. + +Wed May 23 17:45:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (seteuid): Restrict overriding external provided + user tokens to ntsec. Don't test external tokens for primary + group to evaluate if it should be overridden. Restrict creating + internal tokens to ntsec. + +Wed May 23 10:11:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (chown_worker): Don't check for ENOSYS. + +Tue May 22 12:20:07 2001 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (sleep): Protect with sigframe. + +Tue May 22 17:58:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_file_attribute): Don't set errno. + +Mon May 21 15:08:00 2001 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Allow --enable-newvfork to turn NEWVFORK on and off. + * configure: Regenerate. + +Mon May 21 11:46:01 2001 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump minor version number. + +Sun May 20 13:26:25 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_dsp.cc: Reformat to GNU standards. + (s_audio): Change to a pointer throughout. + (fhandler_dev_dsp::open): Initialize s_audio, if required. + +Sat May 19 23:40:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add load statements for `LookupAccountNameW', + `LsaClose', `LsaEnumerateAccountRights', `LsaFreeMemory', + `LsaOpenPolicy', `LsaQueryInformationPolicy', `NetLocalGroupEnum', + `NetLocalGroupGetMembers', `NetServerEnum', `NetUserGetGroups' and + `NtCreateToken'. + * ntdll.h: Add declaration for `NtCreateToken'. + * sec_helper.cc: Add `well_known_local_sid', `well_known_dialup_sid', + `well_known_network_sid', `well_known_batch_sid', + `well_known_interactive_sid', `well_known_service_sid' and + `well_known_authenticated_users_sid'. + (cygsid::string): Define as const method. + (cygsid::get_sid): Set psid to NO_SID on error. + (cygsid::getfromstr): Ditto. + (cygsid::getfrompw): Simplify. + (cygsid::getfromgr): Check for gr == NULL. + (legal_sid_type): Move to security.h. + (set_process_privilege): Return -1 on error, otherwise 0 or 1 related + to previous privilege setting. + * security.cc (extract_nt_dom_user): Remove `static'. + (lsa2wchar): New function. + (open_local_policy): Ditto. + (close_local_policy): Ditto. + (get_lsa_srv_inf): Ditto. + (get_logon_server): Ditto. + (get_logon_server_and_user_domain): Ditto. + (get_user_groups): Ditto. + (is_group_member): Ditto. + (get_user_local_groups): Ditto. + (sid_in_token_groups): Ditto. + (get_user_primary_group): Ditto. + (get_group_sidlist): Ditto. + (get_system_priv_list): Ditto. + (get_priv_list): Ditto. + (get_dacl): Ditto. + (create_token): Ditto. + (subauth): Return immediately if SE_TCB_NAME can't be assigned. + Change all return statements in case of error to jumps to `out' + label. Add `out' label to support cleanup. + * security.h: Add extern declarations for `well_known_local_sid', + `well_known_dialup_sid', `well_known_network_sid', + `well_known_batch_sid', `well_known_interactive_sid', + `well_known_service_sid' and `well_known_authenticated_users_sid'. + Add extern declarations for functions `create_token', + `extract_nt_dom_user' and `get_logon_server_and_user_domain'. + (class cygsid): Add method `assign'. Change operator= to call new + `assign' method. Add `debug_print' method. + (class cygsidlist): New class. + (legal_sid_type): Moved from sec_helper.cc to here. + * spawn.cc (spawn_guts) Revert reversion of previous patch. + Call `RevertToSelf' and `ImpersonateLoggedOnUser' instead of `seteuid' + again. + * syscalls.cc (seteuid): Rearranged. Call `create_token' now when + needed. Call `subauth' if `create_token' fails. Try setting token + owner and primary group only if token was not explicitely created + by `create_token'. + * uinfo.cc (internal_getlogin): Try harder to generate correct user + information. Especially don't trust return value of `GetUserName'. + +Sat May 19 21:16:07 2001 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork_parent): Move atforkprepare call here. + (fork): From here. + +Sat May 19 18:35:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add missing load statement for `CancelIo'. + +Sat May 19 01:22:43 2001 Christopher Faylor <cgf@cygnus.com> + + * grp.cc (read_etc_group): Don't copy mutex on fork. + * pwd.cc (read_etc_passwd): Ditto. + * autoload.cc (LoadDLLfuncEx): Use LoadDLLprime to initialize DLL + specific area. + +Fri May 18 10:31:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (wsock_event::wait): Explicitely cancel IO when a signal + arrived to avoid data loss. Fallback to blocking IO when canceling + fails. + +Thu May 17 15:29:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (cygwin_set_impersonation_token): Never destroy + previous token object. + (subauth): Create token source with well defined identifier. + +Wed May 16 23:27:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (uinfo_init): Just set user token to INVALID_HANDLE_VALUE. + Token value is already invalid at that point. + +Wed May 16 21:34:00 2001 Fred Yankowski <fred@ontosys.com> + + * net.cc (errmap): Add missing mapping from WSAEINTR to EINTR. + +Wed May 16 09:20:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (legal_sid_type): Fix conditional. Change to + inline function. + +Wed May 16 01:01:48 2001 Christopher Faylor <cgf@cygnus.com> + + * autoload.h: Eliminate. + * autoload.cc: Pull in autoload.h. Eliminate many macros. Rewrite to + avoid necessity of initialization routines. Just use a standard one. + (wsock_init): New function. Moved from net.cc. + * net.cc (wsock_init): Move to autoload.cc. + (wsadata): Make global. + * dtable.cc (dtable::build_fhandler): Use more reliable method for + checking if net stuff has been loaded. + +Tue May 15 19:52:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork): Eliminate superfluous call to getuid(). + * security.h: New define `NO_SID'. Remove declarations of functions + moved to methods into class cygsid. + (class cygsid): Declare new methods `getfromstr', `get_sid', + `getfrompw', `getfromgr', `get_rid', `get_uid', `get_gid', `string' + and new constructors and operators =, == and !=. + Declare new global cygsids `well_known_XXX_sid' substituting the + corresponding `get_XXX_sid' functions. Remove declarations of + these functions. + * sec_helper.cc (well_known_admin_sid): New global variable. + (well_known_system_sid): Ditto + (well_known_creator_owner_sid): Ditto + (well_known_world_sid): Ditto + (cygsid::string): New method, substituting `convert_sid_to_string_sid'. + (cygsid::get_sid): New method, substituting `get_sid'. + (cygsid::getfromstr): New method, substituting + `convert_string_sid_to_sid'. + (cygsid::getfrompw): New method, substituting `get_pw_sid'. + (cygsid::getfromgr): New method, substituting `get_gr_sid'. + (cygsid::get_id): New method, substituting `get_id_from_sid'. + (get_admin_sid): Eliminated. + (get_system_sid): Ditto. + (get_creator_owner_sid): Ditto. + (get_world_sid): Ditto. + * grp.cc: Use new cygsid methods and well known sids throughout. + * registry.cc: Ditto. + * sec_acl.cc: Ditto. + * security.cc: Ditto. + * shared.cc: Ditto. + * syscalls.cc (seteuid): Ditto. Eliminate redundant conditional. + * uinfo.cc (internal_getlogin): Ditto. + * spawn.cc (spawn_guts) Revert previous patch. + +Tue May 15 10:20:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::ioctl): Convert s_addr + field to host byte order before comparing with INADDR_LOOPBACK. + +Tue May 15 9:03:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add autoload statements for ws2_32 functions + `WSACloseEvent', `WSACreateEvent', `WSAGetOverlappedResult', + `WSARecv', `WSARecvFrom', `WSASend', `WSASendTo' and `WSASetEvent', + `WSAWaitForMultipleEvents'. + * net.cc: Define wsock_evt. + (wsock_event): New class. + (cygwin_sendto): Use overlapped socket io if available. + (cygwin_recvfrom): Ditto. + (cygwin_recv): Ditto. + (cygwin_send): Ditto. + * security.cc (subauth): Set Win32 error to 0 to safely ask for the + error code of dynamically loaded function `LsaRegisterLogonProcess'. + +Mon May 14 15:37:29 2001 Christopher Faylor <cgf@cygnus.com> + + * errno.cc (_sys_errlist): Add missing commas. + +Mon May 14 16:13:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (subauth): Check if Secur32.dll could be loaded. + +Sun May 13 22:49:04 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Revert allow_ntsec check so that volume + info is always retrieved and isdisk setting is properly set. + +Sun May 13 14:02:36 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_tty.cc (fhandler_tty_common::dup): Preserve O_NOCTTY when + duping a filehandle. + +Sat May 12 18:19:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (rmdir): Rearrange slightly to allow removing directories + even when R/O attribute is set. + +Fri May 11 16:53:38 2001 Christopher Faylor <cgf@cygnus.com> + + * external.cc (fillout_pinfo): Use correct pids. + * path.cc (mount_info::conv_to_win32_path): Correct test for whether to + include a slash. + +Fri May 11 01:04:17 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Don't print message when executing + from a cygwin program. + +2001-05-10 Egor Duda <deo@logos-m.ru> + Christopher Faylor <cgf@redhat.com> + + * environ.cc (winenv): Always add SYSTEMDRIVE and SYSYEMROOT to + win32-style environment if they don't already exist. + +2001-05-10 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * path.cc (mount_info::conv_to_win32_path): Treat UNC paths the same as + paths including `:' or `\'. + +Wed May 9 14:46:32 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_termios::echo_erase): Declare new method. + * fhandler_termios.cc (fhandler_termios::echo_erase): New method for + echoing erase characters. + (fhandler_termios::line_edit): Check the echo flag before echoing + control characters (from Kazuhiro Fujieda <fujieda@jaist.ac.jp>). + +Wed May 9 10:43:30 2001 Christopher Faylor <cgf@cygnus.com> + + * include/pthread.h: Remove C++ comment. + +Tue May 8 11:09:59 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (_cfree): Add regparm attribute. + (_crealloc): Ditto. + + * dcrt0.cc (dll_crt0_1): Default to always checking for executable for now. + + * dtable.cc (dtable::not_open): Move method. + * dtable.h (dtable): Here. + + * exceptions.cc (ctrl_c_handler): Don't expect process group leader to + handle a signal if it doesn't exist. + + * fhandler.h (fhandler_base): Make openflags protected. + + * localtime.c (tzsetwall): Check for __CYGWIN__ as well as __WIN32__. + + * path.cc (path_conv::check): Add some comments. Change strcat to assignment. + + * lib/_cygwin_S_IEXEC.cc (_cygwin_bob__): Eliminate. + + * fhandler_tty.cc (fhandler_console::dup): Set controlling terminal if necessary. + * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto. + +Mon May 7 21:33:17 2001 Christopher Faylor <cgf@cygnus.com> + + * include/sys/file.h: Revert special X_OK usage. Just make it a + constant. + +Sun May 6 17:05:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.h (pthread_cond): New element cond_access to allow atomic + broadcasts. + * thread.cc (pthread_cond::pthread_cond): Initialise cond_access. + (pthread_cond::~pthread_cond): Destroy cond_access. + (pthread_cond::Broadcast): Use cond_access. + (pthread_cond::Signal): Use cond_access. + (pthread_cond_wait): Use cond_access. + (pthread_cond_timedwait): Use cond_access. + +Sun May 6 11:55:40 2001 Christopher Faylor <cgf@cygnus.com> + + * string.h (cygwin_strchr): Make 'static inline' so that things will + still work when optimized. + +Sat May 5 01:04:11 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Vastly increase test for exception + loop guard variable. + +Fri May 4 22:23:33 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (stack_info): Add some controls. + (stack_info::init): Add extra arguments to control method of + initialization.. If we have a known good frame, set things up so that + this frame is not skipped the first time through. Record whether + caller cares about arguments or not. + (stack_info::walk): Don't store arguments if they're unwanted. + (stackdump): Add isexception parameter for use when called by exception + handler. + (cygwin_stackdump): Accommodate extra argument to stackdump. + (handle_exceptions): Ditto. + (sig_handle): Ditto. + (interrupt_on_return): Accommodate extra arguments to stack walk + initialization. + +Fri May 4 21:05:20 2001 Christopher Faylor <cgf@cygnus.com> + + * localtime.c: Revert exclusion of windows.h. + +Fri May 4 17:03:16 2001 Christopher Faylor <cgf@cygnus.com> + + * string.h: Fix last-minute typo. + +Fri May 4 16:49:34 2001 Christopher Faylor <cgf@cygnus.com> + + * pinfo.h: Correctly set __SIGOFFSET. + + * path.cc (hash_path_name): Avoid calling library functions for simple + copying of characters. + + * shortcut.c: Use WIN32_LEAN_AND_MEAN. + * smallprint.c: Ditto. + + * environ.cc (getwinenv): Minor clarity fix. + + * localtime.c: No need to include windows.h + + * string.h: New file. + +Fri May 4 16:37:30 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (ctrl_c_handler): Always send signal to process if it + has no tty. + +2001-05-04 Egor Duda <deo@logos-m.ru> + + * fhandler_socket.cc (set_connect_secret): Use /dev/urandom to + generate secret cookie. + +Thu May 3 16:37:55 2001 Christopher Faylor <cgf@cygnus.com> + + * include/pthread.h (pthread_cleanup_push): Eliminate space preceding + arguments. + (pthread_cleanup_pop): Ditto. + +Thu May 3 18:16:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (wsock_init): Rename `was_in_progress' to `wsock_started' + for clearness. + +Thu May 3 10:44:16 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (handle_exceptions): Break out of "loop" if the + debugger doesn't seem to be attaching to our process. + +Wed May 2 20:18:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Use new definition of LoadDLLinitfunc throughout. + Redefine wrapper for wsock32.dll and ws2_32.dll. + (std_dll_init): New function. + * autoload.h: Rename LoadDLLinitfunc to LoadDLLinitfuncdef. + Add new defines LoadDLLinitfunc and LoadDLLstdfunc. + * net.cc (wsock_init): Add guard variable handling. Take care + to call WSAStartup only once. Load WSAStartup without using + autoload wrapper to eliminate recursion. Eliminate FIONBIO + and srandom stuff. + +Tue May 1 01:26:15 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::conv_to_win32_path): More path tweaking. + +Tue May 1 00:34:46 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mount_info::conv_to_win32_path): Fix debugging output to + avoid a SIGSEGV. Avoid double backslashes in middle of filename. + +Mon Apr 30 21:51:14 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (mkrelpath): New function. + (mount_info::conv_to_win32_path): Eliminate now-unneeded relative path + name arg and processing. + (path_conv::check): Accommodate relative path names again. Accommodate + one extra argument in mount_info::conv_to_win32_path. Tack trailing + slash on end of relative path as a side effect, like before. + * shared_info.h (mount_info::conv_to_win32_path): Reflect new argument + ordering. + +Mon Apr 30 22:09:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add LoadDLLinitfunc for secur32.dll. + Add LoadDLLfuncEx statements for AllocateLocallyUniqueId@4, + DuplicateTokenEx@24, LsaNtStatusToWinError@4, + LsaDeregisterLogonProcess@4, LsaFreeReturnBuffer@4, + LsaLogonUser@56, LsaLookupAuthenticationPackage@12, + LsaRegisterLogonProcess@12, + * environ.cc: Add extern declaration for `subauth_id'. + (subauth_id_init): New function for setting `subauth_id'. + (struct parse_thing): Add entry for `subauth_id'. + * fork.cc (fork_parent): Call `RevertToSelf' and + `ImpersonateLoggedOnUser' instead of `seteuid'. + * security.cc: Define global variable `subauth_id'. + (extract_nt_dom_user): New function. + (cygwin_logon_user): Call `extract_nt_dom_user' now. + (str2lsa): New static function. + (str2buf2lsa): Ditto. + (str2buf2uni): Ditto. + (subauth): Ditto. + * security.h: Add prototype for `subauth'. + * spawn.cc (spawn_guts): Use cygheap->user.token only if impersonated. + Use `cygsid' type. Remove impersonation before allowing access to + workstation/desktop to everyone. Call `RevertToSelf' and + `ImpersonateLoggedOnUser' instead of `seteuid'. + * syscalls.cc (seteuid): Rearranged to allow using subauthentication + to retrieve user tokens when needed. + +Mon Apr 30 20:26:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (internal_getlogin): Formatting change. + +Mon Apr 30 19:58:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc: Eliminate MAX_DOMAIN_NAME define. + (read_etc_group): Substitute MAX_DOMAIN_NAME by + INTERNET_MAX_HOST_NAME_LENGTH. + * passwd.cc (parse_pwd): Don't force pw_name to be lower case. + * sec_helper.cc: Substitute MAX_USER_NAME by UNLEN, + MAX_COMPUTERNAME_LENGTH by INTERNET_MAX_HOST_NAME_LENGTH throughout. + (lookup_name): Slight cleanup. + * security.cc (alloc_sd): Substitute MAX_USER_NAME by UNLEN. + * security.h: Define DEFAULT_UID as DOMAIN_USER_RID_ADMIN and + DEFAULT_GID as DOMAIN_ALIAS_RID_ADMINS. + * shared.cc (memory_init): Substitute MAX_USER_NAME by UNLEN. + * thread.h: Ditto. + * uinfo.cc (internal_getlogin): Substitute MAX_USER_NAME by UNLEN. + Substitute MAX_COMPUTERNAME_LENGTH and MAX_HOST_NAME by + INTERNET_MAX_HOST_NAME_LENGTH. + * winsup.h: Include lmcons.h. Eliminate MAX_USER_NAME and + MAX_HOST_NAME. Move DEFAULT_UID and DEFAULT_GID to security.h. + +Mon Apr 30 12:35:40 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Don't use path_flags when converting to + MS-DOS syntax unless parsing tail of path component. Stop parsing path + when we reach the 'root' of the path. Correctly copy tail to path + component. + +Sun Apr 29 22:28:06 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (INIT_EXCEPTION_HANDLER): Eliminate. + (init_exceptions): Just use init_exception_handler. + (open_stackdumpfile): New function. + (stack_info::first_time): Eliminate. + (stack_info::init): Set up fields to avoid "first_time" consideration. + (stack_info::walk): Remove "first_time" consideration. + (stackdump): Change arguments to accept initial frame pointer and open + stack file flag. + (stack): Eliminate. + (cygwin_stackdump): Use stackdump() rather than stack(). + (try_to_debug): Remove all synchronization logic. Just keep looping in + exception handler until debugger notices us. Return 1 if successfully + started debugger. + (handle_exceptions): Just return if we know that we're debugging. + Reorganize to avoid creating a stackdump file if we are starting a + debugger. Return from exception handler if debugger started + successfully. + (sig_handle): Create a stackdump only if debugger wasn't started. + * winsup.h (try_to_debug): Add an argument. + +Sun Apr 29 21:41:25 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (symlink_info::check): Remove extra arguments, move + functionality back to path_conv::check. Clear symlink bit from pflags + argument before detecting if this is a symlink. + (path_conv::check): Convert posix path here instead of + symlink_info::check. Only grab volflags when using ntsec. + (symlink_info::check_case): Just replace appropriate part of input + path. + +Sat Apr 28 19:36:13 2001 Christopher Faylor <cgf@cygnus.com> + + Throughout, change 'tty_attached' to 'real_tty_attached', for clarity. + Throughout, change 'OutputStopped' to 'output_stopped', for + consistency. + * dtable.cc (stdio_init): Set controlling tty if not set by stdio + opens. + * exceptions.cc (ctrl_c_handler): Avoid special pgid checking if no tty + is associated with the process. + (Suggested by Tim Baker <dbaker@direct.ca>) + * external.cc (fillout_pinfo): Return actual tty number for ctty. + * fhandler_console.cc (get_tty_stuff): Set ctty when shared memory is + allocated. Accept flags input from open(). + (set_console_ctty): New function. + (fhandler_console::open): Pass flags to get_tty_stuff and rely on this + function to set the ctty, if appropriate. + * fhandler_termios.cc (fhandler_termios::set_ctty): Move to tty_min + class. + * fhandler_tty.cc (fhandler_tty_slave::open): Use tc field to access + set_ctty(). + * tty.h (TTY_CONSOLE): Move to include/sys/cygwin.h. + (tty_min): Add set_ctty class here. + * include/sys/cygwin.h (TTY_CONSOLE): New home here. + + * path.cc (symlink_info): Make contents an actual buffer. Pass more + flags to case_check. + (path_conv::check): Reorganize to do parsing based on posix path rather + than native path. + (symlink_info::check): Expect posix path as input. Translate to native + path here. Accept path_conv flags. Stop parsing if not a symlink + regardless of whether previous path was a symlink. + +2001-04-27 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * thread.cc (thread_init_wrapper): Use _REENT_INIT to initialize the + reent structure of newlib. + +Fri Apr 27 14:02:24 2001 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sig_send): Add exception parameter to sig_send. + * sigproc.cc (sig_send): Ditto. Use it when setting frame info. + * exceptions.cc (handle_exceptions): Use exception flag when calling + sig_send. + +2001-04-27 Egor Duda <deo@logos-m.ru> + + * tty.cc (tty::make_pipes): Set to_slave pipe mode to nonblocking. + * fhandler_tty.cc (fhandler_pty_master::accept_input): If pipe buffer + is full, give slave a chance to read data. + +2001-04-26 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * security.cc (alloc_sd): Add unrelated ACCESS_ALLOWED_ACE behind + the `everyone' ACE. + +Wed Apr 25 15:07:37 2001 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h [sigthread]: Add exception field. + [sigframe::~sigframe]: Clear exception field. + [sigframe::set]: Set exception field from caller. + * sigproc.cc (sig_send): Set exception field when frame pointer is + passed in. + * exceptions.cc (interrupt_on_return): Always treat exception as + interruptible. + +2001-04-25 Egor Duda <deo@logos-m.ru> + + * cygwin.din: Export asctime_r, ctime_r, gmtime_r, localtime_r + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 39 + +Wed Apr 25 10:57:36 2001 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump minor version number. + * childinfo.h: Bump child structure magic number. + +2001-04-25 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * uinfo.cc (internal_getlogin): Return pointer to struct passwd. + (uinfo_init): Accommodate the above change. + * syscalls.cc (seteuid): Ditto. + +Tue Apr 25 11:08:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add LoadDLLfunc statements for SetTokenInformation@16. + * cygheap.cc: Include security.h. + * grp.cc (internal_getgrent): New function. + (getgroups): Rearranged using `internal_getgrent' and the new + `cygsid' class. + * passwd.cc (internal_getpwent): New function. + * sec_acl.cc: Use new `cygsid' class throughout. + (acl_access): Use `internal_getgrent' instead of `getgrent'. + * sec_helper.cc: Use new `cygsid' class throughout. + (get_id_from_sid): Use `internal_getgrent' instead of `getgrent'. + Use `internal_getpwent' instead of `getpwent'. + * security.cc: Use new `cygsid' class throughout. + * security.h: Move `MAX_SID_LEN' from winsup.h to here. + Add extern declarations for `internal_getgrent' and `internal_getpwent'. + (class cygsid): New class. + * shared.cc (sec_user): Use new `cygsid' class. + * syscalls.cc (seteuid): Try to set owner to user and primary group to + current group in impersonation token before performing impersonation. + (setegid): Try to set primary group in process token to the new group + if ntsec is on. + * uinfo.cc (internal_getlogin): Use new `cygsid' class. + Try to set owner to user and primary group to current group in process + token if the process has been started from a non cygwin process. + (uinfo_init): Set primary group only if the process has been started + from a non cygwin process. + * winsup.h: Move define for `MAX_SID_LEN' to security.h. + +Mon Apr 16 23:20:00 2001 Andy Younger <andylyounger@hotmail.com> + + * fhandler_dsp.cc: Improved handling of 8 bit playback modes. + Put in mock support for SNDCTL_DSP_SETFRAGMENT. + +Tue Apr 24 23:51:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (getpwnam_r): Add pw_passwd handling as well. + (getpwuid_r): Ditto. + +Tue Apr 24 23:43:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (getpwnam_r): Use correct offsets into buffer. + Copy pw_gecos field as well. + (getpwuid_r): Ditto. + +2001-04-24 Egor Duda <deo@logos-m.ru> + + * dlmalloc.c: New file. Port of Doug Lea's malloc + * dlmalloc.h: Ditto. + * Makefile.in: Add support for MALLOC_DEBUG + * config.h.in: Ditto. + * winsup.h: Ditto. + * configure.in: Add --enable-malloc-debugging option. + * configure: Regenerate. + * debug.h: Include declarations for debugging malloc. + * tty.cc (grantpt): Fix definition. + (unlockpt): Ditto. + +Mon Apr 23 22:00:29 2001 Christopher Faylor <cgf@cygnus.com> + + Remove trailing underscore from fhandler_base and friends, throughout. + * fhandler.h (fhandler_base::set_open_status): New method. Stores + original open status. + (fhandler_base::get_open_status): New method. Retrieves original open + status. + (fhandler_base::reset_to_open_binmode): New method. + * fhandler.cc (fhandler_base::open): Save open status. + (fhandler_base::init): Ditto. + * fhandler_clipboard.cc (fhandler_clipboard::open): Ditto. + * fhandler_console.cc (fhandler_console::open): Ditto. + * fhandler_dsp.cc (fhandler_dsp::open): Ditto. + * fhandler_dev_mem.cc (fhandler_dev_mem::open): Ditto. + * fhandler_dev_random.cc (fhandler_dev_random::open): Ditto. + * fhandler_serial.cc (fhandler_serial::open): Ditto. + * fhandler_tty_slave.cc (fhandler_tty_slave::open): Ditto. + * fhandler_tty_master.cc (fhandler_tty_master::open): Ditto. + * fhandler_dev_zero.cc (fhandler_dev_zero::open): Ditto. + * syscalls.cc (setmode): Rework so that 0 mode value causes reversion + to open state. + + * fhandler_tty_slave.cc (fhandler_tty_slave::read): Use correct + multiplier when converting from deciseconds to milliseconds. + +Mon Apr 23 13:28:35 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.h (fhandler_base::clear_r_binary): New method. + (fhandler_base::clear_w_binary): New method. + * syscalls.cc (setmode): Accept 0 as mode value. Resets text/binary + behavior for fd to default. + +Mon Apr 23 12:46:07 2001 Christopher Faylor <cgf@cygnus.com> + + * net.cc [errmap]: Add '0' condition. + (find_winsock_errno): Don't translate no error to EPERM. + +Sun Apr 22 20:48:24 2001 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump Cygwin version and API version. + +Mon Apr 23 9:27:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (MTinterface::Init): Always initialise per process variables. + +Sun Apr 22 19:18:18 2001 Christopher Faylor <cgf@cygnus.com> + + * features.h: Reinstate as wrapper for sys/features.h. + +Mon Apr 23 0:10:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Reformat comment. + * shared.cc: Drop function declarations already in security.h. + +Sun Apr 22 12:17:57 2001 Christopher Faylor <cgf@cygnus.com> + + * shortcut.c (check_shortcut): Close input file handle before + returning. + * path.cc (check_sysfile): Ditto. + (symlink_info::check): Rely on opened file handle being closed by + symlink checking routines. Set ext_tacked_on when .lnk is detected. + +Sat Apr 21 19:26:05 2001 Christopher Faylor <cgf@cygnus.com> + + * thread.cc (MTinterface::Init): Remove accidentally checked in code. + +Sun Apr 22 00:22:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * passwd.cc (getpwuid): Check for thread cancellation. + (getpwuid_r): Ditto. + (getpwname): Ditto. + (getpwnam_r): Ditto. + * thread.h (pthread_mutex): New constructors for pshared operation. + (MTinterface): Associative array for pshared mutex's. + * thread.cc (MTinterface::Init): Initailize pshared mutex array. + (pthread_cond::BroadCast): Implementation notes. + (pthread_cond::TimedWait): Remove use of SignalObjectAndWait on non-NT systems. + (pthread_mutex::pthread_mutex(unsigned short)): New function. + (pthread_mutex::pthread_mutex (pthread_mutex_t *, pthread_mutexattr *)):New function. + (pthread_mutex::pthread_mutex(pthread_mutexattr *)): Fail on pshared mutex's. + (__pthread_mutex_getpshared): New function. + (__pthread_join): Check for thread cancellation. + (__pthread_cond_timedwait): Support pshared mutex's. + (__pthread_cond_wait): Ditto. + (__pthread_condattr_setpshared): Error on PROCESS_SHARED requests. + (__pthread_mutex_init): Support pshared mutex's. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutexattr_setpshared): Support PTHREAD_PROCESS_PSHARED requests. + +Fri Apr 20 19:38:29 2001 Christopher Faylor <cgf@cygnus.com> + + * cygwin.din: Add *scanf and *scan_r functions. + +Fri Apr 20 22:25:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_process_privileges): Swap out. + * sec_helper.cc (set_process_privilege): Rename from + `set_process_privileges'. Takes the privilege to enable or disable + as parameter now. + * security.h: Add prototype for `set_process_privileges'. + +2001-04-19 Egor Duda <deo@logos-m.ru> + + * path.cc (path_conv::check): Always initialize member variables. + +Fri Apr 20 12:27:49 2001 Christopher Faylor <cgf@cygnus.com> + + * include/sys/file.h: More cleanup for X_OK. + +Fri Apr 20 11:48:45 2001 Christopher Faylor <cgf@cygnus.com> + + * include/sys/file.h: Move X_OK protection earlier. + + * dtable.cc (dtable::vfork_child_fixup): Avoid closing already closed + handles. + +Fri Apr 20 16:29:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgroups): Change so that SIDs get compared instead + of strings to SIDs. + +Fri Apr 20 14:50:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add object files `sec_helper.cc' and `sec_acl.cc'. + * security.cc: Swap out several functions. + * sec_acl.cc: New file. Move Sun compatibel ACL functions from + `security.cc' to here. + * sec_helper.cc: New file. Move security helper functions from + `security.cc' to here. + * security.h: Changed to accommodate the above changes. + +Fri Apr 20 14:12:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc: Replace `group_in_memory_p' by `group_state'. + Eliminate group_sem throughout. + (enum grp_state): New enumeration type. + (read_etc_group): Make race safe. + * security.cc: Eliminate group_sem throughout. + +Thu Apr 19 9:40:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Drop usage of the same memory area if the same + region of the same file is mapped twice. + +Wed Apr 18 16:53:54 2001 Christopher Faylor <cgf@cygnus.com> + + Throughout, change fdtab references to cygheap->fdtab. + * child_info.h (cygheap_exec_info): Eliminate special fdtab stuff. + * spawn.cc (spawn_guts): Ditto. + * cygheap.cc (cygheap_init): Initialize fdtab, if appropriate. + * cygheap.h (CYGHEAPSIZE): Include size of init_cygheap. + (_cmalloc_entry): Include fdtab here. + * dtable.h (dtable): Declare/define new methods. + * dtable.cc (dtable::vfork_child_fixup): New method. + (dtable::fixup_after_exec): Remove unneeded extra arguments. + * dcrt0.cc (dll_crt0_1): Ditto. + + * environ.cc (getwinenv): Use case sensitive comparison. + (winenv): Make a copy of environment cache to avoid realloc problems + when duplicate environment variables exist in the environment. (From + Egor Duda) + + * net.cc (cygwin_socket): Revert Apr 14 change. + + * include/sys/file.h: Protect against previous X_OK definition. + +Tue Apr 17 12:18:28 2001 Christopher Faylor <cgf@cygnus.com> + + * passwd.cc: Eliminate passwd_sem throughout. + * security.cc: Ditto. + +Tue Apr 17 12:18:28 2001 Robert Collins <rbtcollins@hotmail.com> + + * cygwin.din: Export New functions. + * passwd.cc (read_etc_passwd): Make race safe. + (getpwuid_r): New function. + (getpwnam_r): New function. + +2001-04-18 Egor Duda <deo@logos-m.ru> + + * grp.cc (getgroups): Avoid crash if passwd field if /etc/group is + empty. + +Tue Apr 17 19:05:44 2001 Christopher Faylor <cgf@cygnus.com> + + * path.h (path_conv::add_ext_from_sym): Declare. + * path.cc (path_conv::add_ext_from_sym): Convert to pure inline method. + +Tue Apr 17 18:50:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (windows_device_names): Add missing NULL element. + +Tue Apr 17 12:14:54 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (windows_device_names): Move dsp to proper location. + +Tue Apr 17 13:44:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Set case_clash even if pcheck_case + is set to PCHECK_ADJUST when a case clash is given for the last + component in path. + (symlink_info::case_check): Ditto. + * syscalls.cc (_rename): Avoid overwriting an already existing file + if a case clash is given even if pcheck_case is set to PCHECK_ADJUST. + +Tue Apr 17 2:07:07 2001 Christopher Faylor <cgf@cygnus.com> + + * config.h.in: Turn off VFORK again. + +Mon Apr 16 23:45:24 2001 Christopher Faylor <cgf@cygnus.com> + + * path.h (cwdstuff): Move class. + * cygheap.h (cwdstuff): To here. + (init_cygheap): Add cwd field. + * child_info.h (cygheap_exec_info): Eliminate cwd stuff. + (child_info_spawn): Ditto. + * dcrt0.cc (dll_crt0_1): Remove cygcwd.fixup_after_exec call. Convert + cygcwd reference to cygheap->cwd. + * path.cc: Ditto, throughout. + (cwdstuff::copy): Eliminate. + (cwdstuff::fixup_after_exec): Ditto. + * spawn.cc (spawn_guts): Eliminate call to cygcwd.copy. + + * fhandler.h (FH_OSS_DSP): Move into "fast" device category. + +Mon Apr 16 19:19:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Move fh_paging_file from some functions to be + a global static variable. + (class mmap_record): Add `devtype_' member to remember + the device type of the file. Add declaration for methods + `get_device', `alloc_fh' and `free_fh'. + (mmap_record::mmap_record): Initialize `devtype_' correctly. + (mmap_record::alloc_fh): New method. + (mmap_record::free_fh): Ditto. + (munmap): Use new mmap_record::alloc_fh and mmap_record::free_fh + methods to create a correct fhandler. + (msync): Ditto. + (fixup_mmaps_after_fork): Ditto. + +Mon Apr 16 16:01:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgroups): If `allow_ntsec' is set, use the process token + information to evaluate the groups list. + +Mon Apr 16 00:08:02 2001 Christopher Faylor <cgf@cygnus.com> + + * features.h: Remove this file as it is now being supplied by newlib. + +Sun Apr 15 23:23:29 2001 Christopher Faylor <cgf@cygnus.com> + + * autoload.cc: Add winmm functions needed by fhandler_dsp.cc. + +Sun Apr 15 22:53:52 2001 Andy Younger <andylyounger@hotmail.com> + + * fhandler_dsp.cc: New file. Implements OSS like /dev/dsp. + * include/sys/soundcard.h: New file. User land includes for OSS + /dev/dsp. + * fhandler.h: Add new class fhandler_dev_dsp and a FH_OSS_DSP + definition. + * dtable.cc (dtable::build_fhandler): Allow creation of the /dev/dsp + device. + * path.cc (windows_device_names): Add /dev/dsp into list of device + names. + * Makefile.in (DLL_OFILES): Add fhandler_dsp.o. + +Sun Apr 15 16:36:27 2001 Christopher Faylor <cgf@cygnus.com> + + * uname.c (uname): Default n in in86 to 6 if Windows returns > 6. + +Sun Apr 15 15:56:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (add_ext_from_sym): Redefine to call `add_ext_from_sym_'. + (add_ext_from_sym_): New inline function. + +Sat Apr 14 19:23:52 2001 Christopher Faylor <cgf@cygnus.com> + + * config.h.in: Turn on VFORK by default. + +Sat Apr 14 18:04:35 2001 Christopher Faylor <cgf@cygnus.com> + + * net.cc (cygwin_socket): Set SO_LINGER to small value so closed UNIX + domain sockets will not stay around. + +Sat Apr 14 18:01:43 2001 Pierre A. Humblet <Pierre.Humblet@ieee.org> + + * select.cc (socket_cleanup): Set SO_LINGER to small value so closed + dummy sockets do not stay around. Use correct value for second argument + to shutdown. + +Sat Apr 14 17:04:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.h (MTinterface): Add threadcount. + * thread.cc (MTinterface::Init): Set threadcount to 1. + (__pthread_create): Increment threadcount. + (__pthread_exit): Decrement threadcount and call exit() from the last thread. + +Fri Apr 13 11:34:24 2001 Robert Collins <rbtcollins@hotmail.com> + + * fork.cc (fork_child): Call the __pthread_atforkchild function. + (fork_parent): Call the __pthread_atforkparent function. + * cygwin.din: Export pthread_atfork. + * thread.h (callback): New class. + (MTinterface): Use it. + * thread.cc (__pthread_atforkprepare): New function. + (__pthread_atforkparent): New function. + (__pthread_atforkchild): New function. + (__pthread_atfork): New function. + * pthread.cc (pthread_atfork): New function. + +Fri Apr 13 9:52:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (add_ext_from_sym): New define evaluating `known'suffix'. + (path_conv::check): Use add_ext_from_sym throughout. + +Thu Apr 12 23:19:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (mkdir): Check for case clash. + * environ.cc: Add extern declaration for `pcheck_case'. + (check_case_init): New function. + (struct parse_thing): Add "check_case" option. + * errno.cc (_sys_nerrlist): Add text for ECASECLASH. + (strerror): Add case branch for ECASECLASH. + * fhandler.cc (fhandler_disk_file::open): Check for case clash. + * path.cc: Add global variable `pcheck_case'. + (struct symlink_info): Add member `case_clash' and method `case_check'. + (path_prefix_p_): Call `pathnmatch' instead of `strncasematch'. + (pathnmatch): New funtion. + (pathmatch): Ditto. + (path_conv::check): Add handling for case checking. + (symlink): Check for case clash. + (symlink_info::check): Add parameter for case checking. + Handle case checking. + (symlink_info::case_check): New method. + (chdir): Don't use unconverted path if pcheck_case==PCHECK_STRICT. + * path.h: Add extern declarations for `pathmatch' and + `pathnmatch'. + (enum case_checking): New enumeration type describing + the case checking behaviour of path conversion routines. + (class path_conv): Add member `case_clash'. + * syscalls.cc (_link): Check for case clash. + +Thu Apr 12 12:49:53 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (mkfifo): New function stub. + +2001-04-12 Robert Collins <rbtcollins@hotmail.com> + + * configure.in: Remove PTH_ALLOW. + * cygwin.din: Remove @PTH_ALLOW@ prefixes to pthread functions. Add + new pthread exports. + * pthread.cc: New wrapper functions for the above new exports. + * sched.cc (valid_sched_parameters): New function. + (sched_setparam): Use it. + (sched_set_thread_priority): New function. Used by pthread_sched*. + * thread.cc (pthread_key_destructor::InsertAfter): New function. + (pthread_key_destructor::UnlinkNext): New function. + (pthread_key_destructor::Next): New function. + (pthread_key_destructor_list::Insert): New function. + (pthread_key_destructor_list::Remove): New function. + (pthread_key_destructor_list::Pop): New function. + (pthread_key_destructor::pthread_key_destructor): New function. + (pthread_key_destructor_list::IterateNull): New function. + (MTinterface::Init): Initialise new member. + (pthread::pthread): Initialise new members. + (pthread::create): Copy new attributes. Set the new thread priority. + (pthread_attr::pthread_attr): Initialise new members. + (pthread_key::pthread_key): Setup destructor function. + (pthread_key::~pthread_key): Remove destructor function. + (pthread_mutexattr::pthread_mutexattr): New function. + (pthread_mutexattr::~pthread_mutexattr): New function. + (__pthread_once): New function. + (__pthread_cleanup): New function. + (__pthread_cancel): New function. + (__pthread_setcancelstate): New function. + (__pthread_setcanceltype): New function. + (__pthread_testcancel): New function. + (__pthread_attr_getinheritsched): New function. + (__pthread_attr_getschedparam): New function. + (__pthread_attr_getschedpolicy): New function. + (__pthread_attr_getscope): New function. + (__pthread_attr_setinheritsched): New function. + (__pthread_attr_setschedparam): New function. + (__pthread_attr_setschedpolicy): New function. + (__pthread_attr_setscope): New function. + (__pthread_exit): Call any key destructors on thread exit. + (__pthread_join): Use the embedded attr values. + (__pthread_detach): Use the embedded attr values. + (__pthread_getconcurrency): New function. + (__pthread_getschedparam): New function. + (__pthread_key_create): Pass the destructor on object creation. + (__pthread_key_delete): Correct incorrect prototype. + (__pthread_setconcurrency): New function. + (__pthread_setschedparam): New function. + (__pthread_cond_timedwait): Support static mutex initialisers. + (__pthread_cond_wait): Ditto. + (__pthread_mutex_getprioceiling): New function. + (__pthread_mutex_lock): Support static mutex initialisers. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): New function. + (__pthread_mutexattr_getprotocol): New function. + (__pthread_mutexattr_getpshared): New function. + (__pthread_mutexattr_gettype): New function. + (__pthread_mutexattr_init): New function. + (__pthread_mutexattr_destroy): New function. + (__pthread_mutexattr_setprotocol): New function. + (__pthread_mutexattr_setprioceiling): New function. + (__pthread_mutexattr_getprioceiling): New function. + (__pthread_mutexattr_setpshared): New function. + (__pthread_mutexattr_settype): New function. Remove stubs for non + MT_SAFE compilation. + * thread.h: Remove duplicate #defines. Add prototypes for new + functions in thread.cc. + (pthread_key_destructor): New class. + (pthread_key_destructor_list): New class. + (pthread_attr): Add new members. + (pthread): Remove members that are duplicated in the pthread_attr + class. + (pthread_mutex_attr): Add new members. + (pthread_once): New class. + * include/pthread.h: Add prototypes for new functions exported from + cygwin1.dll. Remove typedefs. + * include/sched.h: Add prototypes for new functions in sched.cc. + * include/cygwin/types.h: Add typedefs from pthread.h + +Tue Apr 10 22:02:53 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (struct symlink_info): Add extn and ext_tacked_on fields. + (path_conv::check): Only tack on extension if a known one didn't + already exist. + (suffix_scan::has): Return pointer to known extension. + (symlink_info::check): Record location of extension, if any. + +2001-04-09 Egor Duda <deo@logos-m.ru> + + * fhandler.h (class fhandler_socket): Add members and methods to + support secure connections on AF_UNIX sockets. + * fhandler_socket.cc (fhandler_socket::set_connect_secret): New method. + (fhandler_socket::get_connect_secret): Ditto. + (fhandler_socket::create_secret_event): Ditto. + (fhandler_socket::close_secret_event): Ditto. + (fhandler_socket::check_peer_secret_event): Ditto. + (fhandler_socket::fixup_after_fork): Duplicate secret event to child. + (fhandler_socket::dup): Copy address family. + (fhandler_socket::close): Close secret event. + * net.cc (get_inet_addr): Read secret cookie. + (cygwin_connect): Check if peer knows secret cookie value. + (cygwin_accept): Ditto. Copy address family to newly created socket. + (cygwin_bind): Generate and write secret cookie. + (wsock_init): Initialize random number generator. + +Sun Apr 8 20:40:58 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Put -lgcc last in list of libraries, since stdc++ + library needs it. + * cygwin.din: Remove obsolete "__empty" export. + * exceptions.cc (call_signal_handler_now): Force inclusion of function + even when -finline-functions is specified. + * sigproc.h: Remove obsolete call_signal_handler declaration. + +Sun Apr 8 20:36:55 2001 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> + + * fhandler_console.cc (cp_get_internal): New function. + (cp_convert): New function. + (con_to_str): New function. + (str_to_con): New function. + (fhandler_console::read): Replace OemToCharBuff with con_to_str. + (fhandler_console::write_normal): Replace CharToOemBuff with str_to_con. + +Thu Apr 5 22:41:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat_worker): Fix conditional which still allowed + successful stat'ing of non-existant files. + +Wed Apr 4 10:37:44 2001 Christopher Faylor <cgf@cygnus.com> + + * child_info.h: Bump magic number for fork/exec/spawn. + +Tue Apr 3 20:06:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_FILE_INVALID to ENXIO. + +Mon Apr 2 22:48:58 2001 Christopher Faylor <cgf@cygnus.com> + + * cygrun.c (main): Fix compiler warning. + * gmon.c (_mcleanup): Ditto. + * profil.c (profile_off): Ditto. + + * net.cc (find_winsock_errno): New function. + (__set_winsock_errno): Use find_winsock_errno. + (cygwin_setsockopt): Detect SO_ERROR for debugging. + (cygwin_getsockopt): Ditto. Translate error when getsockopt returns + SO_ERROR. + * winsup.h: regparmize __set_winsock_errno. + * include/sys/strace.h: Document that strace functions can't use + regparm. + +2001-04-02 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * fhandler.cc (fhandler_disk_file::open): Avoid checking a magic + number of a directory. + +Mon Apr 2 00:24:08 2001 Christopher Faylor <cgf@cygnus.com> + + * shared_info.h (mount_info): Remove mnt_ elements. + * thread.h (struct _winsup_t): Add mnt_ elements. + * path.cc (fillout_mntent): Use mnt_ elements from reent_winsup (). + +Sun Apr 1 20:10:34 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sigframe::call_signal_handler): Return value of + call_signal_handler_now. + * sigproc.h (sigframe): Use constructor. + * syscalls.cc (_read): Correct errno test prior to calling signal + handler. + +Sun Apr 1 00:38:06 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sigframe::call_signal_handler): Move outside of "C" + block or some compilers will complain. + +Sun Apr 1 00:24:14 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (call_signal_handler_now): Rename from + call_signal_handler to avoid C++ confusion. + +Sun Apr 1 00:08:15 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (fillout_mntent): Always remove drive root directories from + future consideration by "/cygdrive" reporting. + (cygdrive_getmnt): Avoid reporting removable drives or drives with no + media mounted. + +Sat Mar 31 21:56:19 2001 Christopher Faylor <cgf@cygnus.com> + + * thread.h (struct _winsup_t): Remove obsolete elements. Add + available_drives element. + * path.cc (mount_info::getmntent): Report "/cygdrive" drives when + mounted drives are exhausted. + (fillout_mntent): New function. + (mount_item::getmntent): Use fillout_mntent. + (cygdrives_mntent): New function. Returns next available "/cygdrive". + (setmntent): Initialize available "/cygdrives". + * syscalls.cc: Remove some if 0'ed code. + * times.cc (timezone): Use more descriptive variable name. + +Sat Mar 31 18:59:52 2001 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (class sigframe): Implement 'unregister()' method. + (sigframe::~sigframe): Use unregister method. + (sigframe::call_signal_handler): Declare new method. + * exceptions.cc (sigframe::call_signal_handler): New method. + Unregisters current sigframe before calling signal handler. + (setup_handler): Clear waiting threads prior to arming signal_arrived. + * syscalls.cc (_read): Change goto to loop. Recalculate sigframe + inside of loop so that constructor is called when appropriate. + * wait.cc (wait4): Ditto. + + * signal.cc: Change "sig" to "signal" in debugging messages throughout. + * sigproc.cc: Ditto. + +Sat Mar 31 17:12:08 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_serial.cc (fhandler_serial::raw_write): Close protected + handles with ForceCloseHandle or suffer spurious warnings. + +Sat Mar 31 16:23:32 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler.cc (fhandler_base::read): Remove special handling of CTRL-Z. + +Sat Mar 31 11:09:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_console): Add members `insert_mode'. + * fhandler_console.cc (fhandler_console::dup): Duplicate `insert_mode'. + (fhandler_console::fhandler_console): Initialize `insert_mode'. + (fhandler_console::char_command): Add terminal capabilities + "enter insert mode" = \E[4h and "exit insert mode" = \E[4l. + Care for insert mode on terminal capability "repeat char" = \E[x;yb. + (fhandler_console::write_normal): Care for insert mode before writing + to the console. + (array keytable): Add keymapping for modified cursor and control + block keys (xterm like). + +Fri Mar 30 13:02:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_console): Add members `savebufsiz' and + `savebuf' to allow save/restore of screen. + * fhandler_console.cc (fhandler_console::dup): Duplicate `savebufsiz' + and `savebuf'. + (fhandler_console::fhandler_console): Initialize `savebufsiz' and + `savebuf'. + (fhandler_console::char_command): Add terminal capabilities + "save screen content" = \E[?47h and "restore screen content" = \E[?47l. + +Wed Mar 28 19:28:50 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (chdir): Eat trailing whitespace on input path. + +Tue Mar 27 22:38:42 2001 Christopher Faylor <cgf@cygnus.com> + + * lib/_cygwin_S_IEXEC.c: Remove "const" from globals or they never seem + to be defined. Wrap definitions in extern "C". Include winsup.h to + assure proper definitions. + + * dcrt0.cc (dll_crt0_1): Call stdio_init after premain run so that + binmode.o, etc., will control default stdio settings. + * dtable.cc (dtable::init_std_file_from_handle): Allow __fmode to force + binmode/textmode settings. Default pipes to binmode. + +Tue Mar 27 11:31:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Fix conditional for previous patch. + +Mon Mar 26 18:48:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Outflank copy-on-write problem on 9x by + setting access mode to FILE_MAP_READ when read access is requested. + +Sun Mar 25 20:12:21 2001 Christopher Faylor <cgf@cygnus.com> + + * dlfcn.cc (check_access): Eliminate. + (check_path_access): Use passed in path_conv buf. + (get_full_path_of_dll): Use passed in name buf to avoid a static. Rip + out most of the path checking since LoadLibrary will do all of this + automatically. + (dlopen): Set errno when appropriate (may not be compliant?). + * environ.cc (posify): Don't pass in "native" path if it seems to + actually be posix. + +Thursday Mar 22 2001 Robert Collins <rbtcollins@hotmail.com> + + * fhandler.h (fhandler_dev_clipboard): Extend to support writing. + * fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard): + Initialize new fields. Open clipboard here. + (fhandler_dev_clipboard::dup): New method. + (fhandler_dev_clipboard::open): Accommodate new fields. Register + clipboard here, if appropriate. + (set_clipboard): New function. Moves buffer to clipboard. + (fhandler_dev_clipboard::write): Truly implement clipboard writing. + (fhandler_dev_clipboard::read): Reimplement to allow successive reads. + (fhandler_dev_clipboard::lseek): Truly implement seeks in clipboard. + (fhandler_dev_clipboard::close): Clear out new fields. Support + sequential reads and sequential writes. Support for binary data via a + native clipboard format. + +2001-03-22 Egor Duda <deo@logos-m.ru> + + * fhandler_console.cc (fhandler_console::set_default_attr): Update + console color attributes on tty reset. + +Wed Mar 21 22:12:36 2001 Christopher Faylor <cgf@cygnus.com> + + * autoload.cc (kernel32_init): New function for kernel32 autoload + initialization. + (SignalObjectAndWait): Add conditional load of this function when it is + available. + +2001-03-21 Robert Collins <rbtcollins@hotmail.com> + + * sched.cc: New file. Implement sched*. + * include/sched.h: New file. User land includes for sched*. + * Makefile.in: Add sched.o + * cygwin.din: Add exports for sched*. + +Tue Mar 20 14:48:46 2001 Christopher Faylor <cgf@cygnus.com> + + * dtable.cc: Guard against new winsock.h/winsock2.h warnings when + mixing winsock*.h and sys/types.h. + * fhandler_socket.cc: Ditto. + * net.cc: Ditto. + * select.cc: Ditto. + * exceptions.cc: Remove unneeded define. + +Mon Mar 19 17:43:29 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (interruptible): Update debugging output. + (setup_handler): Ensure that wait_sig loop wakes up when we punt on + sending a signal. + * poll.cc (poll): Add signal guard here. + +2001-03-19 Egor Duda <deo@logos-m.ru> + + * tty.h (tty::create_inuse): Add new parameter to allow non- + inheritable 'inuse' events. + * tty.cc (tty::create_inuse): Use new parameter. + * fhandler_tty.cc (fhandler_tty_master::init): Ditto. + * fhandler_tty.cc (fhandler_pty_master::open): Ditto. + * fhandler_tty.cc (fhandler_tty_master::init): Create master_alive + event. + * tty.cc (tty_list::terminate): Close master_alive event. + * fhandler_tty.cc (fhandler_tty_common::close): Send EOF to slaves + when master side is closed. + +Mon Mar 19 14:32:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (map::get_list_by_fd): Avoid calling `get_namehash' when + file descriptor is -1. + +Sat Mar 17 18:30:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (check_posix_perm): New static function. + (fpathconf): Add _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY + support. + (pathconf): Ditto. + * include/cygwin/version.h: Bump API minor number to 37. + +2001-03-18 Egor Duda <deo@logos-m.ru> + + * fhandler.h (fhandler_tty_slave): Declare new methods. + * select.cc (fhandler_tty_slave::select_read): New method. + * select.cc (fhandler_tty_slave::ready_for_read): Ditto. + * select.cc (verify_tty_slave): New function. + * fhandler_termios.cc (fhandler_termios::line_edit): Empty input + buffer on signal. + * fhandler_tty.cc (fhandler_tty_slave::read): Check for input data + after reading from pipe. Reset event if input pipe is empty. + * tty.h (class tty): Allow creating events with manual reset. + * tty.cc (tty::get_event): Use manual_reset flag. + * tty.cc (tty::common_init): Create input_available_event with + manual reset. + +Sat Mar 17 21:48:03 2001 Christopher Faylor <cgf@cygnus.com> + + * external.cc (fillout_pinfo): Match windows pid, as well as cygwin pid + when passed in pid. Don't prematurely break when searching for a pid. + + * thread.h (_winsup_t): Eliminate unneeded field. + +Sat Mar 17 20:46:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_95_ifconf): Use strcasematch instead of strcasecmp. + * syscalls.cc (_unlink): Ditto. + (_rename): Ditto. + +Sat Mar 17 12:43:15 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (suffix_scan::next): Avoid searching for foo.lnk twice when + input is "foo". + +Sat Mar 17 18:10:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_socket): Set protocol to 0 when address family is + AF_UNIX to avoid WSAEPROTONOSUPPORT error. + +Sat Mar 17 09:51:32 2001 Mathew Brozowski <brozow@tavve.com> + + * net.cc (cygwin_socket): Pass protocol parameter to socket call. + +Sat Mar 17 02:05:38 2001 Christopher Faylor <cgf@cygnus.com> + + * dir.cc (readdir): Use strcasematch for consistency. + * path.cc (symlink_info): Eliminate known_suffix. + (path_conv::check): Always copy ext_here to end of buffer, if found. + (suffix_scan): Eliminate ext_here, add suffixes_start. + (suffix_scan::has): Eliminate an argument. Reorganize. Always return + pointer to end of input path. + (suffix_scan::next): Take a second pass through the suffix list looking + for .lnk. + (symlink_info::check): Eliminate known_suffix usage. + +Sat Mar 17 00:10:52 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (stat_dev): Give devices full read/write by default. + +Saturday Mar 17 3:45 2001 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (MTinterface::CreateCond): Check for null attr pointer. + +Fri Mar 16 21:13:23 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_termios.cc (fhandler_termios::line_edit): Don't accept input + when a signal is sent or we'll end up in an EOF/signal race. + +Fri Mar 16 20:25:40 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc: Translate scan states from defines to enums. + (suffix_scan): Rename state to nextstate for clarity. + (lnk_match): Change to allow multiple states to indicate that a .lnk + has been matched. + (suffix_scan::has): Eliminate a goto. Handle .lnk as a special case, + since a .lnk may also need to be tacked on the end of a .lnk. + (suffix_scan::next): Don't increment next state. Set it specifically. + Recognize new .lnk states. + +Saturday Mar 17 01:19 2001 Robert Collins rbtcollins@hotmail.com + + * cygwin.din: Export the new functions. + * pthread.cc (pthread_cond_*): Add wrapper functions that call + __pthread_cond* functions. + * thread.cc (__pthread_cond_*): Implement the pthread_cond* functions. + * thread.h: Add new class entries and prototypes for __pthread_cond* + functions. + * include/pthread.h: user land header prototypes for pthread_cond* + functions and related defines. + +Wed Mar 14 16:30:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (parse_options): Use strtok_r instead of strtok. + * security.cc (convert_string_sid_to_sid): Ditto. + (aclfromtext): Ditto. Fix buffer usage. + +Wed Mar 14 10:11:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (lnk_suffixes): Remove. + (class suffix_scan): Add `lnk_state' flag. + (suffix_scan::lnk_match): Return state of `lnk_state' now. + (suffix_scan::has): Changed behaviour if file has `.lnk' suffix. + (suffix_scan::next): Set `lnk_state' where appropriate. + (symlink_info::check): Fix a wrong `break'. + * syscalls.cc (chown_worker): Change debug statement to reflect + lchown fix. + (lchown): Call chown_worker with `PC_SYM_NOFOLLOW' instead of + `PC_SYM_IGNORE'. + +Tue Mar 13 13:52:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::fstat): Add correct modes to + symlinks when stat'ing on FAT or FAT32 file systems. + +2001-03-12 Egor Duda <deo@logos-m.ru> + + * fhandler.h (fhandler_termios::fixup_after_exec): New function. + * fhandler_termios.cc (fhandler_termios::fixup_after_fork): New + function. Fixup output handle. + * fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Output + handle is now fixed up in fhandler_termios::fixup_after_fork(). + +2001-03-12 Egor Duda <deo@logos-m.ru> + + * fhandler.h (fhandler_termios::fhandler_termios): Enable fixup + after fork. + * fhandler_console.cc (fhandler_console::fhandler_console): Fixup + after fork is now enabled in the base class constructor. + +Mon Mar 12 11:19:41 2001 Christopher Faylor <cgf@cygnus.com> + + * mkvers.sh: Include config.h so that DEBUGGING is correctly defined. + +Mon Mar 12 09:47:55 2001 Christopher Faylor <cgf@cygnus.com> + + * spawn.cc (spawn_guts): Don't set EXIT_REPARENTING if parent process + is not a cygwin process (suggested by Jason Gouger + <cygwin@jason-gouger.com>). + +Sun Mar 11 16:00:58 2001 Christopher Faylor <cgf@cygnus.com> + + * child_info.h: Bump magic number for fork/exec/spawn. + +Sat Mar 10 20:54:47 2001 Christopher Faylor <cgf@cygnus.com> + + * autoload.cc (noload): Use proper method for multiline strings or + newer gcc's complain. + * exceptions.cc (unused_sig_wrapper): Ditto. + * fhandler.h (fhandler_base): Make get_io_handle and friends return + self. + * fhandler_tty.cc (fhandler_pty_common::close_on_exec): Accommodate + DEBUGGING flag to avoid spurious warnings when inheritance is set. + +Sat Mar 10 16:52:12 2001 Christopher Faylor <cgf@cygnus.com> + + * shortcut.c (PATH_ALL_EXEC): Add parentheses to avoid a compiler + warning. + + * exceptions.cc (setup_handler): Clarify debugging message. + * sigproc.cc (proc_subproc): Remove PROC_CHILDSTOPPED test. It is + handled by normal PROC_CLEARWAIT case. + (wait_sig): Eliminate "dispatched" tracking. Remove __SIGCHILDSTOPPED + test. Decrement counter again before jumping out of + InterlockedDecrement loop so that subsequent InterlockedIncrement will + keep the counter at the correctly decremented value and also detect + when there are pending signals. + * sigproc.h: Remove __SIGCHILDSTOPPED element. + (procstuff): Remove PROC_CHILDSTOPPED element. + +Sat Mar 10 15:22:44 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_rename): Set errno to ENOENT when an old path doesn't + exist (from Kazuhiro Fujieda <fujieda@jaist.ac.jp>). Also set EACCES + when directory is not writable. + +Wed Mar 7 15:49:47 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_read): Change definition to return ssize_t to be + consistent with read. + (_write): Change definition to return ssize_t to be consistent with + write. + +Wed Mar 7 01:08:21 2001 Christopher Faylor <cgf@cygnus.com> + + * sigproc.h (sigthread): Declare new methods. Create new winapi_lock + field. + (sigframe:;set): Call get_winapi_lock after frame is set so that signal + handler thread knows not to call SuspendThread. + (sigframe::~sigframe): Release winapi_lock. + * exceptions.cc (sigthread::get_winapi_lock): New method. + (sigthread::release_winapi_lock): New method. + (setup_handler): Use get_winapi_lock to ensure that signalled thread is + not blocked in a Windows API. + + * path.h (path_types): Avoid broken GCC warning. + +Tue Mar 6 14:02:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (suffix_scan::has): Change order of conditionals + to allow checking for .lnk suffixes even if in_suffixes is empty. + +Tue Mar 6 13:02:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.c (cygwin_premain0): Add missing parameter. + * binmode.c (cygwin_premain0): Ditto. + * textmode.c (cygwin_premain0): Ditto. + +Tue Mar 6 12:04:00 2001 Jason Tiller <jtiller@sjm.com> + + * auto_load.cc: Add "GetKeyboardLayout" entry in the list of + Win32 User32.DLL exports to provide. + * fhandler.h (class fhandler_console): Add meta_mask private + member to remember which keystroke modifiers should generate + META. + * fhandler_console.cc (fhandler_console::read): Modify code that + tests a keystroke for a META-escaped key to use the 'meta_mask' + variable. + (fhandler_console::fhandler_console): Add definition for + variable "meta_mask" used to determine if a keystroke should be + preceded by META in the client console stream. Set meta_mask + based on whether or not user's keyboard language is English - + non-English keyboards pass AltGr (right <ALT>) unmolested, + whereas English keyboards now interpret left- and right-<ALT> + as META. + +Mon Mar 5 20:15:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * include/a.out.h: Add copyright hint. + * include/fcntl.h: Ditto. + * include/lastlog.h: Ditto. + * include/memory.h: Ditto. + * include/mntent.h: Ditto. + * include/paths.h: Ditto. + * include/poll.h: Ditto. + * include/syslog.h: Ditto. + * include/termio.h: Ditto. + * include/tzfile.h: Ditto. + * include/arpa/inet.h: Ditto. + * include/asm/byteorder.h: Ditto. + * include/asm/socket.h: Ditto. + * include/asm/types.h: Ditto. + * include/cygwin/if.h: Ditto. + * include/cygwin/mtio.h: Ditto. + * include/cygwin/rdevio.h: Ditto. + * include/cygwin/socket.h: Ditto. + * include/net/if.h: Ditto. + * include/netinet/in.h: Ditto. + * include/netinet/in_systm.h: Ditto. + * include/netinet/ip.h: Ditto. + * include/netinet/ip_icmp.h: Ditto. + * include/netinet/tcp.h: Ditto. + * include/sys/cdefs.h: Ditto. + * include/sys/cygwin.h: Ditto. + * include/sys/ioctl.h: Ditto. + * include/sys/mman.h: Ditto. + * include/sys/mount.h: Ditto. + * include/sys/mtio.h: Ditto. + * include/sys/procfs.h: Ditto. + * include/sys/resource.h: Ditto. + * include/sys/smallprint.h: Ditto. + * include/sys/socket.h: Ditto. + * include/sys/strace.h: Ditto. + * include/sys/syslog.h: Ditto. + * include/sys/sysmacros.h: Ditto. + * include/sys/termio.h: Ditto. + * include/sys/termios.h: Ditto. + * include/sys/uio.h: Ditto. + * include/sys/un.h: Ditto. + * include/sys/utsname.h: Ditto. + * include/sys/vfs.h: Ditto. + * include/sys/wait.h: Ditto. + * regexp/regerror.c: Ditto. + * regexp/regexp.h: Ditto. + * regexp/regmagic.h: Ditto. + +Mon Mar 5 01:25:03 2001 Christopher Faylor <cgf@cygnus.com> + + * dlopen.c (dlopen): Return NULL when name is NULL (suggested by + chrisiasci@aol.com). + + * cygwin.din: Add a new, internally used export - + _check_for_executable. + * dcrt0.cc (dll_crt0_1): Set _check_for_executable for older binaries. + Pass user_data to premain functions. + * fhandler.cc (fhandler_disk_file::open): Only check for executable if + the linked program is interested in the executable bit. + (fhandler_disk_file::check_execable_p): Delete. + * fhandler.h (executable_states): New enumeration of various states of + executable bit caring. + (fhandler_base::set_execable_p): New method. + + * fhandler_termios.cc (fhandler_termios::line_edit): Flag when a signal + has been sent to the tty. Return -1 when this is so. + * fhandler_console.cc (fhandler_console::read): Return -1 when signal + sending character encountered. + + * path.cc (path_conv::check): Record when path refers to a disk device. + Move executable extension check here. + (check_sysfile): Accommodate new EXEC path states. + (has_suffix): Remove. + (next_suffix): Remove. + (class suffix_scan): New clas. + (suffix_scan::has): New method. + (suffix_scan:next): New method. + (symlink_info::check): Use suffix_scan method to control for scanning + for suffixes. + * path.h (path_conv::exec_state): New method. + * perprocess.h: Make "C" friendly. + * include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_S_IEXEC. + Bump CYGWIN_VERSION_API_MINOR. + * include/sys/cygwin.h: Change premain declarations. + + * winsup.h: Move __cplusplus test to after builtin defines. + +2001-03-04 Egor Duda <deo@logos-m.ru> + + * fhandler.h (class fhandler_tty_common): New mutex and event to + syncronize input on master tty with slave tty. + * fhandler_tty.cc (fhandler_pty_master::accept_input): Use them to + syncronize with slave. + * fhandler_tty.cc (fhandler_tty_slave::read): Use input mutex and + event to syncronize with master. Do not limit amount of data read + from master to vmin value. Interrupt on signal and return already + read data, if any. + * fhandler_tty.cc (fhandler_tty_slave::open): Handle input mutex and + event. + * fhandler_tty.cc (fhandler_tty_common::close): Ditto. + * fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Ditto. + * fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Ditto. + * fhandler_tty.cc (fhandler_tty_common::dup): Ditto. + * tty.h (tty::open_input_mutex): New function. + * tty.cc (tty::common_init): Create input mutex and event. + +Fri Mar 2 13:32:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (readdir): Fix creating path in symlink check. + +Fri Mar 2 12:33:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (readdir): Fix shortcut==symlink condition. + * environ.cc: Add extern decl for `allow_winsymlinks'. + (struct parse_thing): Add entry for `[no]winsymlinks'. + * path.cc (symlink): Change to be able to create both, + symlink==shortcut and symlink==systemfile, dependent of + the setting of `allow_winsymlinks'. + * security.cc (cygwin_logon_user): Add debug output. + * shortcut.c: Add defines from path.h. + (has_exec_chars): Copy from path.h. + (check_shortcut): Check for executable file condition if not a + shortcut. + +Thu Mar 1 21:06:07 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sig_handle_tty_stop): Ignore attempts to suspend a + process if started by non-cygwin parent. + +Thu Mar 1 20:48:11 2001 Christopher Faylor <cgf@cygnus.com> + + * select.cc (peek_console): Don't report read_ready on mouse events + unless we are looking for mouse events. + * fhandler.h (fhandler_console::mouse_aware): New method. + +Wed Feb 28 15:10:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc: Eliminate `#include <wchar.h>'. + +2001-02-28 Egor Duda <deo@logos-m.ru> + + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Determine + drive geometry or partition size to allow seeking from the end of + raw floppy device. Don't allow positioning past the end of media or + to offsets bigger then max off_t. + +2001-02-27 Egor Duda <deo@logos-m.ru> + + * fhandler.h (class fhandler_console): Make all variables that + describe "state" of console to be members of fhandler_console. + default_color is now the color which is set when console recieves + reset command. + * fhandler_console.cc (fhandler_console::fhandler_console): Turn + mouse handling and raw keyboard mode off by default. Initialize + state information. + * fhandler.cc (fhandler_console::set_raw_win32_keyboard_mode): New + function. + * fhandler_console.cc (fhandler_console::set_default_attr): New + function. Reset console attributes to default values. + * fhandler_console.cc (fhandler_console::open): Reset attributes. + * fhandler_console.cc (fhandler_console::get_win32_attr): New function. + Calculate win32-style console attribute based on terminal attributes. + * fhandler_console.cc (fhandler_console::set_cursor_maybe): Use + member variable. + * fhandler_console.cc (fhandler_console::read): If in raw-win32 + keyboard mode, encode win32 keyboard events in \033{x;y;z;t;u;wK + sequences. + * fhandler_console.cc (fhandler_console::dup): Copy all state + information to the dup()ed handle. + * fhandler_console.cc (fhandler_console::scroll_screen): Use current + fill-in attribute. + * fhandler_console.cc (fhandler_console::clear_screen): Ditto. + * fhandler_console.cc (fhandler_console::char_command): Check if we + saw '?' symbol by member variable. Set terminal attributes on \033[Xm + commands. \033[24m - turn off underline mode, \033[27m - turn off + reverse mode, \033[39m - restore default foreground color. + \033[49m - restore default background color. \033[2000h - turn on raw + keyboard mode, \033[2000l - turn off raw keyboard mode. + * fhandler_console.cc (fhandler_console::write): Set attribues to + default values on reset command. + +2001-02-26 Mike Simons <msimons@moria.simons-clan.com> + + * times.cc (settimeofday): Replace function stub with working code. + +Mon Feb 26 10:42:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (strace::vprntf): Move prntf functionality to this function + adding an va_list interface to strace. + (strace::printf): Calls strace::vprntf now. + (strace_printf): New function providing an extern "C" interface to + trace output. + * include/sys/strace.h: Make plain C clean. + (class strace): Add `vprntf' method. + +Mon Feb 26 0:10:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * shortcut.c: Remove #include <sys/strace.h>. + +Sun Feb 25 10:32:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink): Add a ".lnk" suffix regardless. Add a comment. + +Sun Feb 25 10:18:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * shortcut.c (check_shortcut): Change symlink condition. + +Fri Feb 23 10:42:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fhandler_disk_file::mmap): Use `addr' correctly. + * fhandler_mem.cc (fhandler_dev_mem::mmap): Ditto. + +Thu Feb 22 17:09:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink): Keep relative paths relative in the DOS + path inside of a shortcut. If that's impossible or the target + path is already absolute save an absolute path. + +Thu Feb 22 15:33:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h: Revert previous patch. + * errno.cc: Ditto. + * dir.cc: Eliminate `dir_suffixes'. + (opendir): Remove usage of `dir_suffixes'. + (rmdir): Ditto. + * fhandler.cc (fhandler_disk_file::open): Remove usage of + `inner_suffixes'. + * path.cc: Rename `inner_suffixes' to `lnk_suffixes'. + (path_conv::check): Remove usage of `inner_suffixes'. + (symlink): Ditto. + (symlink_info::check): Handle checking for `.lnk' in path_conv + exclusively here. + (chdir): Remove usage of `dir_suffixes'. + * shortcut.c: Eliminate debug_printf lines. + (check_shortcut): Don't set error except on failing ReadFile. + * spawn.cc: Remove ".lnk" from `std_suffixes'. + * syscalls.cc (_unlink): Remove usage of `inner_suffixes'. + Remove ".lnk" from `stat_suffixes'. + (_rename): Add check for renaming a symlink to keep the ".lnk" + suffix after renaming. + +Thu Feb 22 13:38:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * shortcut.c: New file. Provides a C interface to reading of + Windows shortcuts to avoid compiler flag `-fvtable-thunks'. + * shortcut.h: Ditto. + * Makefile.in: Add shortcut.o to DLL_OFILES. + * cygerrno.h: Provide a C interface to `geterrno_from_win_error' for + using in shortcut.c. + * errno.cc (geterrno_from_win_error): Define as extern "C". + * path.cc (struct symlink_info): Remove methods `check_shortcut' and + `check_sysfile'. + (shortcut_header): Move to shortcut.c. + (shortcut_initalized): Ditto. + (create_shortcut_header): Ditto. + (cmp_shortcut_header): Ditto. + (symlink_info::check_shortcut): Ditto. Reorganize as a plain C function. + (symlink_info::check_sysfile): Redefine as a global function using the + same parameter list as `check_shortcut' for clearness. + (symlink_info::check): Change parameter list for calls to + `check_shortcut' and `check_sysfile'. + +Thu Feb 22 12:04:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_disk_file::open): Use `inner_suffixes' when + resolving real_path. + * path.cc (symlink): Ditto for win32_topath. + +Wed Feb 21 22:41:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add `-lshell32 -luuid' to link pass for new-cygwin1.dll. + * autoload.cc: Add LoadDLLinitfunc for ole32.dll. + Add LoadDLLfuncEx statements for CoInitialize@4, CoUninitialize@0 + and CoCreateInstance@20. + * dir.cc (dir_suffixes): New datastructure. + (readdir): Check for R/O *.lnk files to hide the suffix. + (opendir): Use `dir_suffixes' in path conversion. + (rmdir): Ditto. + * fhandler.cc (fhandler_disk_file::fstat): Add S_IFLNK flag + before calling `get_file_attribute'. Take FILE_ATTRIBUTE_READONLY + into account only if the file is no symlink. + * path.cc (inner_suffixes): New datastructure. + (SYMLINKATTR): Eliminated. + (path_conv::check): Use `inner_suffixes' on inner path components. + (shortcut_header): New global static variable. + (shortcut_initalized): Ditto. + (create_shortcut_header): New function. + (cmp_shortcut_header): Ditto. + (symlink): Create symlinks by creating windows shortcuts. Preserve + the old code. + (symlink_info::check_shortcut): New method. + (symlink_info::check_sysfile): Ditto. + (symlink_info::check): Check for shortcuts. Move code reading + old system attribute symlinks into symlink_info::check_sysfile(). + (chdir): Use `dir_suffixes' in path conversion. + * security.cc (get_file_attribute): Check for S_IFLNK flag. + Force 0777 permissions then. + * spawn.cc (std_suffixes): Add ".lnk" suffix. + * syscalls.cc (_unlink): Use `inner_suffixes' in path conversion. + Check for shortcut symlinks to eliminate R/O attribute before + calling DeleteFile(). + (stat_suffixes): Add ".lnk" suffix. + (stat_worker): Force 0777 permissions if file is a symlink. + +2001-02-21 Egor Duda <deo@logos-m.ru> + + * sigproc.cc (getsem): Make semaphore always non-inheritable. + +Mon Feb 19 22:25:53 2001 Christopher Faylor <cgf@cygnus.com> + + * dcrt0.cc (locale_init): Remove. + +2001-02-15 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * cygwin.din: Export rand48 functions. + * thread.cc (MTinterface::Init): Remove the initialization of + `reent_data'. + * dcrt0.cc: Add the initalizer to the declaration of `reent_data'. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 35. + +2001-02-16 Egor Duda <deo@logos-m.ru> + + * signal.cc (signal): Prohibit setting handlers for SIGKILL and + SIGSTOP + * signal.cc (sigaction): Ditto + * syscalls.cc (_lseek): Return EINVAL on invalid input + +Wed Feb 14 14:54:40 2001 Christophe Iasci <chrisiasci@aol.com> + + * dlfcn.cc (dlopen): Do not call LoadLibrary with a NULL pointer, when + the library is not found + +2001-02-14 Egor Duda <deo@logos-m.ru> + + * fhandler_console.cc (fhandler_console::char_command): Ignore unknown + rendition codes in \033[xx;yym control sequences + +Fri Feb 9 23:19:01 2001 Christopher Faylor <cgf@cygnus.com> + + * fork.cc (fork_parent): Return EAGAIN when can't record pid. + * pinfo.h (pinfo::remember): Return value of call to proc_subproc. + * sigproc.cc (proc_subproc): Return error if can't record pid. + +Fri Feb 9 12:17:27 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (mknod): Add valid parameters. + +Thu Feb 8 22:09:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Check for reusing a mapping only on MAP_SHARED + and on MAP_PRIVATE|MAP_ANON in the special case of offset 0. + +Thu Feb 8 21:57:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (class list): Add member `hash'. + (list::list): Initialize `hash'. + (list::get_list_by_fd): Use filepath hash value to get the correct + mapping list if it's not an anonymous mapping. + (map::add_list): Initialize `hash' with filepath hash value. + (mmap): Check for reusing a mapping only on MAP_SHARED. + +Wed Feb 7 18:47:36 2001 Christopher Faylor <cgf@cygnus.com> + + * signal.cc (killpg): Correct first argument. + +Wed Feb 7 22:22:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Add LoadDLLinitfunc for iphlpapi.dll. + Add LoadDLLfuncEx statements for GetIfTable@12 and GetIpAddrTable@12. + * fhandler_socket.cc (fhandler_socket::ioctl): Move variable + definitions to the beginning of the function to allow better debugging. + Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU. + * net.cc: Include iphlpapi.h. + (get_2k_ifconf): Rewritten. Uses IP Helper API now. + (get_nt_ifconf): Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC + and SIOCGIFMTU. + (get_95_ifconf): Ditto. Renamed from `get_9x_ifconf'. + (get_ifconf): Name loopback `lo' instead of `lo0' as in Linux. + Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU. + Call `get_95_ifconf' only on Windows 95, `get_nt_ifconf' only + on Windows NT < Service Pack 3, `get_2k_ifconf otherwise. + * include/asm/socket.h: Add defines for SIOCGIFHWADDR, SIOCGIFMETRIC + and SIOCGIFMTU. + * include/cygwin/if.h: Add `ifr_hwaddr', `ifr_metric' and `ifr_mtu'. + (struct ifreq): Add `ifru_hwaddr'. + +Tue Feb 6 15:04:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat_worker): Add a check for the special case when + a process creates a file using mode 000 using ntsec. + +Mon Feb 5 17:00:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Always add GENERIC_READ access + when opening raw disk devices. + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Implement bytewise + access. + * fhandler_raw.cc (fhandler_dev_raw::open): Always open raw disk device + binary. + (fhandler_dev_raw::raw_write): Don't drop read buffer content when + writing after read. + +Mon Feb 5 13:30:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::fixup_map): New method to duplicate + the memory protection in a just forked child. + (mmap): Realign gran_len to page boundary only on anonymous + mapping before saving in the mmap_record. + (munmap): Cleanup code. + (msync): Ditto. + (fixup_mmaps_after_fork): Ditto. Call mmap_record::fixup_map now. + +Thu Feb 1 23:08:29 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (creturn): Correctly calculate cygheap_max. + +Wed Jan 31 10:04:58 2001 Christopher Faylor <cgf@cygnus.com> + + * shared.cc (shared_info::initialize): Reduce size of heap. + +Wed Jan 31 13:22:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/resource.h: Fix typo. + +Wed Jan 31 13:20:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/resource.h: Add RLIMIT_NLIMITS and RLIM_NLIMITS. + +Tue Jan 30 18:15:23 2001 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump version to 1.3.0. + +Tue Jan 30 8:55:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo::init): Use INVALID_HANDLE_VALUE instead of + explicit cast (HANDLE) 0xffffffff. + * shared.cc (open_shared): Ditto. + +Mon Jan 29 17:15:22 2001 Bill Hegardt <bill@troyxcd.com> + + * fhandler_serial.cc (raw_write): Use local copy of OVERLAPPED + structure instead of shared structure to fix a race condition between + read/write. + +Mon Jan 29 14:30:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Remove obsolete check for MAP_SHARED|MAP_ANON as + being invalid. + +Mon Jan 29 10:23:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::find_empty): Fix loop condition. + +Sun Jan 28 19:40:40 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_link): Make sure that newpath does not exist. Set + errno if it does. + +Sun Jan 28 19:29:08 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (init_cheap): Don't specify a load address for the heap. + It doesn't work on #!*& Windows 9x. + (cygheap_init): Move GetUserName to memory_init. + * dcrt0.cc (dll_crt0_1): Call new memory_init functin, eliminate call + to heap_init. + * heap.cc (heap_init): Improve error output. + * heap.h: Correct some declarations. + * shared.cc (mount_table_init): Remove. + (memory_init): Renamed from shared_init. Reorganize to accommodate + strange Windows 9x problems with cygheap/heap interaction. + * shared_info.h: Rename shared_init to memory_init. + +Sun Jan 28 01:25:33 2001 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump API version. + +Sun Jan 28 01:18:22 2001 Christopher Faylor <cgf@cygnus.com> + + * cygheap.cc (init_cheap): Move username initialization. + (cygheap_init): Here. + * shared_info.h (mount_info): Add a sys_mount_table_counter field. + (shared_info): Ditto. + * path.cc (mount_info::conv_to_win32_path): Check that our mount table + is in sync with the system mount table and reinitialize it if not. + (mount_info::add_reg_mount): Bump sys_mount_table counters if the + system mount table changes. + (mount_info::del_reg_mount): Ditto. + (mount_info::write_cygdrive_info_to_registry): Ditto. + (mount_info::remove_cygdrive_info_from_registry): Ditto. + +Sun Jan 28 00:28:30 2001 Christopher Faylor <cgf@cygnus.com> + + Throughout, change 'cygwin_shared.mount' to 'mount_table'. + * child_info.h (child_info): Move shared_h, console_h to cygheap. Add + mount_h. + * cygheap.h (init_cygheap): Add shared_h, console_h. + * cygheap.cc (init_cheap): Initialize heap at a fixed location after + the shared memory regions. Initialize cygheap->user name here. + * dcrt0.cc (dll_crt0_1): Call getpagesize () to initialize constants. + Remove cygheap_init since it is done in shared_init now. + (_dll_crt0): Initialize mount_h, remove shared_h and console_h + initialization. + * fhandler_console.cc (console_shared_h): Eliminate. + (get_tty_stuff): Use cygheap->console_h rather than console_shared_h. + * heap.cc (heap_init): Use page size constant calculated earlier in + initialization. + * shared.cc: Eliminate cygwin_shared_h. Add cygwin_mount_h. + (mount_table_init): New function for initializing a user mount table. + (open_shared_file_map): Use constant for shared memory region. + Initialize cygheap and mount table here. + (open_shared): Improve debugging output. + (shared_info::initialize): Eliminate call to mount.init. + (shared_terminate): Use cygheap->shared_h. Close cygwin_mount_h. + (open_shared_file_map): Eliminate. + * shared_info.h (mount_info): Add a version field. + (shared_align_past): New macro for calculating location for shared + memory regions. + * sigproc.cc (init_child_info): Eliminate shared_h, console_h. + * spawn.cc (spawn_guts): Pass on cygwin_mount_h iff not a different + user. + * syscalls.cc (system_info): New global holding system memory defaults. + (getpagesize): Use system_info. + * uinfo.cc (internal_getlogin): Only fill in user name if nonexistent. + * winsup.h: Declare system_info. + + * passwd.cc (read_etc_passwd): Use cygheap->user.name () rather than + retrieving the name again. + +Sat Jan 27 10:18:02 2001 Christopher Faylor <cgf@cygnus.com> + + * path.cc (path_conv::check): Detect when path has symlinks. + (symlink_info::check): Remove debugging stuff. + (chdir): Use posix'ized win32 path if cd'ed to a path using symlinks. + +Fri Jan 26 21:20:28 2001 Christopher Faylor <cgf@cygnus.com> + + * exceptions.cc (sigreturn): Call any pending signals prior to + resetting the signal mask so that stacked signals behave correctly. + (sigdelayed): Avoid a race where a signal could end up calling an + incorrect signal handler if two signals come in close together. + +Tue Jan 23 21:56:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fhandler_disk_file::mmap): Call CreateFileMapping with + len != 0 only when performing an anonymous mapping. + +Mon Jan 22 15:35:28 2001 Christopher Faylor <cgf@cygnus.com> + + * path.h: Add a new constant. + * syscalls.cc (_read): Oscillate errno check. + +Mon Jan 22 15:27:12 2001 Christopher Faylor <cgf@cygnus.com> + + * include/cygwin/version.h: Bump API to reflect setlogmask. + +Sun Jan 21 22:40:25 2001 Jason Tishler <jt@dothill.com> + + * cygwin.din: Add export for setlogmask(). + * syslog.cc (setlogmask): New function. + +Thu Jan 18 10:27:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * resource.cc (setrlimit): Support RLIMIT_NOFILE. + +Wed Jan 17 23:23:12 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (setdtablesize): Call with amount to increment not total + amount. Return success or failure error code. + +Wed Jan 17 09:47:13 2001 Christopher Faylor <cgf@cygnus.com> + + * autoload.cc (LoadDLLinitfunc): Remove debugging statement. + + * exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to + earlier in interrupt. + (interrupt_setup): i.e., here. + (sig_handle): Don't queue multiple SIGSTOPS. + * fhandler.h (bg_check_types): Enumerate return value of bg_check for + clarity. + * signal.cc (kill_pgrp): Minor cleanup. + * fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type + for function return. Don't raise signal if a signal is already queued. + * fhandler_console.cc (fhandler_console::read): Use enumerated return + type for bg_check. + * select.cc: Ditto, throughout. + * read.cc: Ditto, throughout. + * termios.cc: Ditto, throughout. + (_read): YA interrupt detect simplification. + * wait.cc (wait4): Ditto. + +Wed Jan 17 10:56:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_user::~cygheap_user): Temporarily + disable free'ing memory. + +Tue Jan 16 18:01:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Initialize fh to avoid compiler warnings. + +Mon Jan 15 21:07:00 2001 Christopher Faylor <cgf@cygnus.com> + + * wait.cc (wait4): Rename variable for consistency. Allow restartable + signal behavior. + +Mon Jan 15 23:15:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap): Add more parameter checking. Change error output + in case of EINVAL. Treat mmapping /dev/zero like MAP_ANONYMOUS. + +Mon Jan 15 20:34:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: include <unistd.h>. Define some bit operations for + the new page map. + (mmap_record): Change type of base_address_ to caddr_t. + Add map_map_ member. Add several methods to manipulate map_map_. + (mmap_record::alloc_map): New method. + (mmap_record::free_map): Ditto. + (mmap_record::find_empty): Ditto. + (mmap_record::map_map): Ditto. + (mmap_record::unmap_map): Ditto. + (list::add_record): Change return type to `mmap_record *'. + Allocate page map. + (list::match): New method. + (mmap): Partly rewritten to take care for the new page map. Add some + parameter checking. + (munmap): Ditto. + +Mon Jan 15 13:50:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (heap_init): Fix extern declaration of getpagesize. + * syscalls.cc (getpagesize): Fix another typo. + +Mon Jan 15 12:48:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (getpagesize): Save pagesize in global variable to + avoid calling GetSystemInfo too often. + * heap.cc (getpagesize): Eliminate. + (heap_init): Use getpagesize function from syscalls.cc. + +Mon Jan 15 11:56:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * sysconf.cc (sysconf): return `getpagesize ()' on _SC_PAGESIZE + request to avoid implementing the same twice. + +Sun Jan 14 14:07:50 2001 Christopher Faylor <cgf@cygnus.com> + + * syscalls.cc (_read): Use more lightweight method for determining if + read has been interrupted by a signal. + +Fri Jan 12 00:35:15 2001 Christopher Faylor <cgf@cygnus.com> + + * debug.h: Add regparm attributes to some functions. + + * signal.cc (sigaction): Don't treat SIGCONT specially. + + * exceptions.cc (interrupt_setup): Save sa_flags of interrupted signal + for later use. + (sig_handler): Default any stopping signal to SIGSTOP. + (call_signal_handler): New function. + (sigdelayed0): New function. + * sigproc.cc (sigproc_init): Initialize SIGSTOP sigaction for special + behavior. + * sigproc.h: Define call_signal_handler. + * syscalls.cc (_read): Allow restartable signal behavior. + +Thu Jan 11 13:17:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base): New method `fixup_mmap_after_fork'. + (fhandler_disk_file: Ditto. + (fhandler_dev_mem): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::open): Set OBJ_INHERIT attribute + for device\physicalmemory handle. + (fhandler_dev_mem::mmap): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork): New + method. + * mmap.cc (mmap_record): Add private `fdesc_' member. Change + constructor accordingly. + (get_fd): New method. + (mmap): Use new mmap_record constructor. + (fhandler_base::fixup_mmap_after_fork): New method. + (fhandler_disk_file::fixup_mmap_after_fork): Ditto. + (fixup_mmaps_after_fork): Call `fixup_mmap_after_fork' of appropriate + fhandler class. + +Wed Jan 10 22:08:30 2001 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * sigproc.cc (wait_sig): Allow SIGCONT when stopped. + +Tue Jan 9 16:55:00 2001 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by René Møller Fonseca <fonseca@mip.sdu.dk> + * include/sys/socket.h: Change prototype to have 2nd parameter `const'. + * net.cc (cygwin_bind): Change 2nd parameter to `const'. + +Sun Jan 7 22:59:37 2001 Christopher Faylor <cgf@cygnus.com> + + * pinfo.cc (codepage_init): Move function. + * environ.cc (codepage_init): To here. + * exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration + since it is supposed to be maskable. + * signal.cc (sigaction): Ditto. + * sigproc.cc (wait_sig): Ditto. + * winsup.h: Eliminate global declaration of codepage_init. + +Thu Jan 5 9:33:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * resource.cc (getrlimit): Set errno on EFAULT instead of returning + it. + (setrlimit): Ditto. + +Thu Jan 5 3:38:00 2001 David Sainty <David.Sainty@optimation.co.nz> + + * resource.cc (setrlimit): Prevent failing with an error when the + operation would not have changed anything. + +Thu Jan 4 10:29:54 2001 Earnie Boyd <earnie_boyd@yahoo.com> + + * thread.cc: Need LONG_MAX definition. + +Wed Jan 3 13:47:23 2001 Christopher Faylor <cgf@cygnus.com> + + * thread.cc (MTinterface::CreateSemaphore): Correctly set semaphore + max. + +Wed Jan 3 09:44:51 2001 Christopher Faylor <cgf@cygnus.com> + + * fhandler_console.cc (fhandler_console::read): Restore missing test + for code page before doing OemToCharBuff. + +Wed Jan 3 09:20:20 2001 Jason Tishler <jt@dothill.com> + + * include/cygwin/version.h: Fix typo in CYGWIN_VERSION_DLL_COMBINED + macro. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2002 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2002 new file mode 100644 index 000000000..21fcf2a18 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2002 @@ -0,0 +1,6655 @@ +2002-12-30 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (events_init): Display name of mutex on failure. + +2002-12-30 Christopher Faylor <cgf@redhat.com> + + * windows.cc (setitimer): Return ENOSYS on invalid argument. + +2002-12-28 Christopher Faylor <cgf@redhat.com> + + * fhandler_termios.cc (fhandler_termios::line_edit): Perform echo + before input is accepted or suffer a "race". + +2002-12-27 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_tty_master::set_winsize): Declare new function. + * fhandler_console.cc (fhandler_console::send_winch_maybe): If + appropriate, call tty master function to handle screen size change. + * fhandler_tty.cc (fhandler_tty_master::set_winsize): New function. + (fhandler_tty_master::init): Call set_winsize to set initial screen + size. + +2002-12-26 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_master::init): Set initial size of tty + to that of console in which tty is operating. + (process_input): Semi-revert previous change. Need to just use current + terminfo settings since this function is running in a thread, blocked + when the terminfo changes. + +2002-12-26 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_termios::line_edit): Replace third argument with + passed-in termios struct. + * fhandler_console.cc (fhandler_console::read): Prior to loop, make a + copy of current termios for passing to line_edit prior so that all + characters are processed consistently. + * fhandler_tty.cc (fhandler_pty_master::write): Ditto. + (process_input): Make a copy of curent termios prior to read for use in + subsequent line_edit. + * fhandler_termios.cc (fhandler_termios::line_edit): Replace third + parameter with passed-in termios struct and use it throughout rather + than the data from the current fhandler_termios class. + +2002-12-25 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-12-25 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (events_init): Initialize critical section to control + exiting via signal. + (signal_exit): Enter critical section early to avoid exit races with + main thread. + * dcrt0.cc (do_exit): Use exit_lock critical section to avoid races. + +2002-12-25 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::detach): Set errno with set_sig_errno so + that EINTR is properly restored after signal. + +2002-12-21 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Default fhandler objects to -fomit-frame-pointer. + Eliminate redundant CFLAGS settings. + +2002-12-20 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (line_edit_status): Reorganize so that tests for error + condition can be < or >. + * fhandler_tty.cc (fhandler_pty_master::write): Don't return after + sending a signal. + + * fhandler_termios.cc (fhandler_termios::line_edit): Trivial change to + use built-in bool types. + +2002-12-19 Pierre Humblet <pierre.humblet@ieee.org> + + * localtime.cc (tzsetwall): Set lcl_is_set and lcl_TZname + in the Cygwin specific part of the routine. + +2002-12-19 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler_base::open): Use "flags" rather than "mode" + in Win9X directory code. + +2002-12-19 Steve Osborn <bub@io.com> + + * fhandler.h (line_edit_status): Add a new element. + * fhandler_termios.cc (fhandler_termios::line_edit): After + accept_input, handle both potential error condition and pipe full + conditions. + * fhandler_tty.cc (fhandler_pty_master::accept_input): Return -1 on + error. + (fhandler_pty_master::write): Handle pipe full condition. + +2002-12-16 Steve Osborn <bub@io.com> + Christopher Faylor <cgf@redhat.com> + + * fhandler_termios.cc (fhandler_termios::line_edit): Return + line_edit_error and remove last char from readahead buffer if + accept_input() fails. + * fhandler_tty.cc (fhandler_pty_master::accept_input): Return 0 and + restore readahead buffer when tty slave pipe is full. + +2002-12-16 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::cmdline): Allocate sufficient space for myself + command line args. + +2002-12-14 Steve Osborn <bub@io.com> + + * fhandler_termios.cc (fhandler_termios::line_edit): Call + accept_input() in character processing loop. Set return value + independently of input_done. + +2002-12-14 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::read): Signal event, if necessary, and + raw_read hasn't done so. + +2002-12-14 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::raw_read): Reset priorities to minimize + window where thread termination may cause data loss. + (fhandler_base::read): Always return at end of function. Just set len + to copied_chars when len is zero. Return immediately after raw_read if + len <= 0. Remove in_len setting and just check end instead. Fix CRLF + handling at end of buffer. + +2002-12-14 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Call well known SID initializer function. + * security.h (cygsid::init): Declare new static method. + * sec_helper.cc (cygsid::init): New method for initializing well + known SIDs. + +2002-12-14 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h: Declare well_known_creator_group_sid. + * sec_helper.cc: Define and initialize well_known_creator_group_sid. + +2002-12-14 Corinna Vinschen <corinna@vinschen.de> + + * netdb.cc: Remove strtok_r comment. + +2002-12-14 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (get_user_local_groups): Use LookupAccountSid to find the + local equivalent of BUILTIN. + +2002-12-14 Christopher Faylor <cgf@redhat.com> + + * pipe.cc (make_pipe): Set fork fixup flag for read pipe. + +2002-12-14 Christopher Faylor <cgf@redhat.com> + + * winbase.h: Turn on inline versions of Interlocked* by default. + +2002-12-14 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net> + + * winbase.h: Fixup inline asm functions. Add ilockcmpexch. + +2002-12-13 Christopher Faylor <cgf@redhat.com> + + Throughout, change fhandler_*::read and fhandler_*::raw_read to void + functions whose second arguments are both the length and the return + value. + * fhandler.cc (fhandler_base::read): Rework slightly to use second + argument as input/output. Tweak CRLF stuff. + (fhandler_base::readv): Accommodate fhandler_*::read changes. + * cygthread.h (cygthread::detach): Declare as taking optional handle + argument. + (cygthread::detach): When given a handle argument, wait for the handle + to be signalled before waiting for thread to detach. Return true when + signal detected. + +2002-12-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add MINGW_LDFLAGS when linking cygrun.exe. + +2002-12-10 Christopher Faylor <cgf@redhat.com> + + * cygthread.h (cygthread::stack_ptr): New element. + (cygthread::detach): Accept a "wait_for_signal" argument. + (cygthread::terminate_thread): New function. + * cygthread.cc (cygthread::stub): Set stack pointer argument. + (cygthread::terminate_thread): New function. Forcibly terminate + thread. + (cygthread::detach): Optionally wait for signals and kill thread when + signal arrives. + * exceptions.cc (signal_exit): Set signal_arrived prior to exiting to + wake up anything blocking on signals. + * fhandler.h (fhandler_base::set_r_no_interrupt): Change to accept bool + argument. + (fhandler_pipe::ready_for_read): Declare. + * pipe.cc (pipeargs): New structure. + (read_pipe): New thread stub wrapper for normal pipe read. + (fhandler_pipe::read): Modify to call reader in a cygthread, + terminating on signal, as appropriate. + * select.cc (fhandler_pipe::ready_for_read): Define new function. + +2002-12-10 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (free_protoent_ptr): Add missing free() for base structure. + (free_servent_pt): Ditto. + (free_hostent_pt): Ditto. + +2002-12-10 Craig McGeachie <slapdau@yahoo.com.au> + + * netdb.cc (parse_alias_list): Change strtok calls to strtok_r. + (parse_services_line): Ditto. + (parse_protocol_line): Ditto. + +2002-12-10 Pierre Humblet <pierre.humblet@ieee.org> + + * pwdgrp.h (pwdgrp_check::pwdgrp_state): Replace by + pwdgrp_check::isinitializing (). + (pwdgrp_check::isinitializing): Create. + * passwd.cc (grab_int): Change type to unsigned, use strtoul and set + the pointer content to 0 if the field is invalid. + (parse_pwd): Move validity test after getting pw_gid. + (read_etc_passwd): Replace "passwd_state <= " by + passwd_state::isinitializing (). + (internal_getpwuid): Ditto. + (internal_getpwnam): Ditto. + (getpwent): Ditto. + (getpass): Ditto. + * grp.cc (parse_grp): Use strtoul for gr_gid and verify the validity. + (read_etc_group): Replace "group_state <= " by + group_state::isinitializing (). + (internal_getgrgid): Ditto. + (getgrent32): Ditto. + (internal_getgrent): Ditto. + +2002-12-10 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h: Move declarations of internal_getgrent, + internal_getpwsid and internal_getgrsid to pwdgrp.h. + * pwdgrp.h: Declare internal_getpwsid, internal_getpwnam, + internal_getpwuid, internal_getgrsid, internal_getgrgid, + internal_getgrnam, internal_getgrent and internal_getgroups. + Delete "emulated" from enum pwdgrp_state. + (pwdgrp_check::isuninitialized): Create. + (pwdgrp_check::pwdgrp_state): Change state to initializing + rather than to uninitialized. + (pwdgrp_read::gets): Remove trailing CRs. + * passwd.cc (grab_string): Don't look for NLs. + (grab_int): Ditto. + (parse_pwd): Don't look for CRs. Return 0 if entry is too short. + (search_for): Delete. + (read_etc_passwd): Simplify tests to actually read the file. + Set state to loaded before making internal_getpwXX calls. + Replace search_for calls by equivalent internal_pwgetXX calls. + (internal_getpwsid): Use passwd_state.isuninitialized to decide + to call read_etc_passwd. + (internal_getpwuid): Create. + (internal_getpwnam): Create. + (getpwuid32): Simply call internal_getpwuid. + (getpwuid_r32): Call internal_getpwuid. + (getpwnam): Simply call internal_getpwnam. + (getpwnam_r): Call internal_getpwnam. + * grp.cc (parse_grp): Don't look for CRs. Adjust blank space. + (add_grp_line): Adjust blank space. + (class group_lock): Ditto. + (read_etc_group): Simplify tests to actually read the file. + Set state to loaded before making internal_getgrXX calls. + Replace getgrXX calls by equivalent internal calls. + (internal_getgrsid): Use group_state.isuninitialized to decide + to call read_etc_group. + (internal_getgrgid): Create. + (internal_getgrnam): Create. + (getgroups32): Simply call internal_getgrgid. + (getgrnam32): Simply call internal_getgrnam. + (internal_getgrent): Call group_state.isuninitialized. + (internal_getgroups): Create from the former getgroups32, using + two of the four arguments. Set gid to myself->gid and username + to cygheap->user.name (). + (getgroups32): Simply call internal_getgroup. + (getgroups): Call internal_getgroup instead of getgroups32. + (setgroups32): Call internal versions of get{pw,gr}XX. + * sec_helper.cc: Include pwdgrp.h. + (is_grp_member): Call internal versions of get{pw,gr}XX. + * security.cc: Include pwdgrp.h. + (alloc_sd): Call internal versions of get{pw,gr}XX. + * syscalls.cc: Include pwdgrp.h. + (seteuid32): Call internal versions of get{pw,gr}XX. + (setegid32): Ditto. + * uinfo.cc: Include pwdgrp.h. + (internal_getlogin): Call internal versions of get{pw,gr}XX. + (cygheap_user::ontherange): Ditto. + * sec_acl.cc: Include pwdgrp.h. + (setacl): Call internal versions of get{pw,gr}XX. + (acl_access): Ditto and simplify logic. + (aclfromtext): Ditto. + +2002-12-09 2002-12-02 Egor Duda <deo@logos-m.ru> + + * lib/pseudo-reloc.c: New file. + * lib/_cygwin_crt0_common.cc: Perform pseudo-relocs during + initialization of cygwin binary (.exe or .dll). + +2002-12-06 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Reflect name change from strtodf to strtof. Export + strtof. + * include/cygwin/version.h: Bump API minor number. + +2002-12-04 Steve Osborn <bub@io.com> + + * fhandler.h (fhandler_termios::line_edit): Change return from an int + to an enum to allow the function to return an error. + * fhandler_console.cc (fhandler_console::read): Update the line_edit + call to use the new enum. + * fhandler_termios.cc (fhandler_termios::line_edit): Change return from + an int to an enum to allow the function to return an error. Put + put_readahead call before doecho for future patch. + * fhandler_tty.cc (fhandler_pty_master::write): Change to call + line_edit one character at a time, and stop if an error occurs. + +2002-12-04 Craig McGeachie <slapdau@yahoo.com.au> + + * netdb.cc: New file. + * Makeile.in (DLL_OFILES): Add reference to the new netdb.cc file. + * cygwin.din : Add new aliased exports for service and protocol + enumerations in netdb.cc. + +2002-12-04 Thomas Pfaff <tpfaff@gmx.net> + + * cxx.cc: New file. Implement new, new[], delete and delete[] + operators and __cxa_pure_virtual if compiled by gcc >=3. + * Makefile.in (DLL_OFILES): Add cxx.o. + Remove libstdc++.a from cygwin1.dll link step. + +2002-11-29 Steve Osborn <bub@io.com> + + * fhandler_tty.cc (fhandler_pty_master::accept_input): Move + read_retval assignment to prevent race condition. Remove read_retval + from return statement. + +2002-11-29 Christopher Faylor <cgf@redhat.com> + + * pinfo.h (winpids::set): Renamed from init. + (winpids::init): New declaration. + (winpids::cs): Ditto. + (winpids::winpids): Use set rather than init. + * external.cc (fillout_pinfo): Ditto. + * dcrt0.cc (dll_crt0_1): Call winpids::init. + * pinfo.cc (winpids::set): Renamed from init. Wrap calls in critical + section. + (winpids::init): New function. + (winpids::cs): Define. + +2002-11-28 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (sig_dispatch_pending): Remove assertion. + +2002-11-27 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-11-27 Mikael Ylikoski <my@post.utfors.se> + + * fhandler_socket.cc (fhandler_socket::sendto): Fix potential + unitialized value return. + +2002-11-27 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Export pthread_getsequence_np. + * include/cygwin/version.h: Bump API minor version. + +2002-11-26 Jason Tishler <jason@tishler.net> + + * cygwin.din: Export nl_langinfo(). + * include/cygwin/version.h: Bump API minor version. + +2002-11-26 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_pty_master::accept_input): Just use a + normal Sleep or suffer amazing pauses when other tty apps are running. + (fhandler_pty_master::process_slave_output): Ditto. + +2002-11-25 Pierre Humblet <pierre.humblet@ieee.org> + + * passwd.cc (read_etc_passwd): Never add an entry when starting + on Win95/98/ME if a default entry is present. + * uinfo.cc (internal_getlogin): Look for the default uid if needed. + Always call user.set_name (). + +2002-11-25 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (getacl): Set errno to ENOSPC if command is GETACL and + nentries is less than the number of entries in the file's ACL. + +2002-11-24 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc: Fix some formatting. Only set and check `other' bits in + a_perm throughout. Use ILLEGAL_GID id for all entries having no id. + (setacl): Fix inheritance condition. + (getacl): Set all permission bits in CLASS_OBJ and DEF_CLASS_OBJ + entries. Remove DENY bits before returning to calling function. + (acltomode): Fix usage of searchace(). If available, use CLASS_OBJ + to mask GROUP_OBJ permissions. + (aclfrommode): Fix usage of searchace(). If available, set CLASS_OBJ + permissions to same value as GROUP_OBJ permissions. + +2002-11-24 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_acl.cc (getace): Fix the behavior when allow and + deny entries are present in arbitrary order. + (getacl): Report the actual number of entries when + aclbufp is NULL, even if nentries is zero. Fix the mask + reporting, handle the case where the owner and group sids + are equal and streamline the code. + (acl_worker): Take allow_ntsec into account. + +2002-11-05 Thomas Pfaff <tpfaff@gmx.net> + + * dcrt0.cc (dll_crt0_1): Add call to pthread::initMainThread to + initialize mainthread when it is safe to call new. + * init.cc (dll_entry): Change call to store reents in tls key. + * thread.cc (_reent_clib) : Change call to get reents from tls + key. + (_reent_winsup): Ditto. + (MTinterface::Init): Key handling changed. Remove initialization + of member variables. + (MTinterface::fixup_after_fork): Reinitialize mainthread object + after fork. Reset threadount to 1. + (pthread::initMainThread): Create mainthread object dynamically. + and initialize with valid handles. + (pthread::self): Remove calls to create thread objects. + (pthread::setTlsSelfPointer): Change call to store thread self + handle in tls key. + (pthread::getTlsSelfPointer): New static method. + (pthread::exit): Remove setTlsSelfPointer call. + (pthread::initCurrentThread): New method. + (pthread::thread_init_wrapper): Change call to store thread self + handle in tls key. + (pthread::join): Check for a valid joiner. + (pthreadNull::pthreadNull): Mark Null object as detached. + (pthreadNull::exit): Terminate thread via ExitThread. + * thread.h (pthread::initMainThread): Change parameter in function + call. + (pthread::getTlsSelfPointer): New static method. + (pthread::initCurrentThread): New method. + (MTinterface::reent_key): Remove. + (MTinterface::thread_self_dwTlsIndex): Ditto.. + (MTinterface::indexallocated): Ditto. + (MTinterface::mainthread): Ditto. + (MTinterface::reent_key): New member. + (MTinterface::thread_self_key): Ditto. + (MTinterface::MTinterface): Initialize all members. + +2002-11-23 Christopher Faylor <cgf@redhat.com> + + * wait.cc (wait4): Force pending signal delivery before waiting for + process completion. + +2002-11-23 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-11-22 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (handle_sigsuspend): Force pending signal delivery + before waiting for signals to happen. + * signal.cc (sleep): Force pending signal delivery before sleeping. + (usleep): Ditto. + (signal): Force pending signal delivery before manipulating signal + stuff. + (sigprocmask): Ditto. + (kill_worker): Ditto. + (abort): Ditto. + (sigaction): Ditto. + * syscalls.cc (readv): Force pending signal delivery before I/O. + (writev): Ditto. + (open): Ditto. + * net.cc: Ditto, throughout. + * sigproc.cc (sig_dispatch_pending): Deliver any pending signals prior + to returning. + + * tty.cc (tty::make_pipes): Increase pipe buffer size. + +2002-11-22 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Fix comment. + +2002-11-21 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * external.cc (cygwin_internal): Fix va_arg references. + +2002-11-21 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sigthread::get_winapi_lock): Just do standard 'give up + timeslice' wait. + (setup_handler): Revamp YA to attempt to deliver signal multiple times + on failure rather than punting to wait_sig. + * miscfuncs.cc (low_priority_sleep): Accept INFINITE sleep to mean + "don't reset the priority after setting it to idle". Return previous + priority. + * winsup.h (SLEEP_0_STAY_LOW): Define. + (low_priority_sleep): Return an int. + * sigproc.h: Define WAIT_SIG_PRIORITY here. + * sigproc.cc: Remove WAIT_SIG_PRIORITY definition. + +2002-11-20 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h: Declare internal_getpwsid and internal_getgrsid. + Undeclare internal_getpwent. Define DEFAULT_UID_NT. Change + DEFAULT_GID. + * passwd.cc (internal_getpwsid): New function. + (internal_getpwent): Suppress. + (read_etc_passwd): Make static. Rewrite the code for the completion + line. Set curr_lines to 0. + (parse_pwd): Change type to static int. Return 0 for short lines. + (add_pwd_line): Pay attention to the value of parse_pwd. + (search_for): Do not look for nor return the DEFAULT_UID. + * grp.cc (read_etc_group): Make static. Free gr_mem and set + curr_lines to 0. Always call add_pwd_line. Rewrite the code for the + completion line. + (internal_getgrsid): New function. + (parse_grp): If grp.gr_mem is empty, set it to &null_ptr. + Never NULL gr_passwd. + (getgrgid32): Only return the default if ntsec is off and the gid is + ILLEGAL_GID. + * sec_helper.cc (cygsid::get_id): Use getpwsid and getgrsid. + (cygsid_getfrompw): Clean up last line. + (cygsid_getfromgr): Ditto. + (is_grp_member): Use getpwuid32 and getgrgid32. + * uinfo.cc (internal_getlogin): Set DEFAULT_GID at start. + Use getpwsid. Move the read of /etc/group after the second access + to /etc/passwd. Change some debug_printf. + +2002-11-20 Steven O'Brien <steven.obrien2@ntlworld.com> + + * poll.cc (poll): ...but set POLLIN instead. + +2002-11-20 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (get_attribute_from_acl): Always test "anti", + just in case an access_denied ACE follows an access_allowed. + Handle the case owner_sid == group_sid, with a FIXME. + Remove unnecessary tests for non-NULL PSIDs. + (alloc_sd): Use existing owner and group sids if {ug}id == -1. + Handle case where owner_sid == group_sid. + Do not call is_grp_member. Try to preserve canonical ACE order. + Remove unnecessary tests for non-NULL PSIDs. Reorganize + debug_printf's. + (get_initgroups_sidlist): Put well_known_system_sid on left + side of ==. + (add_access_denied_ace): Only call GetAce if inherit != 0. + (add_access_allowed_ace): Ditto. Use appropriate sizeof. + * syscalls.cc (chown_worker): Pass {ug}id equal to -1 to + alloc_sd, which removes the need to obtain old_{ug}id. + (chmod): Remove call to get_file_attribute (), simply pass + {ug}id equal to -1 to alloc_sd. + +2002-11-20 Corinna Vinschen <corinna@vinschen.de> + + * poll.cc (poll): Don't set POLLERR if a listening socket has a + pending connect. Don't use errno value from call to + fhandler_socket::recvfrom(). + +2002-11-19 Christopher Faylor <cgf@redhat.com> + + * net.cc: Sprinkle sigframes throughout. + +2002-11-16 Christopher Faylor <cgf@redhat.com> + + * tty.cc (tty::make_pipes): Make pipe buffer larger. + +2002-11-15 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (getgroups32): Protect against closing cygheap->user.token. + +2002-11-15 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump API_MINOR to accommodate below + changes. + +2002-11-14 Sergey Okhapkin <sos@prospect.com.ru> + + * cygwin.din (siginterrupt): New export. + * signal.cc (siginterrupt): New. + +2002-11-15 Sergey Okhapkin <sos@prospect.com.ru> + + * select.cc (peek_serial): Don't call PurgeComm() to avoid characters + loss. + +2002-11-14 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (setup_handler): Add debugging output. Set thread + priority to idle if pending signals to allow other threads to get into + interruptible state. + * miscfuncs.cc (sys_mbstowcs): Save current thread in variable to avoid + an OS call. + * wait.cc (wait_sig): Reset thread priority each time through loop + since the priority may have been set down to deal with pending signals. + +2002-11-14 Christopher Faylor <cgf@redhat.com> + + * fhandler_serial.cc (fhandler_serial::tcgetattr): Don't take any + special action when vmin_ == 0. + +2002-11-14 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgroups32): Revert previous patch. Use impersonation + token if process is in impersonated state. + * sec_helper.cc (is_grp_member): Rewrite. Call getgroups32 only + for current user. Scan passwd and group info otherwise. + +2002-11-14 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::write): Allow characters >= + 0177 to be displayed in the title bar. + +2002-11-14 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgroups32): Don't use access token of current user when + retrieving group info for another user. + +2002-11-13 Christopher Faylor <cgf@redhat.com> + + * dll_init.cc (dll_list::detach): Eliminate reliance on passed in dll + address. Infer from module of caller instead. + (cygwin_detach_dll): Ignore dll_index argument. + * dll_init.h (dll_list::detach): Reflect argument change above. + +2002-11-13 Christopher Faylor <cgf@redhat.com> + + * ioctl.cc (ioctl): Always print ioctl results, even when it's a tty. + +2002-11-13 Christopher Faylor <cgf@redhat.com> + + * winsup.h (low_priority_sleep): Declare. + +2002-11-13 Christopher Faylor <cgf@redhat.com> + + * miscfuncs.cc (low_priority_sleep): New function. Use throughout + where code is supposed to be giving up time slice. + + * fhandler_console.cc (fhandler_console::read): Switch button 2/3 + output escape sequences to be consistent with xterm. + +2002-11-12 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (chmod): Simplify conditional. + * sec_helper (cygsid::getfromstr): Reorganize to remove + calls to strcpy and strtok_r. + (cygsid::getfromgr): Change type to __uid32_t instead of int. + Keep only the allow_ntsec branch. Never call LookupAccountSid + which calls PDCs, simply return -1 in case of failure. + Use cygsid == instead of calling EqualSid and remove test + for NULL psid. + * security.h: Declare cygsid::getfromgr as __uid32_t. + +2002-11-10 Corinna Vinschen <corinna@vinschen.de> + + * net.cc: Run indent. + +2002-11-10 Alexander Gottwald <Alexander.Gottwald@s1999.tu-chemnitz.de> + + * autoload.cc (GetIfEntry): Add symbol. + * net.cc (get_2k_ifconf): Get the interface entries with the GetIfEntry + call intead of the GetIfTable call. Clean-up multiple IP address naming. + +2002-11-09 Sergey Okhapkin <sos@prospect.com.ru> + + * fhandler.h (class fhandler_pipe): New ioctl() method. + * pipe.cc (fhandler_pipe::ioctl): New. + +2002-11-07 Christopher Faylor <cgf@redhat.com> + + * fhandler_serial.cc (fhandler_serial::ioctl): Fix typo. + +2002-11-07 Christopher January <chris@atomice.net> + + * include/cygwin/fs.h: New file. + * include/cygwin/hdreg.h: New file. + * fhandler_floppy.cc (fhandler_floppy::ioctl): Add implementation for + HDIO_GETGEO, BLKGETSIZE, BLKGETSIZE64, BLKRRPART and BLKSSZGET ioctls. + +2002-11-07 Gilles Courcoux <Gilles.Courcoux@col.bsf.alcatel.fr> + + * fhandler_socket.cc (fhandler_socket::ioctl): Return correct flags + for loopback interface when name is given on input instead of address. + +2002-11-07 Jason Tishler <jason@tishler.net> + + * cygwin.din: Export fseeko() and ftello(). + * include/cygwin/version.h: Bump API minor version. + +2002-11-06 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (keytable[]): Revert previous change. It would + break too many things. + +2002-11-06 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (keytable[]): Redefine F1 - F5 to something a + little more sensical. + +2002-11-06 Sergey Okhapkin <sos@prospect.com.ru> + + * syscalls.cc (getutid): Use UT_IDLEN where appropriate. + +2002-11-06 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump API minor number for below export. + +2002-11-06 Sergey Okhapkin <sos@prospect.com.ru> + + * cygwin.din (pututline): New exported function. + * syscalls.cc (login): Use pututiline(). + (setutent): Open utmp as read/write. + (endutent): Check if utmp file is open. + (utmpname): call endutent() to close current utmp file. + (getutid): Enable all cases, use strncmp() to compare ut_id fields. + (pututline): New. + * tty.cc (create_tty_master): Set ut_pid to current pid. + +2002-11-05 Christopher Faylor <cgf@redhat.com> + + * fhandler_serial.cc (fhandler_serial::ioctl): Don't try to figure out + if OS has the capability to retrieve RTS/CTS. Just set default values + if DeviceIoControl fails. (suggested by Sergey Okhapkin) + +2002-11-05 Sergey Okhapkin <sos@prospect.com.ru> + + * fhandler_serial.cc (fhandler_serial::raw_read): Use correct type for + minchars. + (fhandler_serial::ioctl): Set errno if the ClearCommError fails. + (fhandler_serial::tcsetattr): Use correct value for vmin_. + (fhandler_serial::tcgetattr): Ditto. + +2002-11-05 Thomas Pfaff <tpfaff@gmx.net> + + * fhandler_socket.cc (fhandler_socket::recvmsg): Call if from == NULL + WSARecvFrom with fromlen = NULL. + +2002-11-04 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::commune_send): Fix thinko in previous checkin. + +2002-11-04 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::commune_send): Set priority low when sleeping, + waiting for commune completion so that we don't spin waiting for lower + priority processes. + +2002-11-04 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (WAIT_SIG_PRIORITY): Bump to THREAD_PRIORITY_TIME_CRITICAL. + +2002-11-04 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::commune_send): Initialize buffer or suffer random + crashes. + +2002-11-04 Christopher Faylor <cgf@redhat.com> + + * fhandler_process.cc (fhandler_process::fill_filebuf): Deal with error + condition from cmdline retrieval. + +2002-11-04 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (WAIT_SIG_PRIORITY): Bump to highest priority. + +2002-11-04 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-11-03 Christopher Faylor <cgf@redhat.com> + + * fhandler_serial.cc (fhandler_serial::ioctl): Reformat. Set errno + appropriately. Exit from the bottom. Correctly deal with third + argument for TCFLSH. (Suggested by Sergey Okhapkin) + +2003-11-03 Sergey Okhapkin <sos@prospect.com.ru> + + * fhandler_tty.cc (fhandler_tty_slave::ioctl): Do nothing if the new + window size is equal to the old one. Send SIGWINCH if slave connected + to a pseudo tty. + (fhandler_pty_master::ioctl): Do nothing if the new window size is + equal to the old one. + +2002-10-31 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler_base::open): Verify pc isn't NULL. + +2002-10-30 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-10-30 Christopher Faylor <cgf@redhat.com> + + * external.cc (cygwin_internal): Implement CW_CMDLINE. + * pinfo.h (SIGCOMMUNE): New signal type. + (commune_result): New structure for commune functions. + (picom): New enum for commune functions. + (_pinfo::hello_pid): New. Pid who's communicating with me. + (_pinfo::tothem): New. Handle of communicating pipe. + (_pinfo::fromthem): Ditto. + (_pinfo::commune_recv): Declare. + (_pinfo::commune_send): Declare. + (_pinfo::alive): Declare. + (_pinfo::cmdline): Declare. + (_pinfo::lock): Declare. + * pinfo.cc (set_myself): Initialize new _pinfo lock. + (_pinfo::alive): Define. Determines if process still exists. + (_pinfo::commune_recv): Define. Receive info from another cooperating process. + (_pinfo::commune_send): Define. Send info to another cooperating process. + (_pinfo::cmdline): Define. Determine command line of a given process. + * include/sys/cygwin.h (CW_CMDLINE): Define. + + *sigproc.cc (talktome): Communicate with any processes who want to talk + to me. + (wait_sig): Honor __SIGCOMMUNE. + + * fhandler.cc (fhandler_virtual::fixup_after_exec): Declare. + * fhandler_proc.cc: Use malloc/free/realloc throughout rather than + cmalloc since buffers don't need to be propagated to subprocesses. + * fhandler_registry.cc: Ditto. + * fhandler_virtual.cc: Ditto. + (fhandler_virtual::fixup_after_exec): Define. + * fhandler_process.cc: Ditto for malloc/free/realloc. + (process_listin): Add "cmdline". + (fhandler_process::fill_filebuf): Implement PROCESS_CMDLINE. + + * miscfuncs.cc (isalpha_array): New array populated with xor values for + alpha characters to switch from one case to another. + * string.h (cygwin_strcasematch): New asm implementation of case match. + * string.h (cygwin_nstrcasematch): New asm implementation of counted + case match. + +2002-10-24 Pierre Humblet <pierre.humblet@ieee.org> + + * pwdgrp.h (pwdgrp_read::open): Compare fh to INVALID_HANDLE_VALUE. + +2002-10-22 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Nevermind. + Revert everything to previous state wrt ntsec and exec bits. + +2002-10-22 Christopher Faylor <cgf@redhat.com> + + * shared.cc (shared_info::initialize): Use correct value for version + comparison. + * include/cygwin/version.h (CYGWIN_VERSION_MAGIC): Use all of a DWORD + for magic calculation. + +2002-10-22 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Oops. Only + do the executable thing for #! scripts since .exe files wouldn't be + executable in ntsec case regardless. + +2002-10-22 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always + consider .exe files and '#!' shell scripts to be executable. + +2002-10-22 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::exiting): New variable. + (cygthread::initialized): Delete. + (cygthread::stub): Use exiting variable to determine when to exit. + (cygthread::runner): Delete. + (cygthread_protect): New variable. + (cygthread::init): Don't start runner thread. Initialize muto for list + protection. + (cygthread::freerange): Return pointer to cygthread. + (cygthread::operator new): Change logic to start threads on an + as-needed basis. + (cygthread::detach): Don't zero id. + (cygthread::terminate): Don't kill any executing threads. Just set + exiting flag. + * cygthread.h (cygthread): Reflect above changes. + * dcrt0.cc (dll_crt0_1): Move cygthread initialization later. + + * fork.cc (fork_child): Do fdtab fixup after dll fixup or (apparently) + winsock may allocate memory in dll load address. + +2002-10-22 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_helper.cc (cygsid::get_id): If the sid matches a sid stored in + cygheap->user, return the uid or gid from myself. + * security.cc (alloc_sd): If gid == myself->gid, return the group sid + from cygheap->user. Remove the test for uid == original_uid, which is + counter-productive. + +2002-10-22 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cygheap_fixup_in_child): Use user_heap element in + cygheap. + (init_cheap): Ditto for declaration. + * fork.cc (fork_parent): Use user_heap element in cygheap. + * heap.h (inheap): Ditto. + * heap.cc (sbrk): Ditto. + (heap_init): Ditto. Reorganize to shrink heap chunk as required and + record new value in cygheap. + * dcrt0.cc (dll_crt0_1): More "move the cygthread init" games. + * shared.cc (open_shared): Rework memory protection to properly deal + with relocated shared segment. + (shared_info::heap_chunk_size): Rename element to 'heap_chunk'. + * shared_info.h (shared_info): Ditto for declaration. + * strace.cc (strace::hello): Report on heap chunk size from cygheap + since it may shrink. + +2002-10-20 Christopher Faylor <cgf@redhat.com> + + Change _function() to function() throughout. + * cygwin.din: Remove last vestiges (?) of newlib wrappers. + +2002-10-20 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::detach): Always wait for event or suffer an + apparently inavoidable race. + * dcrt0.cc (dll_crt0_1): Allocate threads after stack has been + relocated. + * debub.cc (lock_debug): Don't acquire lock on exit. + * fork.cc (fork_child): Recreate mmaps before doing anything else since + Windows has a habit of using blocks of memory in the child that could + previously have been occupied by shared memory in the parent. + * mmap.cc (fhandler_disk_file::fixup_mmap_after_fork): Issue error here + and provide some details about what went wrong. + (fixup_mmaps_after_fork): Remove error message. + * shared.cc (open_shared): Move warning message so that more detail is + possible. + * sigproc.cc (sigproc_init): Initialize sync_proc_subproc to avoid a + race. + (sigproc_terminate): Specifically wait for process thread to terminate. + +2002-10-20 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Fix typo. + (cygthread::terminate): Don't zero thread handle prior to using it. + +2002-10-20 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig): Remove obsolete sigchld logic. + +2002-10-20 Christopher Faylor <cgf@redhat.com> + + Rename _kill() to kill() throughout. Rename _raise() to raise() + throughout. Rename _pid() to pid() throughout. + * Makefile.in: Compile some objects with -fomit-frame-pointer. + * cygwin.din: Reverse aliasing for _kill. + * syscalls.cc (_getpid_r): New function, implemented for newlib + compatibility. + + * shared.cc (open_shared): Remove reserving of memory since previous + change eliminate the need for this hack. + +2002-10-19 Christopher Faylor <cgf@redhat.com> + + * fork.cc (fork_child): Move pinfo fixup later to attempt some minor + gains from concurrency with cythread::init. + +2002-10-18 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dll_crt0_1): Initialize cygwin threads here only when not + forking. + * fork.cc (fork_child): Initialize cygwin thread later in process to + avoid allocating memory for thread stacks. + * shared.cc (open_shared): Issue warning if NT and shared segment is + relocated. + +2002-10-18 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc: Bump number of cygthreads up to accommodate + applications which use ttys. + +2002-10-18 Christopher Faylor <cgf@redhat.com> + + * fork.cc (fork_child): Move mmap initialization. + * shared.cc (shared_info::heap_chunk_size): Store info as megabytes. + Search HKEY_LOCAL_MACHINE as well as HKEY_CURRENT_USER. + * shared_info.h (shared_info::initial_heap_size): Change element name + to reflect new functionality. + * strace.cc (strace::hello): Report on initial heap size. + +2002-10-18 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (verifyable_object_isvalid): Test for a valid object + pointer before testing for static ptr. + +2002-10-17 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::init_std_file_from_handle): Force "devices" to + always be in binary mode. Temporary fix until ssh is rebuilt? + +2002-10-17 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::set_file_pointers_for_exec): New function. + * dtable.h (dtable::set_file_pointers_for_exec): Declare new function. + * spawn.cc (spawn_guts): Call dtable::set_file_pointers_for_exec to set + pointers to EOF when execing non-cygwin applications. + +2002-10-17 Robert Collins <rbtcollins@hotmail.com> + + * thread.h (pthread_mutex::isGoodInitializerOrBadObject): Declare. + * thread.cc (pthread_mutex::isGoodInitializerOrBadObject): Implement. + (pthread_mutex::init): Use isGoodInitializerOrBadObject to avoid + unneeded SEGV's during debugging. + +2002-10-17 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (verifyable_object_isvalid): Test for static object first. + +2002-10-16 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::read): Attempt #527 to properly + implement VMIN/VTIME. + +2002-10-15 Christopher Faylor <cgf@redhat.com> + + * shared.cc (open_shared): Revert to "old" method for shared memory + location if !wincap.needs_memory_protection. + * wincap.cc: Implement needs_memory_protection throughout. + * wincap.h: Ditto. + +2002-10-15 Christopher Faylor <cgf@redhat.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. + (child_info_fork::mount_table): Remove. + (child_info_fork::myself_addr): Remove. + * fork.cc (fork_child): Don't set either of the above. + * dcrt0.cc (dll_crt0_1): Call memory_init as early as possible. + * fhandler_console.cc (console_state): Move to shared_info.h. + (fhandler_console::get_tty_stuff): Reflect open_shared arg change. + * pinfo.cc (myself_addr): Remove definition. + (pinfo::init): Get myself address from open_shared. + * pinfo.h (myself_addr): Remove declaration. + * shared.cc (open_shared): Rework so that known shared memory locations + are protected. Take shared memory type as fifth argument. + (memory_init): Reflect open_shared arg change. + * shared_info.h (shared_locations): New enum. + (console_state): Move here. + (open_shared): Reflect open_shared arg change in declaration. + +2002-10-14 Christopher Faylor <cgf@redhat.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. + (child_info_fork::heaptop): Remove obsolete element. + (child_info_fork::heabbase): Ditto. + (child_info_fork::heapptr): Ditto. + (child_info_fork::mount_table): New element. + (child_info_fork::myself_addr): Ditto. + * dcrt0.cc (dll_crt0_1): Set mount_table and myself_addr when forking. + (initial_env): Add newline to "sleeping" message. + * dll_init.cc (reserve_upto): Accommodate cygwin heap when freeing + memory. Make debugging output a little more descriptive. + * fork.cc (fork_parent): Save mount_table and myself_addr. + * pinfo.cc (myself_addr): New variable. + (set_myself): Pass PID_MYSELF flag to init. + (pinfo::init): Honor PID_MYSELF. Save address where myself shared + memory resides in myself_addr, for fork. + * pinfo.h (myself_addr): Declare. + * shared.cc (memory_init): On fork, use previously saved address for + location of mount table. + * include/sys/cygwin.h (PID_MYSELF): New value. + + * dtable.cc (dtable::stdio_init): Don't pass access type to + init_std_file_from_handle. It's always the same. + (dtable::init_std_file_from_handle): Remove access type argument. + Assume read/write. + * dtable.h (dtable::init_std_file_from_handle): Ditto for declaration. + + * exceptions.cc (try_to_debug): Don't try to debug if already being + debugged. + + * fhandler_console.cc (shared_console_info_save): New variable. + (fhandler_console::get_tty_stuff): Save address of shared console stuff + for fork. + +2002-10-13 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Reintroduce clearing of __name but do + it before SetEvent to eliminate a race. + (cygthread::terminate): Accumulate list of threads to check for + termination and call WaitForMultipleObjects on list rather than waiting + for each thread individually. + * sigproc.cc (subproc_init): Zap hwait_subproc thread handle since it + is no longer used. + +2002-10-13 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawn_guts): Fix so that cygthread::terminate is *really* + called only for exec. + +2002-10-13 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Don't zero __name here. That + introduces a race. + +2002-10-13 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-10-13 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Don't create event for long-running + threads. Initialize thread_sync event here which is used to Suspend + using an event rather than relying on SuspendThread/ResumeThread. + (cygthread::init): Save handle to runner thread for future termination. + (cygthread::cygthread): Only resume thread when it is actually + suspended. Otherwise signal thread completion event. + (cygthread::terminate): Forcibly terminate runner thread and any helper + threads. Call DisableThreadLibrary calls if execing. + * cygthread.h (cygthread::thread_sync): Declare. + * dcrt0.cc (do_exit): Eliminate calls to obsolete window_terminate and + shared_terminate. + * exceptions.cc (events_terminate): Don't bother closing title_mutex + since it is going away anyway. + * pinfo.cc (_pinfo::exit): Call cygthread::terminate to ensure that + threads are shut down before process exit or otherwise strange races + seem to occur. + * shared.cc (shared_terminate): Eliminate. + * shared.h (shared_terminate): Eliminate declaration. + * winsup.h (window_terminate): Eliminate declaration. + * spawn.cc (spawn_guts): Call cygthread::terminate early in process if + execing. Call DisableThreadLibrary calls if execing. + * window.cc (Winmain): Call ExitThread to force exit. + (window_terminate): Eliminate. + + * dcrt0.cc (do_exit): Track exit state more closely. + +2002-10-10 Christopher Faylor <cgf@redhat.com> + + * window.cc (gethwnd): Use SetThreadPriority method. + +2002-10-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (new-cygwin1.dll): Reorganize library order. + + * dcrt0.cc (do_exit): Move thread stuff after vfork stuff or threads + are terminated during vfork. + * sigproc.cc (proc_terminate): Grab proc lock prior to signalling + subproc thread exit to avoid an extra "wait-for-thread-to-exit". + +2002-10-09 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Don't create an event for "cygself" + threads. Assume that they exit via an ExitThread call. + * cygthread.h (cygthread::SetThreadPriority): New function. + (cygthread::zap_h): New function. + * dcrt0.cc (do_exit): Move cygthread::terminate earlier and establish + exit_state guard. + * fhandler.h (fhandler_tty_master::output_thread): Delete. + * fhandler_tty.cc (fhandler_tty_master::init): Set priority for threads + via method. Zap handles when done. Don't treat process_output + specially. + (process_output): Call ExitThread directly. + (fhandler_tty_master::fixup_after_fork): Don't worry about + output_thread. + (fhandler_tty_master::fixup_after_exec): Ditto. + * sigproc.cc (proc_terminate): Don't detach from hwait_subproc. Just + let it exit. + (sigproc_init): Close thread handle after initialization. + (wait_sig): Use GetCurrentThread() as SetThreadPriority call rather + than *event* handle. Call ExitThread directly on termination. + (wait_subproc): Call ExitThread directly on termination. + * tty.cc (tty_list::terminate): Don't attempt to detach from + output_thread. + +2002-10-08 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (dup_now): Make fatal error a little more informative. + (cygheap_setup_for_child): Detect when default size of shared region is + less than the current size and allocate that much. + (_cbrk): Just return NULL on inability to allocate. + (_cmalloc): Ditto. + * cygheap.h (CYGHEAPSIZE): Change size to reflect newer, tinier + fhandler sizes. + * spawn.cc (av::error): New element, reflects potential errno from cmalloc. + (av::~av): Don't free NULL pointers. + (av::replace0_maybe): Detect out-of-memory conditions. + (av::dup_maybe): Ditto. + (av::dup_all): Ditto. + (av::unshift): Ditto. + (spawn_guts): Set errno and return if argv creation ran into problems. + + * fhandler.h (fhandler_union): Change member names to something safer. + + * fhandler_console.cc (fhandler_console::get_tty_stuff): Always set + fhandler_console::dev_state regardless of whether shared region is + initialized. + + * cygthread.cc (cygthread::runner): Use ExitThread rather than return + (planning for future). + +2002-10-08 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (dev_console): New class. + (fhandler_console::dev_state): New class element. + (fhandler_console::mouse_aware): Use dev_state element. + (fhandler_console::get_tty_stuff): Declare new function. + * fhandler_console.cc: Use dev_state fhandler_console element, + throughout. + (fhandler_console::get_tty_stuff): Move to fhandler_console class. + Incorporate dev_console information. Move constructor stuff here. + +2002-10-07 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::init_std_file_from_handle): Try to mimic standard + open behavior with files redirected from stdin/stdout/stderr, i.e., + fmode settings take precedence over mount settings. + +2002-10-07 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (unknown_file): New variable. + (dtable::init_std_file_from_handle): Don't set binmode if we couldn't + determine the actual file name on stdin/stdout/stderr. + (handle_to_fn): Return unknown_file when can't determine filename. + +2002-10-07 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (do_exit): Call DisableThreadLibraryCalls since we don't + need to track thread detaches. + * init.cc (dll_entry): Reorganize slightly. Fix api_fatal message. + +2002-10-05 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Very minor cleanup. + (cygthread::stub): Report overflows in cygwin thread pool when + DEBUGGING is on and special environment variable is not set. + (cygthread::terminate): Set event only when event actually exists. + * exceptions.cc (signal_exit): Set priority of main thread to low + before setting current thread to high. + +2002-10-01 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_key::keys): Copy on fork. Add a comment explaining + why. + (pthreadNull::_instance): Copy on fork. Absolutely no state exists + in pthreadNull. + +2002-09-30 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_transport_pipes.cc (transport_layer_pipes::accept): + Remove trailing \n from debug_printf. + +2002-09-30 Christopher Faylor <cgf@redhat.com> + + * thread.cc (pthread_mutex::initMutex): Remove \n from api_fatal. + +2002-09-30 Christopher Faylor <cgf@redhat.com> + + * thread.cc (pthread::precreate): Use explicit "no inherit" option when + creating mutex. + (pthread_mutex::nativeMutex::init): Ditto. + +2002-09-30 Christopher Faylor <cgf@redhat.com> + + * thread.cc (pthread_key::keys): Do not copy on fork. + (pthread_mutex::mutexInitializationLock): Ditto. + (pthreadNull::_instance): Ditto. + +2002-09-30 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (unused_sig_wrapper): Still need additional level of + indirection when setting errno. + +2002-09-30 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_mutex::initMutex): Use the wrapper init call. + (pthread_mutex::nativeMutex::init): Implement. + (pthread_mutex::nativeMutex::lock): Ditto. + (pthread_mutex::nativeMutex::unlock): Ditto. + (pthread_mutex::init): Use the wrapper lock and unlockcalls. + * thread.h (pthread_mutex): Move mutexInitializationLock into a + nativeMutex wrapper class. + +2002-09-30 Christopher Faylor <cgf@redhat.com> + + Remove \n from calls to strace class printfs throughout. + +2002-09-30 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (unused_sig_wrapper): Accommodate newer compilers. + +2002-09-29 Christopher Faylor <cgf@redhat.com> + + * security.cc (allow_ntsec): Default to zero. + * environ.cc (environ_init): Set allow_ntsec to TRUE by default, + assuming OS allows it. + +2002-09-29 Christopher Faylor <cgf@redhat.com> + + * environ.cc (environ_init): Avoid a compiler warning. + * path.cc (path_conv::check): Ditto. + * path.h (path_conv::operator int): Ditto. + * regex/engine.c: Ditto throughout. + * regex/regcomp.c: Ditto throughout. + * regex/regexec.c: Ditto throughout. + +2002-09-29 Christopher Faylor <cgf@redhat.com> + + * thread.cc: Use "%E" in *_printf throughout rather than calling + GetLastError. GNUify comments. + (__pthread_mutex_lock): Don't return error on EBUSY since that just + means that the mutex has already been initialized. + +2002-09-30 Robert Collins <rbtcollins@hotmail.com> + + * pthread.cc (pthread_mutex_init): Use new pthread_mutex::init. + * thread.cc: Change __pthread_mutex_init to pthread_mutex::init + throughout. + (MTinterface::Init): Initialise pthread_mutex support. + (pthread_mutex::mutexInitializationLock): Instantiate. + (pthread_mutex::initMutex): New method. + (__pthread_cond_dowait): Don't dereference untrusted pointers. + Use the new pthread_mutex::init method. + (__pthread_condattr_init): Don't dereference untrusted pointers. + (__pthread_mutex_init): Rename to pthread_mutex::init. + Lock and release mutexInitializationLock to prevent races on + mutex initialisation. + * thread.h (pthread_mutex::initMutex): New method, initialise + pthread_mutex supporting state on process initialisation. + (pthread_mutex::init): Initialise a single mutex. + (pthread_mutex::mutexInitializationLock): A win32 mutex for + syncronising pthread mutex initialisation. + (__pthread_mutex_init): Remove this. + +2002-09-28 Christopher Faylor <cgf@redhat.com> + + * thread.h (verifyable_object:~verifyable_object): Make virtual. + +2002-09-28 Christopher Faylor <cgf@redhat.com> + + * cygthread.h (cygthread::terminate): Declare new function. + (cygthread::initialized): Change to 'int'. + * cygthread.cc (cygthread::stub): Exit thread if initialized < 0. + (cygthread::new): Ditto. + (cygthread::runner): Ditto. Set initialized using xor to preserve + sign. + (cygthread::terminate): New function. + * dcrt0.cc (do_exit): Call cygthread::terminate. + +2002-09-27 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_key::run_destructor): Run_destructor is not + const as it needs to set the key value. + * thread.h (pthread_key::run_destructor): Ditto. + +2002-09-27 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_key::run_destructor): Follow opengroup algorithm. + I.e. only run the destructor NON-NULL key values, and reset the key + to NULL before running the destructor. Reported by Thomas Pfaff. + +2002-09-25 Christopher Faylor <cgf@redhat.com> + + * cygrun.c (main): Fix setting of CYGWIN environment variable. + + * Makefile.in: Remove linking of unnecessary libraries. + +2002-09-24 Christopher January <chris@atomice.net> + + * fhandler_proc.cc (format_process_stat): make ctty a real device + number. + (format_process_status): use effective uid/gid as real and saved + uid/gid. + +2002-09-24 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_INVALID_ADDRESS to new errno code + EOVERFLOW. + (_sys_errlist): Add entries for EILSEQ and EOVERFLOW. + (strerror): Ditto. + * mmap.cc (map_map): Set errno in case of error. + (mmap64): Remove setting errno explicitely to ENOMEM. + +2002-09-24 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (map_map): Add debug output. + (mmap64): Evaluate gran_len correctly even if offset isn't 0. + +2002-09-22 Christopher Faylor <cgf@redhat.com> + + More GNUify non-GNU formatted functions calls throughout. + +2002-09-22 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (DLL_O_FILES): Restore formatting. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + GNUify non-GNU formatted functions calls throughout. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc (with_strerr): Remove macro. + (server_shmmgr::segment_t::~segment_t): Remove calls to with_strerr. + (server_shmmgr::segment_t::attach): Ditto. + (server_shmmgr::new_segment): Ditto. + * shm.cc (with_strerr): Remove macro. + (client_shmmgr::shmdt): Remove calls to with_strerr. + (client_shmmgr::attach): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/sys/ipc.h: Move to "include/cygwin/ipc.h". + * include/sys/msg.h: Move to "include/cygwin/msg.h". + * include/sys/sem.h: Move to "include/cygwin/sem.h". + * include/sys/shm.h: Move to "include/cygwin/shm.h". + * include/cygwin/ipc.h: New file. + * include/cygwin/msg.h: Ditto. + * include/cygwin/sem.h: Ditto. + * include/cygwin/shm.h: Ditto. + * cygserver_shm.h: Update includes. + * msg.cc: Ditto. + * sem.cc: Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * safe_memory.h (safe_delete): Make a templated function. + * cygserver.cc (~server_request): Update use of safe_delete. + (main): Ditto. + * cygserver_client.cc (client_request::handle_request): Ditto. + (client_request::make_request): Ditto. + * cygserver_process.cc (~process_cleanup): Ditto. + (process::remove): Ditto. + (process::cleanup): Ditto. + (process_cache::process): Ditto. + * cygserver_shm.cc (server_shmmgr::segment_t::detach): Ditto. + (server_shmmgr::delete_segment): Ditto. + * shm.cc (client_shmmgr::shmdt): Ditto. + * threaded_queue.cc (~threaded_queue): Ditto. + (threaded_queue::worker_loop): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * safe_memory.h: Replace #include <new> with an explicit + definition of the placement new operator. + (safe_delete): Remove unnecessary ## operator. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc (class server_shmmgr): Remove `cleanup_t' + friend declaration. + (cleanup_t::cleanup_t): Use the segment's shmid as the key rather + than the segment pointer itself. + (cleanup_t::segptr): Remove method. + (cleanup_t::shmid): New method. + (cleanup_t::cleanup): Update for new key value. + (server_shmmgr::find (segment_t *)): Remove method. + * include/cygwin/cygserver_process.h (cleanup_routine::key): Make + method const. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver_process.h + (cleanup_routine::_key): New field. + (cleanup_routine::cleanup_routine): Initialise new field with new + argument. + (cleanup_routine::operator==): New method. + (cleanup_routine::key): New method. + (cleanup_routine::cleanup): Make argument non-const. + (process::is_active): New method. + (process::remove): Ditto. + (process::check_exit_code): Rename method. + * cygserver_process.cc (process::add): Reorganize code. + (process::remove): New method. + (process::check_exit_code): Rename method. + (process::cleanup): Use new `process::is_active' method. + (process_cache::process): Ditto. + (process_cache::sync_wait_array): Ditto. + (process_cache::check_and_remove_process): Ditto. + * cygserver_shm.cc (server_shmmgr): Make `cleanup_t' a friend. + (segment_t::detach): Make argument non-const. Remove cleanup + object from client if appropriate. + (cleanup_t::_segptr): Remove field. + (cleanup_t::cleanup_t): Initialise parent explicitly. Remove + field. + (cleanup_t::segptr): New method. + (cleanup_t::cleanup): Add error checking and reporting. + (server_shmmgr::shmdt): Make argument non-const. + (server_shmmgr::find (segment_t *)): New method. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc (client_request_shutdown::client_request_shutdown): + Comment out verbose tracing statement. + * cygserver_client.cc + (client_request_get_version::client_request_get_version): Ditto. + (client_request_attach_tty::client_request_attach_tty): Ditto. + * cygserver_shm.cc (client_request_shm::client_request_shm): + Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_transport_pipes.cc (transport_layer_pipes::listen): + Set `_is_listening_endpoint' appropriately. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver_transport.h + (transport_layer_base::listen): Change return type. + (transport_layer_base::connect): Ditto. + * include/cygwin/cygserver_transport_pipes.h + (transport_layer_pipes::listen): Change return type. + (transport_layer_pipes::connect): Ditto. + (transport_layer_pipes::_sec_none_nih): Remove unused field. + (transport_layer_pipes::_is_listening_endpoint): New field. + * cygserver_transport_pipes.cc: Synchronize with sockets code. + (transport_layer_pipes::transport_layer_pipes): Initialise new + field. Separate out asserts. + (transport_layer_pipes::listen): Change return type. Add asserts. + (transport_layer_pipes::accept): Add asserts. + (transport_layer_pipes::read): Change conditional to an assert. + Add assert. + (transport_layer_pipes::write): Ditto. + (transport_layer_pipes::connect): Change return type. Change + conditional to an assert. Add asserts. Rationalize error code + slightly. + (transport_layer_pipes::impersonate_client): Add asserts. + * include/cygwin/cygserver_transport_sockets.h + (transport_layer_sockets::listen): Change return type. + (transport_layer_sockets::connect): Ditto. + (transport_layer_sockets::_addr): Change type of field. + (transport_layer_sockets::_addr_len): Ditto. + (transport_layer_sockets::_is_accepted_endpoint): New field. + (transport_layer_sockets::_is_listening_endpoint): Ditto. + * cygserver_transport_sockets.cc + (MAX_CONNECT_RETRY): New constant. + (transport_layer_sockets::transport_layer_sockets): Initialise new + fields. Only initialise the socket address where necessary. + (transport_layer_sockets::listen): Change return type. Rewrite. + (transport_layer_sockets::accept): Add asserts. Add tracing + statements. Use a local variable to hold the accepted address. + (transport_layer_sockets::close): Add tracing statements. Unlink + the UNIX domain socket file as appropriate. Close the socket + cleanly. + (transport_layer_sockets::read): Rewrite method. + (transport_layer_sockets::write): Ditto. + (transport_layer_sockets::connect): Change return type. Rewrite. + * cygserver.cc (server_submission_loop::request_loop): Run the + listening thread at high priority with special handling for + shutdown. + (main): Print the request error code rather than errno in shutdown + request code. Install signal handlers with sigaction(2) to avoid + setting SA_RESTART. Check value of the listen method call, now it + has one. + * cygserver_client.cc (client_request::make_request): Check new + return value on connect method call. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver_transport_pipes.h + (cygserver_transport_pipes::_sd): Rename field. + (cygserver_transport_pipes::_sec_none_nih): Ditto. + (cygserver_transport_pipes::_sec_all_nih): Ditto. + (cygserver_transport_pipes::_pipe_name): Ditto. + (cygserver_transport_pipes::_hPipe): Ditto. + (cygserver_transport_pipes::_is_accepted_endpoint): Ditto. + * cygserver_transport_pipes.cc + (transport_layer_pipes::transport_layer_pipes): Rename fields. + (transport_layer_pipes::init_security): Ditto. + (transport_layer_pipes::listen): Ditto. + (transport_layer_pipes::accept): Ditto. + (transport_layer_pipes::close): Ditto. + (transport_layer_pipes::read): Ditto. + (transport_layer_pipes::write): Ditto. + (transport_layer_pipes::connect): Ditto. + (transport_layer_pipes::impersonate_client): Ditto. + (transport_layer_pipes::revert_to_self): Ditto. + * include/cygwin/cygserver_transport_sockets.h + (cygserver_transport_sockets::_fd): Rename field. + (cygserver_transport_sockets::_addr): Ditto. + (cygserver_transport_sockets::_addr_len): Ditto. + * cygserver_transport_sockets.cc + (transport_layer_sockets::transport_layer_sockets): Rename fields. + (transport_layer_sockets::listen): Ditto. + (transport_layer_sockets::accept): Ditto. + (transport_layer_sockets::close): Ditto. + (transport_layer_sockets::read): Ditto. + (transport_layer_sockets::write): Ditto. + (transport_layer_sockets::connect): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc (with_strerr): Fix use of %p format. + * shm.cc (client_shmmgr::shmat): Ditto. + (client_shmmgr::shmctl): Ditto. + (client_shmmgr::shmdt): Ditto. + (client_shmmgr::attach): Ditto. + +2002-09-22 Christopher Faylor <cgf@redhat.com> + + * woutsup.h (system_printf): Remove extraneous semicolon from macro + definition. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_transport_pipes.cc + (transport_layer_pipes::connect): Use ProtectHandle in DLL code. + (transport_layer_pipes::close): Use ForceCloseHandle in DLL code. + +2002-09-22 Nicholas Wourms <nwourms@netscape.com> + + * threaded_queue.h (class queue_submission_loop): Correct friend + declaration for GCC 3.1.1. + * include/cygwin/cygserver_process.h (class process): Ditto. + (class process_cache): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc (server_shmmgr::shmdt): Only call + delete_segment if the segment exists [sic]. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * safe_memory.h: Include <new> rather than <new.h> for gcc 3. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * safe_memory.h: New file extracted from "woutsup.h". + * woutsup.h: Move the "safe" new/delete macros into the new + "safe_memory.h" header file and include that here. + * cygserver_client.cc: Explicitly include "safe_memory.h" for + client-side code. + (client_request::make_request): Use the "safe" new/delete macros + unconditionally, i.e. use them on the client side as well as on + the server side. + * cygserver_transport.cc: Explicitly include "safe_memory.h" for + client-side code. + (create_server_transport): Use the "safe" new/delete macros + unconditionally, i.e. use them on the client side as well as on + the server side. + * shm.cc: Include "safe_memory.h". + (client_shmmgr::instance): Use the "safe" new/delete macros. + (client_shmmgr::shmdt): Ditto. + (client_shmmgr::new_segment): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_process (process::process): Add the client's cygpid + and winpid to all tracing statements as appropriate. + (process::exit_code): Ditto. + (process_cache::check_and_remove_process): Ditto. + * cygserver_shm.cc (server_shmmgr::shmat): Ditto. + (server_shmmgr::shmdt): Ditto. + (server_shmmgr::shmctl): Add a process object argument and remove + the explicit cygpid argument. Add the client's cygpid and winpid + to all tracing statements as appropriate. + (server_shmmgr::shmget): Ditto. + (client_request_shm::serve): Update for the new signature of the + shmctl and shmget methods. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc (client_request_shutdown::serve): Don't set the + shutdown flag directly, but send a SIGINT, as the signal handler + sets the flag and the signal breaks the pause(2) in the main loop. + (print_usage): Add new options. + (main): Add new --cleanup-threads and --request-threads options to + set the number of threads used by the daemon. Use pause(2) rather + the win32 Sleep in the main loop. + * shm.cc (shmat): Add sigframe. + (shmctl): Ditto. + (shmdt): Ditto. + (shmget): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc: Automatically detach processes from any + segments they are attached to at exit. + (class server_shmmgr::attach_t): New class. + (server_shmmgr::segment_t::IS_DELETED): Rename and make private. + (server_shmmgr::segment_t::_sequence): Make private. + (server_shmmgr::segment_t::_flg): Ditto. + (server_shmmgr::segment_t::_hFileMap): Ditto. + (server_shmmgr::segment_t::_attach_head): New private field. + (server_shmmgr::segment_t::segment_t): Initialise new fields. + Make non-inline. + (server_shmmgr::segment_t::~segment_t): New method. + (server_shmmgr::segment_t::is_deleted): Ditto. + (server_shmmgr::segment_t::is_pending_delete): Ditto. + (server_shmmgr::segment_t::mark_deleted): Ditto. + (server_shmmgr::segment_t::attach): Ditto. + (server_shmmgr::segment_t::detach): Ditto. + (server_shmmgr::segment_t::find): Ditto. + (class server_shmmgr::cleanup_t): New class. + (server_shmmgr::_shm_atts): New private field. + (server_shmmgr::shmat): Add a process object argument to replace + the removed process_cache, cygpid and winpid arguments. Remove + the process_cache manipulations. Move body of code to the + segment_t::attach method. Increment _shm_atts when required. + Update tracing statements. + (server_shmmgr::shmdt): Add a process object argument to replace + the removed cygpid argument. Move body of code to the + segment_t::detach method. Decrement _shm_atts when required. + Update tracing statements. + (server_shmmgr::shmget): Use the new segment_t::is_deleted method. + (server_shmmgr::server_shmmgr): Initialise the new _shm_atts + field. + (server_shmmgr::delete_segment): Remove the CloseHandle code, as + this is now done in the segment_t destructor. + (client_request_shm::serve): Look up the client's process object + and pass to the server_shmmgr::shmat and server_shmmgr::shmdt + methods rather than passing the cache, winpid and cygpid. + * cygserver_process.h: Add a cygpid to the process object to make + it more useful and then pass process objects rather than winpids + where possible. + (cleanup_routine::cleanup): Change argument to be a pointer to a + process object. + (class process): Re-order fields for no discernible reason. + (process::_cygpid): New field. + (process::process): Add a cygpid argument. + (process::winpid): New method. + (process::cygpid): Ditto. + (process::add): Make public, as it always should have been. + (process_cache::process): Add a cygpid argument. + * cygserver_process.cc (process::process): Add a cygpid argument + and use it to initialise the `_cygpid' field. Re-order + initialisers to match new field order. + (process::cleanup): Pass `this' rather than just the winpid to + cleanup_routine::cleanup. + (process_cache::process): Add a cygpid argument and pass it to the + process object constructor. + * include/sys/shm.h (shmatt_t): Make unsigned as per SUSv3. + (shm_info::shm_atts): New field. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc (class server_shmmgr::segment_t): Add `_' + prefix to the names of all fields. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * msg.cc: New file of stub functions, no functionality. + * sem.cc: Ditto. + * shm.cc (client_shmmgr::shmctl): Add support for an out shm_info + buffer for the SHM_INFO command. + (client_shmmgr::shmget): Use %X to print keys. + * include/sys/ipc.h: Comment all fields and values. + (IPC_PRIVATE): Change to be non-negative. + * include/sys/msg.h: New file with SUSv3 and ipcs(8) interfaces. + * include/sys/sem.h: Ditto. + * include/sys/shm.h: Comment all fields and values. + (struct shm_info): New struct. + * cygserver_shm.h (client_request_shm::shminfo): Rename. + (client_request_shm::shm_info): New method. + (client_request_shm::_parameters.out.hFileMap): Move into union. + (client_request_shm::_parameters.out.shminfo): Rename. + (client_request_shm::_parameters.out.shm_info): New field. + * cygserver_shm.cc (server_shmmgr::_shm_ids): Rename. + (server_shmmgr::_shm_tot): New field. + (server_shmmgr::shmctl): Rename `out_shminfo' argument. Add + `out_shm_info' argument. Fill in the `out_shm_info' argument in + the SHM_INFO command. + (server_shmmgr::shmget): Check `shmflg' against the mode of + existing segments as per Stevens 1990, p. 123. + (server_shmmgr::server_shmmgr): Initialise the new `_shm_tot' + field. + (server_shmmgr::new_segment): Set ENOMEM if CreateFileMapping + fails. Pass `size' to new_segment. + (server_shmmgr::new_segment): Add size argument and use it to + check against and update the new `_shm_tot' field. + (server_shmmgr::delete_segment): Update the new `_shm_tot' field. + * Makefile.in (DLL_OFILES): Add new DLL object files. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_transport_pipes.cc: The main change is to make the + client try harder to connect to the server if it's previously + connected, and so has good grounds for believing that the server + is running. + (MAX_WAIT_NAMED_PIPE_RETRY): Change to be an enumerator. + (WAIT_NAMED_PIPE_TIMEOUT): Ditto. + (transport_layer_pipes::accept): Use interlocked operators on + `pipe_instance'. + (transport_layer_pipes::close): Rearrange so that FlushFileBuffers + and DisconnectNamedPipe are only called for accepted endpoints. + Use interlocked operators on `pipe_instance'. + (transport_layer_pipes::read): Use set_errno where required. + (transport_layer_pipes::write): Ditto. + (transport_layer_pipes::connect): Add local static variable + `assume_cygserver'. Set it if a connection is made to cygserver, + clear it if a connection is not made even after retrying. If set, + ignore all errors from CreateFile and retry the connection. Catch + the situation where WaitNamedPipe fails to wait [sic] and add a + `Sleep (0)' so that the server gets a chance to run. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * dcrt0.cc: Only check for cygserver if and when required. + (dll_crt0_1): Remove call to `cygserver_init ()'. + * fhandler_tty.cc (fhandler_tty_slave::open): Change the cygserver + logic to allow for the fact that `cygserver_init ()' may not yet + have been called. + (fhandler_tty_slave::cygserver_attach_tty): Tweak the cygserver + request logic to conform to the practice elsewhere in the code. + * tty.cc (tty::common_init): Add an explicit call to + `cygserver_init ()' if it hasn't already been called. + * include/cygwin/cygserver.h (CYGSERVER_UNAVAIL): Rename from + `CYGSERVER_DEAD'. + (client_request_get_version::check_version): Make available in + cygserver as well the DLL. + (check_cygserver_available): Ditto. Remove `check_version_too' + argument. + (cygserver_init): Ditto. And likewise. + * cygserver_client.cc (client_request_get_version::check_version): + Make available in cygserver as well the DLL. + (client_request::make_request): This may now be called without + `cygserver_init ()' having been called first. Detect this and + call it as required. Add tracing. + (check_cygserver_available): Make available in cygserver as well + the DLL. Remove `check_version_too' argument and always check the + version information. And since this is called from within + `cygserver_init ()', force `cygserver_running' before calling + `client_request::make_request ()'. + (cygserver_init): Make available in cygserver as well the DLL. + Remove `check_version_too' argument. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc: Implement the ipcs(8) interfaces, IPC_INFO, + SHM_STAT and SHM_INFO. + (server_shmmgr::segment_t::sequence): New static field. + (server_shmmgr::segment_t::key): Remove field, use the new + ds.shm_perm.key field instead. + (server_shmmgr::segment_t::shmid): Remove field. + (server_shmmgr::segment_t::intid): New field. + (server_shmmgr::segment_t::segment_t): Use the `key' argument to + initialise `ds.shm_perm.key'. Change from using `shmid' to + `intid'. + (server_shmmgr::_shmseg_cnt): Renamed from `_shmid_cnt'. + (server_shmmgr::_intid_max): Renamed from `_shmid_max. + (server_shmmgr::shmat): Move the out arguments to the start of the + argument list. Rename the `pid' argument as `cygpid'. Add + tracing. Pass an intid to `find ()', not a shmid. + (server_shmmgr::shmctl): Add separate out arguments. Rename the + `pid' argument as `cygpid'. Add support for the ipcs(8) + interfaces. Add tracing. Pass an intid to `find ()', not a + shmid. + (server_shmmgr::shmdt): Rename the `pid' argument as `cygpid'. + Add tracing. Pass an intid to `find ()', not a shmid. + (server_shmmgr::shmget): Add a separate out arguments. Rename the + `pid' argument as `cygpid'. Add tracing. + (server_shmmgr::server_shmmgr): Update for new field names. + (server_shmmgr::find_by_key): Update for the new `ds.shm_perm.key' + field. + (server_shmmgr::find): Update to use the new `segment_t::intid' + field. + (server_shmmgr::new_segment): Rename the `pid' argument as + `cygpid'. Check that the requested size is within bounds. Handle + new error result from `new_segment (key, HANDLE)'. + (server_shmmgr::new_segment): Work with intids, not shmids. Check + that the new intid is within bounds. Update for new field names. + (server_shmmgr::delete_segment): Pass an intid to `find ()', not a + shmid. Update for new field names. + (client_request_shm::serve): Check that the incoming message + length is the size of the `_parameters.in' struct, not of the + whole in/out parameter union. Likewise, set the outgoing message + length to the size of the `_parameters.out' struct. Update for + the new server_shmmgr interfaces. + * include/sys/ipc.h (ipc_perm::key): New field. + * include/sys/shm.h (SHM_INFO): New constant. + * cygserver_ipc.h (IPCMNI): New constant. + (ipc_int2ext): Add `sequence' argument and munge this into the + external ipc id. + (ipc_ext2int_subsys): Unmunge the sequence number from the + external ipc id. + (ipc_ext2int): Ditto. + (ipc_inc_id): Remove. + (ipc_dec_id): Remove. + * cygserver_shm.h (SHMMAX): New constant. + (SHMMIN): Ditto. + (SHMMNI): Ditto. + (SHMSEG): Ditto. + (SHMALL): Ditto. + (client_request_shm::_parameters): Re-arrange as a union of two + separate structs, one for in arguments, the other for out. + (client_request_shm::shmid): Update for the new parameter layout. + (client_request_shm::ds): Ditto. + (client_request_shm::info): New method. + * shm.cc (client_shmmgr::_shmat_cnt): New static field. + (client_shmmgr::shmat): Add locking. Add tracing. + (client_shmmgr::shmctl): Update for ipcs(8) commands. Add + tracing. Add more argument checking. + (client_shmmgr::shmdt): Add locking. Add tracing. Update the new + `_shmat_cnt' field. + (client_shmmgr::shmget): Add tracing. + (client_shmmgr::fixup_shms_after_fork): Add tracing. Add + consistency checking. + (client_shmmgr::attach): Add more tracing. + (client_shmmgr::new_segment): Update the new `_shmat_cnt' field. + (client_request_shm::client_request_shm): Update for the new + parameter layout. Set the outgoing message length to the size of + the `_parameters.in' struct, not of the whole in/out parameter + union. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * shm.cc: Remove the use of a static client_shmmgr object. + (client_shmmgr::_instance): New static variable. + (client_shmmgr::instance): Allocate a new shmmgr on the heap, + rather than using a local static object. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_transport.cc (create_server_transport): Fix + cut-and-paste error. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_client.cc (client_request::handle_request): Don't + bother with the client request activity marker when compiled with + debugging output. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_transport_pipes.cc + (MAX_WAIT_NAMED_PIPE_RETRY): New constant. + (WAIT_NAMED_PIPE_TIMEOUT): Ditto. + (transport_layer_pipes::close): The `pipe' field is now either + NULL or a valid handle, and it should never have the value + `INVALID_HANDLE_VALUE'. + (transport_layer_pipes::read): Ditto. + (transport_layer_pipes::write): Ditto. + (transport_layer_pipes::connect): Ditto. + (transport_layer_pipes::impersonate_client): Ditto. + (transport_layer_pipes::connect): Ditto. New, but still bogus, + retry logic. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc (server_shmmgr::server_shmmgr): All fields have + to be initialized now that the singleton is no longer static. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc (server_shmmgr::_instance): New static field. + (server_shmmgr::_instance_once): Ditto. + (server_shmmgr::initialise_instance): New static method. + (server_shmmgr::instance): Use a pthread_once_t rather than + relying on a local static variable. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * woutsup.h: Remove all uses of the C++ new and delete operators + throughout cygserver until they are fully thread-safe. + (safe_new0): New macro to replace the C++ new operator. + (safe_new): Ditto. + (safe_delete): New macro to replace the C++ delete operator. + * cygserver_client.cc (client_request::handle_request): Replace + all uses of the C++ new and delete operators with the new macros + from "woutsup.h". + (client_request::make_request): Ditto. + * cygserver_process.cc (~process_cleanup): Ditto. + (process::cleanup): Ditto. + (process_cache::process): Ditto. + (process_cache::check_and_remove_process): Ditto. + * cygserver_shm.cc (server_shmmgr::new_segment): Ditto. + (server_shmmgr::delete_segment): Ditto. + * cygserver_transport.cc (create_server_transport): Ditto. + * cygserver_transport_pipes.cc + (transport_layer_pipes::accept): Ditto. + * cygserver_transport_sockets.cc + (transport_layer_sockets::accept): Ditto. + * threaded_queue.cc (~threaded_queue): Ditto. + (threaded_queue::worker_loop): Ditto. + (threaded_queue::stop): Replace sleep(3) with win32 Sleep. + * cygserver.cc (~server_request): Replace all uses of the C++ new + and delete operators with the new macros from "woutsup.h". + (server_submission_loop::request_loop): Ditto. + (main): Ditto. Replace sleep(3) with win32 Sleep. Replace + iostreams with FILEs. + (print_usage): Replace iostreams with FILEs. + (print_version): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_transport_sockets.cc + (transport_layer_sockets::accept): Rename local variable + `accept_fd' to avoid shadowing the `fd' field. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygwin_ipc.h: Moved (back) to "include/sys/ipc.h". + * cygwin_shm.h: Moved (back) to "include/sys/shm.h". + * include/sys/ipc.h: New file. + * include/sys/shm.h: New file. + * cygserver_shm.h: Update for new header file locations. + * ipc.cc: Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_client.cc (client_request::make_request): Comment out + a verbose tracing statement. + * cygserver_process.cc (process_cache::sync_wait_array): Fix + broken assert. + * include/cygwin/cygserver.h (class client_request): Remove excess + use of `class' qualifier in declarations. + (class client_request_get_version): Ditto. + (class client_request_shutdown): Ditto. + (class client_request_attach_tty): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_ipc.h: New file. + * cygserver_shm.h: Re-written from scratch. + * cygserver_shm.cc: Ditto. + * shm.cc: Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * threaded_queue.h (class queue_request): Re-write. + (threaded_queue_thread_function): Remove. + (class queue_process_param): Remove. + (class threaded_queue): Re-write. + (class queue_submission_loop): New version of the old + `queue_process_param' class. + (TInterlockedExchangePointer): New templated function. + (TInterlockedCompareExchangePointer): Ditto. + * threaded_queue.cc (worker_function): Remove. + (class threaded_queue): Re-write. + (class queue_process_param): Remove. + (class queue_submission_loop): New version of the old + `queue_process_param' class. + * include/cygwin/cygserver_process.h (process_cleanup): Re-write. + (class process_process_param): Remove. + (class cleanup_routine): Re-write. + (class process): Re-write. + (class process_cache): Re-write. + * cygserver_process.cc (process_cleanup): Re-write. + (class process_process_param): Remove. + (class cleanup_routine): Re-write. + (class process): Re-write. + (class process_cache): Re-write. + * cygserver.cc (request_count): Remove unused variable. + (class server_request): Move methods inline. + (class server_process_param): Remove. + (class server_request_queue): Remove. + (request_queue): Move into `main ()' and change type to + `threaded_queue'. + (request_loop): Remove. + (class server_submission_loop): New version of the old + `server_process_param' class. + (shutdown_server): New variable. + (client_request_shutdown::serve): Set `shutdown_server' to trigger + shutdown. + (handle_signal): Ditto. + (main): Install signal handler for SIGINT rather than SIGQUIT. + Use new interfaces for the `request_queue' and the `cache'. + Create a `server_submission_loop' and add to the `request_queue'. + Add check for the `shutdown_server' variable to the main loop. + * cygserver_shm.cc (client_request_shm::serve): Release the + process object after use. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_client.cc (client_request::handle_request): Correct + tracing statement. + * cygserver_transport_pipes.cc: Remove local definition of + FILE_FLAG_FIRST_PIPE_INSTANCE constant. + * cygwin_ipc.h: Update copyright notice. + * cygwin_shm.h: Ditto. + * woutsup.h: Add definition of _WIN32_WINNT. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_client (client_request::make_request): Replace my + inappropriate use of set_errno () with error_code () throughout. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver.h: Add forward declarations of class + transport_layer_base and class process_cache to reduce + dependencies between header files. + * include/cygwin/cygserver_process.h: Add include of + "threaded_queue.h". + * cygserver.cc: Remove unnecessary cygserver header files. + * cygserver_client.cc: Ditto. + * cygserver_process.cc: Ditto. + * cygserver_shm.cc: Ditto. + * cygserver_shm.h: Ditto. + * cygserver_transport_pipes.cc: Ditto. + * dcrt0.cc: Ditto. + * fhandler_tty.cc: Ditto. + * tty.cc: Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.h: Replace <sys/shm.h> with "cygwin_shm.h" after + merge from HEAD. + * cygwin_ipc.h: Update with changes to include/sys/ipc.h lost in + merge from HEAD. + * cygwin_shm.h: Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc: The tests for a duplicate server instance are now + the responsibility of the transport layer. + (request_loop): Use new `recoverable' flag in call to + `cygserver_transport::accept ()' and shutdown on an unrecoverable + error. + (main): Never call `cygserver_init ()'. Fake `cygserver_running' + just for sending a shutdown request. + * cygserver_client.cc (client_request::send): Comment out + message-size tracing statements as verbose. + (client_request::handle): Ditto. + (client_request_get_version::check_version): #ifdef as DLL-only. + (check_cygserver_available): Ditto. + (cygserver_init): Ditto. + * include/cygwin/cygserver.h + (client_request_get_version::check_version): #ifdef as DLL-only. + (check_cygserver_available): Ditto. + (cygserver_init): Ditto. + * include/cygwin/cygserver_transport.h + (transport_layer_base::impersonate_client): #ifdef as + cygserver-only. + (transport_layer_base::revert_to_self): Ditto. + (transport_layer_base::listen): Ditto. + (transport_layer_base::accept): Ditto. Add a `recoverable' out + flag for error handling. + * include/cygwin/cygserver_transport_sockets.h: Ditto. + * include/cygwin/cygserver_transport_pipes.h: Ditto. + (transport_layer_pipes): Change type of the `pipe_name' field. + Remove the `inited' field, as unnecessary. Add new + `is_accepted_endpoint' field. + * include/cygwin/cygserver_transport.cc + (transport_layer_base::impersonate_client): #ifdef as + cygserver-only. + (transport_layer_base::revert_to_self): Ditto. + * include/cygwin/cygserver_transport_sockets.cc + (transport_layer_sockets::listen): #ifdef as cygserver-only. + (transport_layer_sockets::accept): #ifdef as cygserver-only. + Analyse any errno from `accept ()' and set `recoverable' as + appropriate. + * cygserver_transport_pipes.cc: Add local #define of + `FILE_FLAG_FIRST_PIPE_INSTANCE'. + (pipe_instance_lock_once): New variable. + (pipe_instance_lock): Ditto. + (pipe_instance): Ditto. + (initialise_pipe_instance_lock): New function. + (transport_layer_pipes::transport_layer_pipes): Change + initialization of `pipe_name'. Initialize `is_accepted_endpoint' + as appropriate. Remove use of `inited'. + (transport_layer_pipes::impersonate_client): #ifdef as + cygserver-only. + (transport_layer_pipes::revert_to_self): Ditto. + (transport_layer_pipes::listen): Ditto. + (transport_layer_pipes::accept): Ditto. Keep track of how often + many named pipes have been created, in the `pipe_instance' + variable, and pass the `FILE_FLAG_FIRST_PIPE_INSTANCE' flag on the + open of the first instance. Analyse the error code from + `CreateNamedPipe ()' and set the `recoverable' flag as + appropriate. + (transport_layer_pipes::close): Update the `pipe_instance' count. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * woutsup.h (cygserver_running): Add declaration. + (api_fatal): Eliminate. + * include/cygwin/cygserver.h + (client_request_get_version::check_version): Change return type to + bool. + (check_cygserver_available): New function. + (cygserver_init): Add check_version_too argument. + * cygserver_client.cc (allow_daemon): Make a bool. + (client_request_get_version::make_request): See errno on error. + Remove special case for CYGSERVER_REQUEST_GET_VERSION; this is now + handled in cygserver_init(). + (client_request_get_version::check_version): Use syscall_printf() + instead of api_fatal(). Return true if cygserver version is + compatible. + (check_cygserver_available): New function; code moved here from + cygserver_init(). + (cygserver_init): Move some code into check_cygserver_available(). + * cygserver.cc (__set_errno): Copy from debug.cc so that + set_errno() can be used when __OUTSIDE_CYGWIN__. + (main): Call cygserver_init() to set up cygserver_running and add + checks against this to (try and) prevent multiple copies of + cygserver running simultaneously. Remember to delete all + transport connections so that (one day) the transport classes can + tidy up on cygserver shutdown. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc (main): Adjust tracing output for a cleaner display + when compiled without --enable-debugging. + * threaded_queue.cc (threaded_queue::cleanup): Ditto. + (queue_process_param::stop): Ditto. + * include/cygwin/cygserver.h + (client_request::make_request): Make non-virtual. + (client_request::send): Make virtual and protected, not private. + (client_request_attach_tty::send): New virtual method. + * cygserver_client.cc: Use the `msglen()' accessor rather than + `_header.msglen' throughout. + (client_request_attach_tty::send): New method. + (client_request::make_request): Remove the explicit close of + `transport' as it is closed on deletion. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver.h: Change the client_request classes to + give greater encapsulation and to allow variable length requests + and replies. + (enum cygserver_request_code): Now client_request::request_code_t. + (class request_header): Now client_request::header_t. Make a + union of the request_code and the error_code. The `cb' field, + which was the buffer length, is now the `size_t msglen' field. + (struct request_get_version): Now + client_request_get_version::request_get_version. + (struct request_shutdown): Remove unused type. + (struct request_attach_tty): Now + client_request_attach_tty::request_attach_tty. + (client_request::_buf): Make field const. + (client_request::_buflen): New const private field. + (client_request::request_code): New accessor. + (client_request::error_code): Ditto. + (client_request::msglen): Ditto. + (client_request::handle_request): New static method. + (client_request::make_request): New virtual method. + (client_request::handle): New method. + (client_request::send): Make private. + (client_request_get_version::check_version): New method. + (client_request_get_version::serve): Make private. + (client_request_get_version::version): Ditto. + (client_request_shutdown::serve): Ditto. + (client_request_attach_tty::req): Ditto. + (client_request_attach_tty::serve): Ditto. + (client_request_attach_tty::from_master): Make method const. + (client_request_attach_tty::from_master): Ditto. + * cygserver_client.cc + (client_request_get_version::client_request_get_version): Track + changes to the client_request classes. + (client_request_attach_tty::client_request_attach_tty): Ditto. + (client_request_get_version::check_version): New method to + encapsulate code from cygserver_init(). + (client_request_shutdown::client_request_shutdown): Move into + "cygserver.cc". + (client_request::send): Track changes to the client_request + classes. Add more error checking. + (client_request::handle_request): New static method containing the + first half of the old server_request::process() code. + (client_request::make_request): New method to replace the old + cygserver_request() function. + (client_request::handle): New method containing the second half of + the old server_request::process() code. + (cygserver_init): Track changes to the client_request classes. In + particular, some code moved into the + client_request_get_version::check_version() method. + * cygserver.cc (client_request_attach_tty::serve): Track changes + to the client_request classes. In particular, only return a reply + body if some handles are successfully duplicated for the client. + And remove goto's. + (client_request_get_version::serve): Track changes to the + client_request classes. + (client_request_shutdown::serve): Ditto. + (class client_request_invalid): Dead, and so young too. + (server_request::request_buffer): Remove unnecessary field. + (client_request_shutdown::client_request_shutdown): Moved here + from "cygserver_client.cc". + (server_request::process): Implementation moved into the new + client_request::handle_request() and client_request::handle() + methods. + * cygserver_shm.h (class client_request_shm): Put client- and + server-specific interfaces inside #ifdef/#ifndef __INSIDE_CYGWIN__ + guards. + (client_request_shm::serve): Make private. + * cygserver_shm.cc + (client_request_shm::client_request_shm): Track changes to the + client_request classes. + (client_request_shm::serve): Ditto + * shm.cc (client_request_shm::client_request_shm): Ditto. Use + alloc_sd() rather than set_security_attribute() to get access to + the SECURITY_DESCRIPTOR length, so that we can use it to set the + request body length. + (shmat): Track changes to the client_request classes. In + particular, allocate client_request objects on the stack rather + than on the heap, and use the client_request::make_request() + method rather than the old cygserver_request() function. + (shmdt): Ditto. + (shmctl): Ditto. + (shmget): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::cygserver_attach_tty): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver_transport.h + (cygserver_transport::read): Change buffer type to void *. + (cygserver_transport::write): Ditto. + * include/cygwin/cygserver_transport_sockets.h + (cygserver_transport_sockets::read): Ditto. + (cygserver_transport_sockets::write): Ditto. + * include/cygwin/cygserver_transport_pipes.h + (cygserver_transport_pipes::read): Ditto. + (cygserver_transport_pipes::write): Ditto. + * cygserver_transport_sockets.cc + (cygserver_transport_sockets::read): Ditto. + (cygserver_transport_sockets::write): Ditto. + * cygserver_transport_pipes.cc + (cygserver_transport_pipes::read): Ditto. Set errno on error, to + match behaviour of cygserver_transport_sockets class. + (cygserver_transport_pipes::write): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc (version): New static variable. + (server_request_queue::add_connection): Remove my gratuitous use + of studly caps. + (setup_privileges): Declare static. + (handle_signal): Ditto. + (longopts): Make a local variable of main(). + (opts): Ditto. + (print_usage): New function. + (print_version): Ditto (tip of the hat to Joshua Daniel Franklin + for inspiration here). + (main): More argument checking. Add --help and --version options. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver.h (client_request::serve): Make pure + virtual. + * cygserver.cc (client_request::serve): Remove definition of pure + virtual method. + (class client_request_invalid): New class. + (server_request::process): Use new client_request_invalid + class. And remove goto's. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc (class server_request): Add virtual destructor. + (server_request_queue::addConnection): New method to replace bad + virtual add() method. + (request_loop): Replace call to queue->add() with call to + queue->addConnection(). + (server_request::server_request): Use field initialization. + (server_request::~server_request): New virtual destructor. + (server_request::process): Remove close and delete of + transport_layer_base object. It is deleted by the server_request's + own destructor and closed by its own destructor. + * include/cygwin/cygserver.h + (client_request::operator request_header): Remove unused method. + * cygserver_client.cc: Ditto. + * include/cygwin/cygserver_process.h + (class cleanup_routine): Add virtual destructor. + (cleanup_routine::cleanup): Make pure virtual. + (class process_cache): Make destructor non-virtual. + (process_cache::add): Ditto. + * cygserver_process.cc + (cleanup_routine::~cleanup_routine): New virtual destructor. + * include/cygwin/cygserver_transport.h + (class transport_layer_base): Add virtual destructor. + * cygserver_transport.cc + (transport_layer_base::~transport_layer_base): New virtual + destructor. + * include/cygwin/cygserver_transport_pipes.h + (class transport_layer_pipes): Add virtual destructor. + * cygserver_transport_pipes.cc + (transport_layer_pipes::~transport_layer_pipes): New virtual + destructor. + (transport_layer_pipes::close): Null out handle after closing. + * include/cygwin/cygserver_transport_sockets.h + (class transport_layer_sockets): Add virtual destructor. + * cygserver_transport_sockets.cc + (transport_layer_sockets::~transport_layer_sockets): New virtual + destructor. + (transport_layer_sockets::close): Null out fd after closing. + * threaded_queue.h (class queue_request): Add virtual destructor. + (queue_request::process): Make pure virtual. + * threaded_queue.cc (~queue_request): New virtual destructor. + (queue_request::process): Remove definition of pure virtual + method. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver.h (client_request::send): Make + non-virtual. + (class client_request_attach_tty): Put client- and server-specific + interfaces inside #ifdef/#ifndef __INSIDE_CYGWIN__ guards. + * cygserver_client.cc: Ditto. + (cygserver_init): Fix error handling. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc: Throughout the code, check and correct level of + the XXX_printf() functions used. Comment out several of the + debug_printf() calls with "// verbose:". Reformat and correct + typos of some of the XXX_printf() formats. + * cygserver_process.cc: Ditto. + * cygserver_shm.cc: Ditto. + * cygserver_transport_pipes.cc: Ditto. + * cygserver_transport_sockets.cc: Ditto. + * shm.cc (hi_ulong): New function to allow printing of a 64-bit + key with current small_printf implementation. + (lo_ulong): Ditto. + (client_request_shm::client_request_shm): Use hi_ulong() and + lo_ulong() in call to debug_printf(). + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver_shm.cc: Remove #define __INSIDE_CYGWIN__ from around + <sys/shm.h> as it no longer contains any internal code. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/sys/ipc.h (IPC_PRIVATE): Add cast to key_t. + (IPC_INFO): New flag for ipcs(8). + (IPC_RMID IPC_SET IPC_STAT): Renumber. + * include/sys/shm.h (SHM_RDONLY SHM_RND): Renumber with distinct + values [sic]. + (class _shmattach): Internal type moved to "cygserver_shm.h". + (class shmnode): Ditto. + (class shmid_ds): Ditto. + (struct shmid_ds): Add spare fields. + (struct shminfo): New type for IPC_INFO interface. + * cygserver_shm.h: Remove obsolete #if 0 ... #endif block. + (class shm_cleanup): Remove unused class. + (struct _shmattach): Internal type moved from <sys/shm.h>. + (struct shmnode): Ditto. + (struct int_shmid_ds): Ditto. Renamed to avoid name clash with + public interface struct shmid_ds. Use the shmid_bs structure as a + field. + * cygserver_shm.cc: Remove obsolete #if 0 ... #endif block. + (client_request_shm::serve): Update for redefinition of + int_shmid_ds structure. + * shm.cc (build_inprocess_shmds): Ditto. + (fixup_shms_after_fork): Ditto. + (shmctl): Ditto. + (shmget): Ditto. Remove obsolete #if 0 ... #endif code. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * include/cygwin/cygserver_transport.h + (transport_layer_base::transport_layer_base): Remove since it is + now redundant. + (transport_layer_base::listen): Make a pure virtual method. + (transport_layer_base::accept): Ditto. + (transport_layer_base::close): Ditto. + (transport_layer_base::read): Ditto. + (transport_layer_base::write): Ditto. + (transport_layer_base::connect): Ditto. + * cygserver_transport.cc + (transport_layer_base::transport_layer_base): Remove since it is + now redundant. + (transport_layer_base::listen): Remove since it is now a pure + virtual method. + (transport_layer_base::accept): Ditto. + (transport_layer_base::close): Ditto. + (transport_layer_base::read): Ditto. + (transport_layer_base::write): Ditto. + (transport_layer_base::connect): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygserver.cc (check_and_dup_handle): Only use security code if + running on NT, i.e. if wincap.has_security(). + (client_request_attach_tty::serve): Add check for has_security(). + * cygserver_process.cc (process_cache::process): Use DWORD winpid + throughout to avoid win32 vs. cygwin pid confusion. + (process::process): Ditto. + * cygserver_shm.cc (client_request_shm::serve): Only use security + code if running on NT, i.e. if wincap.has_security(). + * cygserver_shm.h (client_request_shm::parameters.in): Replace the + ambiguous pid field with cygpid and winpid fields. + (client_request_shm::client_request_shm): Reduce to only two + client-side constructors: one for SHM_CREATE, another for all the + other requests. + * shm.cc (client_request_shm::client_request_shm): + Ditto. Initialize cygpid and winpid fields here. On NT initialize + sd_buf here using set_security_attribute() to make use of the euid + and egid. + (shmat): Use new client_request_shm constructor. + (shmdt): Ditto. + (shmctl): Ditto. + (shmget): Ditto. Remove security code, now performed in the + relevant client_request_shm constructor. + * include/cygwin/cygserver_process.h: (class cleanup_routine): + Change winpid type to DWORD. + (class process): Ditto. + +2002-09-22 Conrad Scott <conrad.scott@dsl.pipex.com> + + * woutsup.h: New file. + * cygserver.cc: Use "woutsup.h" and new XXX_printf macros. + (getfunc): New function, copied verbatim from "strace.cc". + (__cygserver__printf): New function. + * cygserver_client.cc: Use "woutsup.h" and new XXX_printf macros. + * cygserver_process.cc: Ditto. + * cygserver_shm.cc: Ditto. + * cygserver_transport.cc: Ditto. + * cygserver_transport_pipes.cc: Ditto. + * cygserver_transport_sockets.cc: Ditto. + * threaded_queue.cc: Ditto. + * shm.cc: Remove trailing \n from XXX_printf format strings. + * Makefile.in: Remove special __OUTSIDE_CYGWIN__ case for + cygserver_shm.cc. + +2002-09-21 Christopher Faylor <cgf@redhat.com> + + * init.cc (dll_entry): Temporarily disable thread detach code. + +2002-09-21 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::dup): Don't set handle on failure. + Caller has already taken care of that. + * fhandler_console.cc (fhandler_console::open): Initialize handles to + NULL. + (fhandler_console::close): Ditto. + +2002-09-21 Christopher Faylor <cgf@redhat.com> + + GNUify non-GNU formatted functions calls throughout. + +2002-09-21 Conrad Scott <conrad.scott@dsl.pipex.com> + + * cygwin_ipc.h: Move to "include/cygwin/ipc.h". + * cygwin_shm.h: Move to "include/cygwin/shm.h". + * include/cygwin/ipc.h: New file. + * include/cygwin/shm.h: New file. + * ipc.c:c Update <cygwin/ipc.h> include. + * cygserver_shm.cc: Update <cygwin/shm.h> include. + * shm.cc: Ditto. + +2002-09-21 Robert Collins <rbtcollins@hotmail.com> + + * pthread.cc: Use class::call for converted pthread and semaphore + calls. + * thread.cc: Convert various __pthread_call and __sem_call to + pthread::call and sem::call throughout. + * pthread.h (__pthread_cancel): Convert to pthread::cancel. + (__pthread_join): Convert to pthread::join. + (__pthread_detach): Convert to pthread::detach. + (__pthread_create): Convert to pthread::create. + (__pthread_once): Convert to pthread::once. + (__pthread_atfork): Convert to pthread::atfork. + (__pthread_suspend): Convert to pthread::suspend. + (__pthread_continue): Convert to pthread::resume. + (__sem_init): Convert to semaphore::init. + (__sem_destroy): Convert to semaphore::destroy. + (__sem_wait): Convert to semaphore::wait. + (__sem_trywait): Convert to semaphore::trywait. + (__sem_post): Convert to semaphore::post. + +2002-09-21 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc: Finish the removal of the separate pthread_key + destructor list. + Remove all pthread_key_destructor and pthread_key_destructor_list + references throughout. + (pthread::exit): Call the new pthread_key interface to activate + destructors. + (pthread_key::keys): Change into a list. + (pthread_key::saveAKey): New method, used via forEach. + (pthread_key::restoreAKey): Ditto. + (pthread_key::destroyAKey): Ditto. + (pthread_key::fixup_before_fork): Use the List::forEach functionality. + (pthread_key::fixup_after_fork): Ditto. + (pthread_key::runAllDestructors): New method implementation. + (pthread_key::pthread_key): Use List::Insert rather than custom list + code. + (pthread_key::~pthread_key): Use List::Remove for the same reason. + * thread.h: Remove all pthread_key_destructor and + pthread_key_destructor_list references throughout. + (List): Move the interface above pthread_key in the header. + Use atomic operations during insert and delete. + (List::forEach): A generic interface for doing something on each node. + (pthread_key::runAllDestructors): New method, run all destructors. + (pthread_key::fork_buf): Make private. + (pthread_key::run_destructor): Ditto. + (pthread_key::saveAKey): New method for clearer source. + (pthread_key::restoreAKey): Ditto. + (pthread_key::destroyAKey): Ditto. + (MTinterface::destructors): Remove. + +2002-09-21 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc: Partial refactoring of pthread_key destructor + handling. Loosely based on Thomas Pfaff's work. + (pthread_key_destructor_list::Insert): Remove. + (pthread_key_destructor_list::Pop): Remove. + (pthread_key_destructor_list::IterateNull): Call the key's + run_destructor method. + (pthread_key::pthread_key): Initialize new member. + (pthread_key::get): Mark as const for correctness. + (pthread_key::run_destructor): Implement. + * thread.h (pthread_key::get): Mark as const for correctness. + (pthread_key::run_destructor): Declare. + (List): New template class that implements a generic list. + (pthread_key_destructor_list): Inherit from List, and remove + now duplicate functions. + +2002-09-21 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc: Change verifyable_object_isvalid calls with + PTHREAD_CONDATTR_MAGIC, PTHREAD_MUTEXATTR_MAGIC, PTHREAD_COND_MAGIC, + SEM_MAGIC to objecttype::isGoodObject() calls throughout. + (pthread_condattr::isGoodObject): Implement. + (pthread_mutex::isGoodInitializer): Implement. + (pthread_mutex::isGoodInitializerOrObject): Minor bugfix in the + check for verifyable_object_isvalid result. + (pthread_mutexattr::isGoodObject): Implement. + (pthread_cond::isGoodObject): Ditto. + (pthread_cond::isGoodInitializer): Ditto. + (pthread_cond::isGoodInitializerOrObject): Ditto. + (semaphore::isGoodObject): Ditto. + * thread.h (pthread_mutex::isGoodInitializer): Declare. + (pthread_condattr::isGoodObject): Ditto. + (pthread_cond::isGoodObject): Const correctness. + (pthread_cond::isGoodInitializer): Declare. + (pthread_cond::isGoodInitializerOrObject): Ditto. + (semaphore::isGoodObject): Const correctness. + +2002-09-21 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc: Change verifyable_object_isvalid calls with + PTHREAD_MUTEX_MAGIC and PTHREAD_KEY_MAGIC and PTHREAD_ATTR_MAGIC to + ::isGoodObject() calls throughout. + (MTinterface::Init): Remove dead code. + (pthread_attr::isGoodObject): Implement. + (pthread_key::isGoodObject): Implement. + (pthread_mutex::isGoodObject): Implement. + (pthread_mutex::isGoodInitializerOrObject): Implement. + (pthread::isGoodObject): Update signature. + * thread.h (pthread_key::isGoodObject): Declare. + (pthread_attr::isGoodObject): Ditto. + (pthread_mutex::isGoodObject): Ditto. + (pthread_mutex::isGoodInitializerOrObject): Ditto. + (pthread::isGoodObject): Change to a const parameter for const + correctness. + (pthread_mutexattr::isGoodObject): Declare. + (pthread_condattr::isGoodObject): Ditto. + (pthread_cond::isGoodObject): Ditto. + (semaphore::isGoodObject): Ditto. + +2002-09-19 Christopher Faylor <cgf@redhat.com> + + Cleanup calls to CreateFile throughout. + * dcrt0.cc (__api_fatal): Correctly check for failing return from CreateFile. + * assert.cc (__assert): Don't check return value from CreateFile for NULL. + * fhandler_console.cc (set_console_state_for_spawn): Ditto. + * fork.cc (fork_parent): Ditto. + +2002-09-18 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::initialized): Avoid copying on fork or some + threads may not end up in the pool. + (cygthread::new): Avoid race when checking for initialized. Add + debugging code. + +2002-09-18 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler_base::raw_read): Add case for + ERROR_INVALID_HANDLE due to Win95 directories. + (fhandler_base::open): Handle errors due to Win95 directories. + (fhandler_base::close): Add get_nohandle () test. + (fhandler_base::set_close_on_exec): Ditto. + (fhandler_base::fork_fixup): Ditto. + (fhandler_base::lock): Change error code to Posix EINVAL. + (fhandler_base::dup): If get_nohandle (), set new value to + INVALID_HANDLE_VALUE instead of NULL. + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Call fstat_by_name + if get_nohandle (). Remove extraneous element from strpbrk. + (fhandler_disk_file::open): Remove test for Win95 directory. + + * fhandler_random.cc (fhandler_dev_random::open): Add set_nohandle (). + * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto. + * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. + (fhandler_dev_zero::close): Delete. + * fhandler.h (class fhandler_dev_zero): Ditto. + +2002-09-17 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (pthread_key::set): Preserve GetLastError(). Reported + by Thomas Pffaf. + +2002-09-17 Robert Collins <rbtcollins@hotmail.com> + + This work inspires by Thomas Pfaff's pthread_fork patch (1). + * fork.cc (fork_child): Remove MTinterface fixup call, it's + adsorbed by pthread::atforkchild. + Rename __pthread_atforkchild to pthread::atforkchild to give + access to private members. + (fork_parent): Rename __pthread_atforkparent to + pthread::atforkparent to give it access to private members. + Ditto for __pthread_atforkprepare. + * thread.cc: Fix some formatting problems throughout. + (MTinterface::fixup_before_fork): Implement. + (MTinterface::fixup_after_fork): Fix pthread_keys. + (pthread_key::keys): Implement. + (pthread_key::fixup_before_fork): Ditto. + (pthread_key::fixup_after_fork): Ditto. + (pthread_key::pthread_key): Add to pthread_key::keys. + (pthread_key::~pthread_key): Remove from pthread_key::keys. + (pthread_key::saveKeyToBuffer): Implement. + (pthread_key::recreateKeyFromBuffer): Ditto. + (pthread::atforkprepare): Prepare all MT classes for fork. + (pthread::atforkchild): And fix them up afterwards. + * thread.h (pthread_key): Buffer the key value during + fork in fork_buf. + List the keys needing to be fixed up in a linked list with + head pthread_key::keys. + (pthread): Move atfork cygwin internal calls into the class. + (MTInterface): Provide a fixup_before_fork for objecst that + need to save state. + (__pthread_atforkprepare): Remove. + (__pthread_atforkparent): Remove. + (__pthread_atforkchild): Remove. + +2002-09-16 Christopher Faylor <cgf@redhat.com> + + * init.cc: Cleanup slightly and remove obsolete code. + +2002-09-11 Robert Collins <rbtcollins@hotmail.com> + + * init.cc (dll_entry): On thread detach, if the thread hasn't + exit()ed, do so. + * pthread.cc (pthread_getsequence_np): Remove the + __pthread_getsequence_np wrapper. This requires errno.h. + * thread.cc (pthread::self): Instantiate a new pthread object + when called and none exists. return a NULL object if instantiation + fails. + (pthread::precreate): Factor out common code. + (pthread::postcreate): Ditto. + (pthread::create): Ditto. + (pthread::exit): Remove the TLS value when we exit to prevent + double exits. + (MTinterface::Init): Bugfix - don't mark the TLS index as created + if one was not allocated. + Apply Extract Method to move pthread specific initialisation into + pthread. + (pthread::initMainThread): Extracted method from MTinterface::Init. + (pthread::setTlsSelfPointer): Extracted method from various pthread + calls, to make reading those functions easier. + (pthread::setThreadIdtoCurrent): Ditto. + (pthread::cancel_self): Bring into the .cc file, it's only used + within the class. + (pthread::getThreadId): Ditto. + (pthread::thread_init_wrapper): Apply Extract Method to the TLS + setting logic. + (pthread::isGoodObject): Extracted method from various pthread + wrapper calls, for clarity of reading. + (pthread::getsequence_np): Converted from __pthread_getsquence_np. + (__pthread_create): Apply Extract Method to the object validation. + (__pthread_cancel): Ditto. + (__pthread_join): Ditto. + (__pthread_detach): Ditto. + (__pthread_suspend): Ditto. + (__pthread_continue): Ditto. + (__pthread_getschedparam): Ditto. + (__pthread_getsequence_np): Remove. + (__pthread_setschedparam): Apply Extract Method to the object + validation. + (pthreadNull::getNullpthread): New method, return the pthreadNull + object. + (pthreadNull::pthreadNull): Private constructor to prevent accidental + use. + (pthreadNull::~pthreadNull): Prevent compile warnings. + (pthreadNull::create): Override pthread behaviour. + (pthreadNull::exit): Ditto. + (pthreadNull::cancel): Ditto. + (pthreadNull::testcancel): Ditto. + (pthreadNull::setcancelstate): Ditto. + (pthreadNull::setcanceltype): Ditto. + (pthreadNull::push_cleanup_handler): Ditto. + (pthreadNull::pop_cleanup_handler): Ditto. + (pthreadNull::getsequence_np): Ditto. + (pthreadNull::_instance): Ditto. + * thread.h (pthread): Declare pre- and post-create. + Move GetThreadId to private scope and rename to getThreadId. + Move setThreadIdtoCurrent to private scope. + Make create virtual. + Make ~pthread virtual. + Declare initMainThread. + Declare isGoodObject. + Make exit virtual. + Make cancel virtual. + Make testcancel virtual. + Make setcancelstate virtual. + Make setcanceltype virtual. + Make push_cleanup_handler virtual. + Make pop_cleanup_handler virtual. + Declare getsequence_np. + Declare setTlsSelfPointer. + (pthreadNull): New null object class for pthread. + (__pthread_getsequence_np): Remove. + +2002-09-13 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (seteuid32): Treat ILLEGAL_UID invalid. + (setegid32): Treat ILLEGAL_GID invalid. + +2002-09-10 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (initgroups): Call groups::clear_supp to free the + supplementary group sids that may have been set by setgroups. + * security.cc (cygsidlist::free_sids): Also zero the class members. + * security.h (groups::clear_supp): New. + Rename cygsidlist_unknown to cygsidlist_empty. + +2002-09-08 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Don't protect + input/output handles since they are not properly manipulated later. + * tty.cc (tty::make_pipes): Ditto. + +2002-09-06 Christopher Faylor <cgf@redhat.com> + + * winsup.h (_WIN32_WINNT): Protect. + +2002-09-06 Christopher Faylor <cgf@redhat.com> + + * winsup.h (_WIN32_WINNT): Define. + +2002-09-03 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Drop shortcut.o. + * path.cc: Move all shortcut functions from shortcut.c to here. + (check_shortcut): Implement without using COM interface. + * path.h: Move definition of SHORTCUT_HDR_SIZE to here. + * shortcut.c: Remove. + * shortcut.h: Ditto. + +2002-09-03 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.h (fhandler_socket::read): Remove method. + (fhandler_socket::write): Ditto. + (fhandler_socket::readv): New method. + (fhandler_socket::writev): Ditto. + (fhandler_socket::recvmsg): Add new optional argument. + (fhandler_socket::sendmsg): Ditto. + * fhandler.cc (fhandler_socket::read): Remove method. + (fhandler_socket::write): Ditto. + (fhandler_socket::readv): New method. + (fhandler_socket::writev): Ditto. + (fhandler_socket::recvmsg): Use win32's scatter/gather IO where + possible. + (fhandler_socket::sendmsg): Ditto. + * net.cc (cygwin_recvmsg): Check the msghdr's iovec fields. + (cygwin_sendmsg): Ditto. Add omitted sigframe. + +2002-09-02 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * cygwin.din: Revert exporting new wchar functions. + * include/cygwin/version.h: Change comment for API minor 62. + +2002-09-02 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dll_crt0_1): Remove getpagesize() call. + * shared.cc (memory_init): Move it here. + +2002-08-31 Christopher January <chris@atomice.net> + + * fhandler_proc.cc: Add <sys/param.h> include. + (format_proc_uptime): Use KernelTime and UserTime only as they include + the other counters. + (format_proc_stat): KernelTime includes IdleTime, so subtract IdleTime + from KernelTime. Make number of 'jiffies' per second same as HZ define. + * fhandler_process.cc: Add <sys/param.h> include. + (format_process_stat): Make number of 'jiffies' per second same as + HZ define. Use KernelTime and UserTime only to calculate start_time. + +2002-08-30 Christopher Faylor <cgf@redhat.com> + + (inspired by a patch from Egor Duda) + * select.cc (fhandler_tty_slave::ready_for_read): Remove. + * fhandler.h (fhandler_tty_slave::ready_for_read): Remove declaration. + * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Set "don't + need ready for read" flag. + (fhandler_tty_slave::read): Don't do anything special with vtime when + vmin == 0. + +2002-08-30 Egor Duda <deo@logos-m.ru> + + * autoload.cc (GetConsoleWindow): Correct parameter count. + +2002-08-30 Christopher January <chris@atomice.net> + Christopher Faylor <cgf@redhat.com> + + * tty.cc (tty_list::allocate_tty): Use GetConsoleWindow, if available. + Call FindWindow in a loop. + * autoload.cc (GetConsoleWindow): Export + +2002-08-30 Christopher Faylor <cgf@redhat.com> + + * miscfuncs.cc (check_iovec_for_read): Don't check buffer when zero + length iov_len. + (check_iovec_for_write): Ditto. + +2002-08-27 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.h (fhandler_base::readv): New method. + (fhandler_base::writev): Ditto. + * fhandler.cc (fhandler_base::readv): New method. + (fhandler_base::writev): Ditto. + * syscalls.cc (_read): Delegate to readv(2). + (_write): Ditto, mutatis mutandi. + (readv): Rewrite, based on the old _read code, to use the new + fhandler_base::readv method. Improve access mode handling and ensure + all calls reach the final strace statement. + (writev): Ditto, mutatis mutandi. + * include/sys/uio.h (struct iovec): Change field types to match SUSv3. + * winsup.h (check_iovec_for_read): New function. + (check_iovec_for_write): Ditto. + * miscfuncs.cc (check_iovec_for_read): Ditto. + (check_iovec_for_write): Ditto. + +2002-08-30 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add more prototypes for new wchar functions in newlib. + +2002-08-30 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add prototypes for new wchar functions in newlib. + * include/cygwin/version.h: Bump API minor number. + +2002-08-29 Boris Schaeling <boriss@web.de> + Corinna Vinschen <corinna@vinschen.de> + + * poll.cc (poll): Peek sockets ready for read to see if there's + actually data. + +2002-08-28 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (hthreads): Remove unneeded global. + (cygthread::simplestub): New static member function. + (cygthread::runner): Don't set hthreads. + (cygthread::freerange): New member function. + (cygthread::operator new): Call freerange if all cygwin slots are used + up. + (cygthread::exit_thread): Don't mess with event if freerange thread. + (cygthread::detach): Ditto. + * cygthread.h (class cygthread): Declare new member functions and + variables. + +2002-08-28 Christopher Faylor <cgf@redhat.com> + + * malloc.cc: Protect some definitions to avoid a compile time warning. + +2002-08-27 Nicholas Wourms <nwourms@netscape.net> + + * cygwin.din: Export getc_unlocked, getchar_unlocked, + putc_unlocked, putchar_unlocked functions. + * include/cygwin/version.h: Bump api minor. + +2002-08-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flags + not understood by WinSock. + (fhandler_socket::sendto): Ditto. If WinSock sendto() returns + WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL + isn't set in flags. + * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL. + * include/cygwin/version.h: Bump API minor number. + +2002-08-28 Corinna Vinschen <corinna@vinschen.de> + + * poll.cc (poll): Eliminate erroneous POLLERR conditional. + +2002-08-26 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler_socket.cc (fhandler_socket::check_peer_secret_event): + Fix strace message. + (fhandler_socket::connect): Remove sigframe. + (fhandler_socket::accept): Ditto. + (fhandler_socket::getsockname): Ditto. + (fhandler_socket::getpeername): Ditto. + (fhandler_socket::recvfrom): Ditto. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + (fhandler_socket::close): Ditto. + (fhandler_socket::ioctl): Ditto. + * ioctl.cc (ioctl): Add sigframe. + * net.cc (cygwin_sendto): Ditto. + (cygwin_recvfrom): Ditto. + (cygwin_recvfrom): Ditto. + (cygwin_connect): Ditto. + (cygwin_shutdown): Ditto. + (cygwin_getpeername): Ditto. + (cygwin_accept): Ditto. Improve strace message. + (cygwin_getsockname): Ditto. Ditto. + (cygwin_recvmsg): Ditto. Ditto. + (cygwin_sendmsg): Fix strace message. + +2002-08-27 Christopher Faylor <cgf@redhat.com> + + * child_info.h: Add _PROC_WHOOPS enum value. + (CURR_CHILD_INFO_MAGIC): Update. + (child_info::magic): Make 'long'. + * cygheap.h: Export _cygheap_start. + * cygheap.cc: Don't declare _cygheap_start. + * cygmagic: Use cksum to produce checksums. Append 'U' to end of + checksum. + * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer. + (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin + version. Set child_proc_info to NULL when _PROC_WHOOPS. + (multiple_cygwin_problem): If child_info specific problem, then set + child_proc_info type to _PROC_WHOOPS. + * shared_info.h (CURR_MOUNT_MAGIC): Update. + (CURR_SHARED_MAGIC): Ditto. + +2002-08-25 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.h (fhandler_socket::recvfrom): Fix prototype. + (fhandler_socket::sendto): Ditto. + * fhandler_socket.cc (fhandler_socket::recvfrom): Ditto. + (fhandler_socket::sendto): Ditto. + * include/sys/socket.h (recv): Fix prototype. + (recvfrom): Ditto. + (send): Ditto. + (sendto): Ditto. + * net.cc (cygwin_sendto): Ditto. Improve strace message + (cygwin_recvfrom): Ditto. Ditto. + (cygwin_setsockopt): Improve strace message. + (cygwin_getsockopt): Ditto. + (cygwin_connect): Ditto. + (cygwin_accept): Ditto. + (cygwin_bind): Ditto. + (cygwin_getsockname): Ditto. + (cygwin_getpeername): Ditto. + (cygwin_recv): Fix prototype. + (cygwin_send): Ditto. + (cygwin_recvmsg): Improve strace message. + (cygwin_sendmsg): Ditto. + +2002-08-25 Pierre Humblet <Pierre.Humblet@ieee.org> + + * sec_acl.cc (getacl): Check ace_sid == well_known_world_sid + before owner_sid and group_sid so that well_known_world_sid + means "other" even when owner_sid and/or group_sid are Everyone. + * security.cc (get_attribute_from_acl): Created from code common + to get_nt_attribute() and get_nt_object_attribute(), with same + reordering as in getacl() above. + (get_nt_attribute): Call get_attribute_from_acl(). + (get_nt_object_attribute): Ditto. + +2002-08-26 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (cygrunk.exe): Make a -mno-cygwin program. + * cygrun.c (main): Export CYGWIN=ntsec unless otherwise set. + + * shared.cc (shared_name): Only add build date to shared name when + *testing*. + +2002-08-24 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (DLL_IMPORTS): Move libuuid.a and libshell32.a to list + rather than referring to them via -l. Add DLL imports last in link + line for new-cygwin.dll and cygrun.exe. + +2002-08-19 Christopher Faylor <cgf@redhat.com> + + * pinfo.h (pinfo::remember): Arrange for destructor call if + proc_subproc returns error. + * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses + NZOMBIES element. + +2002-08-19 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h (pwdgrp_read::pwdgrp_read): Remove. + (pwdgrp_read::~pwdgrp_read): Ditto. + (pwdgrp_read::open): Reset fh to NULL instead of INVALID_HANDLE_VALUE. + (pwdgrp_read::close): Ditto. + +2002-08-19 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_console::send_winch_maybe): New method. + * fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed + code. + (fhandler_console::send_winch_maybe): Define new method. + (fhandler_console::read): Use send_winch_maybe where appropriate. + (fhandler_console::init): Just call all tcsetattr rather than + output_tcsetattr. + * select.cc (peek_console): Reorganize so that send_winch_maybe is + called for everything but keyboard input. + +2002-08-18 Christopher Faylor <cgf@redhat.com> + + * perthread.h (vfork_save): Add ctty, sid, pgid, exitval fields. + (vfork_save::restore_pid): New method. + (vfork_save::restore_exit): New method. + * fork.cc (vfork): Save ctty, sid, pgid and restore them when returning + to "parent". Use exitval field if exiting but never created a new + process. + * syscalls.cc (setsid): Detect when in "vfork" and force an actual fork + so that pid will be allocated (UGLY!). + (getsid): New function. + * dcrt0.cc (do_exit): Use vfork_save::restore_exit method for returning + from a vfork. + * spawn.cc (spawnve): Use vfork_save::{restore_pid,restore_exit} + methods for returning from vfork. + * cygwin.din: Export getsid. + * include/cygwin/version.h: Bump api minor number. + + * malloc.cc: #ifdef sYSTRIm for when MORECORE_CANNOT_TRIM is true. + +2002-08-18 Christopher Faylor <cgf@redhat.com> + + * cygmalloc.h (MORECORE_CANNOT_TRIM): Define. + +2002-08-18 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (sigCONT): Define. + * sigproc.h (sigCONT): Declare. + (wait_sig): Create sigCONT event here. + * exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather + than stopping thread. + (sig_handle): Set sigCONT event as appropriate on SIGCONT rather than + calling ResumeThread. + +2002-08-17 Christopher Faylor <cgf@redhat.com> + + * malloc.cc: Update to 2.7.2. + * malloc_wrapper.cc (malloc_init): Call user level mallocs to determine + if the malloc routines have been overridden. + +2002-08-16 Christopher Faylor <cgf@redhat.com> + + * winsup.h: Remove malloc_*lock functions. + +2002-08-16 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add support for new malloc.o and renamed + malloc_wrapper.o. Use -fomit-frame-pointer for malloc.o compilation. + * malloc_wrapper.cc: New file. Rename from malloc.cc. Add support for + more malloc functions. Eliminate export_* calls. Just use straight + malloc names. Remove unused argument from malloc lock functions. + * cygwin.din: Just export straight malloc names. Add malloc_stats, + malloc_trim, malloc_usable_size, mallopt, memalign, valloc. + * dcrt0.cc (__cygwin_user): Eliminate export_* malloc entries. + * fork.cc (fork_parent): Remove unused argument from malloc_lock + argument. + * malloc.cc: New file. Doug Lea's malloc v2.7.1. + * cygmalloc.h: New file. + * include/cygwin/version.h: Bump API_MINOR. + + * sync.h (muto::acquire): Use appropriate number for regparm attribute. + (muto::reset): Ditto. + (muto::release): Ditto. + +2002-08-16 Pavel Tsekov <ptsekov@gmx.net> + + * exceptions.cc (interrupt_setup): Ensure that the previous signal mask + is properly saved. + +2002-08-15 Thomas Pfaff <tpfaff@gmx.net> + + * dcrt0.cc: Modify define for CYGWIN_GUARD. + (alloc_stack_hard_way): Just use CYGWIN_GUARD in VirtualAlloc call. + +2002-08-11 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.h (fhandler_socket::recv): Remove method. + (fhandler_socket::send): Ditto. + * fhandler_socket.cc (fhandler_socket::recv): Ditto. + (fhandler_socket::send): Ditto. + (fhandler_socket::read): Delegate to fhandler_socket::recvfrom. + (fhandler_socket::write): Delegate to fhandler_socket::sendto. + (fhandler_socket::sendto): Check for null `to' address. + * net.cc (cygwin_sendto): Check for zero request length. + (cygwin_recvfrom): Ditto. Fix signature, use void *buf. + (cygwin_recv): Delegate to cygwin_recvfrom. + (cygwin_send): Delegate to cygwin_sendto. + +2002-08-11 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::cygthread): Close another race. + +2002-08-11 Christopher Faylor <cgf@redhat.com> + + * assert.cc (__assert): Call debugger on assertion failure if + debugging. + * dcrt0.cc (dll_crt0_1): Just wait for signal thread to go live rather + than going through the overhead of invoking it. + * fork.cc (fork_child): Ditto. + * exceptions.cc (signal_fixup_after_fork): Call sigproc_init here. + * sigproc.cc (proc_can_be_signalled): Assume that the signal thread is + live. + (sig_dispatch): Ditto. + (sig_send): Ditto. + (wait_for_sigthread): Rename from "wait_for_me". Assume that + wait_sig_inited has been set and that this function is only called from + the main thread. + * sigproc.h (wait_for_sigthread): Declare new function. + +2002-08-08 Christopher Faylor <cgf@redhat.com> + + * environ.cc (parse_options): Remember the "no" part of any options for + later export. + +2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com> + + * winsup.h (__check_null_invalid_struct): Make ptr argument non-const. + (__check_null_invalid_struct_errno): Ditto. + * miscfuncs.cc (__check_null_invalid_struct): Ditto. + (__check_null_invalid_struct_errno): Ditto. + (__check_invalid_read_ptr_errno): Remove superfluous cast. + * net.cc (get): Set appropriate errno if fd is not a socket. + (cygwin_sendto): Fix parameter checking. + (cygwin_recvfrom): Ditto. + (cygwin_setsockopt): Ditto. + (cygwin_getsockopt): Ditto. + (cygwin_connect): Ditto. + (cygwin_gethostbyaddr): Ditto. + (cygwin_accept): Ditto. + (cygwin_bind): Ditto. + (cygwin_getsockname): Ditto. + (cygwin_listen): Ditto. + (cygwin_getpeername): Ditto. + (cygwin_send): Ditto. + (cygwin_shutdown): Ditto. Move sigframe to fhandler_socket. + (cygwin_recvmsg): Fix parameter checking. Add tracing. + (cygwin_sendmsg): Ditto. + * fhandler_socket.cc (fhandler_socket::shutdown): Add sigframe. + * resource.cc (setrlimit): Fix parameter checking. + +2002-08-08 Joe Buehler <jbuehler@hekimian.com + + * sec_helper.cc (sec_acl): remove extraneous arg to debug_printf. + +2002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler_socket.cc (fhandler_socket::accept): Fix FIONBIO call. + +2002-08-06 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (_csbrk): Avoid !cygheap considerations. + (cygheap_init): Deal with unintialized cygheap issues here. + (cheap_init): Move cygheap_max setting here. + +2002-08-06 Christopher Faylor <cgf@redhat.com> + Conrad Scott <conrad.scott@dsl.pipex.com + + * cygheap.cc (_csbrk): Allocate some slop initially. Don't erroneously + add sbrk amount to returned value in initial case. + +2002-08-06 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawn_guts): Don't set mount_h here. + * sigproc.cc (init_child_info): Set it here instead. + * shared.cc (cygwin_mount_h): Make NO_COPY. + +2002-08-06 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Accept flag to pass info structure to + thread function. + (cygthread::operator new): Add defensive debugging output. + (cygthread::cygthread): Add debugging output. Set name after thread + has been awakened to avoid a race. + (cygthread::exit_thread): Use handle operator rather than using ev + directly. + (cygthread::exit_thread): Reorganize to provide debugging. Set __name + to NULL. + * cygthread.h (cygself): Define. + * fhandler_tty.cc (fhandler_tty_master::init): Use cygself as argument + so that invoked thread can access its own info. + (process_output): Derive cygthread info of thread from thread argument. + * sigproc.cc (sigproc_init): Use cygself as argument so that invoked + thread can access its own info. + (wait_sig): Derive cygthread info of thread from thread argument. + +2002-08-06 Conrad Scott <conrad.scott@dsl.pipex.com> + + * debug.h (handle_list::allocated): Remove field. + * debug.cc (newh): Don't malloc extra entries. + (add_handle): Downgrade strace message level. + (delete_handle): Remove case for `allocated' entries. + +2002-08-05 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Change event creation to manual + reset. Set __name after calling SetEvent to prevent races. + (cygthread::detach): Always reset event here to prevent races. + +2002-08-03 Conrad Scott <conrad.scott@dsl.pipex.com> + + * debug.h (WaitForMultipleObjects): Correct typo. + +2002-08-01 Pierre Humblet <Pierre.Humblet@ieee.org> + + * security.cc (verify_token): Do not reject a token just because + the supplementary group list is missing Everyone or a groupsid + equal to usersid, or because the primary group is not in the token, + as long as it is equal to the usersid. + * syscalls.cc (seteuid32): Use common code for all successful returns. + * grp.cc (getgroups32): Never includes Everyone in the output. + +2002-08-01 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::exit_thread): Define new method. + * cygthread.h (cygthread::exit_thread): Declare new method. + * fhandler.h (fhandler_tty_master::hThread): Delete. + (fhandler_tty_master::output_thread): Define. + * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Adjust + constructor. + (fhandler_tty_master::init): Use cygthread rather than handle. + (process_output): Use cygthread method to exit. + (fhandler_tty_master::fixup_after_fork): Set output_thread to NULL + after fork. + (fhandler_tty_master::fixup_after_exec): Set output_thread to NULL + after spawn/exec. + * tty.cc (tty_list::terminate): Detach from output_thread using + cygthread method. + +2002-08-01 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_link): Revert previous change and just always + dereference the oldpath. + +2002-08-01 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (link): Properly deal with a link to a symlink. + +2002-08-01 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc: Remove cruft. + +2002-08-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (DLL_OFILES): Add cygthread.o. + * dcrt0.cc (dll_crt0_1): Eliminate various thread initialization + functions in favor of new cygthread class. + * debug.cc: Remove thread manipulation functions. + * debug.h: Ditto. + * external.cc (cygwin_internal): Use cygthread method for determining + thread name. Remove capability for setting thread name. + * fhandler_console.cc (fhandler_console::read): Use cygthread method + rather than iscygthread function. + * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Use + cygthread methods to create threads. + (fhandler_tty_common::__acquire_output_mutex): Use cygthread method to + retrieve thread name. + * select.cc (pipeinf): Use cygthread pointer rather than handle. + (start_thread_pipe): Ditto. + (pipe_cleanup): Ditto. + (serialinf): Ditto. + (start_thread_serial): Ditto. + (serial_cleanup): Ditto. + (socketinf): Ditto. + (start_thread_socket): Ditto. + (socket_cleanup): Ditto. + * sigproc.cc (hwait_sig): Ditto. + (hwait_subproc): Ditto. + (proc_terminate): Ditto. + (sigproc_terminate): Ditto. + (sigproc_init): Initialize cygthread hwait_sig pointer. + (subproc_init): Initialize cygthread hwait_subproc pointer. + (wait_sig): Rely on cygthread HANDLE operator. + * strace.cc (strace::vsprntf): Use cygthread::name rather than threadname. + * window.cc (gethwnd): Use cygthread method to initialize thread. + +2002-07-31 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.h (fhandler_base::get_r_no_interrupt): Make non-virtual. + * net.cc (fdsock): Call set_r_no_interrupt. + +2002-07-30 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_read): Clarify debugging output. + +2002-07-30 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_base::get_r_no_interrupt): Make virtual. + +2002-07-30 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Incorporate . + and .. processing here. + (fhandler_cygdrive::readdir): Assume . and .. are already in pdrive. + (fhandler_cygdrive::seekdir): Ditto. + +2002-07-29 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dll_crt0_1): Move debug_fixup_after_fork_exec. + * cygheap.cc (cygheap_fixup_in_child): Call debug_fixup_after_fork_exec + immediately after cygheap has been set up. + +2002-07-29 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: Change some formatting. + * include/cygwin/version.h: Bump API minor version. + +2002-07-28 Pierre Humblet <Pierre.Humblet@ieee.org> + + * cygheap.h (class cygheap_user): Add member groups. + * security.h (class cygsidlist): Add members type and maxcount, methods + position, addfromgr, alloc_sids and free_sids and operator+= (const + PSID psid). Modify contains () to call position () and optimize add () + to use maxcount. + (class user_groups): Create. Update declarations of verify_token and + create_token. + * security.cc (cygsidlist::alloc_sids): New. + (cygsidlist::free_sids): New. + (get_token_group_sidlist): Create from get_group_sidlist. + (get_initgroups_sidlist): Create from get_group_sidlist. + (get_group_sidlist): Suppress. + (get_setgroups_sidlist): Create. + (verify_token): Modify arguments. Add setgroups case. + (create_token): Modify arguments. Call get_initgroups_sidlist and + get_setgroups_sidlist as needed. Set SE_GROUP_LOGON_ID from auth_pos + outside of the loop. Rename the various group sid lists consistently. + * syscalls.cc (seteuid32): Modify to use cygheap->user.groups. + (setegid32): Call cygheap->user.groups.update_pgrp. + * grp.cc (setgroups): Create. + (setgroups32): Create. + * uinfo.cc (internal_getlogin): Initialize and update + user.groups.pgsid. + * cygwin.din: Add setgroups and setgroups32. + +2002-07-28 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::read): Use appropriate + kill_pgrp method. + * select.cc (peek_console): Ditto. + * fhandler_termios.cc (fhandler_termios::bg_check): Send "stopped" + signal to entire process group as dictated by SUSv3. + * termios.cc (tcsetattr): Detect when stopped signal sent and force a + stop before setting anything. + +2002-07-26 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump API version to indicate that ntsec is + on by default now. + +2002-07-26 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler_registry.cc (fhandler_registry::close): Return any error + result to the caller. + * syscalls.cc (_close): Return result of fhandler::close to the caller. + +2002-07-25 Christopher Faylor <cgf@redhat.com> + + * security.cc (allow_ntsec): Default to on. + (allow_smbntsec): Default to off. + +2002-07-24 David MacMahon <davidm@smartsc.com> + + * times.cc (to_time_t): Always round time_t down to nearest second. + +2002-07-25 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Check if API version is updated when exports are + changed and stop if not so. + +2002-07-24 Egor Duda <deo@logos-m.ru> + + * include/cygwin/version.h: Bump minor API version. + +2002-07-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc: Change 'must_init_serial_line capability' + to 'supports_reading_modem_output_lines' throughout (negated meaning). + * wincap.cc: Ditto. + * wincap.h: Ditto. + +2002-07-23 Nicholas Wourms <nwourms@netscape.net> + + * cygwin.din (fcloseall): Add symbol for export. + (fcloseall_r): Ditto. + +2002-07-24 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Always set fileattr when component == 0. + (readlink): Use path_conv method rather than field. + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto, + throughout. + * path.h (path_conv): Make fileattr private. + * exceptions.cc (try_to_debug): Default to idle priority when looping. + +2002-07-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc: Use must_init_serial_line capability throughout. + * wincap.cc: Set flag must_init_serial_line appropriately. + * wincap.h: Add flag must_init_serial_line. + +2002-07-23 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_group_sidlist): Create group list from /etc files + even if DC is available but access fails. + +2002-07-22 Christopher Faylor <cgf@redhat.com> + + * fhandler_serial.cc: Fix formatting problems introduced by below + changes. + +2002-07-22 Jacek Trzcinski <jacek@certum.pl> + + * fhandler.h (class fhandler_serial): Add new members of the class - + rts,dtr and method ioctl(). Variables rts and dtr important for Win 9x + only. + * fhandler_serial.cc (fhandler_serial::open): Add initial setting of + dtr and rts. Important for Win 9x only. + (fhandler_serial::ioctl): New function. Implements commands TIOCMGET, + TIOCMSET and TIOCINQ. + (fhandler_serial::tcflush): Fix found error. + (fhandler_serial::tcsetattr): Add settings of rts and dtr. Important + for Win 9x only. + * termios.h: Add new defines as a support for ioctl() function on + serial device. + +2002-07-20 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (LoadDLLprime): Add jmp call to allow streamlining of + later jmp rewrite. + (doit): Avoid use of cx register. Just change one word to avoid races. + +2002-07-18 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (get_unix_group_sidlist): Create. + (get_supplementary_group_sidlist): Evolve into get_unix_group_sidlist. + (get_user_local_groups): Add check for duplicates. + (get_user_primary_group): Suppress. + (get_group_sidlist): Silently ignore PDC unavailability. + Call get_unix_group_sidlist() before get_user_local_groups(). + Remove call to get_supplementary_group_sidlist(). Never call + get_user_primary_group() as the passwd group is always included. + Add well_known_authenticated_users_sid in only one statement. + +2002-07-19 Christopher Faylor <cgf@redhat.com> + + * fhandler_serial.cc (fhandler_serial::tcflush): Fix typo. + +2002-07-15 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_group_sidlist): Fix formatting. + +2002-07-14 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (initial_env): Force path and CYGWIN_DEBUG contents to lower + case. + * exceptions.cc (error_start_init): Use the name derived from + GetModuleName rather than myself->progname. + +2002-07-14 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a + compiler warning. + * shared.cc (memory_init): Remove debug_init call. + * debug.h (handle_list): Change "clexec" to "inherited". + * debug.cc: Remove a spurious declaration. + (setclexec): Conditionalize away since it is currently unused. + (add_handle): Use inherited field rather than clexec. + (debug_fixup_after_fork_exec): Ditto. Move debugging output to + delete_handle. + (delete_handle): Add debugging output. + * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting + inheritance in debugging table since the handle was never protected + anyway. + (fhandler_base::fork_fixup): Ditto. + + * exceptions.cc (debugger_command): Revert. + +2002-07-14 Conrad Scott <conrad.scott@dsl.pipex.com> + + * debug.cc (clexec): Add missing `hl = hl->next'. + +2002-07-14 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (cygrun.exe): Add a -lcygwin on the end. + +2002-07-14 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (cygserver.exe): Add -lstdc++. + (cygrun.exe): Move -lgcc last. + +2002-07-13 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap + has been set up. + (break_here): New function, for debugging. + (initial_env): Add program name to "Sleeping" message. Implement new + "CYGWIN_DEBUG" environment variable option. + * exceptions.cc (debugger_command): Add argument to dumper call. + * strace.cc (strace::hello): Use winpid if cygwin pid is unavailable. + (strace::vsprntf): Ditto. + +2002-07-13 Christopher Faylor <cgf@redhat.com> + + * debug.h (handle_list): Move here from debug.cc. Add "inherit" flag + functionality. + * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk. + (_csbrk): Reorganize to not assume first allocation is <= 1 page. + (cygheap_setup_for_child): Mark protected handle as inheritable. + * cygheap.h (cygheap_debug): New struct. + (init_cygheap): Add new structure when debugging. + * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle + here, if appropriate. Don't protect subproc_ready, since it is already + protected in the parent. Call memory_init prior to ProtectHandle to + ensure that cygheap is set up. Call debug_fixup_after_fork_exec when + appropriate. + (_dll_crt0): Don't close ppid_handle here. + * debug.cc: Use cygheap debug structure rather than static elements + throughout. + (add_handle): Don't issue a warning if attempt to protect handle in + exactly the same way from exactly the same place. Add pid info to + warning output. Accept additional argument controlling whether handle + is to be inherited. Add pid to stored information. + (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork. + Reorganize to avoid erroneously skipping handles. + (mark_closed): Add pid info to warning output. + (setclexec): Rename from setclexec_pid. + * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg. + (fhandler_base::fstat): Add debugging output. + (fhandler_base::set_inheritance): Call setclexec rather than + setclexec_pid. + (fhandler_base::fork_fixup): Ditto. + * fhandler_console.cc (get_tty_stuff): Mark protected handle as + inheritable. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + * tty.cc (tty::make_pipes): Ditto. + (tty::common_init): Ditto. + * fork.cc (fork_parent): Ditto. + (fork_child): Close protected handles with correct name. Remove + debug_fixup_after_fork call. + * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark + protected handle as inheritable/non-inheritable, as appropriate. + * shared.cc (memory_init): Mark protected handle as inheritable. + Call debug_init here. + * sigproc.cc (wait_sig): Close protected handle with correct name. + * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as + inheritable. + + * exceptions.cc (debugger_command): Try to run dumper.exe, if found. + + * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup + since path is already resolved. + +2002-07-12 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Change erroneous entries. + +2002-07-11 Pavel Tsekov <ptsekov@gmx.net> + + * fhandler_disk_file.cc (fhandler_disk_file::open): Don't + move the file pointer to the end of file if O_APPEND is + specified in the open flags. + +2002-07-09 Christopher Faylor <cgf@redhat.com> + + * debug.cc: Avoid explicit zeroing of globals. + (lock_debug): Make locker a static member. Avoid unlocking when + already unlocked (from Conrad Scott). + (debug_init): Initialize lock_debug::locker here. + * fork.cc (fork_child): Fix up fdtab earlier to avoid some (but not + all) confusion with close-on-exec craziness. + +2002-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::is_unconnected): Constify. + (fhandler_socket::is_connect_pending): Ditto. + (fhandler_socket::is_connected): Ditto. + (fhandler_socket::set_connect_state): New method. + (struct select_record): Add member `except_on_write'. + (select_record::select_record): Initialize all bool values to `false'. + * fhandler_socket.cc: Use set_connect_state() method throughout. + (fhandler_socket::connect): Set state always to connected if connection + isn't pending. + * net.cc (cygwin_getsockopt): Revert erroneous previous patch. + * select.cc (set_bits): Check for `except_on_write'. Set fd in + write_fds if set. Set connect state to connected if fd has been + returned by WINSOCK_SELECT. + (peek_socket): Check for `except_on_write'. + (start_thread_socket): Ditto. + (fhandler_socket::select_write): Don't set `write_ready' if connect + is pending. Set `except_on_write' if connect is pending. + +2002-07-05 Christopher Faylor <cgf@redhat.com> + + * ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment. + (_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto. + + * path.cc (suffix_scan::has): Reorganize to eliminate double scanning + for for .exe (in the typical case). + +2002-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (UNCONNECTED): New define. + (CONNECT_PENDING): Ditto. + (CONNECTED): Ditto. + (class fhandler_socket): Add member `had_connect_or_listen'. + Add member functions `is_unconnected', `is_connect_pending' and + `is_connected'. + * fhandler_socket.cc (fhandler_socket::connect): Set member + `had_connect_or_listen' according to return code of WinSock + call. + (fhandler_socket::listen): Ditto. + * net.cc (cygwin_getsockopt): Modify SO_ERROR return value in + case of socket with pending connect(). + * select.cc (peek_socket): Only add socket to matching fd_set + if it's not "ready". Call WINSOCK_SELECT only if at least one + socket is in one of the fd_sets. + (start_thread_socket): Only add socket to matching fd_set + if it's not "ready". + (fhandler_socket::select_write): Set write_ready to true also + if socket isn't connected or listening. + +2002-07-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free + memory here. Allow NULL parameter. + +2002-07-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operation + on sun_path. + +2002-07-03 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-07-03 Christopher Faylor <cgf@redhat.com> + + * include/sys/statfs.h: New header file. + +2002-07-03 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode + if none specified. + * fhandler.cc (fhandler_base::init): Make bin argument a guarantee + rather than a suggestion. + * path.cc (path_conv::check): Load flag returned from + cygwin_conv_to_win32_path into path_flags. + +2002-07-03 Conrad Scott <conrad.scott@dsl.pipex.com> + + * tty.cc (tty::common_init): Reverse logic of cygserver check in + call to SetKernelObjectSecurity. + +2002-07-03 Thomas Pfaff <tpfaff@gmx.net> + + * autoload.cc (WSAEventSelect): Define new autoload function. + (WSAEnumNetworkEvents): Ditto. + * fhandler_socket.cc (fhandler_socket::accept): If socket is + in blocking mode wait for incoming connection and signal. + +2002-07-02 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cheap): Rearrange error message. + (cygheap_fixup_in_child): Ditto. + * dtable.cc: Remove if 0'ed code. + * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode. + * sec_helper.cc (cygsid::get_id): Use system_printf for error message. + * tty.cc (tty::common_init): Ditto. + +2002-07-02 Christopher Faylor <cgf@redhat.com> + + * net.cc (cygwin_getpeername): Defend against NULL pointer dereference. + +2002-07-02 Egor Duda <deo@logos-m.ru> + + * include/cygwin/version.h: Bump API minor version. + +2002-07-01 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (get_logon_server): Interpret a zero length + domain as the local domain. + (get_group_sidlist): Add authenticated users SID to SYSTEM's group + list instead of SYSTEM itself. + (verify_token): Accept the primary group sid if it equals + the token user sid. + +2002-07-02 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (__fpclassifyd): Add symbol. + (__fpclassifyf): Ditto. + (__signbitd): Ditto. + (__signbitf): Ditto. + +2002-07-02 Corinna Vinschen <corinna@vinschen.de> + + * security.h (DONT_INHERIT): Eliminate definition. + (INHERIT_ALL): Ditto. + (INHERIT_ONLY): Ditto. + * sec_acl.cc: Use appropriate defines from accctrl.h instead of the + above throughout. + * security.cc: Ditto. + +2002-07-01 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.c (seteuid32): Return immediately if the program is not + impersonated and both uid and gid are original. + (setegid32): Return immediately if the new gid is the current egid. + +2002-07-01 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (seteuid32): Fix incorrect placement of Pierre's patch + below. + +2002-07-01 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (seteuid32): Fix incorrect use of system_printf. + +2002-07-02 Christopher January <chris@atomice.net> + + * autoload.cc (GetSecurityInfo): Define new autoload function. + (RegQueryInfoKeyA): Ditto. + * fhandler.h (fhandler_virtual::fill_filebuf): Change return type to + bool. + (fhandler_proc::fill_filebuf): Ditto. + (fhandler_registry::fill_filebuf): Ditto. + (fhandler_process::fill_filebuf): Ditto. + (fhandler_registry::value_name): Add new member. + (fhandler_registry::close): Add new method. + (fhandler_process::p): Remove member. + * fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after + calling superclass method. Check return value of fill_filebuf. + (fhandler_proc::fill_filebuf): Change return type to bool. Add return + statement. + * fhandler_process.cc (fhandler_process::open): Add set_nohandle after + calling superclass method. Remove references to p. Check return value + of fill_filebuf. + (fhandler_process::fill_filebuf): Change return type to bool. Don't + use dereference operator on p. Add return statement. + (fhandler_process::format_process_stat): Fix typo. + * fhandler_registry.cc: Add static open_key declaration. + (fhandler_registry::exists): Assume path is already normalised. Try + opening the path as a key in its own right first, before reverting to + enumerating subkeys and values of the parent key. + (fhandler_registry::fstat): Add additional code to return more relevant + information about the registry key/value. + (fhandler_registry::readdir): Explicitly set desired access when + opening registry key. Remove output of buf from debug_printf format + string. + (fhandler_registry::open): Use set_io_handle to store registry key + handle. Set value_name member. Move code to read a value from the + registry to fill_filebuf. Add call to fill_filebuf. + (fhandler_registry::close): New method. + (fhandler_registry::fill_filebuf): Change return type to bool. Add + code to read a value from registry. + (fhandler_registry::open_key): Make function static. Use KEY_READ as + desired access unless this is the last path component. Check the + return value of RegOpenKeyEx for an error instead of hKey. + * fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value + of fill_filebuf. + (fhandler_virtual::open): Remove call to set_nohandle. + (fhandler_virtual::fill_filebuf): Change return type to bool. Add + return statement. + * security.cc (get_nt_object_attribute): New function. + (get_object_attribute): New function. + * security.h (get_object_attribute): New function declaration. + +2002-07-01 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.c (seteuid32): Do not return an error when the token cannot + be created only because of a problem with the gid. + +2002-07-01 Christopher Faylor <cgf@redhat.com> + + * fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode. + * fhandler_console.cc (fhandler_console::open): *Really* force binary + mode rather than make it optional. + * fhandler_proc.cc (fhandler_proc::open): Ditto. + * fhandler_process.cc (fhandler_process::open): Ditto. + * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::open): Ditto. + * fhandler_registry.cc (fhandler_registry::open): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + * fhandler_virtual.cc (fhandler_virtual::open): Ditto. + * fhandler_windows.cc (fhandler_windows::open): Ditto. + * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. + * net.cc (fdsock): Ditto. + * path.cc (set_flags): Add more debugging. + +2002-07-01 Christopher Faylor <cgf@redhat.com> + + * debug.cc (threads): Avoid initialization. + * uinfo.cc (cygheap_user::ontherange): (from Corinna Vinschen) Actually + make below changes work. + +2002-07-01 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (cygheap_user::ontherange): Make cygwin root the last resort + for HOMEPATH/HOMEDRIVE for consistency with HOME. + +2002-07-01 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (sec_none): Move to sec_helper.cc. + (sec_none_nih): Ditto. + (sec_all): Ditto. + (sec_all_nih): Ditto. + (get_null_sd): Ditto. + (sec_acl): Ditto. + (__sec_user): Ditto. + * sec_helper.cc (sec_none): Move from shared.cc to here. + (sec_none_nih): Ditto. + (sec_all): Ditto. + (sec_all_nih): Ditto. + (get_null_sd): Ditto. + (sec_acl): Ditto. + (__sec_user): Ditto. + +2002-06-30 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (cygheap_user::ontherange): Potentially set HOME from + existing homepath and homedrive cygheap_user fields (not currently used + yet). Set HOME to / if no other alternative. + (cygheap_user::test_uid): Simplify. + +2002-06-30 Christopher Faylor <cgf@redhat.com> + + * environ.cc (parse_options): Use setenv to potentially replace CYGWIN + value on export. Fixes broken behavior since November 2000 changes. + (regopt): Return indication of whether or not something has been parsed + from the registry. + (environ_init): Only attempt to export CYGWIN variable when values were + set from the registry. It is exported automatically otherwise. + +2002-06-30 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_process::pid): New field. + (fhandler_process::fstat): Remove unneeded array. Set pid element. + (fhandler_process::open): Ditto. + (fhandler_process::fill_filebuf): Handle case where 'p' field is NULL. + +2002-06-30 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_process::p): New field. + (fhandler_process:fill_filebuf): Revert to same definition as virtual + in parent class. + (fhandler_process::open): Fill out p field rather than passing as an + argument. + (fhandler_process::fill_filebuf): Use p pointer rather than argument. + +2002-06-29 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (extract_nt_dom_user): Check for all buffer overflows. + Call LookupAccountSid after trying to get domain & user from passwd. + (get_group_sidlist): Obtain the domain and user by calling + extract_nt_dom_user instead of LookupAccountSid. + +2002-06-29 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (cygheap_user::test_uid): Use standard issetuid test. + +2002-06-29 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (NetGetDCName): Change to make this an optional load + function. + * cygheap.h (cygheap_user::logsrv): Return NULL when operation fails. + (cygheap_user::winname): Ditto. + (cygheap_user::domain): Ditto. + * uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable. + (cygheap_user::env_userprofile): Ditto. + +2002-06-29 Christopher Faylor <cgf@redhat.com> + + * environ.cc (spenv::retrieve): Detect return of env_dontadd from + cygheap_user methods. + (build_env): Avoid incrementing environment pointer if not actually + adding to the environment. That could result in garbage in the + environment table. Be more defensive when reallocing envblock. + +2002-06-29 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (cygheap_user::test_uid): Return NULL or further tests are + sorta useless. + (cygheap_user::env_domain): Recalculate if name is missing. + +2002-06-29 Christopher Faylor <cgf@redhat.com> + + * environ.cc (spenv::from_cygheap): Still need to take setuid into + consideration. + +2002-06-28 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (cygheap_user::env_logsrv): Return "almost_null" in case + where no domain or username is "SYSTEM". + +2002-06-28 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_user): Reorg to accommodate environment caching. + (cygheap_user::logsrv): New method. + (cygheap_user::winname): Ditto. + (cygheap_user::domain): Ditto. + (cygheap_user::test_uid): Ditto. + * cygheap.cc (cygheap_user::set_name): Reflect name "pwinname" name + change. + * environ.cc (getwinenveq): New function. + (penv::from_cygheap): penv::from_cygheap): Change arguments. + (spenv::retrieve): Ditto for call. Use getwinenveq to retrieve info + from environment. Always return value from cygwin environment, if it + exists. + * environ.h (getwinenveq): Declare. + * uinfo.cc (cygheap_user::ontherange): Use logsrv() rather than + env_logsrv(). + (cygheap_user::test_uid): Define new method. + (cygheap_user::env_logsrv): Accept environment arguments. Use test_uid + to find info. + (cygheap_user::env_domain): Ditto. + (cygheap_user::env_userprofile): Ditto. + (cygheap_user::env_homepath): Ditto. + (cygheap_user::env_homedrive): Ditto. + (cygheap_user::env_name): Ditto. + +2002-06-27 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cfree_and_set): New function. + (cygheap_user::set_name): Use cfree_and_set to reset members. + * cygheap.h (cygheap_user): Delete static members. + (cygheap_user::puserprof): New member. + (cfree_and_set): Declare. + * dcrt0.cc (almost_null): Define. + * environ.cc (env_dontadd): Redefine as "almost_null". + * winsup.h (almost_null): Declare. + * syscalls.cc (cfree_and_set): Remove unused variable. + * uinfo.cc (cygheap_user::homepath_env_buf): Eliminate. + (cygheap_user::homedrive_env_buf): Ditto. + (cygheap_user::userprofile_env_buf): Ditto. + (cygheap_user::ontherange): YA change to try to preserve existing + HOMEPATH and HOMEDRIVE. Return almost_null values when variables + should not actually exist. + (cygheap_user::env_logsrv): Ditto. + (cygheap_user::env_domain): Ditto. + (cygheap_user::env_userprofile): Ditto. + +2002-06-27 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Let __progname point to the applications + basename. Move eliminating ".exe" suffix from argv[0] so that it + always also affects __progname. + +2002-06-27 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread::create): Add trace printf to get CreateThread + LastError. + +2002-06-27 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (list::match): Check using pagesize aligned size. + +2002-06-26 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Force + FindFirstFile on first file of directory when asking for x:\ . + +2002-06-26 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cygheap_user::set_name): Correct thinko in below change. + +2002-06-26 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cygheap_user::set_name): Avoid clearing things when just + setting name to itself or during first time initialization. + + * environ.cc (check_case_init): Make case insensitive. + +2002-06-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::bind): Add method definition. + (fhandler_socket::connect): Ditto. + (fhandler_socket::listen): Ditto. + (fhandler_socket::accept): Ditto. + (fhandler_socket::getsockname): Ditto. + (fhandler_socket::getpeername): Ditto. + (fhandler_socket::recvfrom): Ditto. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + (fhandler_socket::shutdown): Ditto. + * fhandler_socket.cc (get_inet_addr): Move here from net.cc. + (fhandler_socket::bind): New method. + (fhandler_socket::connect): Ditto. + (fhandler_socket::listen): Ditto. + (fhandler_socket::accept): Ditto. + (fhandler_socket::getsockname): Ditto. + (fhandler_socket::getpeername): Ditto. + (fhandler_socket::recvfrom): Ditto. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + (fhandler_socket::shutdown): Ditto. + * net.cc: Various formatting cleanups throughout. + (get_inet_addr): Move to fhandler_socket.cc. + (cygwin_bind): Move base functionality to appropriate fhandler_socket + method. + (cygwin_connect): Ditto. + (cygwin_listen): Ditto. + (cygwin_accept): Ditto. + (cygwin_getsockname): Ditto. + (cygwin_getpeername): Ditto. + (cygwin_recvfrom): Ditto. + (cygwin_recvmsg): Ditto. + (cygwin_sendto): Ditto. + (cygwin_sendmsg): Ditto. + (cygwin_shutdown): Ditto. + +2002-06-26 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h (pwdgrp_read::~pwdgrp_read): Avoid compiler warning. + +2002-06-26 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and + it's not cygwin info. + +2002-06-26 Christopher Faylor <cgf@redhat.com> + + * autoload (noload): Avoid clobbering bx register. + + * environ.cc (codepage_init): Use case insensitive match. + + * fhandler_console.cc (cp_get_internal): Delete. + (con_to_str): Use get_cp to derive code page. + (str_to_con): Ditto. + * miscfuncs.cc (get_cp): New function. + (sys_wcstombs): New function. Converted from macro. + (sys_mbstowcs): Ditto. + * winsup.h: Reflect above changes. + +2002-06-26 Christopher Faylor <cgf@redhat.com> + + * winsup.h: Minor cleanup. + * path.h (path_conv::[]): New operator. + * syscalls.cc (_link): Use path_conv operators rather than methods, + where appropriate. Minor white space cleanup. + +2002-06-26 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-06-25 Thomas Pfaff <tpfaff@gmx.net> + + * include/pthread.h (PTHREAD_CANCELED): Define a reasonable value. + * pthread.cc (pthread_exit): Call method instead of function. + (pthread_setcancelstate): Ditto. + (pthread_setcanceltype): Ditto. + (pthread_testcancel): Ditto. + * thread.h (pthread::cancel_event): New member. + (__pthread_cancel_self): New prototype. + (pthread::exit): New Method. + (pthread::cancel): Ditto. + (pthread::testcancel): Ditto. + (pthread::cancel_self): Ditto. + (pthread::static_cancel_self): Ditto. + (pthread::setcancelstate): Ditto. + (pthread::setcanceltype): Ditto. + (__pthread_cancel): Give c++ linkage. + (__pthread_exit): Remove. + (__pthread_setcancelstate): Ditto. + (__pthread_setcanceltype): Ditto. + (__pthread_testcancel): Ditto. + * thread.cc (pthread::pthread): Inititialize cancel_event. + (pthread::~pthread): Close cancel_event if needed. + (pthread::create): Create cancel_event. + (pthread::exit): New method. Replacement for __pthread_exit. + (pthread::cancel): New method. + (pthread::testcancel): Ditto. + (pthread::static_cancel_self); New static method. + (pthread::setcancelstate): New method. Replacement for + __pthread_setcancelstate. + (pthread::setcanceltype): New method. Replacement for + __pthread_setcanceltype. + (pthread::pop_cleanup_handler): Add lock for async cancel safe + cancellation. + (pthread::thread_init_wrapper): Change __pthread_exit to + thread->exit(). + (__pthread_cancel): Call method thread->cancel(). + (__pthread_exit): Remove. + (__pthread_setcancelstate): Ditto. + (__pthread_setcanceltype): Ditto. + (__pthread_testcancel): Ditto. + +2002-06-25 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (sm): Make NO_COPY. + +2002-06-25 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (chown): Convert uid to 32 bit. + (lchown): Ditto. + (fchown): Ditto. + +2002-06-24 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::find_unused_handle): Avoid coercion. + +2002-06-24 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (fhandler_base::dup2): Cleanup. Ensure that lock is turned + off in error condition. + +2002-06-24 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (internal_getlogin): Set myself->uid and myself->gid instead + of user.real_uid and user.real_gid. + (uinfo_init): Evaluate orig_uid and real_uid from myself->uid. Ditto + for gid. + +2002-06-23 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (get_group_sidlist): Add pw argument and use pw->pw_name + in call to get_supplementary_group_sidlist. + (create_token): Add pw argument and use it in call to + get_group_sidlist. + * security.h: Add pw argument in declaration of create_token. + * syscalls.cc (seteuid32): Add pw argument in call to create_token. + +2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes. + * fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK. + +2002-06-23 Christopher Faylor <cgf@redhat.com> + + * lib/_cygwin_S_IEXEC.cc: Remove obsolete file. + +2002-06-23 Christopher Faylor <cgf@redhat.com> + + Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout. + * sys/ipc.h: Remove. + * sys/shm.h: Remove. + * cygwin_ipc.h: New file. + * cygwin_shm.h: New file. + +2002-06-23 Christopher Faylor <cgf@redhat.com> + + * cygwin.sc: Add recent changes from ld sources. + +2002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com> + + * winsup.h: Move #ifdef EXPCGF code into "winbase.h". + * winbase.h: #ifdef EXPCGF code moved here from "winsup.h". + +2002-06-12 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread::cleanup_stack): Rename cleanup_handlers to + cleanup_stack. + * thread.cc (pthread::pthread): Ditto. + (pthread::create): Fix mutex verification. + (pthread::push_cleanup_handler): Renam cleanup_handlers to + cleanup_stack. Remvoe Mutex calls, use InterlockedExchangePointer + instead. + (pthread::pop_cleanup_handler): Rename cleanup_handlers to + cleanup_stack. + (pthread::pop_all_cleanup_handlers): Ditto. + (__pthread_once): Check state first and return if already done. + (__pthread_join): Revert DEADLOCK test to __pthread_equal call. + (__pthread_detach): Unlock mutex before deletion. + +2002-06-21 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (cygrun.exe): Move -lgcc where it will do some good. + +2002-06-21 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat64_to_stat32): Correctly evaluate st_rdev. + (fstat64): Set st_rdev to same value as st_dev. + (stat_worker): Ditto. + +2002-06-21 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Carefully check owner_sid again after trying + SIDs from cygheap. + +2002-06-21 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Remove unnecessary retrieval of owner name. + Check uid for current user first and use SIDs from cygheap if so. + Set errno to EINVAL if user SID isn't retrievable. Just print user SID + as debug output. + Don't bail out if group SID isn't retrievable. Change debug output + appropriately. + +2002-06-21 Christopher Faylor <cgf@redhat.com> + + * errno.cc: Change text description for EBADF throughout. + +2002-06-20 Pierre Humblet <pierre.humblet@ieee.org> + + * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo. + (cygheap_user::env_logsrv): Verify env_domain is valid. + * environ.cc: Include child_info.h and keep spenvs[] sorted. + (environ_init): Check child_proc_info instead of myself->ppid_handle. + +2002-06-19 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::set_flags): Change priority of "linked + in" default binmode setting so that it has priority over optional + setting. + +2002-06-19 Christopher Faylor <cgf@redhat.com> + + Use hMainProc where appropriate, throughout. + * environ.cc (spenv::retrieve): Add debugging statements. + + * pinfo.cc (set_myself): Don't call strace.hello if already stracing. + * strace.cc (strace): Move NO_COPY keyword so that it will actually + take effect. + +2002-06-19 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with + non-NULL logserver parameter. + +2002-06-16 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_user::issetuid): New method. + * dtable.cc (dtable::vfork_child_dup): Use new method to determine if + we are in "setuid mode." + * fork.cc (fork_parent): Ditto. + * spawn.cc (spawn_guts): Ditto. + * syscalls.cc (seteuid32): Ditto. + (setegid32): Ditto. + * environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do + potential recalculation of cygheap_user stuff when in setuid mode. + Return special value when environment variable should be calculated but + not added. + (build_env): Don't add retrieved value to dstp if it is 'dont_add'. + +2002-06-16 Christopher Faylor <cgf@redhat.com> + + Changes suggested by Pierre Humblet. + * environ.cc (NL): New macro. + (conv_envvars): Use NL macro to fill in name and namelen. + (spenv::namelen): New field. + (spenvs): Use NL to fill in name and namelen. + (spenv::retrieve): Eliminate length argument. Instead, use namelen + throughout. + (build_env): Don't calculate length of initial FOO= part of + environment. Accommodate spenv::retrive argument change. + +2002-06-16 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_user::winname): New field. + * cygheap.cc (cygheap_user::set_name): Clear winname when name changes. + * uinfo.cc (cygheap_user::env_logsrv): Avoid calculating server when + Windows user == SYSTEM. + (cygheap_user::env_domain): Set winname here too. + (cygheap_user::env_userprofile): Eliminate superfluous tests. + (cygheap_user::env_name): Seed winname by calling env_domain(). + +2002-06-12 Pierre Humblet <pierre.humblet@ieee.org> + + * spawn.cc (spawn_guts): Revert removal of ciresrv.moreinfo->uid = + ILLEGAL_UID. + +2002-06-15 Christopher Faylor <cgf@redhat.com> + + * child_info.h (child_proc_info): Declare as base class. + (spawn_info): Declare as alias of child_proc_info to aid debugging. + (fork_info): Ditto. + * cygheap.cc (cygheap_fixup_in_child): Use child_proc_info global + rather than parameter. + * cygheap.h (cygheap_fixup_in_child): Reflect above change in + declaration. + * dcrt0.cc (_dll_crt0): Move 'si' definition here. Assign + child_proc_info. + (dll_crt0_1): Accommodate cygheap_fixup_in_child and *_info changes. + * environ.cc (spenv::retrieve): Make regparm. + * environ.h (environ_init): Ditto. + (win_env::add_cache): Ditto. + (build_env): Ditto. + (getwinenv): Ditto. + * fork.cc (sync_with_parent): Use fork_info global. + (fork_child): Ditto. + +2002-06-14 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (cygheap_user::ontherange): Don't set HOMEDRIVE or HOMEPATH + unless one or the other is specified. + +2002-06-14 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_user::userprofile_env_buf): New static member. + * environ.cc (build_env): Add debugging statement. + (spenvs): Switch functions for USERDOMAIN and USERNAME. + * spawn.cc (spawn_guts): Move environment initialization prior to + cygheap_setup_for_child or environment info will never be copied to + child. + +2002-06-14 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_user): Add static members to hold home{drive,path} + info. + * uinfo.cc (cygheap_user::ontherange): Use static class members for + local HOME* storage. + +2002-06-14 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cygheap_user::set_logsrv): Remove. + (cygheap_user::set_domain): Ditto. + * cygheap.h (cygheap_user::set_logsrv): Remove declaration. + (cygheap_user::set_domain): Ditto. + (cygheap_user::env_domain): Declare new method. + (cygheap_user::env_name): Ditto. + * environ.cc (spenvs): Add two environment variables. + * spawn.cc (spawn_guts): Call build_env after RevertToSelf. Always set + ciresrv.mount_h. + (cygheap_user::ontherange): Recalculate homedrive/homepath if they are + empty. Use env_logsrv to get logon server. + (cygheap_user::env_logsrv): Calculate server name here rather than + relying on it having been previously calculated. + (cygheap_user::env_domain): Ditto for domain name. + (cygheap-user::env_name): New method. + +2002-06-12 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (seteuid32): Do not get or set the environment. Do not + call LookupAccountSid nor internal_getlogin. Set cygheap->user name + and sid from the passwd entry. + * uinfo.cc (uinfo_init): Only call internal_getlogin when starting from + a non Cygwin process and use the values returned in user. + (internal_getlogin): Simplify to case where starting from a non Cygwin + process. Store return values in user and return void. Do not set the + Windows default environment. + * dcrt0.cc (dll_crt0_1): Call uinfo_init only when needed. Do not set + myself->uid nor reset user.sid. + * spawn.cc (spawn_guts): Get the sid from cygheap->user. Always + RevertToSelf(). Don't set uid in impersonated case. + * cygheap.cc (cygheap_user::set_sid): Do not set orig_sig. + (cygheap_user::set_orig_sid): New. + * cygheap.h: Declare cygheap_user::set_sid. + * winsup.h: Add argument to uinfo_init(). + +2002-06-14 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (build_env): If realloc moves envblock, move s with it. + +2002-06-13 Nicholas S. Wourms <nwourms@netscape.net> + + * winver.rc: Add more words to copyright. + +2002-06-13 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_user::set_name): Revert previous change. + * environ.cc (spenv::retrieve): Check return value of call to + cygheap->user.*from_cygheap(). + +2002-06-13 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_user::set_name): Remove setting homedrive and + homepath to NULL. + (cygheap_user::set_logsrv): Fix free'ing of plogsrv. + * cygheap.h (cygheap_user::cygheap_user): Initialize homedrive and + homepath to NULL. + +2002-06-13 Christopher Faylor <cgf@redhat.com> + + * security.cc (get_logon_server): Use strcasematch rather than + strcasecmp. + +2002-06-12 Christopher Faylor <cgf@redhat.com> + + * path.cc (chdir): Minor cleanup. + +2002-06-12 Christopher Faylor <cgf@redhat.com> + + * environ.cc (build_env): Correctly fill out windows environment block + with win32 paths rather than posix paths. + +2002-06-12 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to + NULL on user name change. + (cygheap_user::set_logsrv): Allocate enough space for leading \\ so + that we can put this in the environment, if needed. + * cygheap.h (homebodies): New enum. + (cygheap_user::homedrive): New field. + (cygheap_user::homepath): Ditto. + (cygheap_user::env_logsrv): New method. + (cygheap_user::env_homepath): New method. + (cygheap_user::env_homedrive): New method. + (cygheap_user::env_userprofile): New method. + (cygheap_user::ontherange): New method. + * environ.cc (envsize): Eliminate debugging argument. + (environ_init): Assume that envc counts number of elments not total + size. + (spenv): New class. + (spenvs): New array, rename from forced_winenv_vars, using spenv. + (spenv::retrieve): New method. + (build_env): Rename from 'winenv' -- one stop shopping for building new + environment blocks for both windows and "unix". + * environ.h (build_env: Declare. + (winenv): Delete declaration. + (envsize): Ditto. + * spawn.cc (spawn_guts): Use build_env to build windows and cygwin + environment blocks. + * uinfo.cc (internal_getlogin): Eliminate environment manipulation. + Default to info from GetUserName if it exists. Move HOMEPATH and + HOMEDRIVE stuff elsewhere. Move HOME setting elsewhere. Only set HOME + environment variable in processes that are not parented by a cygwin + process. + (cygheap_user::ontherange): Define new method. + (cygheap_user::env_logsrv): Ditto. + (cygheap_user::env_homepath): Ditto. + (cygheap_user::env_homedrive): Ditto. + (cygheap_user::env_userprofile): Ditto. + +2002-06-11 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawn_guts): More hToken removal cleanup. + +2002-06-09 Pierre Humblet <pierre.humblet@ieee.org> + + * spawn.cc (spawn_guts): Define sec_attribs and call sec_user_nih() + only once. + +2002-06-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Ensure that -MD gets added to CFLAGS regardless of + CFLAGS command-line setting. + + * cygwin.din: Export sexec* functions as function which returns ENOSYS + (i.e., sexec* is deprecated). + * dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is + restored even on failure. + * exec.cc: Throughout, remove references to sexec* and _spawnve. + * pinfo.h: Remove _spawnve declaration. + * spawn.cc: Rename _spawnve to spawnve and use throughout. + (spawn_guts): Eliminate hToken argument and processing of same. Just + perform special actions if impersonating. + (spawnve): Rename from _spawnve. + +2002-06-10 Christopher Faylor <cgf@redhat.com> + + * include/sys/strace.h (strace): Avoid use of constructor. + +2002-06-10 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dll_crt0_1): Initialize wincap and check for sanity before + running global ctors. + * wincap.h (wincap): Eliminate constructor. Default is to zero memory, + anyway. + * wincap.cc (wincap): Copy this on fork to avoid initialization in + forked processes. + +2002-06-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::fixup_after_fork): Revert patch from + 2002-06-04. + * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto. + (fhandler_socket::dup): Ditto. + * net.cc (fdsock): Make sockets explicitely noninheritable on NT. + +2002-06-09 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly + set number of links for directory, if appropriate. + +2002-06-10 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc: Variation of a patch from Thomas Pffaf. + (__pthread_detach): Cleanup thread object if the thread has terminated. + (__pthread_join): Change order of error checks, and lock against + join/detach/exit races. + (__pthread_exit): Lock object against join/detach/exit races. + (pthread::thread_init_wrapper): Ditto. + (thread_init_wrapper): Rename to pthread::thread_init_wrapper. + (pthread::create): Check that the mutex initialized correctly. + (pthread::push_cleanup_handler): Lock against potential cancellation + race. NB: this may not be required if pthread_cleanup_push is non- + cancelable. + * thread.h (pthread::mutex): New member. + (thread_init_wrapper): Rename to pthread::thread_init_wrapper. + (pthread::thread_init_wrapper_: New static member. + +2002-06-10 Robert Collins <rbtcollins@hotmail.com> + + * cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop. + * pthread.cc: Change __pthread_self to pthread::self() thruoghout. + (_pthread_cleanup_push): New function. + (_pthread_cleanup_pop): Ditto. + * thread.cc: Thanks to Thomas Pfaff for the pthread cleanup_push,_pop + patch, this work is derived from that. + Change __pthread_self to pthread::self() thruoghout. + (__pthread_self): Rename to pthread::self. + (pthread::self): New method. + (pthread::pthread): Initialize new member. + (pthread::push_cleanup_handler): New method. + (pthread::pop_cleanup_handler): New method. + (pthread::pop_all_cleanup_handlers): New method. + (__pthread_exit): Pop all cleanup handlers. + * thread.h (pthread::push_cleanup_handler): Declare. + (pthread::pop_cleanup_handler): Ditto. + (pthread::pop_all_cleanup_handlers): Ditto. + (pthread::self): New static method. + (__pthread_exit): Give C++ linkage. + (__pthread_join): Ditto. + (__pthread_detach): Ditto. + (__pthread_self): Remove. + +2002-04-24 Thomas Pfaff <tpfaff@gmx.net> + + * include/pthread.h (__pthread_cleanup_handler): New structure. + (pthread_cleanup_push): Rewritten. + (pthread_cleanup_pop): Ditto. + (_pthread_cleanup_push): New prototype. + (_pthread_cleanup_pop): Ditto. + +2002-04-24 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (thread_init_wrapper): Check if thread is already joined. + (__pthread_join): Set joiner first. + (__pthread_detach): Ditto. + +2002-06-10 Robert Collins <rbtcollins@hotmail.com> + + * cygserver_transport.cc (create_server_transport): Finish the split + out of sockets code from transport_layer_base. Thanks to Nicholas + Wourms and Conrad Scott for catching this. + +2002-06-08 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (pinfo_dummy): Initialize to correct size. + +2002-06-08 Christopher Faylor <cgf@redhat.com> + + * path.cc: Change MOUNT_AUTO to MOUNT_CYGDRIVE throughout. + * shared_info.h (CURR_MOUNT_MAGIC): Update. + +2002-06-08 Christopher Faylor <cgf@redhat.com> + + * external.cc (cygwin_internal): Make v1 mount table access invalid. + * path.cc (mount_info::init): Remove had_to_create_mount_areas initialization. + (mount_info::from_registry): Remove v1 table import. + (mount_info::read_v1_mounts): Eliminate. + (mount_info::import_v1_mounts): Ditto. + * shared_info.h (mount_info): Ditto for both of above. + * sys/mount.h (MOUNT_DEVFS): New enum. + (MOUNT_PROC): Ditto. + +2002-06-08 Christopher Faylor <cgf@redhat.com> + + * include/wchar.h: Define __need_size_t. + +2002-06-07 Christopher Faylor <cgf@redhat.com> + + * fhandler_socket.cc (fhandler_socket::fstat): Don't assume that socket + is unix-domain socket. + +2002-06-07 Christopher Faylor <cgf@redhat.com> + + * times.cc (hires_ms::prime): Set init flag. + +2002-06-07 Conrad Scott <conrad.scott@dsl.pipex.com> + + * times.cc (hires_ms::prime): Adjust epoch of initime_us from 1601 to + 1970. + +2002-06-06 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (timeGetDevCaps): Define new autoload function. + (timeGetTime): Ditto. + (timeBeginPeriod): Ditto. + (timeEndPeriod): Ditto. + * hires.h (hires_base): New class. Rename from hires. + (hires_us): New class. + (hires_ms): New class. + * strace.cc (strace::microseconds): Use hires_us class. + * times.cc (gettimeofday): Use hires-ms class. + (hires_us::prime): Rename from hires::prime. + (hires_us::usecs): Rename from hires:usecs. + (hires_ms::prime): New method. + (hires_ms::usecs): New method. + (hires_ms::~hires_ms): New destructor. + +2002-06-06 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (noload): Correctly save argument count register. + +2002-06-05 Conrad Scott <conrad.scott@dsl.pipex.com> + + * fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of + st_atim, st_mtim, and st_ctim fields. + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto. + * fhandler_process.cc (fhandler_process::fstat): Ditto. + * glob.c (stat32_to_STAT): Copy across the whole st_atim, st_mtime, and + st_ctim fields. + * syscalls.cc (stat64_to_stat32): Ditto. + * times.cc (to_timestruc_t): New function. + (time_as_timestruc_t): New function. + * winsup.h: Add to_timestruc_t and time_as_timestruc_t functions. + * include/cygwin/stat.h: Replace time_t with timestruc_t throughout for + all file times, removing the st_spare1, st_spare2, and st_spare3 fields + in the process. Add macros to access tv_sec fields by old names. + * include/cygwin/types.h: Typedef timespec_t and timestruc_t as struct + timespec. + +2002-06-03 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_helper.cc (lookup_name): Suppress. + * security.cc (alloc_sd): Remove logsrv argument. + Remove two calls to lookup_name. + (set_security_attribute): Remove logsrv argument. + Remove logsrv argument in call to alloc_sd. + (set_nt_attribute): Remove logsrv argument. + Remove logsrv argument in call to set_security_attribute. + (set_file_attribute): Remove logsrv argument. + Remove logsrv argument in call to set_nt_attribute. + (set_file_attribute): Remove logsrv argument. + Remove logsrv argument in call to set_file_attribute. + * syscalls.cc (chown_worker): Remove logserver argument in + call to set_file_attribute. + (chmod): Ditto. + * shm.cc (shmget): Remove logsrv argument in call to alloc_sd. + * uinfo.cc (internal_getlogin): Replace calls to + lookup_name by call to LookupAccountName. + * security.h: Remove logsrv in declarations of set_file_attribute + and alloc_sd. Remove declaration of lookup_name. + +2002-06-05 Christopher Faylor <cgf@redhat.com> + + * child_info.h (CHILD_INFO_MAGIC): Oops. Revert previous change. gcc + 3.1 bug? + +2002-06-05 Christopher Faylor <cgf@redhat.com> + + * child_info.h (CHILD_INFO_MAGIC): Update. + +2002-06-05 Christopher Faylor <cgf@redhat.com> + + * strace.cc (strace::hello): Set inited, when appropriate. + +2002-06-05 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Eliminate some newlib wrappers. + * path.cc (get_devn): Only consider first 99 potential com devices. + (get_device_number): Ditto. + * times.cc (_times): Eliminate. + (_times): Rename from times(). + +2002-06-05 Christopher Faylor <cgf@redhat.com> + + * dir.cc (rmdir): Streamline. Detect attempts to remove directories + from "read-only" virtual devices. (Suggested by Pavel Tsekov) + * syscalls.cc (unlink): Detect attempts to remove directories from + "read-only" virtual devices. (From Pavel Tsekov) + +2002-06-05 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (handle_to_fn): Check error return value from NtQueryObject + first before seeing if name buffer is NULL. + + * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format. + * passwd.cc (read_etc_passwd): Ditto. + +2002-04-18 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread::joiner): New member. + * thread.cc (pthread::pthread): Initialize joiner to NULL + (pthread::create): Increment of thread counter moved from + __pthread_create to this location. + (__pthread_create): Increment thread counter removed. + (thread_init_wrapper): Set joiner to self when thread was created + detached. + (__pthread_exit): delete thread when it is detached and not + joined. + (__pthread_join): Check for deadlock and delete thread when it has + terminated. + (__pthread_detach): Set joiner to self when thread state + changed to detached. + +2002-06-05 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (read_etc_group): When emulating nonexisting group file on + NT systems, read primary group SID from process token. Use that info + to create correct group entry. On error or on 9x systems fallback + to emulating Administrators group as before. + * passwd.cc (read_etc_passwd): When emulating nonexisting passwd file + on NT systems, read user and primary group SID from process token. + Use that info to create correct passwd entry. On error or on 9x + systems fallback to emulating user with Administrator user id and + Administrators group as before. + +2002-06-05 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (etc_group): Removed. + (parse_grp): Make line parameter nonconst. Don't copy data into new + allocated memory. Check for CR instead of LF to accomodate new + read method. + (add_grp_line): Make line parameter nonconst. + (read_etc_group): Rearrange using new pwdgrp_read class. + * passwd.cc (parse_pwd): Don't copy data into new allocated memory. + Check for CR instead of LF to accomodate new read method. + (read_etc_passwd): Rearrange using new pwdgrp_read class. + * pwdgrp.h (pwdgrp_check::set_last_modified): Use different + parameters. + (class pwdgrp_read): New class for opening and reading passwd and + group files. + +2002-06-04 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote + shares. + * path.cc (mount_info::conv_to_win32_path): Set flags to binary when + mount entry is not found. + (mount_info::set_flags_from_win32_path): Ditto. + +2002-06-04 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (handle_to_fn): Correct placement and length of name + buffer. (Suggested by Pavel Tsekov) + +2002-06-04 Christopher Faylor <cgf@redhat.com> + + Remove fcntl.h includes throughout. + * fhandler.h: Move fcntl.h include here. + (fhandler_base::set_flags): Accept supplied_bin argument. Make + non-inlined. + * dtable.cc (dtable::init_std_file_from_handle): Just use binmode from + pc. + (reset_to_open_binmode): Use set_flags. + * cygwin.din (open): Avoid newlib wrapper. + (read): Ditto. + (unlink): Ditto. + (write): Ditto. + * fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument. + Make binmode decisions here. + (fhandler_base::open): Avoid using pc if it is NULL. Eliminate binmode + logic. Just call set_flags with binmode argument. + (fhandler_base::init): Call set_flags with binmode argument. + * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto. + * fhandler_console.cc (fhandler_console::open): Ditto. + (fhandler_console::init): Force binary on open. + * fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode + here. Let it happen in base class. + * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open. Set + return value appropriately if unable to open. + * fhandler_proc.cc (fhandler_proc::open): Make sure flags are set + before open_status. + * fhandler_process.cc (fhandler_process::open): Ditto. + * fhandler_registry.cc (fhandler_registry::open): Ditto. + * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default. + * fhandler_serial.cc (fhandler_serial::init): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + (fhandler_pty_master::open): Ditto. + * fhandler_virtual.cc (fhandler_virtual::open): Ditto. + * fhandler_windows.cc (fhandler_windows::open): Ditto. + * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. + * net.cc (fdsock): Ditto. + * path.cc (path_conv::check): Avoid checking for executable extension + when directory. (Suggested by Pavel Tsekov) + (set_flags): Set PATH_TEXT explicitly, when appropriate. + (mount_info::conv_to_win32_path): Use set_flags() to set path flags. + * path.h (PATH_TEXT): New enum. + (path_conv::binmode): Return appropriate constant based on binmode. + * pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY. + * syscalls.cc (setmode_helper): Make debugging message a little + clearer. + (setmode): Set binmode via set_flags. + +2002-06-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add private method + fixup_after_fork (bool, HANDLE). + * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Move + functionality to new private method. Add closing parent socket + if not called from dup(). Create method new calling private method + with appropriate parameter. + (fhandler_socket::fixup_after_exec): Call private method + fixup_after_fork with appropriate parameter. + (fhandler_socket::dup): Ditto. + +2002-06-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::open): Set errno to EACCES if + requested mode isn't supported. + +2002-06-03 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::open): Don't set binmode if already set. + Don't check for file. Files should already be set. Report on binary + mode for debugging. + (fhandler_base::fhandler_base): Don't set default binmode here. That's + for later. + * fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set + binmode, ever, for console. + * fhandler_disk_file.cc (fhandler_disk_file::open): Always set the + binary mode to the value derived from mount table. + * path.cc (mount_info::conv_to_win32_path): Default to binmode if path + does not translate into anything in the mount table. + +2002-06-03 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Add CW_EXTRACT_DOMAIN_AND_USER + handling to call extract_nt_dom_user() from applications. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_EXTRACT_DOMAIN_AND_USER. + +2002-06-03 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat64_to_stat32): Transform st_dev correctly. + (fstat64): Add evaluating st_ino and st_dev. + (stat_worker): Evaluate st_dev as 32 bit value. + * include/cygwin/stat.h: Use new dev_t definition throughout. + * include/cygwin/types.h: Define __dev16_t and __dev32_t. Define + dev_t according to __CYGWIN_USE_BIG_TYPES__ setting. + * include/sys/sysmacros.h: Define major, minor and makedev + according to __CYGWIN_USE_BIG_TYPES__ setting. + +2002-06-03 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (setegid32): Verify the correctness of the gid + of the group returned by getgrgid32. + +2002-06-03 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (lsa2wchar): Suppressed. + (get_lsa_srv_inf): Suppressed. + (get_logon_server_and_user_domain): Suppressed. + (get_logon_server): Essentially new. + (get_user_groups): Add "domain" argument. Only lookup the + designated server and use "domain" in LookupAccountName. + (is_group_member): Simplify the arguments. + (get_user_local_groups): Simplify the arguments. Do only a + local lookup. Use "BUILTIN" and local domain in LookupAccountName. + (get_user_primary_group). Only lookup the designated server. + (get_group_sidlist): Remove logonserver argument. Do not lookup + any server for the SYSTEM account. + (create_token): Delete logonserver and call to get_logon_server. + Adjust arguments of get_group_sidlist, see above. + * security.h: Delete declaration of get_logon_server_and_user_domain + and add declaration of get_logon_server. + * uinfo.cc (internal_get_login): Call get_logon_server instead of + get_logon_server_and_user_domain. + +2002-06-02 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (handle_to_fn): Use largest match for device. Correctly + (?) deal with remote drive weirdness. + +2002-06-02 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check + specifically for non-existent file, first. + (fhandler_disk_file::fstat): Perform fd open on files with funny + characters. + +2002-06-02 Christopher January <chris@atomice.net> + + * fhandler_process.cc (fhandler_process::open): Set fileid. + +2002-06-02 Christopher Faylor <cgf@redhat.com> + + Remove unneeded sigproc.h includes throughout. + * fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument. + * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search + for given pid. + (fhandler_proc::readdir): Assume that pid exists if it shows up in the + winpid list. + * fhandler_process.cc (fhandler_process::open): Simplify search for + given pid. Call fill_filebuf with pinfo argument. + (fhandler_process::fill_filebuf): Pass pinfo here and assume that it + exists. + * pinfo.h (pinfo::remember): Define differently if sigproc.h is not + included. + +2002-06-02 Christopher Faylor <cgf@redhat.com> + + * dll_init.cc (dll_list::detach): Don't run destructor on exit. + +2002-06-01 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::fstat): Move dev and ino calculation into + caller. + * syscalls.cc (stat_worker): Calculate dev and ino calculation here, if + zero. + * fhandler_proc.cc (fhandler_proc::fhandler_proc): Minor reorg for + debugging. + * fhandler_process.cc (fhandler_process::exists): Return 0 on + nonexistence. + (fhandler_process::fstat): Simplify pid logic. + * fhandler_tape.cc (fhandler_dev_tape::fstat): Minor reformatting. + +2002-06-01 Christopher Faylor <cgf@redhat.com> + + * path.cc (chdir): Don't allow cd'ing to a non-directory virtual path. + +2002-05-31 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (readdir): Move inode calculation into caller. + (fhandler_cygdrive::readdir): Add "." and "..". + * dir.cc (readdir): Move inode calculation here so that fhandler + readdirs can benefit. + +2002-05-31 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::open): Reinstate setting of + flags. + + * dtable.cc (dtable::init_std_file_from_handle): Default to using + binmode derived from path_conv, when required. + * fhandler.h (fhandler_base::get_w_binary): Default to binmode if + nothing else is specified. + * fhandler.h (fhandler_base::get_r_binary): Ditto. + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_handle): Work + around g++ warning. + + * path.cc (path_conv::check): Remove a debugging statement. + +2002-05-31 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::open): Always default to + binmode. + (fhandler_console::write_normal): Don't honor binmode setting. There + is already a termios setting for this. + (fhandler_console::init): Correct argument order in init call. + +2002-05-31 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::open): Make default open mode == binmode. + (fhandler_base::init): Set open flags based on derived binmode argument. + +2002-05-31 Christopher Faylor <cgf@redhat.com> + + * dll_init.cc (dll_list::init): Eliminate unneeded debugging statement. + +2002-05-31 Christopher Faylor <cgf@redhat.com> + + * fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more + files. + * fhandler_process.cc (fhandler_process::readdir): Ditto. + * fhandler_registry.cc (fhandler_registry::readdir): Ditto. + +2002-05-30 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES + for nonexistent virtual device path. + (chdir): Set correct errno when attempt is made to cd to nonexistent + virtual device path. + +2002-05-30 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call + fstat_by_name if fd is not opened to allow fstat_by_name to properly + set errno. + +2002-05-30 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Replace autoload statments for ZwXXX by NtXXX. + Drop ZwQuerySystemInformation since NtQuerySystemInformation was + already available. + * fhandler_proc.cc (format_proc_uptime): Replace call to + ZwQuerySystemInformation by call to NtQuerySystemInformation. + (format_proc_stat): Ditto. + * fhandler_process.cc (format_process_stat): Replace call to + ZwQueryInformationProcess by call to NtQueryInformationProcess. + (get_process_state): Ditto. + (get_mem_values): Ditto. Replace call to ZwQueryVirtualMemory by + call to NtQueryVirtualMemory. + * ntdll.h: Cleanup. Drop ZwQuerySystemInformation since + NtQuerySystemInformation was already available. Replace declarations + of ZwXXX functions by declarations of NtXXX. + * pinfo.cc (winpids::enumNT): Replace call to ZwQuerySystemInformation + by call to NtQuerySystemInformation. + +2002-05-29 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (binmode): Default to binmode when mode is not known. + +2002-05-29 Christopher Faylor <cgf@redhat.com> + + * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION): Reinstate. + * external.cc (fillout_pinfo): Use it. + +2002-05-29 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (fillout_pinfo): Use new version define. + * include/sys/cygwin.h (external_pinfo): Define + EXTERNAL_PINFO_VERSION_16_BIT and EXTERNAL_PINFO_VERSION_32_BIT + instead of just EXTERNAL_PINFO_VERSION. + +2002-05-29 Christopher Faylor <cgf@redhat.com> + + * external.cc (fillout_pinfo): Set new version field in external_pinfo + structure. + * include/sys/cygwin.h (external_pinfo): Replace strace_file with + version field. + +2002-05-29 Corinna Vinschen <corinna@vinschen.de> + + Change internal uid datatype from __uid16_t to __uid32_t + throughout. + * cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32, + geteuid32, setuid32, seteuid32. + * passwd.cc (getpwuid32): New function. + (getpwuid_r32): Ditto. + * syscalls.cc (seteuid32): Ditto. + (setuid32): Ditto. + * uinfo.cc (getuid32): Ditto. + (geteuid32): Ditto. + * winsup.h (uid16touid32): New macro, correct casting from __uid16_t + to __uid32_t. + (gid16togid32): Ditto fir gids. + (getuid32): Declare. + (geteuid32): Ditto. + (getpwuid32): Ditto. + * include/sys/cygwin.h (struct external_pinfo): Add members uid32 and + gid32. + +2002-05-29 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h: Protect some symbols against multiple + definition. + * include/netinet/ip.h: Ditto. + * include/netinet/tcp.h: Ditto. + +2002-05-29 Wu Yongwei <adah@netstd.com> + + * include/netinet/ip.h: Replace by BSD derived version of the file. + * include/netinet/tcp.h: Ditto. + * include/netinet/udp.h: New file. + * include/cygwin/ip.h: Remove. + +2002-05-29 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::init_std_file_from_handle): Attempt stronger + detection of invalid handle. + (handle_to_fn): Detect pathological condition where NT resets the + buffer pointer to NULL on an invalid handle. + +2002-05-28 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Properly + check for whether we should be opening the file to search for #! + characters. Set path_conv structure execability, too, when + appropriate. + +2002-05-28 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_security_attribute): Call getegid32() instead of + getegid(). + * include/cygwin/grp.h: Declare getegid32(). + +2002-05-28 Corinna Vinschen <corinna@vinschen.de> + + Change internal gid datatype from __gid16_t to __gid32_t + throughout. + * cygwin.din: Export new symbols chown32, fchown32, getegid32, + getgid32, getgrgid32, getgrnam32, getgroups32, initgroups32, lchown32, + setgid32, setegid32, getgrent32. + * grp.cc (grp32togrp16): New static function. + (getgrgid32): New function. + (getgrnam32): Ditto. + (getgrent32): Ditto. + (getgroups32): Change name of internal function from getgroups. + (getgroups32): New function. + (initgroups32): Ditto. + * syscalls.cc (chown32): Ditto. + (lchown32): Ditto. + (fchown32): Ditto. + (setegid32): Ditto. + (setgid32): Ditto. + * uinfo.cc (getgid32): Ditto. + (getegid32): Ditto. + * include/cygwin/grp.h: Remove declaration of getgrgid() and getgrnam(). + Declare getgrgid32() and getgrnam32() instead. Declare getgid32(). + +2002-05-27 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (noload): Properly mask low order word for determining + number of bytes to pop. + +2002-05-27 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Minor logic + cleanup. + +2002-05-27 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro. + (LoadFuncEx2): Adapt from LoadFuncEx. Provides control of return + value for nonexistent function. + (NtQueryObject): Declare. + (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if + not available. + * debug.h (being_debugged): Just rely on IsDebuggerPresent return + value. + * dtable.cc (handle_to_fn): New function. + (dtable::init_std_file_from_handle): Attempt to derive std handle's + name via handle_to_fn. + (dtable::build_fhandler_from_name): Fill in what we can in path_conv + structure when given a handle and path doesn't exist. + * fhandler.cc (fhandler_base::open): Don't set the file pointer here. + Use pc->exists () to determine if file exists rather than calling + GetFileAttributes again. + * fhandler.h (fhandler_base::exec_state_isknown): New method. + (fhandler_base::fstat_helper): Add extra arguments to declaration. + (fhandler_base::fstat_by_handle): Declare new method. + (fhandler_base::fstat_by_name): Declare new method. + * fhandler_disk_file (num_entries): Make __stdcall. + (fhandler_base::fstat_by_handle): Define new method. + (fhandler_base::fstat_by_name): Define new method. + (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate. + (fhandler_disk_file::fstat_helper): Accept extra arguments for filling + out stat structure. Move handle or name specific stuff to new methods + above. + (fhandler_disk_file::open): Use real_path->exists rather than calling + GetFileAttributes again. + * ntdll.h (FILE_NAME_INFORMATION): Define new structure. + (OBJECT_INFORMATION_CLASS): Partially define new enum. + (OBJECT_NAME_INFORMATION): Define new structure. + (NtQueryInformationFile): New declaration. + (NtQueryObject): New declaration. + * path.cc (path_conv::fillin): Define new method. + * path.h (path_conv::fillin): Declare new method. + (path_conv::drive_thpe): Rename from 'get_drive_type'. + (path_conv::volser): Declare new method. + (path_conv::volname): Declare new method. + (path_conv::root_dir): Declare new method. + * syscalls.cc (fstat64): Send real path_conv to fstat as second + argument. + +2002-05-24 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (lsa2str): New function. + (get_priv_list): Call lsa2str instead of sys_wcstombs. + +2002-05-22 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (seteuid): Do not take allow_ntsec into account. + Attempt to use an existing or new token even when the uid + matches orig_uid, but the gid is not in the process token. + Major reorganization after several incremental changes. + (setegid): Do not take allow_ntsec into account. Minor + reorganization after several incremental changes. + +2002-05-26 Christopher Faylor <cgf@redhat.com> + + * debug.h (being_debugged): New macro. + * dtable.cc (dtable::extend): Use new macro. + * exceptions.cc (try_to_debug): Ditto. + * strace.cc (strace::hello): Only output debugging info when we think + we're being debugged. + +2002-05-25 Robert Collins <rbtcollins@hotmail.com> + + * winsup.h: Remove duplicate declarations of malloc_lock and + malloc_unlock. + +2002-05-24 Christopher Faylor <cgf@redhat.com> + + Remove unneeded sync.h, where appropriate, throughout. + Remove unneeded heap.h, where appropriate, throughout. + Remove unneeded exceptions.h, where appropriate, throughout. + Remove unneeded perprocess.h, where appropriate, throughout. + +2002-05-22 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (create_token): Call __sec_user() instead of + sec_user() to remove dependence on allow_ntsec. Verify that + the returned sd is non-null. + +2002-05-25 Robert Collins <rbtcollins@hotmail.com> + + * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's. + +2002-05-24 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path + along to set_name via return_and_clear_normalized_path. + (dtable::build_fhandler): New method with const char * argument. + (dtable::reset_unix_path_name): Eliminate. + (dtable::dup_worker): Use correct build_fhandler method. + * mmap.cc (mmap_record::alloc_fh): Ditto. + * dtable.h (dtable::build_fhandler): New method. + (dtable::reset_unix_path_name): Eliminate. + * fhandler.cc (fhandler_base::set_name): Assume that unix_name has + already been cmalloced. + (fhandler_base::reset_unix_path_name): Eliminate. + (fhandler_base::~fhandler_base): Coercion for cfree. + * fhandler.h (fhandler_base::unix_path_name): Make const char *. + (fhandler_base::win32_path_name): Ditto. + (fhandler_base::reset_unix_path_name): Eliminate. + * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate + const char *ness of win32_path_name. + * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name + requirements. + * path.cc (path_conv::return_and_clear_normalized_path): New method. + (path_conv::clear_normalized_path): Eliminate. + (path_conv::~path_conv): Ditto. + (path_conv::check): Accommodate new build_fhandler method. + * path.h (path_conv::~path_conv): Eliminate. + (path_conv::clear_normalized_path): Ditto. + (path_conv::return_and_clear_normalized_path): Declare new method. + +2002-05-23 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Make sure any trailing path component is + part of potential normalized posix path. + +2002-05-23 Christopher Faylor <cgf@redhat.com> + + * smallprint.c (__small_vsprintf): Implement '%o' after all these + years. + +2002-05-22 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_virtual::exists): Eliminate path argument. + (fhandler_proc::exists): Ditto. + (fhandler_registry::exists): Ditto. + (fhandler_process::exists): Ditto. + * fhandler_proc.cc (fhandler_proc::exists): Ditto. Use built-in name. + * fhandler_process.cc (fhandler_process::exists): Ditto. + (fstat): Ditto. + * fhandler_registry.cc (fhandler_registry::exists): Ditto. + (fhandler_registry::fstat): Ditto. + * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto. + * path.cc (path_conv::check): Ditto. Add debugging. + +2002-05-22 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (dup): Always call dup2 for error handling. + +2002-05-22 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h: Revert previous patch. + +2002-05-22 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h: Define pthread stuff only if _POSIX_THREADS + is defined. + +2002-05-19 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (open_local_policy): Initialize lsa to + INVALID_HANDLE_VALUE instead of NULL. + (get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE + instead of NULL. + (create_token): Both of the above. + +2002-05-18 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of + nlink consistent for remote files. + +2002-05-18 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Always set executable bit for executable + extension. + +2002-05-17 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with + high order part of 64 bit address on OS's which do not support that + kind of operation. Otherwise Windows 95 will become confused. + +2002-05-16 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno() + by __seterrno_from_win_error(). + * security.cc (open_local_policy): Ditto. + (get_lsa_srv_inf): Ditto. + (get_user_groups): Ditto. + (get_user_primary_group): Ditto. + (create_token): Ditto. + (subauth): Ditto. + +2002-05-17 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me when + opening file for writing timestamp. + * wincap.cc: Remove flag has_specific_access_rights. + * wincap.h: Ditto. + +2002-05-13 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (seteuid): Set default dacl in process token. + Replace in-line code by call to verify_token(). + (setegid): Reverse change from 2002-01-21. Add call to + RevertToSelf and set primary group in impersonation token. + * security.cc (create_token): Store pgrpsid in token security + descriptor, except if it already appears in my_grps. + Use sec_acl() in place of get_dacl(). + (verify_token): Create from code in seteuid(), with tighter checks. + (get_dacl): Deleted. + (get_group_sidlist): Add argument to indicate if pgrpsid is already + in the groups. + * security.h: Define verify_token(). + * autoload.cc: Load GetKernelObjectSecurity(). + +2002-05-13 Mark Bradshaw <bradshaw@staff.crosswalk.com> + + * cygwin.din: Add strlcat and strlcpy. + * include/cygwin/version.h: Increment API minor version number. + +2002-05-09 Pierre Humblet <pierre.humblet@ieee.org> + + * shared.cc (__sec_user): Split into sec_acl() and call orig_sid(). + (sec_acl): Create from part of __sec_user(), except creator/owner. + * security.h: Define sec_acl() and MAX_DACL_LEN. + +2002-05-12 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using + O_DIROPEN when OS doesn't support it. Return proper errno in that + case. + +2002-05-12 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_read): Change error to EBADF if attempt to read from a + non-readable fd. + +2002-05-11 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (executable_states): For now, make dont_care_if_executable + equivalent to not_executable. + * sys/mount.h: Define MOUNT_NOTEXEC. + * path.h (fs_info): New class. + (path_conv): Move fs-specific fields to new 'fs' structure. + (path_conv::update_fs_info): Move to fs_info and rename to just 'update'. + * path.cc (fs_info::update): Ditto. Return 'true' if successful. + (fillout_mntent): Add ',noexec' to list of reported options. + +2002-05-11 Christopher Faylor <cgf@redhat.com> + + * fhandler_virtual.cc (fhandler_virtual::close): Quiet a compiler + warning. + +2002-05-10 Christopher January <chris@atomice.net> + + * autoload.cc: Add dynamic load statements for + 'ZwQueryInformationProcess' and 'ZwQueryVirtualMemory'. + * fhandler.h: Change type of bufalloc and filesize members of + fhandler_virtual from int to size_t. Change type of position member + from __off32_t to __off64_t. Add new fileid member to fhandler_virtual + class. Make seekdir take an __off64_t argument. Make lseek take an + __off64_t argument. Add fill_filebuf method to fhandler_virtual. Add + fill_filebuf method to fhandler_proc. Add fill_filebuf method to + fhandler_registry. Add fill_filebuf method to fhandler_process. Add + saved_pid and saved_p members to fhandler_process. + * fhandler_proc.cc (proc_listing_array): Add 'loadavg', 'meminfo', and 'stat'. + (proc_fhandlers array): Ditto. + (fhandler_proc::open): Use fill_filebuf to flesh out the file contents. + (fhandler_proc::fill_filebuf): New method. + (fhandler_proc::format_proc_meminfo): Ditto. + (fhandler_proc::format_proc_stat): Ditto. + (fhandler_proc::format_proc_uptime): Ditto. + * fhandler_process.cc (process_listing): Add 'stat' and 'statm'. + (fhandler_process::fstat): Find the _pinfo structure for the process + named in the filename. Return ENOENT if the process is no longer + around. Set the gid and uid fields of the stat structure. + (fhandler_process::open): Store pid and pointer to _pinfo structure in + saved_pid and saved_p respectively. Use fill_filebuf to flesh out file + contents. + (fhandler_proc::fill_filebuf): New method. + (format_process_stat): New function. + (format_process_status): Ditto. + (format_process_statm): Ditto. + (get_process_state): Ditto. + (get_mem_values): Ditto. + * fhandler_registry.cc (fhandler_registry::seekdir): Change argument + type from __off32_t to __off64_t. + (fhandler_registry::fill_filebuf): New method. + * fhandler_virtual.cc (fhandler_virtual::seekdir): Change argument type + from __off32_t to __off64_t. + (fhandler_virtual::lseek): Ditto. + (fhandler_virtual::fill_filebuf): New method. + (fhandler_virtual::fhandler_virtual): Initialise fileid to -1. + * wincap.cc: Set flag has_process_io_counters appropriately. + * wincap.h: Add flag has_process_io_counters. + +2002-05-09 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_write): Change error to EBADF if attempt to write to a + non-writeable fd. + +2002-05-08 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class cygheap_user): Add member `orig_psid'. + Add method `orig_sid()'. + * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid. + +2002-04-28 Norbert Schulze <norbert.schulze@web.de> + + * localtime.cc (tzsetwall): Use wildabbr if generated timezone name + length < 3. + +2002-05-05 Pierre Humblet <pierre.humblet@ieee.org> + + * spawn.cc (spawn_guts): Move call to set_process_privilege() + to load_registry_hive(). + * registry.cc (load_registry_hive): ditto. + * fork.cc (fork_parent): Call sec_user_nih() only once. + +2002-05-04 Christopher January <chris@atomice.net> + + * path.h (path_conv::path_conv): Initialise normalized_path to NULL. + +2002-05-03 Christopher Faylor <cgf@redhat.com> + + * net.cc (getdomainname): Change second argument of getdomainname to + size_t. + +2002-05-03 Christopher January <chris@atomice.net> + + * fhandler_proc.cc (proc_listing): Add '.' and '..' to directory + listing. + (fhandler_proc::open): Change use of mode to flags. If the file does + not exist already, fail with EROFS if O_CREAT flag is set. Change + EROFS error to EACCES error when writing to a file. Use cmalloc to + allocate memory for filebuf. + (fhandler_proc::close): Use cfree to free filebuf. + (fhandler_proc::get_proc_fhandler): Properly detect attempts to access + unknown subdir. + * fhandler_process.cc (process_listing): Add '.' and '..' to directory + listing. + (fhandler_process::open): Use cmalloc to allocate memory for filebuf. + (fhandler_process::close): Use cfree to free filebuf. + * fhandler_registry.cc (registry_listing): Add . and '..' to directory + listing. + (fhandler_registry::open): Move check for open for writing before + open_key. Use cmalloc to allocate memory for filebuf. + (fhandler_registry::close): Use cfree to free filebuf. + (fhandler_registry::telldir): Use lower 16 bits of __d_position as + position in directory. + (fhandler_registry::seekdir): Ditto. + * fhandler_virtual.cc (fhandler_virtual::write): Change EROFS error to + EACCES error. + (fhandler_virtual::open): Set the NOHANDLE flag. + (fhandler_virtual::dup): Add call to fhandler_base::dup. Allocate + child's filebuf using cmalloc. Copy filebuf from parent to child. + (fhandler_virtual::close): Use cfree to free filebuf. + (fhandler_virtual::~fhandler_virtual): Ditto. + (from Chris Faylor <cgf@redhat.com>). + (fhandler_registry::readdir): Add support for '.' and '..' files in + subdirectories of /proc/registry. + * path.cc (path_conv::check): Do not return ENOENT if a file is not + found in /proc. + +2002-05-02 Christopher Faylor <cgf@redhat.com> + + * fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather + than path_conv name. + (fhandler_proc::open): Ditto. + * fhandler_process.cc (fhandler_process::fstat): Use fhandler name + rather than path_conv name. + (fhandler_process::open): Ditto. + * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name + rather than path_conv name. + (fhandler_registry::open): Ditto. + * path.cc (path_conv::check): Don't copy posix path when virtual. + (mount_info::conv_to_win32_path): Don't zero string when isproc. Just + derive normal windows path. + + * path.h (path_conv::clear_normalized_path): Declare new method. + * path.cc (path_conv::clear_normalized_path): Define new method. + * dtable.cc (build_fhandler_from_name): Clear normalized path when + finished to conserve space. + +2002-05-02 Christopher Faylor <cgf@redhat.com> + + * fhandler_proc.cc (fhandler_proc::fstat): Prime with information from + fhandler_base::fstat. Use defines rather than constants for permission + settings. + +2002-04-30 Eric Blake <ebb9@email.byu.edu> + + * path.cc (hash_path_name): Improve hash function strength. + +2002-05-02 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (__pthread_cond_dowait): Fix a race on signalling from a + thread woken by the same condition variable it's signalling on. Thanks + to Michael Beach for the report and test case. + +2002-05-02 Christopher Faylor <cgf@redhat.com> + + * path.h (pathconv_arg): Add PC_POSIX. + (path_conv): Add normalized_path field. + * path.cc (path_conv::~path_conv): New destructor. + (path_conv::check): Set normalized_path, where appropriate. + * dtable.cc (build_fhandler_from_name): Use normalized path from + path_conv. + * syscalls.cc (chroot): Ditto. + + * cygheap.h: Remove path_prefix_p declaration. + +2002-02-26 Christopher January <chris@atomice.net> + Christopher Faylor <cgf@redhat.com> (minor fixups) + + * Makefile.in: Add fhandler_proc.o, fhandler_registry.o, + fhandler_process.o and fhandler_virtual.o. + * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC, + FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix + path. + * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS. + Add class declarations for fhandler_virtual, fhandler_proc, + fhandler_registry and fhandler_virtual. Update fhandler_union + accordingly. + * fhandler_proc.cc: New file. Add implementation for fhandler_proc. + * fhandler_virtual.cc: New file. Add implementation for + fhandler_virtual. + * fhandler_process.cc: New file. Add implementation for + fhandler_process. + * fhandler_registry.cc: New file. Add implementation for + fhandler_registry. + * path.cc (isproc): New macro. + (isvirtual_dev): Ditto. + * path.cc (path_conv::check): Add check for virtual devices. + * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to + empty Win32 paths. + * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic + isvirtual_dev macro. Force setting of posix path for virtual + fhandlers. + * path.h (path_prefix_p): Declare. + + +Wed May 1 16:06:02 2002 Jason Tishler <jason@tishler.net> + + * include/cygwin/types.h: Include <sys/sysmacros.h>. + +Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net> + + * security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for + the NT Domain case. + +2002-04-12 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_accept): Set socket type for accepted socket. + (socketpair): Set socket type for both sockets. + +2002-04-12 Egor Duda <deo@logos-m.ru> + + * fhandler.h (class fhandler_socket): New member to store socket type. + (fhandler_socket::get_socket_type): Access it. + (fhandler_socket::set_socket_type): Ditto. + * net.cc (cygwin_socket): Store socket type. + (cygwin_connect): Disable security checks for connectionless sockets. + (cygwin_accept): Ditto. + +2002-04-09 Mark Bradshaw <bradshaw@staff.crosswalk.com> + + * cygwin.din: Add strptime. + * include/cygwin/version.h: Increment API version number. + +2002-04-09 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork_child): Call fixup_mmaps_after_fork() somewhat earlier. + +2002-04-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Set read-only bit in + file_attributes when adequate. + +2002-03-28 Christopher Faylor <cgf@redhat.com> + + * times.cc (gettimeofday): Fix typo in previous patch. + +2002-03-27 Wu Yongwei <adah@netstd.com> + + * times.cc (gettimeofday): Revert to setting timezone info if tz != + NULL. + +2002-03-21 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set + st_[ug]id to value derived from get_file_attributes. + +2002-03-21 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (find_exec): Return input if file not found. + +2002-03-19 Boris Schaeling <boriss@web.de> + + * poll.cc (poll): Add support for invalid descriptors. + +2002-03-15 Robert Collins <rbtcollins@hotmail.com> + + * fhandler.h (fhandler_termios::lseek): Override lseek. + * fhandler_termios.cc (fhandler_termios::lseek): Implement this. + +2002-03-15 Christopher Faylor <cgf@redhat.com> + + * cygserver.cc: Include stdlib.h for exit declaration. + * threaded_queue.cc: Ditto. + +2002-03-15 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (pinfo::init): Use PID_ALLPIDS flag to control when a + redirected block should be marked as nonexistent. + (winpids::add): Use PID_ALLPIDS when looking for all pids. + * cygwin.h (PID_ALLPIDS): New enum element. + +2002-03-15 Corinna Vinschen <corinna@vinschen.de> + + * glob.c (stat32_to_STAT): New function. + (g_lstat): Call user space functions always with 32 bit struct stat + as a workaround. + (g_stat): Ditto. + * include/glob.h (struct glob): Don't prototype function pointers + when compiling Cygwin. + +2002-03-14 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (pinfo::init): Properly handle execed process stub when + PID_NOREDIR is specified. + +2002-03-13 Boris Schaeling <boriss@web.de> + + * poll.cc (poll): Remove variable open_fds. Rearrange and add code to + fix settings of revents. + +2002-03-13 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::map_map): Return -1 if VirtualProtect fails. + (list::erase): New method with no argument. Erase latest record + added. + (mmap64): Fail if map_map() fails. + +2002-03-12 Corinna Vinschen <corinna@vinschen.de> + + * sysconf.cc (sysconf): Fix condition. + +2002-03-11 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (msync): Check area given by addr and len for being a + contigeous mmap'd region. + +2002-03-11 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork_child): Call fixup_mmaps_after_fork() before + closing parent process handle. Call fixup_mmaps_after_fork() + with parent process handle as parameter. + * mmap.cc (mmap_record::access): New method. + (fixup_mmaps_after_fork): Take process handle as parameter. + In case of FILE_MAP_COPY access, copy valid memory regions to child. + * pinfo.h (fixup_mmaps_after_fork): Change prototype accordingly. + +2002-03-07 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NetGetDCName): Add symbol. + (NetServerEnum): Remove symbol. + * security.cc (get_lsa_srv_inf): Call NetGetDCName() instead of + NetServerEnum() since it's faster. Don't call it at all if machine + is not a domain member. + +2002-03-06 Christopher Faylor <cgf@redhat.com> + + * path.cc (normalize_posix_path): Avoid runs of '.'s > 2. + +2002-03-05 Christopher Faylor <cgf@redhat.com> + + * errno.cc: Change EPERM associated text to "Operation not permitted" + throughout. + +2002-03-05 Christopher Faylor <cgf@redhat.com> + + * fhandler_socket.cc (fhandler_socket::close): Respond to signals while + looping, waiting for socket to close. Superstitiously clear last error + when WSAEWOULDBLOCK. + +2002-03-05 Robert Collins <rbtcollins@hotmail.com> + + * cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes): + Always init - until static members work correctly. + * shm.cc (shmget): Initialize the security descriptor - thanks Corinna! + * include/sys/ipc.h: Make the ipc control constants partitioned off from the sem + control constants. + +2002-03-04 Christian Lestrade <christian.lestrade@free.fr> + + * include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro. + * fhandler_termios.cc: Include <sys/termios.h>. + (line_edit): Recognize disabled c_cc[] chars. Ignore VDISCARD when + not in ICANON mode. + +2002-03-04 Dmitry Timoshkov <dmitry@baikal.ru> + + * syscalls.cc (truncate64): Use ftruncate64 directly to not lose + upper 32 bits. + +2002-03-04 Robert Collins <rbtcollins@hotmail.com> + + * cygserver_shm.cc (delete_shmnode): New function. + (client_request_shm::serve): Use it. + +2002-03-04 Robert Collins <rbtcollins@hotmail.com> + + * cygserver_shm.cc (client_request_shm::serve): Implement SHM_DETACH. + * shm.cc (shmdt): Implement. + +2002-03-04 Robert Collins <rbtcollins@hotmail.com> + + * cygserver_shm.cc: Run indent. + (deleted_head): New global for storing shm id's pending deletion. + (client_request_shm::serve): Return ENOSYS for invalid request types. + Implement SHM_DEL - delete a shm id. + * cygserver_shm.h (SHM_DEL): New type value. + * shm.cc (delete_inprocess_shmds): New function, does what it's name implies. + (shmctl): Implement shm_rmid control type. + +2002-03-04 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in (install): Remove install-bin to allow make install to work. + +2002-03-03 Robert Collins <rbtcollins@hotmail.com> + + * shm.cc (shmat): Prevent a compile error. + (shmdt): Set errno as this function is incomplete. + +2002-02-28 Christopher Faylor <cgf@redhat.com> + + * times.cc: Remove if 0'd code. Clean up slightly. + +2002-02-28 Robert Collins <rbtcollins@hotmail.com> + + * Merge cygwin_daemon into head minus the new shm and ipc exports. + +2002-02-28 Robert Collins <rbtcollins@hotmail.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): More debugging. + (fhandler_tty_slave::read): Fix printf type for the handle. + * tty.cc (tty::common_init): Add a FIXME for security. + +2002-01-29 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in (OBJS): Remove duplicate localtime.o. + +2002-01-17 Robert Collins <rbtcollins@hotmail.com> + + * cygserver.cc (check_and_dup_handle): Consolidate the two variants for + simplicity. + Add Some basic debug output. + (client_request_attach_tty::serve): Use the new debug_printf for clarity. + Mark the duplicated handles as inheritable - fixup_after_fork() doesn't reopen + tty's. + +2002-01-16 Robert Collins <rbtcollins@hotmail.com> + + * cygserver.cc (transport): Correct scope. + (client_request_attach_tty::serve): Add more debug information. + Fix erroneous use of transport instead of conn. + * cygserver_transport_pipes.cc (transport_layer_pipes::close): More debug. + (transport_layer_pipes::read): Ditto. + (transport_layer_pipes::write): Ditto. + (transport_layer_pipes::impersonate_client): Ditto. + +Mon Oct 8 7:41:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * cygserver.cc (server_request::process): Rename client_request_shm_get to + client_request_shm. + * cygserver_process.cc (process_cache::add): Rename to add_task. + Use process_cleanup instead of process_request. + (process_cache::remove_process): New method. + (process::process): Initialize new members. + (process::~process): New member. + (process::cleanup): New method. + (process::add_cleanup_routine): New method. + (process_request::process): Rename to process_cleanup. + Call the process object's cleanup method and then delete it. + (process_process_param::request_loop): Remove the signalling process. + * cygserver_shm.cc: Globally rename client_request_shm_get to client_request_shm. + (client_request_shm_get::serve): Handle attach request counting. + * cygserver_shm.h: Globally rename client_request_shm_get to client_request_shm. + (class shm_cleanup): New class. + * shm.cc: Globally rename client_request_shm_get to client_request_shm. + (client_request_shm::client_request_shm): New constructor for attach requests. + (shmat): Use it. + * include/cygwin/cygserver_process.h (class process_request): Rename to + process_cleanup. + (class cleanup_routine): New class. + (class process): New members and methods to allow calling back when the process + terminates. + +Thu Oct 4 14:12:00 2001 Robert Collins <rbtcollins@hotmail.com> + * cygserver.cc (request_loop): Make static. + (main): Use new cache constructor syntax. + Start cache worker threads. + Cleanup the cache at shutdown. + * cygserver_process.cc: Run indent. + (process_cache::process_cache): Add a trigger to use when adding a process. + (process_cache::process): Move process_entry to process. + Insert at the end of the list. + Trigger the request loop when new process's inserted. + (process_cache::process_requests): Do it. + (process_cache::add): New method. + (process_cache::handle_snapshot): New method. + (process::process): Merge in the process_entry fields. + (process::handle): Make a stub function. + (process::exit_code): New method. + (process_request::process): New method. + (process_process_param::request_loop): New method. + * cygserver_shm.cc: New header dependency - threaded_queue.h. + * threaded_queue.cc (threaded_queue::cleanup): Clearer messages. + (queue_process_param::stop): Short spinlock on interruptible threads. + * threaded_queue.h (class threaded_queue): New constructor. + * include/cygwin/cygserver_process.h (process_request): New class. + (process_entry): Remove. + (process): Merge in process_entry. + (process_cache): Inherit from threaded_queue. + +Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * cygserver.cc (class server_process_param): Use new constructor syntax. + * cygserver_process.cc (process_cache::~process_cache): New function. + * threaded_queue.cc: Define condition debug_printf. + Run indent. + (threaded_queue::cleanup): Move queue_process_param guts to a method. + (threaded_queue::process_requests): Ditto. + (queue_process_param::queue_process_param): New method. + (queue_process_param::~queue_process_param): Ditto. + (queue_process_param::start): Ditto. + (queue_process_param::stop): Ditto. + * threaded_queue.h (class queue_process_param): Add support for + interruptible request loops. + * cygwin/include/cygwin/cygserver_process.h (class process_cache): Add + destructor. + +Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * cygserver_client.cc: New flag allow_daemon to disable the daemon completely. + (cygserver_request): Check it. + (cygserver_init): Ditto. + * environ.cc (parse_thing): Add (no)daemon option. + +Tue Oct 2 23:00:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * shm.cc: Update to handle include changes from HEAD. + +Tue Oct 2 16:06:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in: Remove cygserver_shm.o from cygwin1.dll. + Rename cygserver_shm_outside.o to cygserver_shm.o. + * cygserver.cc (server_request::process): Use the new client_request + constructor. + * cygserver_client.cc: Remove the #ifdef's stubs for the server method + within cygwin. + (client_request_attach_tty::client_request_attach_tty): Use the new + client_request constructor. + (client_request_shutdown::client_request_shutdown): Ditto. + (client_request::client_request): Ditto. + * cygserver_shm.cc (client_request_shm_get::serve): Remove the + #ifdef'd stub for in-cygwin builds. + (client_request_shm_get::client_request_shm_get): Use the new + client_request constructor, and remove the in-cygwin variants. + * cygserver_shm.h (class client_request_shm_get): #ifndef test the + serve method - it's only used in cygserver. + * shm.cc (client_request_shm_get::client_request_shm_get): New function. + * include/cygwin/cygserver.h (request_header): New constructor. + (class client_request): Use it. + New constructor accepting the header size. + #ifndef test the server method - it's only used within cygserver. + (client_request_get_version): #ifdef test the server method. + (client_request_shutdown): Ditto. + (client_request_attach_tty): Ditto. + +Tue Oct 2 9:57:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in: add threaded_queue.o to cygserver.exe. + * cygserver.cc: Include threaded_queue.h + (class server_request): Inherit from queue_request. + (class server_process_param): Inherit from queue_process_param. + (class server_request_queue): Inherit from threaded_queue. + (request_loop): Adjust for new types. + (server_request_queue::process_requests): Remove guts to + threaded_queue::process_requests. + (server_request::server_request): Adjust for new types. + (worker_function): Delete. + (server_request_queue::create_workers): Delete. + (server_request_queue::cleanup): Delete. + (server_request_queue::add): Move guts to threaded_queue::add. + * threaded_queue.cc: New file. + * threaded_queue.h: New file. + +Mon Oct 1 12:38:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * cygserver.cc (client_request::serve): New function. + * cygserver_process.cc: Inlude <pthread.h> for pthread_once. + (process_cache::process_cache): Initialise a crtiical section for write access. + (process_cache::process): Use the critical section. Also add missing entries to + the cache. + (do_process_init): New function to initalise class process static variables. + (process::process): Ensure that the process access critical section is + initialised. + (process::handle): Close the handle of old process's when they have terminated + and we are returning the handle for a process with the same pid. + * cygserver_shm.cc: Run indent. + Include cygserver_process.h to allow process cache functionality. + (client_request_shm_get::serve): New parameter for process cache support. + Use the process cache, not OpenProcess to get a handle to the originating process. + Fix a handle leak with token_handle. + * cygserver_shm.h (class client_request_shm_get): Update ::serve for process + cache support. + * cygserver_transport_pipes.cc: Redefine debug_printf to be conditional on DEBUG. + * include/cygwin/cygserver.h: Do not implement client_request::serve in the + header. + * include/cygwin/cygserver_process.h (class process_cache): Add a write access + critical section to prevent races when requests from a multithreaded + application arrive. + +Sun Sep 30 23:41:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in: Add cygserver_process.o to cygserver.exe. + * cygserver.cc: Include signal.h and cygwin_version.h. + Define debug_printf as a macro. + Define DEBUG to a value. + (client_request_attach_tty::serve): Add beginning of process cache support. + Change from #ifdef DEBUG to work with new DEBUG style. + (client_request_get_version::serve): Add beginning of process cache support. + (class server_request): New prototype for support of process cache. + (class queue_process_param): New class to allow request loop threading. + (class server_request_queue): Add beginning of process cache support. + Allow request loop threading. + (request_loop): Thread function for request loops. + (server_request_queue::process_requests): Initiator for threaded request loops. + (client_request_shutdown::serve): Add beginning of process cache support. + (server_request::server_request): Ditto. + (server_request::process): Use debug_printf. Add beginning of process cache + support. + (server_request_queue::cleanup): Kill off any request loop threads. + (server_request_queue::add): Add beginning of process cache support. + (handle_signal): Trigger a shutdown. + (main): Print out some useful info at startup - version, date time. + Add process cache support. + Spawn a separate thread for the transport request loop, thus allowing concurrent + support for multiple transports. + * cygserver_client.cc (client_request_get_version::serve): Add process cache + support. + (client_request_attach_tty::serve): Add process cache support. + (client_request_shutdown::serve): Add process cache support. + * cygsserver_process.cc: New file with the process cache support. + * cygserver_shm.cc: Redefine debug_printf to allow conditional output. + * cygwin.din: Export shmdt(). + * shm.cc: Run indent. + Update FIXME's. + (shmdt): New function. + * include/cygwin/cygserver.h (class client_request): Add process cache support. + (class client_request_get_version): Ditto. + (class client_request_shutdown): Ditto. + (class client_request_attach_tty): Ditto. + * include/cygwin/cygserver_process.h: New header for process cache support. + +Sun Sep 30 8:52:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * include/cygwin/cygserver_transport.h: Add copyright header. + * include/cygwin/cygserver_transport_pipes.h: Ditto. + * include/cygwin/cygserver_transport_sockets.h: Ditto. + +Sat Sep 29 20:40:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * Makefile.in: Add cygserver_transport_sockets.o to DLL_OFILES. + Add cygserver_transport_sockets_outside.o to cygserver.exe. + * cygserver.cc: Include new include files. + * cygserver_client.cc: Ditto. + * cygserver_shm.h: No need to include <sys/socket.h> now. + * cygerver_transport.cc: Include new include files. + (transport_layer_base::transport_layer_base): Strip back to a stub. + (transport_layer_base::listen): Ditto. + (transport_layer_base::accept): Ditto. + (transport_layer_base::close): Ditto. + (transport_layer_base::read): Ditto. + (transport_layer_base::write): Ditto. + (transport_layer_base::connect): Ditto. + * cygserver_transport_pipes.cc: Include new header + "cygwin/cygserver_transport_pipes.h". + * cygserver_transport_sockets.cc: New file. + * dcrt0.cc: No need to include <sys/socket.h> now. + * fhandler_tty.cc: Ditto. + * tty.cc: Ditto. + * include/cygwin/cygserver_transport.h: Strip the base class to a stub. + Remove the cygserver_transport_pipes class. + * include/cygwin/cygserver_transport_pipes.h: New file. + * include/cygwin/cygserver_transport_sockets.h: New file. + +Tue Sep 25 16:22:00 2001 Robert Collins <rbtcollins@hotmail.com> + + * autoload.cc: Add dynamic load statement for 'ImpersonateNamedPipeClient'. + * Makefile.in: Add new object files, and build instructions for cygserver.exe. + * cygwin.din: Export ftok, shmat, shmctl and shmget. + * dcrt0.cc: Additional includes for cygserver support. + (dll_crt0_1): Initialise the cygserver client. + * fhandler.h (fhandler_tty): New method cygserver_attach_tty. + * fhandler_tty.cc: Additional includes for cygserver support. + (fhandler_tty_slave::open): Attempt to use the cygserver when obtaining + handles from the parent process. On failure or 9x use the current method. + (fhandler_tty_slave::cygserver_attach_tty): New function. + * fork.cc (fork_child): Fixup shm memory mapped areas. + * pinfo.h: Declare fixup_shms_after_fork(). + * security.h: Declare alloc_sd(). + * tty.cc: Additonal includes to support cygserver. + (tty::common_init): Don't allow others to open us if the cygserver is running. + * winsup.h: Declare cygserver_running. + * cygserver.cc: New file. + * cygserver_client.cc: New file. + * cygserver_shm.cc: New file. + * cygserver_shm.h: New file. + * cygserver_transport.cc: New file. + * cygserver_transport_pipes.cc: New file. + * ipc.cc: New file. + * shm.cc: New file. + * include/cygwin/cygserver.h: New file. + * include/cygwin/cygserver_transport.h: New file. + * include/sys/ipc.h: New file. + * include/sys/shm.h: New file. + +2002-02-28 Robert Collins <rbtcollins@hotmail.com> + + * thread.cc (semaphore::TryWait): Set errno as required by posix 1003.1. + (__sem_wait): Ditto. + (__sem_trywait): Ditto. + +2002-02-27 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-02-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (fstat64): New symbol. + (ftruncate64): Ditto. + (lseek64): Ditto. + (lstat64): Ditto. + (mmap64): Ditto. + (seekdir64): Ditto. + (stat64): Ditto. + (telldir64): Ditto. + (truncate64): Ditto. + * dir.cc (telldir64): New function. + (telldir): Call telldir64(). + (seekdir64): New function. + (seekdir): Call seekdir64(). + * fhandler.h: Redefine all methods using __off32_t to use __off64_t. + * fhandler.cc: Use __off64_t and struct __stat64 throughout. + * fhandler_clipboard.cc: Ditto. + * fhandler_disk_file.cc: Ditto. + * fhandler_dsp.cc: Ditto. + * fhandler_floppy.cc: Ditto. + * fhandler_mem.cc: Ditto. + * fhandler_random.cc: Ditto. + * fhandler_socket.cc: Ditto. + * fhandler_tape.cc: Ditto. + * fhandler_zero.cc: Ditto. + * pipe.cc: Ditto. + * glob.c: Ditto, call lstat64 and stat64 in Cygwin. + * mmap.cc: Use __off64_t throughout. + (mmap64): New function. + * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64. + * syscalls.cc (lseek64): New function. + (stat64_to_stat32): Ditto. + (fstat64): Ditto. + (stat64): Ditto. + (lstat64): Ditto. + (ftruncate64): Ditto. + (truncate64): Ditto. + (_fstat): Call fstat64. + (_stat): Call stat64. + (cygwin_lstat): Rename to avoid declaration problem. Call lstat64. + (stat_worker): Use struct __stat64. + (access): Ditto. + (ftruncate): Call ftruncate64. + (truncate): Call truncate64. + * wincap.cc: Set flag has_64bit_file_access appropriately. + * wincap.h: Add flag has_64bit_file_access. + * winsup.h (ILLEGAL_SEEK): Define as __off64_t. + (stat_dev): Declare using struct __stat64. + (stat_worker): Ditto. + * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin. + (struct __stat64): Ditto. + (struct stat): Revert definition with explicitly sized datatypes. + Eliminate sized field names. + * include/cygwin/types.h (blksize_t): New type. + (__blkcnt32_t): Ditto. + (__blkcnt64_t): Ditto. + (blkcnt_t): Ditto. + +2002-02-22 Christopher Faylor <cgf@redhat.com> + + * sync.h (new_muto): Just accept an argument which denotes the name of + the muto. Use this argument to construct static storage. + * cygheap.cc (cygheap_init): Reflect above change. + * exceptions.cc (events_init): Ditto. + * malloc.cc (malloc_init): Ditto. + * path.cc (cwdstuff::init): Ditto. + * cygheap.h (cwdstuff): Change name of lock element to make it less + generic. + * path.cc (cwdstuff::get_hash): Ditto. + (cwdstuff::get_initial): Ditto. + (cwdstuff::set): Ditto. + (cwdstuff::get): Ditto. + * sigproc.cc (proc_subproc): Ditto. + + * debug.cc (lock_debug): Change to method. Use method rather than + macro throughout. + + * tty.h (tty_min::kill_pgrp): Declare new method. + * fhandler_termios.cc (tty_min::kill_pgrp): New method. + (fhandler_termios::line_edit): Use new method for killing process. + * dcrt0.cc (do_exit): Ditto. + + * dtable.cc (dtable::get_debugger_info): New method for inheriting + dtable info from a debugger. + * tty.cc (tty_init): Attempt to grab file handle info from parent + debugger, if appropriate. + + # dtable.cc (dtable::stdio_init): Make this a method. + (dtable::init_std_file_from_handle): Don't set fd unless it's not open. + (dtable::build_fhandler_from_name): Move name setting to + dtable::build_fhandler. + (dtable::build_fhandler): Add win32 name parameter. + * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init. + * dtable.h (dtable): Reflect build_fhandler parameter change. + * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in + build_fhandler. + * net.cc (fdsock): Remove set_name call since it is now handled by + build_fhandler. + + * sigproc.cc (proc_subproc): Release muto as early as possible. + +2001-02-22 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.c (rn): Allow long long values. + (__small_vsprintf): Add 'D', 'U' and 'X' formats for long long + parameters. + +2002-02-19 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::puts_readahead): Remove default parameter + setting. Newer gcc's complain about this. + (fhandler_base::set_readahead_valid): Ditto. + * fhandler_dsp.cc (Audio::open): Ditto. + (fhandler_dev_dsp::open): Ditto. + +2002-02-19 Christopher Faylor <cgf@redhat.com> + + * fork.cc (fork_parent): Use sec_user_nih to control process/thread + inheritance/permission. + * spawn.cc (spawn_guts): Ditto. + * security.cc (create_token): Initialize token so that it is not tested + for bogus value later. Use sec_user to control process/thread + creation. + * security.h (__sec_user): Rename declaration from sec_user. + (sec_user_nih): Declare here as inline function wrapper for __sec_user. + (sec_user): Ditto. + * sigproc.cc (czombies): Allocate a character array for zombies to + avoid constructor overhead + (extremely hackish, I know). + (cpchildren): Ditto. + (pchildren): New define. + (zombies): Ditto. + (getsem): Use sec_user_nih to control semaphore inheritance/permission. + +2002-02-16 Christopher Faylor <cgf@redhat.com> + + * times.cc (hires::prime): Restore thread priority on failure + condition. + + * uinfo.cc (uinfo_init): Use more robust method for determining if + process was invoked from a non-cygwin process. + + * sync.h (muto::init): Eliminate "inheritance" parameter. + (new_muto): Reflect removal of parameter. + * sync.cc (muto::init): Ditto. + * cygheap.cc (cygheap_init): Ditto. + * debug.cc (threadname_init): Ditto. + * exceptions.cc (events_init): Ditto. + * malloc.cc (malloc_init): Ditto. + * path.cc (cwdstuff::init): Ditto. + * sigproc.cc (sigproc_init): Ditto. + + * grp.cc (group_lock): Use different method for locking with static + member. + (read_etc_group): REALLY ensure that read lock mutex is released. + * passwd.cc (passwd_lock): Use different method for locking with static + member. + (read_etc_passwd): REALLY ensure that read lock mutex is released. + + * shared.cc (sec_user): Correct reversed inheritance test. + +2002-02-15 Christopher Faylor <cgf@redhat.com> + + * hires.h (hires::usecs): Rename from utime. Accept an argument. + * strace.cc (strace::microseconds): Use hires class for calculating + times. + * sync.h (new_muto): Use NO_COPY explicitly in declaration. + * times.cc (gettimeofday): Reflect change in usecs argument. + (hires::usecs): Ditto. Changed name from utime. + * winsup.h (NO_COPY): Add nocommon attribute to force setting aside + space for variable. + * regcomp.c (REQUIRE): Add a void cast to bypass a warning. + +2002-02-15 Christopher Faylor <cgf@redhat.com> + + * hires.h: New file. + * times.cc (gettimeofday): Use hires class for calculating current time. + (hires::prime): New method. + (hires::utime): Ditto. + +2002-02-14 Christopher Faylor <cgf@redhat.com> + + * include/sys/cygwin.h (cygwin_getinfo_types): New CW_STRACE_ACTIVE. + * external.cc (cygwin_internal): Handle CW_STRACE_ACTIVE. + +2002-02-14 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (unused_sig_wrapper): Eliminate unused parameter to + asm. + * external.cc (cygwin_internal): Change CW_STRACE_ON to + CW_STRACE_TOGGLE. + * strace.cc (strace::hello): Toggle strace on and off. + * sync.cc (muto::init): Rename from constructor. + * sync.h (muto::new): Delete. + (muto::delete): Ditto. + (new_muto): Simplify. Use muto.init for nearly everything. + * uinfo.cc (uinfo_init): Avoid closing a NULL handle. + * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_STRACE_OFF to + CW_STRACE_TOGGLE. Delete CW_STRACE_OFF. + * include/sys/strace.h (strace): Add "inited" field. + +2001-02-12 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/acl.h: Fix definition of aclent_t. + +2002-02-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (DLL_OFILES): Consolidate object files. + +2002-02-10 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h, cygheap.h, fhandler_clipboard.cc, fhandler_dsp.cc, + fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc, + fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc, + pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc, + security.h, thread.h, uinfo.cc, include/cygwin/acl.h: Fix copyright. + +2002-02-10 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h, cygheap.h, dcrt0.cc, dir.cc, fhandler.cc, fhandler.h, + fhandler_clipboard.cc, fhandler_disk_file.cc, fhandler_dsp.cc, + fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc, + fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc, + pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc, + security.h, spawn.cc, syscalls.cc, thread.h, uinfo.cc, winsup.h: + Change usage of uid_t to __uid16_t, gid_t to __gid16_t and + off_t to __off32_t throughout. Use INVALID_UID, INVALID_GID and + INVALID_SEEK instead casting -1 to the appropriate type. + * winsup.h: Define INVALID_UID, INVALID_GID and INVALID_SEEK. + * include/cygwin/acl.h: Define internal __aclent16_t and __aclent32_t + types. Don't declare acl functions when compiling Cygwin. + * include/cygwin/grp.h: Declare getgrgid() and getgrnam() with + correct types for internal usage. + +2002-02-10 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Pierre A. Humblet <Pierre.Humblet@ieee.org>: + * uinfo.cc (internal_getlogin): Try evaluating user by SID even if + ntsec is off. + (uinfo_init): Set primary group even if ntsec is off. + +2002-02-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/grp.h: New file. + * include/cygwin/stat.h: Ditto. + * include/cygwin/types.h: Add definitions for __off32_t, + __off64_t, off_t, __uid16_t, __uid32_t, uid_t, __gid16_t, + __gid32_t and gid_t. + * include/sys/cygwin.h: Use correct uid and gid types. + +2002-02-09 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::dup2): Revert previous patch. + * fhandler.h: Ditto. + (fhandler_socket::recv): Define new method. + (fhandler_socket::send): Ditto. + * fhandler_socket.cc (fhandler_socket::recv): New method. + (fhandler_socket::send): Ditto. + (fhandler_socket::read): Call fhandler_socket::recv() now. + (fhandler_socket::write): Call fhandler_socket::send() now. + * net.cc (class wsock_event): Move definition to wsock_event.h. + (fdsock): Revert previous patch. + (cygwin_recv): Move implementation to fhandler_socket::recv(). + (cygwin_send): Move implementation to fhandler_socket::send(). + * wsock_event.h: New file. + +2002-02-06 Alexander Gottwald <Alexander.Gottwald@s1999.tuchemnitz.de> + + * net.cc (get_2k_ifconf): Create interface entries for tokenring cards. + +2002-02-08 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::dup2): Store fd for fhandler_socket. + * fhandler.h (fhandler_base::set_fd): New virtual method. + (fhandler_base::get_fd): Ditto. + (fhandler_socket::set_fd): Ditto. + (fhandler_socket::get_fd): Ditto. + * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead + of native Winsock recv. + (fhandler_socket::write): Call cygwin_send instead of native Winsock + send. + * net.cc (fdsock): Store fd in fhandler_socket. + +2002-02-07 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getsockname): Fix handling of NULL sun_path. + +2002-01-29 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (getdomainname): Fix registry key for 9x systems, too. + +2002-01-29 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (getdomainname): Fix registry key for NT systems. + +2002-01-28 Christopher Faylor <cgf@redhat.com> + + * external.cc (cygwin_internal): Initialize various internal settings + if required to allow use of some things from user loaded DLL. + (CW_STRACE_ON): Add new feature. + (CW_CYGWIN_PID_TO_WINPID): Ditto. + * pinfo.cc (set_myself): Call "strace.hello" to initiate possible + strace session. + (pinfo::init): Guard against dereferencing uninitialized myself. + * sigproc.cc (wait_sig): Call strace.hello() when __SIGTRACE "signal" + received. + * strace.cc (strace::hello): New method. + * wincap.cc (wincapc::init): Avoid initializing if already initialized. + * wincap.h (wincapc::wincapc): New method. + * include/sys/cygwin.h: Add new CW_ enums. Kludge typedefs of + {g,u}id_t if required. + * strace.h (strace::hello): Declare new method. + +2002-01-28 Earnie Boyd <earnie@users.sf.net> + + * include/sys/strace.h (_STRACE_ON): Define. + (_STRACE_OFF): Ditto. + +2002-01-24 Christopher Faylor <cgf@redhat.com> + + * speclib: Ensure that temporary def file is removed. + +2002-01-23 Christopher Faylor <cgf@redhat.com> + + * speclib: Use rm -f to remove temp file just to quiet any potential + warnings. + +2002-01-23 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (create_token): Use sec_user() to create + SECURITY_ATTRIBUTES structure for primary token. Use + MAXIMUM_ALLOWED access rights instead of TOKEN_ALL_ACCESS. + +2002-01-23 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink): Fix check for already existing file. + +2002-01-21 Christopher Faylor <cgf@redhat.com> + + * cygmagic: Suppress error output when figuring out if sum takes an + option. + +2002-01-21 Christopher Faylor <cgf@redhat.com> + + * cygmagic: Attempt to figure out if sum takes an option. + +2002-01-21 DJ Delorie <dj@redhat.com> + + * Makefile.in (libpthread.a): Pass the assembler also. + (libm.a): Ditto. + (libc.a): Ditto. + * speclib: Specify the assembler to dlltool. + +2002-01-21 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-01-21 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgrgid): Don't return default gid entry when ntsec is on. + * syscalls.cc (setegid): Don't set primary group in process token. + +2002-01-21 Christopher Faylor <cgf@redhat.com> + + * speclib: Don't use /dev/null as DLL name. Just default to what's + already in .def file. + +2002-01-21 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle): Remove last vestiges of SA_NOCLDSTOP code + which caused SIGCHLD to be ignored. + +2002-01-20 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-01-20 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (regfree): Make dll_export. + +2002-01-20 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (ctrl_c_handler): Convert windows pid to cygwin pid + when detecting if we should actually handle CTRL-C. + +2002-01-19 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (new-cygwin1.dll): Revert previous change. libsupc++.a + is only available in libstdc++-v3. + +2002-01-19 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle_tty_stop): Don't send SIGCHLD if parent + doesn't want it. + (sig_handle): Don't check for SA_NOCLDSTOP here. We don't have enough + information. + +2002-01-19 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2002-01-19 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (new-cygwin1.dll): Just use -lsupc++ for link. + * sigproc.cc (proc_exists): Change existence criteria. + * sync.h (new_muto): Add volatile to definition to avoid gcc + optimization problems. + +2002-01-19 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump API minor version to 51. + +2002-01-19 Mark Bradshaw <bradshaw@staff.crosswalk.com> + + * cygwin.din: Add recvmsg and sendmsg. + * net.cc: Add cygwin_recvmsg and cygwin_sendmsg. + * /usr/include/sys/socket.h: Add recvmsg and sendmsg. + +2002-01-19 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (create_token): Close processes token handle as soon + as it's not used anymore. + +2002-01-17 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add fnmatch.o to DLL_OFILES. + * cygwin.din: Add fnmatch export symbol. + * fnmatch.c: New file. + * include/fnmatch.h: Ditto. + * include/cygwin/version.h: Bump API minor version to 50. + +2002-01-15 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fchdir): Call chdir with full windows path. + +2002-01-14 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc: Use INVALID_FILE_ATTRIBUTES instead of "(DWORD) -1" + for file attributes throughout. + * fhandler.cc: Ditto. + * fhandler_disk_file.cc: Ditto. + * path.cc: Ditto. + * path.h: Ditto. + * syscalls.cc: Ditto. + * times.cc (utimes): Use path_conv::isdir() instead of explicit + GetFileAttributes() call. + +2002-01-13 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (multiple_cygwin_problem): Clarify logic and make + CYGWIN_MISMATCH_OK more powerful. + +2002-01-10 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle): Accept a second argument indicating + whether the signal came from this process or not. + * sigproc.h: Reflect sig_handle arg change. + * signal.cc (kill_pgrp): Add sigframe info. + (abort): New function. Eliminates newlib function of same name. + * sigproc.cc (wait_sig): Pass "signal from this process" value as arg + 2. + +2002-01-10 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (pathconf): Guard _PC_PATH_MAX branch against invalid + file parameter. + +2002-01-09 Christopher Faylor <cgf@redhat.com> + Robert Collins <rbtcollins@hotmail.com> + + * exceptions.cc (early_stuff_init): Rename from misnamed + set_console_handler. + (ctrl_c_handler): Attempt to work around potential signal duplication + during process startup. + (sig_handle): Ignore SIGINT when we're just an "exec stub". + * spawn.cc (spawn_guts): Store pid of spawned process in global for use + by ctrl_c_handler. + * dcrt0.cc (dll_crt0_1): Call renamed initialization function. + * winsup.h: Reflect function name change. + +2002-01-08 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_accept): Set sun_path for newly connected socket. + +2002-01-07 Ralf Habacker <Ralf.Habacker@freenet.de> + + * Makefile.in: Add uninstall target. + +2002-01-07 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (getsem): Clean up debugging output. + +2002-01-07 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (getsem): Set errno when unable to create own semaphore. + Reorganize to make clearer that error should only come from initial + creation of process semaphore. + +2002-01-06 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::init_std_file_from_handle): Add some defensive + code to invalid handle case. + +2002-01-06 Corinna Vinschen <corinna@vinschen.de> + + * ioctl.cc (ioctl): Make third argument optional. + * include/sys/ioctl.h: Ditto in declaration. + * dtable.cc (dtable::init_std_file_from_handle): Revert previous + bogus patch. + * window.cc (WndProc): Raise SIGURG instead of SIGIO in case of FD_OOB + message. + +2002-01-05 Christopher Faylor <cgf@redhat.com> + + * dir.cc (opendir): Guarantee release of alloced fhandler structure on + error. + +2002-01-05 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN. + +2002-01-05 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Don't treat NULL + handle as errorneous. + +2002-01-04 Christopher Faylor <cgf@redhat.com> + + * cygmagic: Change logic for equality test. + +2002-01-04 Christopher Faylor <cgf@redhat.com> + + * dir.cc (opendir): Don't attempt to call sub-opendir if ENOENT. + +2002-01-04 Corinna Vinschen <corinna@vinschen.de> + + * net.cc: Replace usage of AF_UNIX by Posix compliant AF_LOCAL + throughout. + (socketpair): Explicitly allow SOCK_STREAM and SOCK_DGRAM socket types + in families AF_UNIX and AF_LOCAL. Explicitly allow PF_UNSPEC, PF_LOCAL + and PF_INET protocols. Return error otherwise. Implement datagram + socketpairs. + +2002-01-01 Christopher Faylor <cgf@redhat.com> + + * speclib: Remove temp files automatically. + +2002-01-01 Corinna Vinschen <corinna@vinschen.de> + * fhandler.h (fhandler_socket::sun_path): New private member. + (fhandler_socket::set_sun_path): New method. + (fhandler_socket::get_sun_path): Ditto. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize + sun_path to NULL. + (fhandler_socket::~fhandler_socket): Free sun_path if needed. + (fhandler_socket::set_sun_path): New method. + * net.cc (cygwin_bind): Set sun_path to path of local socket file. + (cygwin_getsockname): Add code to return correct sockaddr for unix + domain sockets. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2003 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2003 new file mode 100644 index 000000000..6c16579a2 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2003 @@ -0,0 +1,5678 @@ +2003-12-31 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Make crt0 functions NOSIGFE. + * include/cygwin/version.h: Gratuitous comment change. + * lib/_cygwin_crt0_common.cc: Remove unneeded declaration. + +2003-12-29 Christopher Faylor <cgf@redhat.com> + + * cygtls.h (_threadinfo::stack): Increase stack size to accommodate + nested signal handlers. Reorganize to cause potential SEGV on stack + overflow. + * sigproc.cc (no_signals_available): Check sendsig value rather than + relying on obsolete sig_loop_wait. + (sigproc_terminate): Ditto. + (proc_can_be_signalled): Check sendsig value even for myself. + * tlsoffsets.h: Regenerate. + +2003-12-29 Christopher Faylor <cgf@redhat.com> + + Move open_fhs from fhandler.h to cygheap.h for easier tracking. + Accommodate this change throughout. + * dtable.cc (dtable::add_archetype): Use correct count when iterating + through *active* archetypes. + * dtable.cc (dtable::fixup_after_exec): Close handle if close_on_exec + and archetype exists since archetype currently does not set windows + close-on-exec flag (FIXME). + * fhandler_tty.cc (fhandler_tty_slave::open): Change debugging output + slightly. + (fhandler_tty_slave::close): Ditto. + (fhandler_tty_slave::fixup_after_fork): Just report on inherited use + counts since since archetype currently does not set windows + close-on-exec flag (FIXME). + * pinfo.cc (_pinfo::set_ctty): Change debugging output slightly. + * cygheap.cc (cygheap_init): Remove open_fhs accommodation and use + count reporting. + * perthread.h (vfork_save::fhctty): New element. + * perthread.h (vfork_save::open_fhs): New element. + * fork.cc (vfork): Muck around with ctty and open_fhs stuff, both of + which are now saved in the vfork_save structure. + +2003-12-27 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_tty_slave::archetype): Make public. + (report_tty_counts): New macro. Use throughout for reporting tty use + counts. + * dtable.cc (dtable::vfork_child_dup): Add debugging output for + usecount increment. Increment open_fhs if appropriate. + (dtable::vfork_parent_restore): "Close" artificially bumped ctty. + (dtable::vfork_child_fixup): Close ctty since it was bumped prior to + vfork. Save open_fhs around close since the closing of these handles + has no effect on the console. + * fhandler_tty.cc (fhandler_tty_slave::open): Reorganize calls to allow + for easier tracking of usecount modification. + (fhandler_tty_slave::open): Ditto. + +2003-12-26 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (close_all_files): Simplify logic around closing ctty. + +2003-12-26 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::set_ctty): *Always* call close on opened ctty since + it counts as an opened handle. + +2003-12-26 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_tty_master::fixup_after_fork): Remove + declaration. + (fhandler_tty_master::fixup_after_exec): Ditto. + * fhandler_tty.cc (fhandler_tty_master::init): Fix so that children do + not inherit master tty handles. + (fhandler_tty_master::fixup_after_fork): Remove, since it was never + used. + (fhandler_tty_master::fixup_after_exec): Ditto. + * pinfo.cc (_pinfo::set_ctty): Increment open_fhs when ctty is set. + * cygheap.cc (cygheap_init): Ditto. + * syscalls.cc (setsid): *Always* call close on opened ctty since the + archetype is associated with the ctty and it counts as an opened + handle. + * tty.cc (tty::common_init): Don't protect input/output mutex since it + confuses subsequent fork/execs when CYGWIN=tty. + + * fhandler_process.cc (fhandler_process::fill_filebuf): Properly set + "file size" for "<defunct>" reporting when filebuf is zero length. + +2003-12-26 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (try_to_debug): Fix off-by-one problem when resetting + environment variable after error_start detected. + + * fhandler_tty_slave.cc (fhandler_tty_slave::close): Clarify debug + message. + * syscalls.cc (setsid): Don't increment usecount here, since it will be + automatically decremented on close. + +2003-12-26 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (setup_handler): Protect against a race. + +2003-12-26 Christopher Faylor <cgf@redhat.com> + + * path.cc (mount_item::build_win32): Backslashify paths in non-managed + case. + +2003-12-25 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (reent_data): Reluctantly resurrect. + (__cygwin_user_data::impure_ptr): Ditto. + (_dll_crt0): Reluctantly initialize _impure_ptr here. + (initialize_main_tls): Eliminate local_clib initialization since it now + happens in init_thread. + * init.cc (dll_entry): Reluctantly remove code which set _impure_ptr to + the main thread's local_clib. + * perthread.h (reent_data): Remove obsolete declaration. + + * sigproc.cc (proc_subproc): Add more debugging output. + (get_proc_lock): Ditto. + + *dcrt0.cc (dll_crt0_1): Allocate argv[0] via malloc since main thread + could exit. + +2003-12-23 Christopher Faylor <cgf@redhat.com> + + * fork.cc (fork_child): After a pthread/fork, ensure that impure + pointer stuff which resides in parent is propagated to child thread. + +2003-12-23 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (set_signal_mask): Redefine to not pass by address. + Report calculated mask in debugging output. + * sigproc.h (set_signal_mask): Reflect above change in declaration. + +2003-12-22 Christopher Faylor <cgf@redhat.com> + + * path.cc (mount_item::build_win32): Take path apart before feeding it + to fnmunge. + +2003-12-21 Christopher Faylor <cgf@redhat.com> + + Throughout, change use of _reent_winsup()-> to _my_tls.locals. + instead. + Throughout, remove obsolete MT_SAFE/_CYG_THREAD_FAILSAFE considerations. + Througout, add cygtls.h include. + * Makefile.in (DLL_OFILES): Add cygtls.o. Add some more objects to the + -fomit-frame-pointer list. + * acconfig.h: Remove obsolete settings. + * config.h.in: Ditto. + * bsdlib.cc: Add cygtls.h include. + * configure.in: Remove --enable-extra-threadsafe-checking. + * configure: Regenerate. + * cygtls.h (_local_storage): New struct renamed from _winsup_t (sic). + (_threadinfo:local_clib): Add new field. + (_threadinfo::locals): Ditto. + (_threadinfo::init_thread): Accept second _reent * argument. + (_threadinfo::call): Define as regparm. + (CYGTLS_PADSIZE): Remove unnecessary slop. + (_getreent): Define as a macro. + * thread.h: Remove _CYG_THREAD_FAILSAFE and MT_SAFE stuff. + (_winsup_t): Move to cygtls.h. + (ResourceLocks::ResourceLocks): Eliminate empty constructor. + (MTinterface::reents): Eliminate. + (MTinterface::thread_self_key): Eliminate. + (MTinterface::MTinterface): Eliminate. + * dcrt0.cc: Include stdio.h for _impure_ptr initialization. + (do_global_ctors): Remove run_ctors_p (sic) considerations. Don't call + atexit here. + (__main): Initialize destructors for user here. + (dll_crt0_1): Accept a dummy argument. Don't call init_thread here. + Don't set _impure_ptr here. Call do_global_ctors after more things + have been initialized. + (_dll_crt0): Define zeros buffer as max of needed size of + CYGTLS_PADSIZE so that it can be used for two purposes while minimizing + stack usage. Initialize _impure_ptr specifically, for speed. Call + dll_crt0_1 with buffer argument. + (cygwin_dll_init): Call dll_crt0_1 with dummy argument. + * dtable.cc (dtable::find_unused_handle): Remove call to + AssertResourceOwner. + * exceptions.cc: Move _threadinfo stuff to new file. + * cygtls.cc: New file. + * gentls_offsets: Accommodate increasing complexity of cygtls.h. + * hires.h (hires_base::~hires_base): Remove. + * init.cc (dll_entry): Remove setting of reents. + * thread.cc: Remove syslog.h include. + (__getreent): Simplify to use _my_tls. + (_reent_winsup): Delete. + (AssertResourceOwner): Delete. + (MTinterface::Init): Remove setting of _clib and _winsup, with all that + entails. + (MTinterface::fixup_after_fork): Ditto. + (pthread::thread_init_wrapper): Ditto. Also remove call to + set_tls_self_pointer. + (pthread::set_tls_self_pointer): Eliminate. + (pthread::get_tls_self_pointer): Just return _my_tls.tid; + (__reent_t::init_clib): Eliminate. + * tlsoffsets.h: Regenerate. + +2003-12-17 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (proc_subproc): Simplify code to just remove all zombies + if SIGCHLD == SIG_IGN. + +2003-12-17 Christopher Faylor <cgf@redhat.com> + + * pinfo.h (pinfo::operator ==): Add a way to check for _pinfo types. + * sigproc.cc (proc_subproc): Ensure that zombie is removed when SIGCHLD + == SIG_IGN but still allow wait()ing threads to wake up. + +2003-12-16 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (set_signal_mask): Report on input argument rather than + getsigmask. + + * fhandler.h (fhandler_base): Make friends with close_all_files. + * pinfo.cc (_pinfo::set_ctty): Add more debugging. + * sigproc.cc (proc_can_be_signalled): Detect state when signal handler + thread is gone in target process as an EPERM situation. Set errno to + ESRCH if process doesn't exist. + (sigproc_terminate): Set sendsig to illegal value when closed. + (sig_send): Rely on proc_can_be_signalled setting the proper errno. + * syscalls.cc (close_all_files): Detect when all ttys are closed prior + to calling close_all_files. The ctty needs to be closed explicitly in + this case. + +2003-12-16 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/ipc.h: Include sys/types.h. + +2003-12-15 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread::init_main_thread): Make sure that the main thread + has valid handles. + (pthread::create_cancel_event): Fix error message. + +2003-12-14 Christopher Faylor <cgf@redhat.com> + + * winsup.h (access_worker): Declare with added fhandler_base parameter. + * syscalls.cc (access_worker): Accommodate extra fhandler_base + argument. Use it instead of stat_worker to determine stat information, + when appropriate. + * fhandler.cc (fhandler_base::device_access_denied): Pass fhandler + pointer to access_worker so that it can use the proper method for + determining stat information. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. + * path.cc (path_conv::check): Add read-only attribute to /cygdrive + default settings. + +2003-12-14 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (ctrl_c_handler): Remove this thread from the signal + handler chain. + +2003-12-14 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Revert previous change and again + subsume cygthread::stub2. Just return from function now since + ExitThread is guaranteed by automatic _threadinfo wrapper. Define as + per ThreadProc convention. + (cygthread::stub2): Remove. + (cygthread::simplestub): Perform similar operations to cygthread::stub. + (cygthread::simplestub2): Remove. + * cygthread.h (cygthread::stub): Declare as per ThreadProc convention. + (cygthread::stub2): Remove declaration. + (cygthread::simplestub): Declare as per ThreadProc convention. + (cygthread::simplestub2): Remove declaration. + * cygtls.h (_threadinfo::call): Define first argument as per ThreadProc + convention. + (_threadinfo::call2): Ditto. + (_tlsbase): Define as char * pointer. + (_tlstop): New definition. + (_main_tls): Define here. + * dcrt0.cc (alloc_stack): Revert previous change which called + init_thread since information would be overwritten by fork later + anyway. + (dll_crt0_1): Use _tlsbase and _tlstop for setting stack bottom, top. + * exceptions.cc: Move _main_tls declaration to cygtls.h. + (_threadinfo::call): Define first argument as per ThreadProc + convention. + (_threadinfo::call2): Call ExitThread with thread function return + value. + (_threadinfo::init_thread): Don't initialize cygtls to zero if input + arg is NULL. + * fork.cc (fork_child): Reset _main_tls here. Reinitialize parts of + _my_tls after copying data from parent. + * init.cc (threadfunc_fe): New function. Front-end for all threads + created in cygwin processes. + (munge_threadfunc): New function. + (dll_entry): Call munge_threadfunc to force the call of a thread + wrapper. + * thread.cc (pthread::thread_init_wrapper): Perform similar operations + to cygthread::stub. + (pthread::thread_init_wrapper2): Remove. + * thread.h (pthread::thread_init_wrapper): Declare as per ThreadProc + convention. + (pthread::thread_init_wrapper2): Remove declaration. + * window.cc (Winmain): Just return from function now since ExitThread + is guaranteed by automatic _threadinfo wrapper. + +2003-12-12 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::delete_archetype): Add debugging. + (dtable::release): Move archetype deletion here. + (dtable::vfork_child_dup): Increment ctty usecount to catch later + close_all_files case in parent/child. + (dtable::vfork_child_fixup): Avoid using cygheap->foo where this should + really be using local references. Call close on archetyped handles + since the handles haven't had the noninherit flag set. + * fhandler_tty.cc (fhandler_tty_slave::close): Remove archetype + deletion code. Add defensive error message when DEBUGGING. + (fhandler_tty_common::set_close_on_exec): Use more robust method for + checking whether to set handles into noninherit if there is an + archetype associated with the fhandler. + +2003-12-12 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (alloc_stack): Move _main_tls if stack is relocated. + +2003-12-11 Christopher Faylor <cgf@redhat.com> + + * miscfuncs.cc (low_priority_sleep): Correct thinko which caused + SetPriority to be called unnecessarily. + * thread.cc (pthread::init_main_thread): Call new create_cancel_event + function. + (pthread::precreate): Ditto. + (pthread::postcreate): Remove cancel_event creation. + (pthread::create_cancel_event): Define new function. + * thread.h (pthread::create_cancel_event): Declare new function. + +2003-12-11 Brian Ford <ford@vss.fsi.com> + + * fhandler_serial.cc (fhandler_serial::tcflush): Simplify. Remove + read polling loop to avoid a hang with streaming devices. + +2003-12-11 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::set_ctty): Correct stupid typo. + +2003-12-11 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (cygheap_types): Add HEAP_ARCHETYPES. + (init_cheap::ctty): Change to pointer. + * dtable.h (dtable::find_archetype): Declare new function. + (dtable::add_archetype): Declare new function. + (dtable::delete_archetype): Declare new function. + (dtable::narchetypes): Declare. + (dtable::farchetypes): Declare. + (dtable::initial_archetype_size): Declare. + (dtable::dtable): Initialize new fields. + (dtable::initial_archetype_size): Declare. + * dtable.cc (dtable::find_archetype): Define new function. + (dtable::add_archetype): Define new function. + (dtable::delete_archetype): Define new function. + (dtable::initial_archetype_size): Define. + * fhandler.h (fhandler_base::archetype): Declare. + (fhandler_base::usecount): Declare. + * fhandler.cc (fhandler_base::fhandler_base): Initialize new fields. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Pass NULL to + third argument of set_ctty. + * fhandler_tty.cc (fhandler_tty_slave::open): Accommodate new archetype + method to create only one instance of a tty. + (fhandler_tty_slave::close): Don't close handles unless archetype + usecount is zero. When that happens, close archetype too. + (fhandler_tty_slave::dup): Just copy archetype. Set use count + appropriately. Set ctty, if appropriate. + (fhandler_tty_common::dup): Remove slave considerations. + (fhandler_tty_common::set_close_on_exec): Remove cygheap->ctty + considerations. + * pinfo.cc (_pinfo::set_ctty): Accommodate new archetype methods. + * pinfo.h (_pinfo::set_ctty): Make third argument explicit. + * syscalls.cc (close_all_files): Decrement controlling tty use count + before closing all handles to allow controlling tty to be closed. + Remove previous controlling tty considerations. + +2003-12-09 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_common::dup): Just copy cygheap->ctty + to child if duping the current ctty. + (fhandler_tty_common::close): Move debugging statement earlier in function. + (fhandler_tty_slave::close): Return success when closing ctty. + * syscalls.cc (close_all_files): Avoid calling fhandler_tty_slave close + method so that open_fhs will not be decremented when closing cygheap + ctty. + (setsid): Ditto. + * dcrt0.cc (do_exit): Reorganize to avoid leaving a critical section + active after vfork. + * fhandler.h (fhandler_tty_slave::get_unit): Remove regparm parameter + since it can't work in a virtualized function. + +2003-12-08 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::set_ctty): Don't copy over existing ctty if it is + active. + +2003-12-08 Christopher Faylor <cgf@redhat.com> + + * thread.cc (pthread::precreate): Delete duplicate setting of + cancel_event. + +2003-12-08 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_tty_slave::ttyname): Use name from pc since it + is guaranteed to be accurate. + * fhandler_tty.cc (fhandler_tty_slave::open): Increment open_fhs + appropriate when copying ctty. + (fhandler_tty_slave::close): Remove special case handling for + exit_state. Use ctty < 0 check instead. + (fhandler_tty_common::close): Set io_handle to NULL after closing. + * syscalls.cc (close_all_files): Specifically close cygheap->ctty, if + appropriate. + +2003-12-07 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawn_guts): Change type back to 'int' after erroneous + change below. + * wait.cc (wait4): Move sawsig initialization inside loop. + +2003-12-07 Christopher Faylor <cgf@redhat.com> + + Change use of BOOL, TRUE, FALSE to bool, true, false, as appropriate, + throughout. + +2003-12-07 Pierre Humblet <pierre.humblet@ieee.org> + + * tty.cc (tty::common_init): Remove call to SetKernelObjectSecurity and + edit some comments. + +2003-12-07 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (init_cygheap::ctty): Add new element. + * devices.in (device::parse): Remove special handling for /dev/tty. + * devices.cc: Regenerate. + * dtable.cc (build_fh_pc): Don't reset /dev/tty device. Let the device + opener do that. + * fhandler_termios.cc (tty_min::set_ctty): Redefine to _pinfo class. + * fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Avoid + setting noninherit flag for ctty. + * tty.h: Move BOOLs to bools. + (tty_min::set_ctty): Redeclare to _pinfo class. + * pinfo.cc (_pinfo::set_ctty): Define new function based on + tty_min::set_ctty. Change first argument from tty number to tty_min + class. + * pinfo.h (_pinfo::set_ctty): Declare. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Reflect move + of set_ctty to _pinfo class. + * fhandler_tty.cc (fhandler_tty_slave::open): Treat FH_TTY specially. + Use saved cygheap value if it exists. Otherwise convert to real device + and save on first time open. + (fhandler_tty_common::dup): Potentially set controlling tty if duping a + slave tty. + * syscalls.cc (setsid): Close controlling tty in cygheap. + * tty.cc: Change some BOOLs to bools. + +2003-12-07 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (locked_append): New. + (updwtmp): Remove mutex code and call locked_append. + (pututline): Ditto. + +2003-12-06 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (_threadinfo::remove): Avoid a linked list walk. + +2003-12-06 Christopher Faylor <cgf@redhat.com> + + * cygtls.h (_threadinfo::find_tls): New function. + * exceptions.cc (_threadinfo::find_tls): Rename from find_tls. Use + critical section to protect access to linked list. + +2003-12-06 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (_threadinfo::remove): Avoid returning without + unlocking critical section in the (hopefully impossible) case of an + unrecognized thread. + +2003-12-06 Christopher Faylor <cgf@redhat.com> + + * cygtls.h: Add more "don't parse this" guards. + (_threadinfo::init_thread): Rename from 'init'. + (_threadinfo::init): Declare new function. + (_threadinfo::protect_linked_list): Declare new critical section. + * dcrt0.cc (dll_crt0_1): Call init_thread to initialize thread stuff. + (_dll_crt0): Call _threadinfo::init prior to invoking dll_crt0_1. + * exceptions.cc (_threadinfo::init_thread): Rename from 'init'. + (_threadinfo::init): Define new function. Protect linked list + manipulation with new critical section. + (_threadinfo::call): Reflect function name change. + (_threadinfo::remove): Protect linked list manipulation with new + critical section + * gentls_offsets: Rework to allow multi-line "don't parse this" + protection. + * init.cc (dll_entry): Don't remove threads info stuff here since the + remove function uses a critical section which can't be used during + thread creation or destruction. + * thread.cc (pthread::exit): Call _threadinfo remove function here. + +2003-12-05 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub2): Remove myself from the list of + threads monitored by signals since this thread will never call raise or + sigwait. + (cygthread::simplestub2): Ditto. Set ev here. + (cygthread::cygthread): Don't set ev here for freerange thread. + +2003-12-04 Christopher Faylor <cgf@redhat.com> + + * path.cc (slash_unc_prefix_p): Allow '.' as a valid character after + '\\' in a UNC path. + +2003-12-04 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (setup_handler): Remove ill-advised debugging output. + +2003-12-04 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h (struct __fcntl64): Fix datatype of l_start. + +2003-12-03 Corinna Vinschen <corinna@vinschen.de> + + Substitute 0x7fffffff and 0xffffffff by INT32_MAX and UINT32_MAX + throughout, except in assembler code. + +2003-12-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::lock): Use UINT32_MAX + instead of 0xffffffff. Accommodate Win 9x bug in evaluating length + of area to lock when given length is 0. + +2003-12-03 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_disk_file.cc (fhandler_disk_file::lock): Interchange + values of off_low and off_high. + +2003-12-03 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc (fcntl_worker): Remove static storage class. + * flock.cc (flock): Use struct __flock64. Call fcntl_worker. + Use Cygwin errno functions instead of accessing errno directly. + * winsup.h: Declare fcntl_worker. + +2003-12-03 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc: Whitespace cleanup. + +2003-12-03 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Properly establish _threadinfo + environment. + (cygthread::stub2): New function. + (cygthread::simplestub): Ditto. + (cygthread::simplestub2): New function. + * cygthread.h (cygthread::stub2): Declare new function. + (cygthread::simplestub2): Ditto. + * cygtls.h (_threadinfo::call): Declare new function. + (_threadinfo::call2): Ditto. + * dcrt0.cc (dll_crt0_1): Accommodate new _threadinfo::init which + doesn't return pointer to tls. + (_dll_crt0): Remove obsolete DECLARE_TLS_STORAGE. + (dll_crt0): Ditto. + * exceptions.cc (_threadinfo::call): New function. + (_threadinfo::call2): Ditto. + (_threadinfo::init): Don't return pointer. + * thread.cc (pthread::thread_init_wrapper): Properly establish + _threadinfo environment. + (pthread::thread_init_wrapper2): New function. + * thread.h (pthread::thread_init_wrapper): Remove noreturn attribute + (pthread::thread_init_wrapper2): Declare new function. + * winbase.h: Remove obsolete code. + +2003-12-02 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Change the way that -f options are appended to CFLAGS, + slightly. + +2003-12-02 Christopher Faylor <cgf@redhat.com> + + * fcntl.cc (_fcntl): Silence a compiler warning. + +2003-12-02 Pierre Humblet <pierre.humblet@ieee.org> + + * pinfo.cc (pinfo::init): Use shared_name to construct the mapname. + +2003-12-01 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread_rwlock::add_reader): Remove mx parameter for + List_insert call. + (pthread::prepare): Ensure race safeness when adding function + pointers to atfork lists by using List_insert. + * thread.h (List_insert): Use InterlockedCompareExchangePointer to + ensure race safeness without using a mutex. + (List_remove): Use InterlockedCompareExchangePointer to + ensure race safeness with List_insert. + (List::insert): Remove mx parameter for List_insert call. + +2003-12-01 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (OBSOLETE_FUNCTIONS): Add fcntl. + (NEW_FUNCTIONS): Add fcntl64. + * cygwin.din: Export fcntl64. Make fcntl being SIGFE. + * fcntl.cc (fcntl_worker): New function. + (fcntl64): New function. + (_fcntl): Call fcntl_worker. Convert 32 bit flock structure into + 64 bit flock structure and vice versa. + * fhandler.cc (fhandler_base::lock): Change 2nd parameter to + struct __flock64 *. + * fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto. Rework + to be 64 bit aware. + * fhandler.h: Accommodate above method argument changes. + * include/cygwin/types.h: Add struct __flock32 and __flock64. + Define struct flock according to setting of __CYGWIN_USE_BIG_TYPES__. + * include/cygwin/version.h: Bump API minor number. + +2003-12-01 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Set cygheap->shared_prefix. + * cygheap.h (struct init_cygheap): Add shared_prefix. + * shared.cc (shared_name): Use cygheap->shared_prefix. + +2003-12-01 Pierre Humblet <pierre.humblet@ieee.org> + + * shared.cc (shared_name): Take into account the SE_CREATE_GLOBAL_NAME + privilege when building the name string. + (open_shared): Remove the call to OpenFileMapping. + (shared_info::initialize): Move cygheap initialization to ... + (memory_init): ... here. Suppress now useless shared_h variable. + (user_shared_initialize): Make tu a cygpsid. + +2003-12-01 Dr. Volker Zell <Dr.Volker.Zell@oracle.com> + + * include/tzfile.h: Remove duplicate definition of TM_SUNDAY. + * localtime.cc: Point TZDIR to the /usr/share/zoneinfo directory used + by the tzcode package. + +2003-11-30 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc: Renamed from flock.c. + +2003-11-29 Christopher Faylor <cgf@redhat.com> + + * pinfo.h: Remove global_sigs declaration. + * siginfo.h: Move global_sigs declaration here. + * Makefile.in: Remove duplicate compiler flag. + +2003-11-29 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (_threadinfo::pop): Zero *contents* of popped stack + location rather than the actual stack pointer. + +2003-11-29 Nicholas Wourms <nwourms@netscape.net> + + * Makefile.in: (DLL_OFILES): Add flock.o. + * cygwin.din: Export flock. + * flock.c: New file. + * include/sys/file.h: Include sys/cdefs.h. + Add function prototype for flock(). + Add some comments from BSD's header for further clarity. + (L_SET, L_CURR, L_INCR, L_XTND): Redefine as the macros + SEEK_SET, SEEK_CUR, SEEK_CUR, & SEEK_END respectively. + (LOCK_SH,LOCK_EX,LOCK_NB,LOCK_UN): New macros for flock(). + * include/cygwin/version.h: Bump API minor number. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (no_signals_available): Fix so that non-zero exit state is + a true condition rather than errnoneously only checking other states + when exist_state was zero. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + * pinfo.h (_pinfo::getthread2signal): Remove obsolete function. + * cygtls.h (_threadinfo): Define tid more precisely. + (_threadinfo::operator HANDLE): Define. + * exceptions.cc (_threadinfo::interupt_now): Use _threadinfo HANDLE + operator to derive thread handle. + (setup_handler): Ditto. + * sigproc.cc: Reorganize includes. Fix no_signals_available test to + properly return true when !sig_wait_loop. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + * pinfo.h (_pinfo::getsig): Remove obsolete function, here and + throughout. + * exceptions.cc: Ditto. + * fhandler_termios.cc: Ditto. + * signal.cc: Ditto. + * sigproc.cc: Ditto. + + * Makefile.in: Revert previous change which made a cygwin.din newer + than a version.h a warning rather than an error. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Re-add inexplicably missing semaphore/msg functions. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + * gendevices: Issue error when shilka is missing. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/signal.h: New file. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + Eliminate use of sigframe and sigthread throughout. + * Makefile.in (DLL_OFILES): Add sigfe.o. Remove reliance on cygwin.def + from cygwin0.dll dependency since dependence on sigfe.o implies that. + Generate def file on the fly using 'gendef'. + * configure.in: Don't auto-generate cygwin.def. + * configure: Regenerate. + * cygwin.din: Add SIGFE stuff where appropriate. + * dcrt0.cc (dll_crt0_1): Initialize cygwin tls early in process + startup. Set _main_tls to address of the main thread's cygwin tls. + * debug.h: Remove now unneeded WFSO and WFMO declarations. + * exceptions.cc (_last_thread): Define. + (set_thread_state_for_signals): New function. + (reset_thread_exception_for_signals): Ditto. + (init_thread_for_signals): Ditto. + (delete_thread_for_signals): Ditto. + (capture_thread_for_signals): Ditto. + (handle_exceptions): Set return address explicitly for exceptions prior + to calling sig_send. + (interrupt_on_return): Eliminate. + (setup_handler): Add preliminary implementation for dealing with + thread-specific signals by querying _main_tls. + (signal_exit): Use cygthread::main_thread_id instead of mainthread.id. + (call_signal_handler_now): For now, just handle the main thread. + * fork.cc (vfork): Save and restore main _my_tls. + * gendef: New file. Generates def file and sigfe.s file. + * gentls_offsets: New file. Generates offsets for perl to use in + sigfe.s. + * how-signals-work.txt: Mention that info is obsolete. + * init.cc (dll_entry): Initialize cygwin tls storage here. + * miscfuncs.cc (low_priority_sleep): Make a C function for easier + calling from asm. + * perthread.h (vfork_save::tls): New element. + * signal.cc (nanosleep): Replace previous use of + sigframe.call_signal_handler_now with straight call to + call_signal_handler_now. + (abort): Ditto. + * syscalls.cc (readv): Ditto. + * termios.cc (tcsetattr): Ditto. + * wait.cc (wait4): Ditto. + * sigproc.cc (sig_dispatch_pending): Ditto. + (sig_send): Ditto. + * sigproc.h: Declare call_signal_handler_now. + * thread.cc (pthread::thread_init_wrapper): Initialize cygwin tls. + Remove obsolete and unworking signal stuff. + * thread.h (verifyable_object::sigs): Eliminate. + (verifyable_object::sigmask): Eliminate. + (verifyable_object::sigtodo): Eliminate. + (verifyable_object::exit): Make attribute noreturn. + (verifyable_object::thread_init_wrapper): Ditto. + (pthread_null::exit): Ditto. + * winbase.h (__stackbase): Always define. + * winsup.h (low_priority_sleep): Declare as a "C" function. + * include/cygwin/version.h: Bump API version to reflect sigwait export. + + * include/sys/queue.h: Protect SLIST_ENTRY from previous declaration. + + * signal.cc (sigwait): Implement. + + * select.cc (fhandler_base::ready_for_read): Add debugging output. + + * devices.h: Define more device pointers via their storage. + * devices.in: Don't parse things like /dev/inet/tcp, as they really + have no meaning. + * devices.cc: Regenerate. + * gendevices: Set proper protection for output file. + + * cygtls.h: New file. + * gendef: New file. + * gentls_offsets: New file. + * tlsoffsets.h: New file. Autogenerated. + * config/i386/longjmp.c: Remove. File subsumed by gendef output. + * config/i386/makefrag: Remove obsolete file. + + * fhandler.cc: Remove spurious access_worker declaration. + + * spawn.cc (spawnve): Make debugging output more accurate. + + * cygwin-gperf: Remove. + * devices.cc: Remove. + +2003-11-28 Christopher Faylor <cgf@redhat.com> + + * speclib: Use correct EOF marker. Ensure that directory is actually + deleted when running under Windows. + +2003-11-27 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Reorganize to + avoid inappropriate .lnk extensions with munged filenames under managed + mode. + +2003-11-26 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (set_process_privilege): Rename restore_priv to + priv_luid. + +2003-11-26 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_helper.cc (set_process_privilege): Call LookupPrivilegeValue + before opening the token. + +2003-11-26 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (mkdir): Use local security_descriptor. Call + set_security_attribute appropriately. + * external.cc (cygwin_internal): Ditto. + * fhandler.cc (fhandler_base::open): Ditto. + * fhandler_socket.cc (fhandler_socket::bind): Ditto. + * path.cc (symlink_worker): Ditto. + * sec_acl.cc (setacl): Ditto. Call read_sd appropriately. + (getace): Ditto. + * sec_helper.cc (security_descriptor::malloc): New method. + (security_descriptor::realloc): New method. + (security_descriptor::free): New method. + * security.cc (read_sd): Get security_descriptor as parameter instead + of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check. + Allocate the security_descriptor buffer according to size returned by + a call to GetFileSecurity. Return buffer size on success. + (write_sd): Get security_descriptor as parameter instead of + PSECURITY_DESCRIPTOR and a size. + (get_nt_attribute): Use local security_descriptor. + (get_nt_object_attribute): Ditto in case of type == SE_REGISTRY_KEY. + Allocate security_descriptor buffer according to size returned by + a call to RegGetKeySecurity. + (alloc_sd): Make static. Get security_descriptor as parameter instead + of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check. + (set_security_attribute): Get security_descriptor as parameter instead + of PSECURITY_DESCRIPTOR and a size. + (set_nt_attribute): Use local security_descriptor. + (check_file_access): Ditto. + * security.h: Add class security_descriptor. + (read_sd): Change declaration to get security_descriptor as parameter + instead of PSECURITY_DESCRIPTOR and a size. + (write_sd): Ditto. + (set_security_attribute): Ditto. + (alloc_sd): Remove declaration. + * thread.cc (semaphore::semaphore): Use local security_descriptor. Call + set_security_attribute appropriately. + +2003-11-26 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.h (getace): Use FILE_*_BITS as permission mask. + * security.cc (get_attribute_from_acl): Ditto. + * security.h (FILE_READ_BITS): Define to match also GENERIC bits. + (FILE_WRITE_BITS): Ditto. + (FILE_EXEC_BITS): Ditto. + +2003-11-25 Christopher Faylor <cgf@redhat.com> + + * thread.cc: Minor whitespace cleanup. Remove some obsolete code. + +2003-11-24 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (build_fh_name): Set error in dummy fhandler when one is + noted during path_conv. + * fhandler.h (fhandler_base::set_error): New method. + +2003-11-24 Christopher Faylor <cgf@redhat.com> + + * configure.in: Avoid using cygserver unless hosting on cygwin. + +2003-11-23 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (sig_send): Correct below checkin. Use + thisframe.call_signal_handler. + +2003-11-23 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (proc_exists): A zombie process does not exist. + (sig_send): Improve debugging output. Wait for pipe to be created + before trying to send to it. Call call_signal_handler_now if sending a + signal to myself. + +2003-11-22 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (check_sanity_and_sync): Correct api major version check so + that newer dlls will work with older apps but not vice versa. + +2003-11-21 Christopher Faylor <cgf@redhat.com> + + * sem.cc: Always include signal.h to handle SIGSYS raise when + !USE_SERVER. + * shm.cc: Ditto. + +2003-11-21 Christopher Faylor <cgf@redhat.com> + + * msg.cc: Always include signal.h to handle SIGSYS raise when + !USE_SERVER. + +2003-11-20 Christopher Faylor <cgf@redhat.com> + + * configure.in: Make --use-server the default. Remove powerpc target. + * configure: Regenerate. + +2003-11-20 Corinna Vinschen <corinna@vinschen.de> + + * msg.cc (msgctl): Raise SIGSYS if call not available. + (msgget): Ditto. + (msgrcv): Ditto. + (msgsnd): Ditto. + * sem.cc (semctl): Ditto. + (semget): Ditto. + (semop): Ditto. + * shm.cc (shmat): Ditto. + (shmctl): Ditto. + (shmget): Ditto. + (shmdt): Ditto. + +2003-11-19 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.h (client_request::request_code_t): Add + CYGSERVER_REQUEST_MSG and CYGSERVER_REQUEST_SEM. + (admininstrator_group_sid): Add extern declaration. + * cygserver_ipc.h: Rewrite. + * cygserver_msg.h: New file. + * cygserver_sem.h: New file. + * cygserver_shm.h: More or less rewrite. + * cygwin.din: Add msgctl, msgget, msgrcv, msgsnd, semctl, semget and + semop. + * msg.cc: Rewrite. + * safe_memory.h: Remove. + * sem.cc: Rewrite. + * shm.cc: Rewrite. + * include/cygwin/ipc.h: Use appropriate guard. + (struct ipc_perm): Add seq. + (IPCID_TO_IX): New define from BSD. + (IPCID_TO_SEQ): Ditto. + (IXSEQ_TO_IPCID): Ditto. + (IPC_R): Ditto. + (IPC_W): Ditto. + (IPC_M): Ditto. + * include/cygwin/msg.h: Use appropriate guard. #ifdef _KERNEL all stuff + not explicitely defined by SUSv3. Use signed types in structs to match + types used in BSD. + (msgqnum_t): Define unsigned. + (msglen_t): Ditto. + (struct msqid_ds): Add msg_first and msg_last. + (struct msginfo): Remove msgpool. Add msgssz and msgseg. + * include/cygwin/sem.h: Use appropriate guard. #ifdef _KERNEL all stuff + not explicitely defined by SUSv3. Use signed types in structs to match + types used in BSD. + (SEM_UNDO): Define appropriately. + (struct semid_ds): Add sem_base. + (struct seminfo): Add semmap and semusz. + (SEM_A): New define from BSD. + (SEM_R): Ditto. + (SEM_ALLOC): Ditto. + (union semun): Define. + * include/cygwin/shm.h: Use appropriate guard. #ifdef _KERNEL all stuff + not explicitely defined by SUSv3. Use signed types in structs to match + types used in BSD. + (SHMLBA): Define using cygwin_internal(CW_GET_SHMLBA) call. + (struct shmid_ds): Add shm_internal. + (struct shm_info): Rename shm_ids to used_ids as in BSD. Add define + for shm_ids. + * include/cygwin/sysproto.h: New file. + * include/cygwin/version.h: Bump API minor number. + * include/sys/ipc.h: New file. + * include/sys/msg.h: New file. + * include/sys/queue.h: New file from BSD. + * include/sys/sem.h: New file. + * include/sys/shm.h: New file. + * include/sys/sysproto.h: New file. + +2003-11-19 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (build_fh_pc): Resurrect accidentally removed + DEV_CYGDRIVE_MAJOR case. + +2003-11-17 Brian Ford <ford@vss.fsi.com> + + * fhandler.cc (fhandler_base::lseek): Include high order offset + bits in return value. + +2003-11-17 Corinna Vinschen <corinna@vinschen.de> + + * bsdlib.cc (getprogname): New function. + (setprogname): New funtion. + * cygwin.din: Export getprogname and setprogname. + * include/cygwin/version.h: Bumb API version number. + +2003-11-15 Christopher Faylor <cgf@redhat.com> + + * include/limits.h: Revert unsanctioned changes below. + * include/cygwin/config.h: Ditto. + * include/sys/param.h: Ditto. + +2003-11-14 Robert Collins <rbtcollins@hotmail.com> + Ron Parker <rdparker@butlermfg.com> + + * bsdlib.cc: Update throughout to use CYG_MAX_PATH rather than MAX_PATH. + * cygheap.h: Ditto. + * dcrt0.cc: Ditto. + * delqueue.cc: Ditto. + * dlfcn.cc: Ditto. + * dll_init.cc: Ditto. + * dll_init.h: Ditto. + * dtable.cc: Ditto. + * environ.cc: Ditto. + * environ.h: Ditto. + * exceptions.cc: Ditto. + * external.cc: Ditto. + * fhandler_disk_file.cc: Ditto. + * fhandler_proc.cc: Ditto. + * fhandler_process.cc: Ditto. + * fhandler_raw.cc: Ditto. + * fhandler_registry.cc: Ditto. + * fhandler_socket.cc: Ditto. + * fhandler_virtual.cc: Ditto. + * miscfuncs.cc: Ditto. + * mmap.cc: Ditto. + * netdb.cc: Ditto. + * path.cc: Ditto. + * path.h: Ditto. + * pinfo.cc: Ditto. + * pinfo.h: Ditto. + * pthread.cc: Ditto. + * registry.cc: Ditto. + * shared.cc: Ditto. + * shared_info.h: Ditto. + * smallprint.c: Ditto. + * spawn.cc: Ditto. + * strace.cc: Ditto. + * syscalls.cc: Ditto. + * thread.h: Ditto. + * uinfo.cc: Ditto. + * winsup.h: Ditto. + * include/limits.h: Ditto. + * include/cygwin/config.h: Ditto. + * include/sys/param.h: Ditto. + +2003-11-12 Brian Ford <ford@vss.fsi.com> + + * dtable.cc (build_fh_pc): Use DEV_SERIAL_MAJOR to catch all serial + ports. Remove redundant FH_CYGDRIVE case since it is handled by + DEV_CYGDRIVE_MAJOR. + +2003-11-11 Christopher Faylor <cgf@redhat.com> + Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread::exit): Cleanup on thread exit. + (__reent_t::init_clib): Set thread local clib __cleanup var + appropriately. + +2003-11-10 Christopher Faylor <cgf@redhat.com> + + * miscfuncs.cc (low_priority_sleep): Make a "C" function. + * winsup.h (low_priority_sleep): Revert previous change to declaration. + +2003-11-10 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (low_priority_sleep): Fix declaration to avoid linker + warning. + +2003-11-10 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (__reent_t::init_clib): Set thread local clib + __sdidinit var appropriately. + +2003-11-08 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (ftruncate64): Log length as long long. + (logout): Erase ut_host. Don't write wtmp entry. Return 1 only + if matching utmp entry has been found, 0 otherwise. + +2003-11-08 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Add CW_GET_UID_FROM_SID and + CW_GET_GID_FROM_SID handling. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID. + +2003-11-07 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reorganize to + handle freeing of memory on error condition. + +2003-11-07 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::freerange): Set inuse count. Avoid setting + ev from h as h would be NULL at this point. + (cygthread::operator new): Issue debugging info when overflowing the + thread pool. + (cygthread::cygthread): Set ev from h here after h has been initialized. + +2003-11-06 Corinna Vinschen <corinna@vinschen.de> + + * bsdlib.cc (_vwarnx): New function. + (vwarn): Ditto. + (vwarnx): Ditto. + (warn): Ditto. + (warnx): Ditto. + (verr): Ditto. + (verrx): Ditto. + (err): Ditto. + (errx): Ditto. + * cygwin.din: Export above functions. + * include/err.h: New file. + * include/cygwin/version.h: Bump API minor number. + +2003-11-06 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (getshmlba): New function. + * external.cc (cygwin_internal): Add CW_GET_SHMLBA handling. + * mmap.cc (mmap64): Call getshmlba to evaluate granularity. + * winsup.h (getshmlba): Add declaration. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_SHMLBA. + +2003-11-06 Christopher Faylor <cgf@redhat.com> + + * winsup.h: Declare access_worker. + +2003-11-05 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h: Fix preprocessor guards for vm_offset_t and + vm_size_t. Add typedef for vm_object_t. + +2003-11-05 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Detect attempt + to open a directory which lacks read privileges. + +2003-11-04 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Add CW_GET_POSIX_SECURITY_ATTRIBUTE + handling. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_GET_POSIX_SECURITY_ATTRIBUTE. + + * exceptions.cc (init_global_security): Move from here... + * sec_helper.cc (init_global_security): ...to here. + +2003-11-04 Christopher Faylor <cgf@redhat.com> + + * net.cc (dup_ent): Use IsBadStringPtr for alignment checks. Don't use + a known bad pointer. + +2003-11-03 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (dup_ent): Move Win 95 misalignment recogition before + trying to evaluate string length. + +2003-10-31 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread::thread_init_wrapper): Initialize exception + handling. + +2003-10-31 Thomas Pfaff <tpfaff@gmx.net> + + Rename pthread::running to pthread::valid throughout. + + * thread.h: (pthread::suspend_all_except_self): New static method. + (pthread::resume_all): Ditto. + (pthread::suspend_except_self): New method. + (pthread::resume): Ditto. + * thread.cc (pthread::suspend_except_self): Implement. + (pthread::resume): Ditto. + +2003-10-29 Danny Smith <dannysmith@users.sourceforege.net> + + * include/stdint.h: Prevent signed->unsigned conversion for 32 and + 64 bit min value constants. + +2003-10-28 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * path.cc (dot_special_chars): New global variable. + (special_name): Make files ending in "." special. + (fnunmunge): Allow encoded ".". + (mount_item::fnmunge): Handle trailing ".". + +2003-10-28 Christopher Faylor <cgf@redhat.com> + + * include/stdint.h: Duplicate below effort for rest of *64_*. + +2003-10-28 Christopher Faylor <cgf@redhat.com> + + * include/stdint.h: Correctly define INT64_MAX. + +2003-10-27 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (fast_mutex::init): Initialize lock_counter. + +2003-10-27 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (OBSOLETE_FUNCTION): Add tmpfile. + (NEW_FUNCTIONS): Add _tmpfile64 -> tmpfile translation. + * cygwin.din: Export _tmpfile64 + * include/cygwin/version.h: Bump api minor number. + +2003-10-27 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add sem_close, sem_getvalue, sem_open and sem_timedwait. + * pthread.cc (+mangle_sem_name): New function. + (sem_open): Ditto. + (sem_close: Ditto. + (sem_timedwait): Ditto. + (sem_getvalue): Ditto. + * thread.cc (semaphore::semaphore): Rearrange member initialization. + Use appropriate security attribute for process shared semaphores. + (semaphore::semaphore): New constructor for named semaphores. + (semaphore::~semaphore): Care for semaphore name. + (semaphore::_post): Accommodate failing ReleaseSemaphore. Use value + returned by ReleaseSemaphore vor currentvalue. + (semaphore::_getvalue): New method. + (semaphore::_timedwait): Ditto. + (semaphore::_fixup_after_fork): Rearrange. Don't fail for process + shared semaphores. + (semaphore::open): New method. + (semaphore::timedwait): Ditto. + (semaphore::post): Fix return value. Set errno appropriately. + (semaphore::getvalue): New method. + * thread.h (class semaphore): Add prototypes for open, getvalue, + timedwait, _getvalue, _timedwait. Add prototypes for new constructor. + Add name member. + * include/semaphore.h: Add prototypes for sem_open, sem_close, + sem_timedwait and sem_getvalue. + include/cygwin/version.h: Bump API minor number. + +2003-10-27 Corinna Vinschen <corinna@vinschen.de> + + * miscfunc.cc (__check_invalid_read_ptr): New function. + * winsup.h: Declare. + +2003-10-26 Corinna Vinschen <corinna@vinschen.de> + + * security.h (cygpsid::debug_print): Avoid compiler warnings. + +2003-10-25 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (normalize_posix_path): Test runs of more than two + dots for being a run of only dots. Let it pass if not. + +2003-10-25 Brian Ford <ford@vss.fsi.com> + + * fhandler.cc (fhandler_base::ioctl): Handle FIONBIO. + +2003-10-24 Thomas Pfaff <tpfaff@gmx.net> + + Rename native_mutex to fast_mutex throughout. + Rename pthread_key::save_key_to_buffer to + pthread_key::_fixup_before_fork throughout. + Rename pthread_key::recreate_key_from_buffer to + pthread_key::_fixup_after_fork throughout. + + * thread.cc (native_mutex::init): Remove. + (native_mutex::lock): Ditto. + (native_mutex::unlock): Ditto. + (pthread::push_cleanup_handler): InterlockedExchangePointer + is not needed here. + (pthread_rwlock::pthread_rwlock): Initialize readers list mutex. + (pthread_rwlock::add_reader): Add reader via List_insert. + (pthread_rwlock::lookup_reader): Lock list while walking through. + (pthread_cond::init): Locking the init mutex is now void. + (pthread_rwlock::init): Ditto. + (pthread_mutex::init): Ditto. + * thread.h: Include security.h. + (fast_mutex): New class. Replacement for native_mutex. + (List_insert): New template function. + (List_remove): Ditto. + (List::List): Initialize synchronising mutex. + (List::fixup_after_fork): New method. + (List::insert): Add node via List_insert. + (List::remove): Remove node via List_remove. + (List::pop): Remove. + (List::for_each): Lock list while walking through. + (List::mx_init): New method. + (pthread_mutex::fixup_after_fork): Fixup mutex list after fork. + (pthread::fixup_after_fork): Ditto. + (pthread_conds::fixup_after_fork): Ditto. + (pthread_rwlock::fixup_after_fork): Ditto. + (semaphore::fixup_after_fork): Ditto. + (pthread_rwlock::readers_mx): New member. + +2003-10-24 Brian Ford <ford@vss.fsi.com> + + * fhandler.cc (fhandler_base::fcntl): Don't clobber O_APPEND when + both O_NONBLOCK/O_NDELAY are set for F_SETFL. + +2003-10-24 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (win32_device_name): Fix comment. + +2003-10-23 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set return + value in FIONBIO case. + +2003-10-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Use new device code + to get major and minor device numbers. Fix size evaluation. + +2003-10-22 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Add CW_GET_ERRNO_FROM_WINERROR + handling. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_GET_ERRNO_FROM_WINERROR. + +2003-10-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add $(LIBSERVER) rule. + * cygserver.h: Moved from include/cygwin to here. + * cygserver_ipc.h: Moved from ../cygserver to here. + * cygserver_shm.h: Ditto. + * cygwin.din: Add shmat, shmctl, shmdt and shmget. + * fhandler_tty.cc (fhandler_tty_slave::open): Don't warn about handle + dup'ing if not build with USE_SERVER. + * shm.cc: Include cygerrno.h unconditionally. + (shmat): Set errno to ENOSYS and return -1 if not build with + USE_SERVER. + (shmctl): Ditto. + (shmdt): Ditto. + (shmget): Ditto. + * woutsup.h: Remove. + * include/cygwin/cygserver_process.h: Moved to ../cygserver directory. + * include/cygwin/cygserver_transport.h: Ditto. + * include/cygwin/cygserver_transport_pipes.h: Ditto. + * include/cygwin/cygserver_transport_sockets.h: Ditto. + * include/cygwin/version.h: Bump API minor number. + +2003-10-16 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (seteuid32): Always construct a default DACL including + the new sid, Admins and SYSTEM and copy it to the new thread token. + * security.cc (create_token): Use a NULL default DACL in NtCreateToken. + +2003-10-14 Micha Nelissen <M.Nelissen@student.tue.nl> + + * dcrt0.cc: Remove local variable alternate_charset_active. + * fhandler.h: Add variable alternate_charset_active, functions + str_to_con, con_to_str to dev_console structure. + * fhandler_console.cc (con_to_str): Move function into dev_console + class. + (str_to_con): Ditto. + (fhandler_console::read): Call con_to_str on dev_state. + (fhandler_console::write_normal): Call str_to_con on dev_state. + (fhandler_console::char_command): Change active_charset_active + assignment to be on dev_state. + * winsup.h: Remove global external variable alternate_charset_active. + +2003-10-13 Micha Nelissen <M.Nelissen@student.tue.nl> + + * fhandler_console.cc (char_command): Add escape sequence for codepage + ansi <-> oem switching for ncurses frame drawing capabilities. + * dcrt0.cc: Add local variable alternate_charset_active. + * winsup.h: Add global external variable alternate_charset_active. + +2003-10-14 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (ctrl_c_handler): Don't send SIGHUP on + CTRL_LOGOFF_EVENT to processes running in invisible Windows Stations. + * window.cc (has_visible_window_station): New function. + * winsup.h: Add declaration for has_visible_window_station. + +2003-10-10 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Don't create a new window + station if one already exists. + +2003-10-10 Christopher Faylor <cgf@redhat.com> + + * shared.cc (shared_info::initialize): Remove myself check since + hMainProc initialization will allow user initialization to work. + +2003-10-09 Yitzchak Scott-Thoennes <sthoenna@efn.org> + + * include/sys/mman.h (MAP_FAILED): Define as void *. + +2003-10-08 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (hMainProc): Initialize to useful value for use when dll is + dynamically loaded. + * shared.cc (shared_info::initialize): Don't initialize user stuff if + myself doesn't exist. + +2003-10-08 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink): Don't even try DELETE_ON_CLOSE technique on + systems not supporting it. + +2003-10-02 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dll_crt0_1): Call newlib __sinit routine to ensure that + stdio buffers are initialized to avoid thread initialization races. + +2003-10-01 Christopher Faylor <cgf@redhat.com> + + * path.cc (win32_device_name): Only fill out destination buffer when + it's really a device. + +2003-09-30 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add YA method for generating devices.cc. + * child_info.h: YA update of another magic number. + * gendevices: New file. + * devices.in: New file. + * devices.cc: Regenerate. + * devices.shilka: Remove. + * devices.h: Correctly define device pointers. + (device): Remove now obsolete fields. + (device::native): Renamed from device::fmt. + * dtable.cc (build_fh_dev): Simplify in light of new unit parsing + scheme. + (build_fh_pc): Ditto. + * path.cc (win32_device_name): Ditto. + * fhandler.h (fhandler_base::get_native_name): Reflect renaming of fmt + to native. + * fhandler_tty.cc (fhandler_tty_mster::init): Initialize slave device + prior to reporting unit. + +2003-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fstat): Drop FH_FLOPPY case. + +2003-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_raw): Add method fstat. + * fhandler_raw.cc (fhandler_dev_raw::fstat): New method. + +2003-09-30 Corinna Vinschen <corinna@vinschen.de> + + * devices.h (enum fh_devices): Remove DEV_RAWDRIVE_MAJOR and + FH_RAWDRIVE. + * devices.shilka (dev_rawdrive_storage): Remove. + (unit_devices): Remove pointer to dev_rawdrive_storage. + (uniq_devices): Remove rawdrive entry. + * dtable.cc (build_fh_pc): Remove DEV_RAWDRIVE_MAJOR case. + * path.cc (win32_device_name): ditto. + +2003-09-29 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc (vsyslog): Print debug message if ReportEventA fails. + +2003-09-28 Pierre Humblet <pierre.humblet@ieee.org> + + * sigproc.cc (proc_subproc): Restrict permissions on ppid_handle. + +2003-09-28 Christopher Faylor <cgf@redhat.com> + + * devices.shilka (device::parse): Restore check for tty in unit + handling, but without the previous typo. + * devices.cc: Regenerate. + * devices.h (DEV_CYGDRIVE_MAJOR): Change major number to one used by + linux for "user-mode virtual block device". + +2003-09-28 Corinna Vinschen <corinna@vinschen.de> + + * devices.h: Move a few device major numbers. Fix typo of FH_UDP. + * device.shilka: Remove /dev/hd device entries, rename all device_hd* + to device_sd*. + (device::parse): Disallow units outside lower and upper bounds. + * dtable.cc (build_fh_pc): Fix typo of FH_UDP. + * path.cc (win32_device_name): Fix win32 name creation to match new + device handling. + +2003-09-27 Christopher Faylor <cgf@redhat.com> + + * device.shilka (device::parse): Allow units on other than tty. + +2003-09-27 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincapc::init): Allow requesting server info for NT4 SP6. + +2003-09-27 Christopher Faylor <cgf@redhat.com> + + * path.cc (symlink_info::check): Use new introducer for mknod'ed files. + (parse_device): Ditto. + * syscalls.cc (mknod_worker): Ditto. + +2003-09-27 Christopher Faylor <cgf@redhat.com> + + * devices.shilka: Add /dev/sda disk devices. + * devices.cc: Regenerate. + +2003-09-27 Christopher Faylor <cgf@redhat.com> + + * cygwin-shilka: Remove '#line directives' or suffer debugging oddities. + Use -length option so that device prefixes are used. + * devices.cc: Regenerate. + * syscalls.cc (ttyname): Add debugging output. + +2003-09-26 Vaclav Haisman <V.Haisman@sh.cvut.cz> + + * wincap.h (wincaps::is_server): New flag. + (wincapc::version): Change type to OSVERSIONINFOEX. + (wincapc::is_server): New function. + * wincap.cc (wincap_unknown::is_server): New initializer. + (wincap_95): Ditto. + (wincap_95osr2): Ditto. + (wincap_98): Ditto. + (wincap_me): Ditto. + (wincap_nt3): Ditto. + (wincap_nt4): Ditto. + (wincap_nt4sp4): Ditto. + (wincap_2000): Ditto. + (wincap_xp): Ditto. + (wincapc::init): Adapt to OSVERSIONINFOEX. Add detection of NT server + systems. + * sched.cc: Include windows.h and registry.h. + (sched_rr_get_interval): Re-implement for NT systems. + +2003-09-26 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::ioctl): Properly set + ioctl_request event when window size changes. Store failing errno in + ioctl_retval (needed?). + +2003-09-26 Pavel Tsekov <ptsekov@gmx.net> + + * fhandler_console.c (fhandler_console::read): Record the state of the + SHIFT, CTRL and ALT keys at the time of the last keyboard input event. + (fhandler_console::ioctl): Handle requests to retrieve the keyboard + modifiers via the TIOCLINUX command. + * fhandler_tty.c (fhandler_tty_slave::read): Ditto. + * include/sys/termios.h (TIOCLINUX): New macro definition. + +2003-09-26 Pierre Humblet <pierre.humblet@ieee.org> + + * pinfo.cc (pinfo::init): Do not give FILE_MAP_WRITE access to Everybody. + * exceptions.cc (sig_handle_tty_stop): Do not create pinfo parent with + PID_MAP_WRITE. + * fhandler_process.cc (fhandler_process::fill_filebuf): Ditto for pinfo p. + * signal.cc (kill_worker): Ditto for pinfo dest. + +2003-09-26 Pierre Humblet <pierre.humblet@ieee.org> + + * pinfo.h (pinfo::set_acl): Declare. + * pinfo.cc (pinfo_fixup_after_fork): Duplicate with no rights. + (pinfo::set_acl): New. + * spawn.cc (spawn_guts): Call myself.set_acl. + +2003-09-26 Pierre Humblet <pierre.humblet@ieee.org> + + * uinfo.cc (cygheap_user::init): Make sure the current user appears + in the default DACL. Rearrange to decrease the indentation levels. + Initialize the effec_cygsid directly. + (internal_getlogin): Do not reinitialize myself->gid. Open the process + token with the required access. + * cygheap.h (class cygheap_user): Delete members pid and saved_psid. + Create members effec_cygsid and saved_cygsid. + (cygheap_user::set_sid): Define inline. + (cygheap_user::set_saved_sid): Ditto. + (cygheap_user::sid): Modify. + (cygheap_user::saved_sid): Modify. + * cygheap.cc (cygheap_user::set_sid): Delete. + (cygheap_user::set_saved_sid): Ditto. + * sec_helper.cc (sec_acl): Set the correct acl size. + * autoload.cc (FindFirstFreeAce): Add. + * security.h: Define ACL_DEFAULT_SIZE. + +2003-09-26 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (munmap): Use correct address and length parameters when + calling fhandler's munmap. + +2003-09-26 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Set errno to E2BIG if command line is + longer than CreateProcess allows (32K). + +2003-09-25 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (build_fh_name): Return pointer to a 'nodevice' rather than + a NULL pointer or suffer SEGVs with invalid paths. + +2003-09-25 Christopher Faylor <cgf@redhat.com> + + * fork.cc (fork_parent): Detect failed pinfo constructor. + * spawn.cc (spawn_guts): Don't overwrite ENOMEM errno on failed pinfo + constructor. + +2003-09-25 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawnve): Remove vfork short circuit and let caller deal + with error return. + +2003-09-25 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawn_guts): Catch potential error from pinfo.remember. + Change debug messages to make sense. Pass correct value to pinfo + constructor. Ensure cleanup after errors. Always reimpersonate after + errors. + +2003-09-25 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawn_guts): Move system signal handling stuff after + CreateProcess error check. + +2003-09-25 Pierre Humblet <pierre.humblet@ieee.org> + + * shared_info.h: Update CURR_USER_MAGIC, CURR_SHARED_MAGIC and + SHARED_INFO_CB. + (mount_info::cb): Delete. + (mount_info::version): Delete. + (shared_info::delqueue): Delete. + * Makefile.in: Do magic for USER_MAGIC, class user_info, instead + of for mount_info. + +2003-09-24 Christopher Faylor <cgf@redhat.com> + + * include/tzfile.h: Add some missing entries. + +2003-09-24 Christopher Faylor <cgf@redhat.com> + + * include/paths.h: Add some missing entries. + +2003-09-24 Christopher Faylor <cgf@redhat.com> + + * shared_info.h (CURR_MOUNT_MAGIC): Fix. + + * sigproc.cc (sigpacket): New structure. + (sig_send): Fill out sigpacket structure to send to signal thread + rather than racily sending separate packets. + (wait_sig): Use sigpacket structure to receive info from signal sender. + +2003-09-24 Pierre Humblet <pierre.humblet@ieee.org> + + * shared_info.h (class user_info): New. + (cygwin_user_h): New. + (user_shared): New. + (enum shared_locations): Replace SH_MOUNT_TABLE by SH_USER_SHARED; + (mount_table): Change from variable to macro. + * shared.cc: Use sizeof(user_info) in "offsets". + (user_shared_initialize): Add "reinit" argument to indicate need + to reinitialize the mapping. Replace "mount_table" by "user_shared" + throughout. Call user_shared->mountinfo.init and + user_shared->delqueue.init. + (shared_info::initialize): Do not call delqueue.init. + (memory_init): Add argument to user_shared_initialize. + * child_info.h (child_info::mount_h): Delete. + (child_info::user_h): New. + * sigpproc.cc (init_child_info): Use user_h instead of mount_h. + * dcrt0.cc (_dll_crt0): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::close): Use + user_shared->delqueue instead of cygwin_shared->delqueue. + * fhandler_virtual.cc (fhandler_virtual::close): Ditto. + * syscalls.cc (close_all_files): Ditto. + (unlink): Ditto. + (seteuid32): Add argument to user_shared_initialize. + +2003-09-24 Christopher Faylor <cgf@redhat.com> + + * devices.cc: New file. + * devices.gperf: New file. + * devices.shilka: New file. + * cygwin-gperf: New file. + * cygwin-shilka: New file. + * fhandler_fifo.cc: New file. + * fhandler_nodevice.cc : New file. + +2003-09-24 Christopher Faylor <cgf@redhat.com> + + Reorganize headers so that path.h precedes fhandler.h throughout. + Remove device argument and unit arguments from fhandler constructors + throughout. Remove pc arguments to fhandler functions and use internal + pc element instead, throughout. Use dev element in pc throughout. Use + major/minor elements rather than units and device numbers previously in + fhandler class. Use correct methods for fhandler file names rather + than directly accessing file name variables, throughout. + * Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o + * dcrt0.cc (dll_crt0_1): Call device::init. + * devices.h: Renumber devices based on more Linux-like major/minor + numbers. Add more devices. Declare standard device storage. + (device): Declare struct. + * dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_* + type. + * dtable.cc (dtable::get_debugger_info): Ditto. + (cygwin_attach_handle_to_fd): Ditto. + (dtable::release): Remove special FH_SOCKET case in favor of generic + "need_fixup_before" test. + (dtable::init_std_file_from_handle): Use either build_fh_dev or + build_fh_name to build standard fhandler. + (dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name. + Move out of dtable class. Don't accept a path_conv argument. Just + build it here and pass it to: + (build_fh_pc): Renamed from dtable::build_fhandler. Move out of dtable + class. Use intrinsic device type in path_conv to create new fhandler. + (build_fh_dev): Renamed from dtable::build_fhandler. Move out of + dtable class. Simplify arguments to just take new 'device' type and a + name. Just return pointer to fhandler rather than trying to insert + into dtable. + (dtable::dup_worker): Accommodate above build_fh name changes. + (dtable::find_fifo): New (currently broken) function. + (handle_to_fn): Use strechr for efficiency. + * dtable.h: Reflect above build_fh name changes and argument + differences. + (fhandler_base *&operator []): Return self rather than copy of self. + * fhandler.cc (fhandler_base::operator =): Use pc element to set + normalized path. + (fhandler_base::set_name): Ditto. + (fhandler_base::raw_read): Use method to access name. + (fhandler_base::write): Correctly use get_output_handle rather than + get_handle. + (handler_base::device_access_denied): New function. + (fhandler_base::open): Eliminate pc argument and use pc element of + fhandler_base throughout. + (fhandler_base::fstat): Detect if device is based in filesystem and use + fstat_fs to calculate stat, if so. + (fhandler_base::fhandler_base): Eliminate handling of file names and, + instead, just free appropriate component from pc. + (fhandler_base::opendir): Remove path_conv parameter. + * fhandler.h: Remove all device flags. + (fhandler_base::pc): New element. + (fhandler_base::set_name): Change argument to path_conv. + (fhandler_base::error): New function. + (fhandler_base::exists): New function. + (fhandler_base::pc_binmode): New function. + (fhandler_base::dev): New function. + (fhandler_base::open_fs): New function. + (fhandler_base::fstat_fs): New function. + (fhandler_base::fstat_by_name): New function. + (fhandler_base::fstat_by_handle): New function. + (fhandler_base::isfifo): New function. + (fhandler_base::is_slow): New function. + (fhandler_base::is_auto_device): New function. + (fhandler_base::is_fs_special): New function. + (fhandler_base::device_access_denied): New function. + (fhandler_base::operator DWORD&): New operator. + (fhandler_base::get_name): Return normalized path from pc. + (fhandler_base::get_win32_name): Return windows path from pc. + (fhandler_base::isdevice): Renamed from is_device. + (fhandler_base::get_native_name): Return device format. + (fhandler_fifo): New class. + (fhandler_nodevice): New class. + (select_stuff::device_specific): Remove array. + (select_stuff::device_specific_pipe): New class element. + (select_stuff::device_specific_socket): New class element. + (select_stuff::device_specific_serial): New class element. + (select_stuff::select_stuff): Initialize new elements. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base + class from fhandler_disk_file. + (fhandler_base::fstat_by_name): Ditto. + (fhandler_base::fstat_by_name): Ditto. + (fhandler_disk_file::open): Move most functionality into + fhandler_base::open_fs. + (fhandler_base::open_fs): New function. + (fhandler_disk_file::close): Move most functionality into + fhandler_base::close_fs. + (fhandler_base::close_fs): New function. + * fhandler_mem.cc (fhandler_dev_mem::open): Use device name in + debugging output. + * fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy + standard urandom device into appropriate place. + (fhandler_socket::accept): Reflect change in fdsock return value. + * fhandler_tty.cc: See "throughouts" above. + * net.cc: Accommodate fdsock change throughout. + (fdsock): Return success or failure, accept fd argument and device + argument. + * path.cc (symlink_info::major): New element. + (symlink_info::minor): New element. + (symlink_info::parse_device): Declare new function. + (fs_info::update): Accommodate changes in path_conv class. + (path_conv::fillin): Ditto. + (path_conv::return_and_clear_normalized_path): Eliminate. + (path_conv::set_normalized_path): New function. + (path_conv::path_conv): Set info in dev element. Use path_conv methods + Check for FH_FS rather than FH_BAD to indicate when to fill in + filesystem stuff. where appropriate rather than direct access. Use + set_normalized_path to set normalized path. + (windows_device_names): Eliminate. + (get_dev): Ditto. + (get_raw_device_number): Ditto. + (get_device_number): Ditto. + (win32_device_name): Call new device name parser to do most of the + heavy lifting. + (mount_info::conv_to_win32_path): Fill in dev field as appropriate. + (symlink_worker): Handle new device files. + (symlink_info::check): Ditto. + (symlink_info::parse_device): Define new function. + * path.h (executable_states): Move here from fhandler.h. + (fs_info): Rename variables to *_storage and create methods for + accessing same. + (path_conv): Add dev element, remove devn and unit and adjust inline + methods to accommodate. + (set_normalized_path): Declare new function. + * pinfo.cc (_pinfo::commune_recv): Add broken support for handling + fifos. + (_pinfo::commune_send): Ditto. + * pipe.cc (fhandler_pipe::close): check for existence of handle before + closing it. + (handler_pipe::create): Rename from make_pipe. Change arguments to + accept fhandler_pipe array. Accommodate fifos. + (pipe): Rework to deal with fhandler_pipe::create changes. + (_pipe): Ditto. + * select.cc: Use individual device_specific types throughout rather + than indexing with obsolete device number. + (set_bits): Use is_socket call rather than checking device number. + * shared_info.h (CURR_MOUNT_MAGIC): Update. + (conv_to_win32_path): Reflect addition of device argument. + * syscalls.cc (mknod_worker): New function. + (open): Use build_fh_name to build fhandler. + (chown_worker): Detect if this is an 'auto' device rather than an + on-filesystem device and handle appropriately. + (chmod_device): New function. + (chmod): Detect if this is an 'auto' device rather than an + on-filesystem device and handle appropriately. Use chmod_device to set + mode of in-filesystem devices. + (stat_worker): Eliminate path_conv argument. Call build_fh_name to + construct fhandler. Use fh->error() rather than pc->error to detect + errors in fhandler construction. + (access_worker): New function pulled from access. Accommodate + in-filesystem devices. + (access): Use access_worker. + (fpathconf): Detect if this is an 'auto' device rather than an + on-filesystem device and handle appropriately. + (mknod_worker): New function. + (mknod32): New function. + (chroot): Free normalized path -- assuming it was actually cmalloced. + * tty.cc (create_tty_master): Tweak for new device class. + (tty::common_init): Ditto. + * winsup.h (stat_worker): Remove. + (symlink_worker): Declare. + + * exceptions.cc (set_process_mask): Just call sig_dispatch_pending and + don't worry about pending_signals since sig_dispatch_pending should + always do the right thing now. + (sig_handle): Reorganize SIGCONT handling to more closely conform to + SUSv3. + * pinfo.h: Move __SIG enum to sigproc.h. + (PICOM_FIFO): New enum element. + (_pinfo): Remove 'thread2signal' stuff throughout class. + (_pinfo::commune_send): Make varargs. + (_pinfo::sigtodo): Eliminate. + (_pinfo::thread2signal): Ditto. + * signal.cc (kill_worker): Eliminate call to setthread2signal. + * sigproc.cc (local_sigtodo): Eliminate. + (getlocal_sigtodo): Ditto. + (sigelem): New class. + (pending_signals): New class. + (sigqueue): New variable, start of sigqueue linked list. + (sigcatch_nonmain): Eliminate. + (sigcatch_main): Eliminate. + (sigcatch_nosync): Eliminate. + (sigcomplete_nonmain): Eliminate. + (pending_signals): Eliminate. + (sig_clear): Call signal thread to clear pending signals, unless + already in signal thread. + (sigpending): Call signal thread to get pending signals. + (sig_dispatch_pending): Eliminate use of pending_signals and just check + sigqueue. + (sigproc_terminate): Eliminate all of the obsolete semaphore stuff. + Close signal pipe handle. + (sig_send): Eliminate all of the obsolete semaphore stuff and use pipe + to send signals. + (getevent): Eliminate. + (pending_signals::add): New function. + (pending_signals::del): New function. + (pending_signals::next): New function. + (wait_sig): Eliminate all of the obsolete semaphore stuff. Use pipe to + communicate and maintain a linked list of signals. + * sigproc.h: Move __SIG defines here. Add __SIGPENDING. + (sig_dispatch_pending): Remove "C" specifier. + (sig_handle): Accept a mask argument. + * thread.cc: Remove signal handling considerations throughout. + +2003-09-22 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (do_exit): Eliminate "C" linkage. Call events_terminate + early. + (exit_states): Move out of source file into header file. + * winsup.h: Move exit_states here. Remove "C" linkage from do_exit + declaration. + * debug.cc (lock_debug): Remove explicit (and incorrect) external for + exit_state. + * sigproc.cc (sig_dispatch_pending): Don't flush signals if exiting. + +2003-09-20 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (pthread_cleanup): New struct. + (do_cleanup): New function. + (spawn_guts): Initialize struct for pthread_cleanup handling to ensure + proper restoration of signals if/when thread is cancelled. Restore + settings using pthread_cancel_pop. + +2003-09-19 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 6. + +2003-09-19 Christopher Faylor <cgf@redhat.com> + + * thread.h (__reent_t::init_clib): Declare new function. + * thread.cc (__reent_t::init_clib): Define new function. + (pthread::thread_init_wrapper): Use __reent_t::init_clib to init local + clib storage and set std{in,out,err} appropriately. + +2003-09-19 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (system): Strip signal considerations from here so that + they are not inherited by a child process. + * spawn.cc (spawn_guts): Handle system() signal stuff here. + * winsup.h (_P_SYSTEM): Define. + +2003-09-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): + Handle buf == NULL as flushing the buffer. + (fhandler_tty_slave::read): Handle ptr == NULL as flushing the buffer. + (fhandler_tty_slave::tcflush): Implement input queue flushing by + calling read with NULL buffer. + (fhandler_pty_master::tcflush): Ditto, calling process_slave_output. + * termios.cc (tcflush): Check for legal `queue' value. Return + EINVAL otherwise. + +2003-09-16 Brian Ford <ford@vss.fsi.com> + + * syscalls.cc (gethostid): Add lpFreeBytesAvailable argument to + GetDiskFreeSpaceEx call since NT4 requires it. + +2003-09-16 Christopher Faylor <cgf@redhat.com> + + * fhandler_process.cc (fhandler_process::fill_filebuf): Open pinfo with + PID_MAP_RW. + * sigproc.cc (talktome): Ditto for winpids. + +2003-09-16 Christopher Faylor <cgf@redhat.com> + + * pinfo.h (winpids::pid_access): New element. + (winpids::winpids): Rejigger to set pinfo_access. + * pinfo.cc (winpids::add): Try to open shared memory region with + supplied pinfo_access first, then default to readonly. + * fhandler_termios.cc (tty_min::kill_pgrp): When getting list of pids + to work with, suggest opening with PID_MAP_RW. + * signal.cc (kill_pgrp): Ditto. + * sigproc.cc (sig_send): Perform a write check on todo prior to + attempting to increment it. Return EACCES if we can't write to it. + +2003-09-16 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_user::set_saved_sid): Rename from set_orig_sid. + * cygheap.h (class cygheap_user): Rename orig_psid, orig_uid and + orig_gid to saved_psid, saved_uid and saved_gid respectively. + Rename methods orig_sid and set_orig_sid to saved_sid and set_saved_sid + respectively. + * sec_helper.cc (sec_acl): Accommodate above changes. + * spawn.cc (spawn_guts): Ditto. + * uinfo.cc (uinfo_init): Ditto. + +2003-09-15 Christopher Faylor <cgf@redhat.com> + + * getopt.c (opterr): Reinstate initialization. + (optind): Ditto. + (optopt): Ditto. + * pinfo.cc: Include cygheap.h or suffer compile error. + * shared.h: Reset magic number. + +2003-09-15 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle_tty_stop): Fix boneheaded mistake by using + correct check for parent state rather than inverted check. + +2003-09-15 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h (__sec_user): Add "access2" argument. + (sec_acl): Add "original" and "access2" arguments. + (sec_user): Add "sid2" and "access2" argument. Remove dependence on + allow_ntsec. + (sec_user_nih): Ditto. + * sec_helper.cc (__sec_user): Add "has_security" test. + Call sec_acl with new arguments, letting it handle original_sid. + (sec_acl): Add "original" and "access2" arguments. Handle original_sid + depending on flag but avoiding duplicates. Use "access2" for sid2. + * pinfo.cc (pinfo::init): Use security attributes created by sec_user + when creating the mapping. + * security.cc (create_token): Adjust arguments in call to sec_acl. + Call sec_user instead of __sec_user. + * syscall.cc (seteuid32): Adjust arguments in call to sec_acl. Remove + now unnecessary test. Remove useless conversions to psid. + * dcrt0.cc (dll_crt0_1): Call cygsid::init before pinfo_init. + +2003-09-13 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Make malloc_wrapper -fomit-frame-pointer. + + * cygwin.din: Remove extraneous mallinfo definition. + + * dcrt0.cc (quoted): Use strechr for efficiency. + + * fhandler.cc (fhandler_base::write): Correctly use get_output_handle + rather than get_handle. + (fhandler_base::lseek): Use method for accessing name in debug output. + +2003-09-13 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (path_conv::ndisk_links): Fix potential + off-by-one problem when first file in a directory is a directory. + +2003-09-13 Pierre Humblet <pierre.humblet@ieee.org> + + * include/sys/cygwin.h: Rename PID_UNUSED to PID_MAP_RW. + * pinfo.cc (pinfo_init): Initialize myself->gid. + (pinfo::init): Create the "access" variable, set it appropriately and + use it to specify the requested access. + * exceptions.cc (sig_handle_tty_stop): Add PID_MAP_RW in pinfo parent. + * signal.cc (kill_worker): Ditto for pinfo dest. + * syscalls.cc (setpgid): Ditto for pinfo p. + +2003-09-13 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 5. + +2003-09-12 Christopher Faylor <cgf@redhat.com> + + * thread.cc (MTinterface::fixup_after_fork): Remove code which + potentially overwrote _impure pointer with contents of thread which + invoked fork since this eliminates important information like the + pointer to the atexit queue. + +2003-09-12 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (path_conv::ndisk_links): Fix problem where + search characters overwrote the path instead of being tacked on the + end. + +2003-09-12 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (_dll_crt0): Accommodate breaking apart of early_stuff_init. + * exceptions.cc (early_stuff_init): Delete. + (init_console_handler): New function - top half of early_stuff_init. + (init_global_security): New function - bottom half of early_stuff_init. + (sig_handle): Avoid special hExeced test for SIGINT. Just terminate + the captive process. + (signal_exit): Add debugging output. + * fhandler_tty.cc (fhandler_tty_slave::open): Don't allocate a console + if one already seems to exist. Properly initialize ctrl-c handling if + we do allocate a console. + * winsup.h (early_stuff_init): Delete declaration. + (init_console_handler): New declaration. + (init_global_security): New declaration. + +2003-09-11 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (path_conv::ndisk_links): Rename from + num_entries. Accept an argument and calculate any extra links needed + based on missing . and .. entries. + (fhandler_disk_file::fstat_helper): Always call pc->ndisks_links() to + calculate the number of links. + * path.h (path_conv::ndisk_links): Declare. + +2003-09-11 Christopher Faylor <cgf@redhat.com> + + * path.cc (normalize_posix_path): Put check for '//' prefix back to + denote a UNC path. + (slash_unc_prefix_p): Remove vestige of old //c method for accessing + drives. + +2003-09-11 Christopher Faylor <cgf@redhat.com> + + * dir.cc (rmdir): Add more samba workarounds. + +2003-09-11 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (user_shared_initialize): Revert length attribute for name + variable to be just UNLEN + 1. + +2003-09-10 Pierre Humblet <pierre.humblet@ieee.org> + + * shared_info.h (shared_info::initialize): Remove argument. + * cygheap.h (cygheap_user::init): New declaration. + * uinfo.cc (cygheap_user::init): New. + (internal_getlogin): Move functionality to cygheap_user::init. Open + the process token to update the group sid. + * shared.cc (user_shared_initialize): Get the user information from + cygheap->user. + (shared_info::initialize): Remove argument. Call cygheap->user.init + instead of cygheap->user.set_name. + (memory_init): Do not get the user name and do not pass it to + shared_info::initialize. + * registry.cc (get_registry_hive_path): Make csid a cygpsid. + (load_registry_hive): Ditto. + +2003-09-10 Christopher Faylor <cgf@redhat.com> + + * fhandler_disk_file.cc (num_entries): Take . and .. into account if + they do not exist since cygwin simulates them. + (fhandler_cygdrive::fstat): Ditto. + (fhandler_cygdrive::readdir): Don't do any specific tests on + __d_position when seeing if a drive exists. + +2003-09-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add getopt.o and iruserok.o. + * cygwin.din: Export __check_rhosts_file, __rcmd_errstr, optarg, + opterr, optind, optopt, optreset, getopt, getopt_long, iruserok + and ruserok. + * getopt.c: Moved from lib to here. Define opt* variables as + dllexport. + * iruserok.c: Moved from lib to here. Rearrange function order. + Prefer using 64/32 bit functions. + * syscalls.cc (shell_fp): Define as struct __sFILE64. + (getusershell): Use fopen64 instead of fopen. + * winsup.h: Add declarations for seteuid32, fopen64, + cygwin_gethostbyname and cygwin_inet_addr. + * include/getopt.h: Declare opt* variables dllimport. + * include/cygwin/version.h: Bump API minor number. + +2003-09-10 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle_tty_stop): Check parent PID_NOCLDSTOP + rather than erroneously checking *my own* sigtodo. + +2003-09-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add some more -fomit-frame-pointer files. + + * path.cc (conv_path_list_buf_size): Free normalized_path or suffer + memory leak. + * syscalls.cc (chroot): Ditto. + +2003-09-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add bsdlib.o. + * autoload.cc (RegisterServiceProcess): Add. + * bsdlib.cc: New file. + (daemon): New function. + (login_tty): Ditto. + (openpty): Ditto. + (forkpty): Ditto. + * cygwin.din: Export daemon, forkpty, login_tty, logwtmp, updwtmp, + openpty and revoke. + * syscalls.cc (updwtmp): New function, writing to wtmp exclusively. + (logwtmp): Ditto. + (login): Call updwtmp instead of writing to wtmp by itself. + (logout): Ditto. + * tty.cc (revoke): New funtion. + * include/paths.h: Define _PATH_DEVNULL. + * include/pty.h: New header. + * include/cygwin/version.h: Bump API minor number. + * include/sys/utmp.h: Declare logwtmp with const arguments. + Declare updwtmp. + * lib/iruserok.c: New file. + (ruserok): New function. + (iruserok): Ditto. + (__ivaliduser): Ditto. + (__icheckhost): Ditto. + +2003-09-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::fstat): Don't use PC_POSIX. + +2003-09-09 Pierre Humblet <pierre.humblet@ieee.org> + + * shared_info.h: Include security.h. + (open_shared): Add psa argument. + (user_shared_initialize): New declaration. + * security.h: Add _SECURITY_H guard. + (sec_user): Use sec_none in the no ntsec case. + * spawn.cc (spawn_guts): Remove call to load_registry_hive. + * syscalls (seteuid32): If warranted, call load_registry_hive, + user_shared_initialize and RegCloseKey(HKEY_CURRENT_USER). + * shared.cc (user_shared_initialize): New. + (open_shared): Add and use psa argument. + (memory_init): Move mount table initialization to + user_shared_initialize. Call it. + +2003-09-09 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Change address types from caddr_t to void * + according to SUSv3. + (mmap): Ditto. + (munmap): Ditto. + (msync): Ditto. + (mprotect): Ditto. Move to before the fhandler methods. + * include/sys/mman.h: Change prototypes accordingly. + +2003-09-08 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely + know to be set. + * exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since + it is reset automatically. + * fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP. + * include/sys/cygwin.h: Ditto. + * sigproc.cc (sig_send): Use sigframe init method to set frame since it + checks for previous ownership of the frame. + * sigproc.h (sigframe::init): Accept an "is_exception" argument. + +2003-09-08 Christopher Faylor <cgf@redhat.com> + + * dir.cc (readdir): Reinstate setting of old ino field for legacy + applications. + * dirent.h (dirent): Rename unused field to __ino32. + +2003-09-08 Christopher Faylor <cgf@redhat.com> + + * passwd.cc (getpwnam_r): Initialize pw_comment field. + +2003-09-08 Christopher Faylor <cgf@redhat.com> + + * passwd.cc (getpwuid_r32): Initialize pw_comment field. + +2003-09-08 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig_inited): Remove assertion since it is racy. + +2003-09-08 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export endusershell, getusershell and setusershell. + * syscalls.cc (getusershell): New function. + (setusershell): Ditto. + (endusershell): Ditto. + * include/cygwin/version.h: Bump API minor number. + +2003-09-08 Nicholas Wourms <nwourms@netscape.net> + + * cygwin.din: Export argz_add argz_add_sep argz_append argz_count + argz_create argz_create_sep argz_delete argz_extract argz_insert + argz_next argz_replace argz_stringify envz_add envz_entry envz_get + envz_merge envz_remove envz_strip + * include/cygwin/version.h: Bump api minor number. + +2003-09-07 Christopher Faylor <cgf@redhat.com> + + Throughout, remove __d_u.__d_data fields from DIR structure. + * include/sys/dirent.h (dirent): Remvoe old_d_ino. + (DIR): Make __d_dirhash a 64 bit value. Remove __d_data and __d_u. + Add __flags. + * dir.cc (opendir_states): New enum. + (opendir): Clear new DIR __flags field. + (readdir): Fill in '.' and '..' entries if we hit EOF and we haven't + seen them already. Nuke setting of old_d_ino. + (rewinddir): Reset DIR __flags field. + (seekdir64): Ditto. + * fhandler_disk_file.cc (fhandler_cygdrive::fhandler_cygdrive): Remove + special handling of "." and ".." since they are now handled + automatically. + +2003-09-07 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/in.h: Don't define ipv6 stuff unless we call for it + specifically since it isn't really implemented yet. + +2003-09-07 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (_csbrk): More left coercion cleanup. + * fhandler_tty.cc (fhandler_tty_slave::read): Ditto. + (fhandler_tty_slave::write): Ditto. + * fhandler_windows.cc (fhandler_windows::read): Ditto. + * heap.cc (sbrk): Ditto. + +2003-09-07 Pierre Humblet <pierre.humblet@ieee.org> + + * signal.cc (nanosleep): Improve test for valid values. Round delay up + to resolution. Fix test for negative remainder. Use timeGetTime + through gtod. + (sleep): Round up return value. + +2003-09-07 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@redhat.com> + + * hires.h (HIRES_DELAY_MAX): Define. + (hires_ms::minperiod): Declare static. + (hires_ms::resolution): New. + (hires_ms::dmsecs): New. + (hires_ms::prime): Return UINT. + (gtod): Declare. + * times.cc (hires_ms::prime): Always calculate minperiod and set it to + 1 in case of failure. Return minperiod. + (hires_ms::resolution): Define. + (hires_ms::~hires_ms): Delete. + (hires_ms::usecs): Check minperiod to prime. + (gtod) Define as global. + +2003-09-06 Christopher Faylor <cgf@redhat.com> + + Remove left coercion throughout. + +2003-09-04 Pierre Humblet <pierre.humblet@ieee.org> + + * hires.h (hires_ms::~hires_ms): Delete declaration. + * times.cc (hires_ms::~hires_ms): Delete definition.. + +2003-09-04 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (__argc_safe): New variable. + (dll_crt0_1): Store argc in __argc_safe, which will theoretically + remain untouched by the user. + * fhandler_console.cc (fhandler_console::read): Silence some compiler + warnings. + * fhandler_raw.cc (fhandler_dev_raw::raw_read): Ditto. + * pinfo.cc (_pinfo::commune_recv): Carefully bound argv scan and check + for potentially bad pointers since user could have set argv cell to + anythinw. + * cygheap.h (CYGHEAPSIZE): Bump up size. + +2003-09-04 Corinna Vinschen <corinna@vinschen.de> + + * sysconf.cc (sysconf): Return more accurate value for _SC_AVPHYS_PAGES. + +2003-09-04 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Restructure. Add, remove and rewrite comments throughout + for better readability. Change function names for better + understanding. + (MAP_SET): Accommodate name change from map_map_ to page_map_. + (MAP_CLR): Ditto. + (MAP_ISSET): Ditto. + (mmap_record::page_map_): Rename from page_map_. + (mmap_record::get_map): Remove. + (mmap_record::alloc_page_map): Rename from alloc_map. Return bool + indicating success of cygheap memory allocation. + (mmap_record::free_page_map): Rename from free_map. + (mmap_record::fixup_page_map): Rename from fixup_map. + (mmap_record::find_unused_pages): Rename from find_empty. + (mmap_record::map_pages): Rename from map_map. + (mmap_record::unmap_pages): Rename from unmap_map. + (class list): Make all class members private. + (list::list): Remove. + (list::~list): Remove. + (list::get_fd): New attribute reader. + (list::get_hash): Ditto. + (list::get_record): Ditto. + (list::add_record): Manage all allocation for mmap_records. Check + for failed memory allocation and return NULL if so. + (list::set): New function. + (list::del_record): Rename from erase. Return true if last mmap_record + has been deleted, false otherwise. Check for legal incoming index + value. + (list::erase): Remove erase/0. + (list::search_record): Rename from match. + (map::map): Remove. + (map::~map): Remove. + (map::add_list): Manage all allocation for lists. Check for failed + memory allocation and return NULL if so. + (map::get_list): New method. + (map::del_list): Rename from erase. Check for legal incoming index + value. + (mmap64): Check for failed mmap_record memory allocation. Return + with MAP_FAILED and errno set to ENOMEM if so. + (munmap): Rearrange loop using new list and mmap_record accessor + functions. Rename loop index variables for better understanding. + Check if list can be deleted after last mmap_record in it has been + deleted. + (msync): Rearrange loop using new list and mmap_record accessor + functions. Rename loop index variables for better understanding. + (fixup_mmaps_after_fork): Ditto. + +2003-09-03 Christopher Faylor <cgf@redhat.com> + + * cxx.cc (new): Fix formatting. Just return result of ccalloc rather + than calling memset explicitly. + +2003-09-03 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (set_process_mask): Set pending signals only when + signals become unmasked. + * sigproc.cc (pending_signals): Flip back to a global. + (wait_sig): Don't set pending signals when there is an armed semaphore + or signal is blocked. + + * shared.cc (shared_info::initialize): Add a username parameter for + user-mode mounts. Reorganize to try to avoid startup race. + (memory_init): Move some stuff into shared_info::initialize. + * shared_info.h (shared_info::initialize): Change declaration. + (CURR_SHARED_MAGIC): Update. + +2003-09-01 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 4. + +2003-09-01 Christopher Faylor <cgf@redhat.com> + + * net.cc (dup_ent): Restore check for NULL input. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * include/sys/cygwin.h: Don't define cygwin-specific things if + !__CYGWIN__. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cygheap_init): Allocate space for sigaction array in + cygheap. + * cygheap.h (cygheap_types): Add HEAP_SIGS. + * exceptions.cc (signal_fixup_after_exec): Remove from this file. + * pinfo.h (pinfo::getsig): Just return global_sigs array. + (pinfo::sigs): Delete. + * sigproc.cc (signal_fixup_after_exec): Move it here. + (global_sigs): New global array, moved from pinfo structure. + (sigalloc): New function. Allocate global sigaction array here. + (proc_subproc): Remove copysigs call. It's automatic now. + * include/sys/cygwin.h (PID_NOCLDSTOP): New value. + * signal.cc (sigaction): Set myself->PID_NODCLDSTOP when appropriate. + * sigproc.h (sigalloc): Declare. + + * fnmatch.c (fnmatch): Use C90 parameters. + (rangematch): Ditto. + + * fhandler.cc (fhandler_base::raw_read): Use right coercion to avoid a + compiler warning. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * net.cc (dup_ent): Make debugging output consistent. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + Use dup_ent rather than specific dup_*_ptr functions throughout. + * (gen_ent): Delete. + (dup_ent): Subsume gen_ent functionality. + (dup_host_ptr): Delete. + (dup_proto_ptr): Ditto. + (dup_servent_ptr): Ditto. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * net.cc (gen_ent): Invert sense of null check so that debug output + makes sense. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * net.cc (free_char_list): Delete. + (dup_addr_list): Delete. + (dup_char_list): Delete. + (free_hostent_ptr): Delete. + (free_protoent_ptr): Delete. + (free_servent_ptr): Delete. + (DWORD_round): New function. + (strlen_round): New function. Returns strlen rounded up to word size. + (dup_ent): New, generic function to duplicate a {host,proto,serv}ent + structure. + (gen_ent): New macro. Generates a generic dup_{host,proto,serv}ent_ptr + function. + (cygwin_getservbyname): Remove call to free_servent_ptr, pass + servent_buf to dup_servent_ptr. + (cygwin_getservbyport): Ditto. + (cygwin_gethostbyname): Ditto for hostent. + (cygwin_gethostbyaddr): Ditto. + (cygwin_getprotobyname): Ditto for protoent. + (cygwin_getprotobynumber): Ditto. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (MALLOC_OFILES): Always fill in with correct malloc + object. + * configure.in: Fill in MALLOC_OFILES with either debugging or regular + malloc. + * configure: Regenerate. + * dlmalloc.c: Make various fruitless changes to attempt to get to work. + * dlmalloc.h: Ditto. + * malloc.cc (free): Check malloc pool when debugging. + + * path.cc (win32_device_name): Eliminate compiler warning. + + * sigproc.cc (sig_dispatch_pending): Remove use of was_pending. Let + thisframe.call_signal_handler decide if handler should be called rather + than using bogus was_pending check. + + * exceptions.cc (interrupt_setup): Remove accidentally checked in + debugging code. + +2003-08-30 Christopher Faylor <cgf@redhat.com> + + * heap.cc (sbrk): Save rounded address in user_heap_max. + +2003-08-30 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (sig_dispatch_pending): Remove explicit call to + thisframe.call_signal_handler. + +2003-08-30 Christopher Faylor <cgf@redhat.com> + + Remove some cygserver files. + +2003-08-28 Christopher Faylor <cgf@redhat.com> + + * sigproc.h: Make some functions regparm. + * sigproc.cc (checkstate): Make regparm. + (getevent): Change parameters in declaration, rename from getsem, make regparm. + (sig_send): Recognize that nosync is now an event. Remove some old + cruft from previous interrupt anywhere signal handler. + (getevent): Change parameters in definition, rename from getsem. + Allocate event rather than semaphore. + (wait_sig): Treat sigcatch_nosync as an event. + +2003-08-28 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sigreturn): Fix problem where old return address was + not properly restored for a nested signal. + +2003-08-27 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (SwitchToThread): Declare as autoload function. + * cygthread.h (cygthread::main_thread_id): Make public. + * exceptions.cc (setup_handler): Remove unneeded priority stuff. + Rename label to reflect what it does. Add debugging for idiotic + Windows NT problem. Change debugging output to include signal number. + * miscfuncs.cc (low_priority_sleep): If available, use SwitchToThread + function to give time slice to other threads. + * wincap.cc: Properly define have_switch_to_thread throughout. + * wincap.h (wincap::switch_to_thread): New element. + +2003-08-27 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (mount): Don't check win32_path when doing cygdrive + mount. + +2003-08-27 Christopher Faylor <cgf@redhat.com> + + * specdir: Correctly remove temporary directory prior to use. + +2003-08-27 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig): Count number of iterations through + 'more_signals' loop and issue a warning if DEBUGGING and excessive. + (WFSO): When debugging and infinite timeout, loop. + +2003-08-26 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/stat.h: Allow definition of internal stat structures + also when compiling newlib. + +2003-08-25 Christopher Faylor <cgf@redhat.com> + + Throughout, change USE_CYGSERVER to USE_SERVER. + * Makefile.in (LIBSERVER): Define and use. + * configure.in: Set LIBSERVER as appropriate. + * configure: Regenerate. + * acconfig.h: Regenerate. + * environ.cc: Rename allow_daemon to allow_server. Only recognize when + USE_SERVER is defined. + +2003-08-23 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (_remove_r): Define. + +2003-08-22 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (enum cygheap_types): Add HEAP_MMAP. + (CYGHEAPSIZE): Add another 64K. + * mmap.cc: Use cmalloc, ccalloc and crealloc with HEAP_MMAP type + throughout. + +2003-08-22 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (user_heap_info::max): New field. + * heap.cc (heap_init): Save pointer to end of heap reserved memory. + (sbrk): Don't attempt to commit memory beyond end of heap reserved + memory. Attempt to honor comment and reserve commitbytes if heapchunk + fails. + +2003-08-20 Pierre Humblet <pierre.humblet@ieee.org> + + * exceptions.cc (sigreturn): Don't clobber ebp in recursive signal + calls. + +2003-08-22 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle): Change so that default signals indicate + success. + +2003-08-21 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig): Remove redundant test in do/while. + +2003-08-21 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig): Avoid infinite loop. + +2003-08-20 Christopher Faylor <cgf@redhat.com> + + * speclib: Reenable removal of temp files. + +2003-08-20 Christopher Faylor <cgf@redhat.com> + + * miscfuncs.cc (low_priority_sleep): Sleep at same priority as main + thread. + * sigproc.cc (wait_sig): Keep looping if there are more signals to + consider and we are flushing signals. + (sig_send): Put nonsync signals in the correct bucket. + +2003-08-20 Christopher Faylor <cgf@redhat.com> + + * speclib: Fix created lib to avoid "File truncated" problems. + +2003-08-20 Pierre Humblet <pierre.humblet@ieee.org> + + * exceptions.cc (interrupt_setup): Set sigsave.sig last to avoid a + race. + +2003-08-20 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig): Ensure that myself->getsigtodo array is + flushed on a __SIGFLUSH. + +2003-08-20 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (_sigreturn): Handle nested signals without growing the + stack. + +2003-08-19 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (pending_signals): Remove unneeded declaration. + * sigproc.cc (pending_signals): Make static. + (wait_sig): Use defined values rather than integers for rc. Never scan + both todo arrays as this could cause hangs if signals arrive from two + different sources. Rename saw_pending_signals to saw_failed_interrupt. + Exit loop when signal found. Enter low-priority sleep, if necessary, + after finished signalling completion. Set pending_signals when blocked + (from Pierre Humblet). + +2003-08-19 Christopher Faylor <cgf@redhat.com> + + * signal.cc (sigpending): Move. + * sigproc.cc (sigpending): To here. + (getlocal_sigtodo): Return process-local signal array. + (sigpending): Accommodate new process-local signal array. + (sig_send): Ditto. + (sig_set_pending): Ditto. + (wait_sig): Ditto. + +2003-08-19 Christopher Faylor <cgf@redhat.com> + + Throughout, eliminate argument to sig_dispatch_pending. + * exceptions.cc (setup_handler): Move non-interruptible condition + handling (back) to wait_sig. + (set_process_mask): Don't worry about calling sig_dispatch_pending from + sigthread since it is detected in the function anyway. + (sig_handle): Eliminate thisproc arg. Don't call sig_dispatch_pending + on SIGCONT since that should happen automatically. + * sigproc.cc (sig_dispatch_pending): Eliminate justwake argument. Just + return when called from sigthread. + (wait_sig): Change some variables to bool. Change inner while to an + if. Move uninterruptible signal handling here. + (sigproc_terminate): Don't call sig_dispatch_pending. Just increment + semaphore on exit. + + * speclib: Use slightly different (but still flawed) method for + determining symbols to extract from libraries. + +2003-08-18 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sigdelayed): Fix race where signal handler could get + the wrong mask (as suggested by Pierre Humblet). + +2003-08-18 Christopher Faylor <cgf@redhat.com> + + * path.cc (mount): Add null/empty check for input parameters. + (umount): Add null/empty check for input parameters. + +2003-08-17 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (read_group): Revert previous change. + * uinfo.cc (pwdgrp::load): Always reset curr_lines. + +2003-08-17 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_INVALID_BLOCK_LENGTH to EIO. + * fhandler_raw.cc (fhandler_dev_raw::raw_read): Set more accurate + errnos instead of EACCES. + (fhandler_dev_raw::raw_write): Ditto. + +2003-08-17 Christopher Faylor <cgf@redhat.com> + + * path.cc (special_name): Accommodate all special names with + extensions. + +2003-08-15 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Avoid crash if file size is less than requested + map length. + +2003-08-13 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * path.cc (special_name): Add checks for some specials followed by + a "." and a FIXME comment. + +2003-08-13 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Accommodate change from cygwin_lstat to lstat. + * syscalls.cc: Add defines to avoid declaration issues when + renaming cygwin_lstat back to lstat. + (lstat): Reverted name change from cygwin_lstat. + +2003-08-12 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/param.h (NBBY): Define if not defined. + +2003-08-12 Nicholas Wourms <nwourms@netscape.net> + + * include/sys/param.h (setbit): Add new bitmap related macro. + (clrbit): Likewise. + (isset): Likewise. + (isclr): Likewise. + (howmany): Add new counting/rounding macro. + (rounddown): Likewise. + (roundup): Likewise. + (roundup2): Likewise. + (powerof2): Likewise + (MIN): Add macro for calculating min. + (MAX): Add macro for calculating max. + +2003-08-09 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 3. + +2003-08-08 Gerrit P. Haase <gp@familiehaase.de> + + * include/stdint.h: Correctly define INT32_MIN. + +2003-08-08 David Rothenberger <daveroth@acm.org> + + * grp.cc (read_group): Set __group32.gr_mem pointer back to &null_ptr + after free() is called. + +2003-08-05 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Rework to accommodate new speclib arguments. + * speclib: Rework to extract everything from libcygwin.a rather than + building things from existing object files. + +2003-08-05 Pavel Tsekov <ptsekov@gmx.net> + + * path.cc (cygdrive_getmntent): Do not skip over drives of type + DRIVE_REMOVABLE. + +2003-08-05 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::lseek): Be more paranoid when + constructing offsets from 64 bit value. + * syscalls.cc (logout): Avoid temp buffer memcpy since new scheme does + not require it. + (utmp_data): Rework as a macro which returns a pointer into a buffer. + (getutent): Use new buffer allocation mechanism to grab a utmp buffer. + (getutid): Ditto. + (pututline): Ditto. + +2003-08-05 Pavel Tsekov <ptsekov@gmx.net> + + * fhandler_disk_file.cc (fhandler_cygdrive::readdir): Do not change + 'errno' if end of directory condition is encountered as per SUSv2. + * fhandler_proc.cc (fhandler_proc::readdir): Ditto. + * fhandler_process (fhandler_process::readdir): Ditto. + * fhandler_registry (fhandler_registry::readdir): Ditto. + +2003-07-30 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (_dll_crt0): Move strace.microseconds initialization to + after pthread initialization. + (dll_crt0_1): i.e., here. + +2003-07-28 Christopher Faylor <cgf@redhat.com> + + * fhandler_base.cc (fhandler_base::readv): Rework to properly return + number of bytes from read. + +2003-07-28 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 2. + +2003-07-26 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (ctrl_c_handler): Send SIGHUP when events occur only if + there is a tty associated with the process. Send SIGHUP on + CTRL_LOGOFF_EVENT. + + * fhandler_tty.cc (fhandler_tty_slave::open): Adjust console open + handle counter regardless of whether this is a pty or tty. + (fhandler_tty_slave::open): Ditto. + (fhandler_tty_slave::dup): Ditto. + (fhandler_tty_common::set_close_on_exec): Ditto. + (fhandler_tty_master::init_console): Decrement console open handle + counter after init since it will now be handled by all tty open. + * syscalls.cc (setsid): Rework debugging output slightly. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * configure.in: Use 'install-sh -c'. + * configure: Regenerate. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * configure.in: Always use install-sh. + * configure: Regenerate. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/socket.h: Conditionalize [AP]F_INET6 define. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (OBSOLETE_FUNCTION): Add fdopen. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Export _fdopen64 + * Makefile.in (NEW_FUNCTIONS): Add _fdopen64 -> fdopen translation. + * include/cygwin/version.h: Bump api minor number. + + * ntdll.h: Remove (now) duplicate FILE_SYNCHRONOUS_IO_NONALERT + definition. + +2003-07-24 Christopher Faylor <cgf@redhat.com> + + * environ.cc (check_case_init): Use strncasematch. + + * cygwin.din: Export __mempcpy. + * cygwin/version.h: Bump api minor number. + +2003-07-21 Pavel Tsekov <ptsekov@gmx.net> + + * mmap.cc: Use proper format specifiers for _off64_t and size_t in + format strings passed to syscall_printf () and debug_printf () + throughout. + +2003-07-18 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (verify_token): Fix white space and style. + Use type bool instead of BOOL and char. Use alloca + instead of malloc and free for my_grps. + +2003-07-17 Corinna Vinschen <corinna@vinschen.de> + + * sysconf.cc (sysconf): Fix OPEN_MAX patch. Return page size on + _SC_PAGESIZE again. + +2003-07-14 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class cygheap_user): Use INVALID_HANDLE_VALUE as invalid + value for tokens. + * syscalls.cc (seteuid32): Ditto. Set new_token to process token if + process token is suitable. + * uinfo.cc (uinfo_init): Initialize tokens in cygheap user info + to INVALID_HANDLE_VALUE. + +2003-07-14 Pierre Humblet <pierre.humblet@ieee.org> + + * cygheap.h (enum impersonation): Delete. + (cygheap_user::impersonation_state): Delete. + (cygheap_user::current_token): New. + (cygheap_user::issetuid): Modify to use current_token. + (cygheap_user::token): Ditto. + (cygheap_user::deimpersonate): Ditto. + (cygheap_user::reimpersonate): Ditto. + (cygheap_user::has_impersonation_tokens): Ditto. + (cygheap_user::close_impersonation_tokens): Ditto. + * security.cc (cygwin_set_impersonation_token): Always set the token. + (verify_token): Change type of gsid to cygpsid. + (get_file_attribute): Use the effective ids. + * syscalls.cc (seteuid32): Modify to use cygheap_user::current_token. + * uinfo.cc (uinfo_init) Do not set cygheap->user.impersonation_state. + +2003-07-12 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::commune_send): Fix bounds test so that poll of + communicating pid actually stops eventually. + +2003-07-10 Christopher Faylor <cgf@redhat.com> + + * path.cc (get_device_number): Remove special com? consideration. + (special_chars): Make static. + (special_introducers): New. + (special_char): Allow specified valid_chars args. + (fnunmunge): Handle aux-like filenames correctly. + (special_name): Add con, conin$, conout$. + (mount_item::fnmunge): Use __small_sprintf return value to calculate + increments. + +2003-07-09 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 1. + +2003-07-09 Christopher Faylor <cgf@redhat.com> + + * fhandler_proc.cc (format_proc_stat): Use correctly sized constants + for filling in zeros on 98. + +2003-07-09 Christopher Faylor <cgf@redhat.com> + + * fhandler_proc.cc (fhandler_proc::fill_filebuf): Allocate more space + for stat buffer. + (format_proc_stat): Reorganize to accumulate and report on all cpus. + +2003-07-09 Christopher Faylor <cgf@redhat.com> + + * sysconf.cc (sysconf): Return processors online rather than bitmask + for _SC_NPROCESSORS_ONLN. + +2003-07-08 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (creturn): Set appropriate errno when out of memory. + (ccalloc): Only issue system_printf when debugging. + * dtable.cc (dtable::extend): Only allocate 100 * the incremental growth + size max. Set errno appropriately. + (dtable::build_fhandler): Check for error from set_name. + * fhandler.cc (fhandler_base::set_name): Set errno and return error on OOM. + * fhandler.h (fhandler_base::set_name): Change to bool. + * fhandler_process.cc (format_process_stat): Fix formatting. + * resource.cc (getrlimit): Return greater of OPEN_MAX or fd table size. + * sysconf.cc (sysconf): Ditto. + +2003-07-07 Christopher Faylor <cgf@redhat.com> + + * rmsym: Don't use ranlib. + +2003-07-07 Christopher Faylor <cgf@redhat.com> + + * newsym: Reenable removal of tmp directory. Just use ar to generate + archive index. + * Makefile.in: Don't send ranlib to newsym or rmsym. + +2003-07-07 Christopher Faylor <cgf@redhat.com> + + * newsym: Create objects that are closer to those created by dlltool so + as not to confuse --export-all-symbols. + * rmsym: Be a little more accepting of object filenames now that + dlltool can create different format files. + +2003-07-06 Christopher Faylor <cgf@redhat.com> + + * newsym: Oops. Revert below change. + +2003-07-06 Christopher Faylor <cgf@redhat.com> + + * newsym: Use correct prefix for generating imports. + * pinfo.cc (_pinfo::commune_send): Don't wait forever for a response + from another process. + +2003-07-06 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (gethostid): Set thread affinity so that results are + predictable. + +2003-07-05 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (list::match): Add parameters to return valid address and + length back to munmap(). Evaluate intersection between given + area and mapped area and return it, if any. + (mmap64): On regular files, don't allow mappings beginning beyond + EOF. Return with errno set to ENXIO instead. + (munmap): Rewrite SUSv3 conformant. Check if given memory area is + valid. Unmap all maps inside given memory area. Don't return error + if no mapping has been unmapped. + +2003-07-05 N Stephens <nigel@mips.com> + + * fhandler.h (fhandler_socket::get_connect_state): New method to + return socket connection state. + * fhandler_socket.cc (dup): Copy socket connect state to new file + handle. + * net.cc (cygwin_rcmd): Mark file handles of sockets returned by + rcmd() as CONNECTED state. + (cygwin_rexec): Similarly for rexec(). + (socketpair): Mark both ends of a new socket pair as CONNECTED. + +2003-07-04 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fhandler_disk_file::mmap): Fix address test. + +2003-07-03 Christopher Faylor <cgf@redhat.com> + + * path.cc (fillout_mntent): Change "posix" to "managed". + +2003-07-02 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (FH_ENC): New enum. + (fhandler_base::get_encoded): New function. + (fhandler_base::set_encoded): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set encoded flag + in fhandler, as appropriate. + (fhandler_disk_file::readdir): Unmunge filename as appropriate based on + new encoding flag. + * path.cc (normalize_posix_path): Don't punt on files with colons. + (special_char): New function. + (mount_item::fnmunge): Ditto. + (fnunmunge): Ditto. + (special_name): Ditto. + (mount_item::build_win32): Avoid drive considerations when file is + encoded. + (mount_info::conv_to_win32_path): Handle encoded filenames. + (mount_info::conv_to_posix_path): Ditto. + (fillout_mntent): Add posix string when directory is encoded. + * path.h (fnunmunge): Declare. + (path_conv::is_encoded): Declare. + +2003-07-03 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize a little + more of the cygserver stuff so that ttys actually work. + +2003-07-03 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Allow MAP_FIXED with pagesize granularity (4K). + If a non-zero addr is given, align it to the next lower 64K boundary. + (fhandler_disk_file::mmap): If a non-zero address is given, try + mapping using the given address first. If it fails and flags is not + MAP_FIXED, try again with NULL address. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * thread.cc: Remove _MT_SAFE conditional. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * configure.in: Fix --enable-server option. + * configure: Regenerate. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Remove cygserver stuff. + * acconfig.h: Add USE_CYGSERVER define. + * config.h.in: Regenerate. + * configure.in: Add --enable-server setting. + * configure: Regenerate. + * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize + compilation of cygserver stuff. + * fork.cc (fork_child): Ditto. + * shm.cc: Ditto. + * tty.cc (tty::common_init): Ditto. + + * dcrt0.cc: Use bool rather than BOOL for CYGWIN environment variable + definitions. + * environ.cc: Ditto. + * ntea.cc: Ditto. + * security.cc: Ditto. + * security.h: Ditto. + * syscalls.cc (check_posix_perm): Remove externs that were already + declared in a header. + * winsup.h: Ditto. Declare _MT_SAFE here. Delete it someday since + cygwin should always be _MT_SAFE. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * thread.cc: Remove _MT_SAFE conditional. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * configure.in: Fix --enable-server option. + * configure: Regenerate. + +2003-07-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Remove cygserver stuff. + * acconfig.h: Add USE_CYGSERVER define. + * config.h.in: Regenerate. + * configure.in: Add --enable-server setting. + * configure: Regenerate. + * fhandler_tty.cc (fhandler_tty_slave::open): Conditionalize + compilation of cygserver stuff. + * fork.cc (fork_child): Ditto. + * shm.cc: Ditto. + * tty.cc (tty::common_init): Ditto. + + * dcrt0.cc: Use bool rather than BOOL for CYGWIN environment variable + definitions. + * environ.cc: Ditto. + * ntea.cc: Ditto. + * security.cc: Ditto. + * security.h: Ditto. + * syscalls.cc (check_posix_perm): Remove externs that were already + declared in a header. + * winsup.h: Ditto. Declare _MT_SAFE here. Delete it someday since + cygwin should always be _MT_SAFE. + +2003-06-30 Pierre Humblet <pierre.humblet@ieee.org> + + * cygheap.h (enum impersonation): New enum. + (cygheap_user::token): Delete. + (cygheap_user::impersonated): Delete. + (cygheap_user::external_token): New member. + (cygheap_user::internal_token): New member. + (cygheap_user::impersonation_state): New member. + (cygheap_user::issetuid): Modify. + (cygheap_user::token): New method. + (cygheap_user::deimpersonate): New method. + (cygheap_user::reimpersonate): New method. + (cygheap_user::has_impersonation_tokens): New method. + (cygheap_user::close_impersonation_tokens): New method. + * dtable.cc (dtable::vfork_child_dup): Use new cygheap_user methods. + * fhandler_socket.cc (fhandler_socket::dup): Ditto. + * fork.cc (fork_child): Ditto. + (fork_parent): Ditto. + * grp.cc (internal_getgroups): Ditto. + * security.cc (verify_token): Ditto. + (check_file_access): Ditto. + (cygwin_set_impersonation_token): Detect conflicts. Set + user.external_token. + * spawn.cc (spawn_guts): Use new cygheap_user methods. + * syscalls.cc (seteuid32): Rearrange to use the two tokens + in cygheap_user. + (setegid32): Use new cygheap_user methods. + * uinfo.cc: (internal_getlogin): Ditto. + +2003-06-25 Doru Carastan <doru.carastan@mvista.com> + + * Makefile.in: Use INSTALL_PROGRAM to install the cygwin DLL. + +2003-06-24 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (MTinterface::fixup_after_fork): Fix thread list after + fork. + (pthread::threads): Instantiate. + (pthread::pthread): Initialize running and suspendend. + Initialize next with NULL. + Add thread to thread list if it is not the null_pthread. + (pthread::~pthread): Remove thread from thread list if it is + not the null_pthread. + (pthread::postcreate): Set running flag. + (pthread::exit): Reset running flag. + (pthread::cancel): Try to cancel thread only if still running. + (pthread::_fixup_after_fork): Implement. + (pthread::detach): Check if thread is still running before detach. + * thread.h (pthread::running): New member. + (pthread::next): Ditto. + (pthread::fixup_after_fork): New static method. + (pthread::threads): New static method. + (pthread::_fixup_after_fork): New method. + +2003-06-20 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::commune_send): Don't attempt to communicate with a + pure windows process. + +2003-06-18 Pierre Humblet <pierre.humblet@ieee.org> + + * autoload.cc (GetNetworkParams): Add. + * net.cc (getdomainname): Call GetNetworkParams and read the + DhcpDomain registry value if warranted. + +2003-06-17 Christopher Faylor <cgf@redhat.com> + + * path.cc (mount): Do more strict checking on posix path arguments. + +2003-06-15 Christopher Faylor <cgf@redhat.com> + + Throughout, remove "include <errno.h>" from files which already include + cygerrno.h. + +2003-06-15 Thomas Pfaff <tpfaff@gmx.net> + + * include/cygwin/config.h (__DYNAMIC_REENT__): Define. + * include/cygwin/version.h: Bump API minor version. + * cygwin.din: Export __getreent + * cygerrno.h: Include errno.h. Fix places where _impure_ptr is used + directly to store the errno value. + * debug.cc (__set_errno): Ditto. + * errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled. + * signal.cc: Rename _reent_clib to _REENT throughout. + * thread.h (reent_clib): Remove prototype. + * thread.cc (reent_clib): Rename reent_clib to __getreent. Return + _impure_ptr until MTinterface is initialized. + (reent_winsup): Fix a possible SEGV when _r == NULL. Return NULL + instead. + * MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to + keep signal handling running when fork is called from a thread other + than the mainthread. + +2003-06-12 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread_attr_init): Revert change from 2003-06-11 + to return 0 if attribute is already initialized back to EBUSY. + (pthread_condattr_init): Ditto. + (pthread_rwlockattr_init): Ditto. + (pthread_mutexattr_init): Ditto. + +2003-06-12 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (ctrl_c_handler): Don't send a signal on + CTRL_SHUTDOWN_EVENT. Add a comment to rationalize the patch. + +2003-06-11 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread_attr_init): Return 0 if attribute is already + initialized. + Fix return code if out of memory. + (pthread_condattr_init): Ditto. + (pthread_rwlockattr_init): Ditto. + (pthread_mutexattr_init): Return 0 if attribute is already + initialized. + +2003-06-09 Pierre Humblet <pierre.humblet@ieee.org> + + * spawn.cc (spawn_guts): Call CreateProcess while impersonated, + when the real {u,g}ids and the groups are original. + Move RevertToSelf and ImpersonateLoggedOnUser to the main line. + * uinfo.cc (uinfo_init): Reorganize. If CreateProcess was called + while impersonated, preserve the uids and gids and call + ImpersonateLoggedOnUser. Preserve the uids and gids on Win9X. + + * exceptions.cc (error_start_init): Quote the pgm in the command. + +2003-06-07 Christopher Faylor <cgf@redhat.com> + + * poll.cc: Define FD_SETSIZE to ridiculously large number so that there + will be no artificially small limits. + +2003-06-07 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::close): Free the console when + last tty closes. + +2003-06-07 Thomas Pfaff <tpfaff@gmx.net> + + * fhandler_socket.cc (fhandler_socket::connect): Change error + handling for nonblocking connects to return EALREADY when + connect is called more than once for the same socket. + +2003-06-06 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add vsyslog. + * fhandler.cc (fhandler_base::write): Only make file sparse if the + seeked area is >= 128K. + * syslog.cc (vsyslog): New function, overtaking functionality from + syslog. + (syslog): Just call vsyslog. + * include/cygwin/version.h: Bump API minor. + * include/sys/syslog.h: Add vsyslog declaration. + +2003-06-05 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::terminate_thread): Change system_printf to + debug_printf. + +2003-06-04 Christopher Faylor <cgf@redhat.com> + + * shared.cc (shared_info::heap_chunk_size): Be really defensive about + making sure that heap_chunk is set. + +2003-06-04 Christopher Faylor <cgf@redhat.com> + + * path.cc (conv_path_list): Use correct value when calculating length + to avoid a potential SEGV. + +2003-06-03 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Mark the pc + as non-executable if the file cannot be opened for read. Retry query + open only if errno is EACCES. Never change the mode, even if it is 000 + when query open() fails. + +2003-06-03 Christopher Faylor <cgf@redhat.com> + + * configure.in: Allow any i?86 variant. + * configure: Regenerate. + +2003-06-03 Corinna Vinschen <corinna@vinschen.de> + Thomas Pfaff <tpfaff@gmx.net> + + * fhandler_socket.cc (connect_thread): Remove. + (accept_thread): Remove. + (fhandler_socket::connect): Remove all special blocking handling. + (fhandler_socket::accept): Ditto. + * net.cc (cygwin_connect): Make blocking sockets temporarily + non-blocking and call cygwin_select on them to be interruptible. + (cygwin_accept): Ditto. + +2003-06-02 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (spawn_guts): Don't hang around if the parent doesn't exist. + +2003-06-02 Christopher Faylor <cgf@redhat.com> + + * cygthread.h (cygthread::terminate_thread): Mark private. + * cygthread.cc (cygthread::terminate_thread): Deallocate free_range + thread stuff. + +2003-06-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::accept): Rename `signalled' + to `interrupted' as used in fhandler_socket::connect. + +2003-06-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::connect): Simplify previous + patch. + (fhandler_socket::accept): Ditto. + +2003-06-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: Include cygthread.h. + (class sock_event): Remove. + (thread_connect): New function. + (thread_accept): Ditto. + (fhandler_socket::connect): Use cygthread instead of socket event + handling for blocking sockets. + (fhandler_socket::accept): Ditto. + +2003-06-02 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::write): Correct minor printf formatting + style glitch. + +2003-06-01 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Assume + an existing directory is a root if FindFirstFile fails. + +2003-05-30 Christopher Faylor <cgf@redhat.com> + + * path.cc (mount_info::conv_to_win32_path): gcc warning about chroot_ok + was actually valid. Fix it. + +2003-05-30 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cheap): Temporarily remove inline that newer gcc's + have problems with. + + * path.cc (path_conv::check): Rework has_acls logic slightly. Uncouple + exec tests away from filesystem tests. + +2003-05-30 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/param.h: Add DEV_BSIZE. + +2003-05-29 Pierre Humblet <pierre.humblet@ieee.org> + Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): Rearrange. Fix + conditional. + +2003-05-28 Christopher Faylor <cgf@redhat.com> + + * mkvers.sh: Avoid "-dontuse" tags. + + * path.cc (path_conv::check): Set exec state based on known situations. + + * path.cc (mount_item::fnmunge): New function. + (mount_item::build_win32): New function. + (mount_info::conv_to_win32_path): Use build_win32 to build windows + path. + * path.h (mount_item::fnmunge): Declare new function. + (mount_item::build_win32): Ditto. + * sys/mount.h (MOUNT_ENC): Define. + +2003-05-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): If running impersonated, + revert to original account before calling fixup_before_fork_exec + and impersonate again afterwards. Change comment accordingly. + Clean up error handling and debug output. + +2003-05-27 Thomas Pfaff <tpfaff@gmx.net> + + * fhandler_socket.cc (sock_event::~sock_event): New method. + (sock_event::load): Change to void. Check if winsock2 is available. + (socke_event::wait): Return 0 if interruptible mode is not available. + (fhandler_socket::connect): Remove checks for winsock2 availability. + (fhandler_socket::accept): Ditto. + +2003-05-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): First try duplicating + using WSADuplicateSocket/WSASocket, if that fails, try DuplicateHandle. + +2003-05-27 Bill C. Riemers <cygwin@docbill.net> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Filter + permissions through umask on FAT or if ntsec is off. + +2003-05-26 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (statfs): Call GetDiskFreeSpaceEx before GetDiskFreeSpace. + +2003-05-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (is_at_eof): Fix conditional. Use INVALID_FILE_SIZE + instead of numeric constant. + +2003-05-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::connect): Guard calls to + sock_event methods by a check for WinSock2 availability. + (fhandler_socket::accept): Ditto. + +2003-05-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h: Rename FH_W95LSBUG flag to FH_LSEEKED. + (fhandler_base::set_did_lseek): Rename from set_check_win95_lseek_bug. + (fhandler_base::get_did_lseek): Rename from get_check_win95_lseek_bug. + (fhandler_base::set_fs_flags): New method. + (fhandler_base::get_fs_flags): Ditto. + * fhandler.cc (fhandler_base::write): Make 64 bit clean. Convert file + to a "sparse" file when writing after a long lseek (>64K) beyond EOF. + (fhandler_base::lseek): Call set_did_lseek() instead of + set_check_win95_lseek_bug(). + (fhandler_base::fhandler_base): Initialize fs_flags to 0. + * fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files + as "sparse" unconditionally. Set fs_flags member. + +2003-05-25 Pierre Humblet <pierre.humblet@ieee.org> + + * autoload.cc (GetDiskFreeSpaceEx): Add. + * syscalls.cc (statfs): Call full_path.root_dir() instead of + rootdir(full_path). Use GetDiskFreeSpaceEx when available and + report space available in addition to free space. + * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): + Do not call FindFirstFile for disk root directories. + +2003-05-24 Joe Buehler <jhpb@draco.hekimian.com> + + * fhandler_process.cc (format_process_stat): Use PagefileUsage + instead of VirtualSize. + (get_mem_values): Ditto. + +2003-05-21 Corinna Vinschen <corinna@vinschen.de> + + * shared_info.h: Match shared_name declaration with below change. + * shared.cc (shared_name): Use incoming char * parameter instead of + local static buffer. + (open_shared): Accommodate new calling convention for shared_name. + * exceptions.cc (events_init): Ditto. + * sigproc.cc (getsem): Ditto. + * syscalls.cc (login): Ditto. + (logout): Ditto. + (pututline): Ditto. + +2003-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (secret_event_name): Return void. Use incoming + char * parameter instead of local static buffer. + (fhandler_socket::create_secret_event): Accommodate new calling + convention for secret_event_name. + (fhandler_socket::close_secret_event): Ditto. + +2003-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (SECRET_EVENT_NAME): Remove. + (ENTROPY_SOURCE_NAME): Ditto. + (secret_event_name): New static function. Create shared event name + with "Global\" prefix on systems supporting terminal services. + (fhandler_socket::set_connect_secret): Fix conditional. + (fhandler_socket::create_secret_event): Create secret event using + secret_event_name(). + (fhandler_socket::close_secret_event): Ditto. + * shared.cc (shared_name): Create shared object name with "Global\" + prefix on systems supporting terminal services. + * wincap.cc: Set has_terminal_services capability throughout. + (wincap_2003): New global object representing Windows 2003 Server + capabilities. + (wincapc::init): Accommodate Windows 2003 Server. + * wincap.h (struct wincaps): Add has_terminal_services capability. + +2003-05-20 Charles Wilson <cygwin@cwilson.fastmail.fm> + + * winsup/cygwin/include/cygwin/version.h: Bump API minor version. + * winsup/cygwin/include/cygwin/types.h: Define key_t as long long. + * winsup/cygwin/cygwin.din: Add ftok, _ftok. + * winsup/cygwin/ipc.cc (ftok): Rework implementation. + +2003-05-18 Joe Buehler <jhpb@hekimian.com> + + * spawn.cc (spawn_guts): Show more of command line in strace output. + +2003-05-15 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread::init_mainthread): Remove function parameter. + (MTinterface::Init): Ditto. + * thread.cc (MTinterface::Init): Remove function parameter. + Always initialize reent_key. + (pthread::init_mainthread): Remove function parameter. + (MTinterface::fixup_after_fork): Fix pthread::init_mainthread call. + * dcrt0.cc (dll_crt_0_1) Fix calls to MTinterface::Init and + pthread::init_mainthread. + Call pthread::init_mainthread only when not forked. + +2003-05-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_meminfo): Make swap memory output + Linux style values. + +2003-05-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h: Define __USE_INTERNAL_STAT64 appropriately. + +2003-05-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (CYGWIN_START): Define as crt0.o. Add to TARGET_LIBS. + * fhandler.h (fhandler_virtual::fstat): Remove useless declaration. + * fhandler_virtual.cc: Remove _COMPILING_NEWLIB define. + * ipc.cc (ftok): Use stat64. + * syscalls.cc (_fstat64): Remove alias. + (_fstat): Ditto. + (_stat): Ditto. + (_fstat64_r): New function. + (_fstat_r): Ditto. + (_stat64_r): Ditto. + (stat_r): Ditto. + * crt0.o: New file, moved from newlib. + * include/sys/param.h: Ditto. + * include/sys/utime.h: Ditto. + * include/sys/utmp.h: Ditto. + * include/sys/dirent.h: Ditto. Expose different struct dirent, + dependening of the environment. + +2003-05-11 Corinna Vinschen <corinna@vinschen.de> + + Replace ino_t by __ino64_t throughout. + +2003-05-11 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h: Add key_t typedef. + +2003-05-10 Christopher Faylor <cgf@redhat.com> + + * dir.cc (readdir): Fill out new old_d_ino field. + * fhandler.h (fhandler_base::namehash): Define as ino_t. + (fhandler_base::get_namehash): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Accommodate + new 64 bit st_ino. + * fhandler_socket.cc (fhandler_socket::fstat): Ditto. + * path.cc (hash_path_name): Return ino_t. + * syscalls.cc (stat64_to_stat32): Convert 64 bit inode to 32 bit. + * winsup.h (hash_path_name): Declare as returning ino_t. + * include/cygwin/stat.h (__stat32): Use 32 bit st_ino. + (__stat64): Use 64 bit st_ino. + * include/cygwin/types.h (__ino64_t): Define. + (__ino32_t): Ditto. + (ino_t): Define appropriately. + +2003-05-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (NEW_FUNCTIONS): All 32/64 from 0.79 API get + leading underscore. + * cygwin.din: Ditto. + * include/cygwin/version.h: Bump API minor number. + +2003-05-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h: New file. + +2003-05-09 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::detach): Prioritize waiting for I/O + completion over waiting for signal delivery. + +2003-05-06 Thomas Pfaff <tpfaff@gmx.net> + + * signal.cc (nanosleep): Do not wait twice for signal arrival. + +2003-05-03 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h: Fix erroneous definition of ino_t from + 2003-04-28. + +2003-05-03 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (chown_worker): Allow chown'ing of socket files. + +2003-04-30 Thomas Pfaff <tpfaff@gmx.net> + + * Makefile.in: Revert patch from 2003-04-17. + +2003-04-28 Brian Ford <ford@vss.fsi.com> + + * profil.h (PROFADDR): Prevent overflow when text segments are larger + than 256k. + * profil.c (profthr_func): Raise thread priority for more accurate + sampling. + +2003-04-26 Christopher Faylor <cgf@redhat.com> + + * path.cc (hash_path_name): Use ino_t as type. + +2003-04-26 Christopher Faylor <cgf@redhat.com> + + * errno.cc (_sys_nerr): Fix compile error erroneously checked in on + 2003-04-23. + +2003-04-25 Corinna Vinschen <corinna@vinschen.de> + + * include/netinet/ip.h: Include netinet/in_systm.h and netinet/in.h + to allow standalone usage (autoconf). + +2003-04-23 Christopher Faylor <cgf@redhat.com> + + * fork.cc: Change SLOW_PID_REUSE to NO_SLOW_PID_REUSE and invert ifdef + sense throughout. + +2003-04-22 Christopher Faylor <cgf@redhat.com> + + * select.cc (fhandler_pipe::ready_for_read): Assure that get_guard is + called for successful non-blocking pipe reads. + +2003-04-22 Corinna Vinschen <corinna@vinschen.de> + + * include/inttypes.h: New file. + * include/stdint.h: New file. + * include/cygwin/in.h: Include stdint.h instead of sys/types.h. + * include/cygwin/types.h: Include stdint.h. Remove typedefs for + intN_t and uintN_t since these are defined in stdint.h now. + +2003-04-21 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL major number to 1005. Change DLL + minor number to 0. Bump API minor number. + +2003-04-20 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CreateWindowStationA): Add. + (SetProcessWindowStation): Add. + +2003-04-19 Christopher Faylor <cgf@redhat.com> + + * wincap.h (wincaps:pty_needs_alloc_console): New element. + (wincapc:pty_needs_alloc_console): New function. + * wincap.cc: Add pty_needs_alloc_console throughout. + * fhandler_tty.cc (fhandler_tty_slave::open): Open an "invisible" + console on first pty allocation. + +2003-04-18 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Allocate a console + whenever a pty is allocated. + +2003-04-18 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Use ${nostdlib} variable. + +2003-04-18 Diego Biurrun <diego@biurrun.de> + + * fhandler_proc.cc (format_proc_cpuinfo): Change /proc/cpuinfo "vendor + id" string to "vendor_id" to conform with Linux systems. + +2003-04-17 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (setsid): Don't call FreeConsole if ctty is already < 0. + +2003-04-17 Thomas Pfaff <tpfaff@gmx.net> + + * Makefile.in: Add finline-functions optimization to CXXFLAGS. + * autoload.cc (LoadDLLprime): Rename std_dll_init to + _std_dll_init. + (std_dll_init): Remove name mangling prototype. Add attributes + used and noinline. + (wsock_init): Ditto. + Change wsock_init to _wsock_init in wsock32 and ws2_32 + LoadDLLprime. + * exceptions.cc (unused_sig_wrapper): Remove prototype. Add + attributes used and noinline. + * pwdgrp.h ((pwdgrp (passwd *&)): Remove inline code. + (pwdgrp (__group32 *&)): Ditto. + * grp.cc (pwdgrp (passwd *&)): Outline constructor. + (pwdgrp (__group32 *&)): Ditto. + +2003-04-17 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread::equal): New static method. + * thread.cc: Rename pthread_equal to pthread::equal throughout. + (pthread_equal): Use pthread::equal to compare threads ids. + +2003-04-15 Christopher Faylor <cgf@redhat.com> + + * termios.cc (setspeed): New function. + (cfsetospeed): Use setspeed to set speed. + (cfsetispeed): Use setspeed to set speed. + +2003-04-15 Chris January <chris@atomice.net> + + * autoload.cc: Add load statement for UuidCreate, and + UuidCreateSequential. + * cpuid.h: New file. + * cygwin.din: Export gethostid. + * fhandler_proc.cc (cpuid): Move to cpuid.h. + (can_set_flag): Move to cpuid.h. + * syscalls.cc (gethostid): New function. + * version.h: Bump api minor version number to 83. + +2003-04-15 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread_rwlock::release): New method. + * thread.cc (pthread_rwlock::unlock): Use release to signal waiting + threads. + (pthread_rwlock::rdlock_cleanup): Signal waiting threads after a + cancelation. + (pthread_rwlock::wrlock_cleanup): Ditto. + +2003-04-13 Pierre Humblet <pierre.humblet@ieee.org> + + * mkvers.sh: Prefix day with 0 in date only when day < 10. + +2003-04-11 Pierre Humblet <pierre.humblet@ieee.org> + + * security.cc (get_info_from_sd): New function. + (get_nt_attribute): Only call read_sd and get_info_from_sd. + Return void. + (get_file_attribute): Move sd error handling to get_info_from_sd. + and symlink handling to fhandler_disk_file::fstat_helper. + (get_nt_object_attribute): Only call read_sd and get_info_from_sd. + Return void. + (get_object_attribute): Remove symlink handling and simply return -1 + when ntsec is off. + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): For + symlinks set the attribute, call get_file_attribute to get the ids + and return. In the normal case call get_file_attribute with the + addresses of the buffer ids and do not recheck if the file is a socket. + +2003-04-10 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::stub): Initialize stack pointer earlier. + (cygthread::simplestub): Initialize stack pointer. + (cygthread::terminate_thread): Account for possibility that stack + pointer has not been set. Issue warnings for unusual conditions. + +2003-04-10 Corinna Vinschen <corinna@vinschen.de> + + * regex/regex.h: Define regoff_t as _off_t. + * regex/regex2.h: Ditto. + +2003-04-10 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcscoll, wcswidth and wcwidth. + * include/cygwin/version.h: Bump API minor number. + +2003-04-10 Christopher Faylor <cgf@redhat.com> + + * cygthread.h: Change 'avail' cygthread element to 'inuse' throughout. + * cygthread.cc: Ditto. + (cygthread::stub): Don't initialize already initialized events. + (cygthread::freerange): Don't create thread here. + (cygthread::cygthread): Create thread here. Die if thread not created. + (cygthread::operator new): Simplify. Just grab a thread structure from + the pool. Don't try to start the thread. + (cygthread::terminate_thread): Don't close event handles. Just reuse + them. Call MEM_RELEASE rather than MEM_DECOMMIT (from Joe uehler). + +2003-04-08 Bob Cassels <bcassels@abinitio.com> + + * fhandler_console.cc (fhandler_console::read) Handle certain key up + events, to allow pasting accented characters and typing them using the + "alt + numerics" sequences. + +2003-04-07 Christopher Faylor <cgf@redhat.com> + + * include/limits.h (IOV_MAX): Set to a number which is small enough to + use in an array. + +2003-04-04 Christopher Faylor <cgf@redhat.com> + + * cygthread.h (cygthread::avail): Make LONG for easier use with + Interlocked* functions. + * cygthread.cc (cygthread::init): Eliminate unneeded muto. + (cygthread::operator new): Don't lock. Instead change use of avail + variable into tri-state: available (1), not available (-1), + uninitialized (0). + (cygthread::terminate_thread): Set avail to uninitialized. + (cygthread::detach): Eliminate local 'avail'. Always set avail to 1 + unless signalled. + +2003-04-04 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::operator new): Be more defensive when messing with + threads that are marked "unavailable". + +2003-04-03 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (CONVERT_LIMIT): Use a size for the 21st century. + +2003-04-03 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (check_ntsec): Return general ntsec state on NULL + filename. Check wincap.is_security() additionally. + +2003-04-02 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (EXTRA_OFILES): Remove debugging object. + +2003-04-02 Jason Tishler <jason@tishler.net> + Christopher Faylor <cgf@redhat.com> + + * external.cc (check_ntsec): New function. + (cygwin_internal): Add CW_CHECK_NTSEC handling to call check_ntsec() + from applications. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CHECK_NTSEC. + +2003-04-02 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::new): Add more defensive debugging. + +2003-04-01 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler_base::fstat): Set the uid and gid fields + from the current effective ids. + * fhandler_socket.cc (fhandler_socket::fstat): Keep the uid and gid set + by fhandler_base::fstat. + * security.cc (get_nt_attribute): Do not test wincap.has_security (). + (get_nt_object_attribute): Ditto. + (get_file_attribute): Add test for wincap.has_security (). + (get_object_attribute): Ditto. + +2003-04-01 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc: Change __off32_t to _off_t and __off64_t to _off64_t + throughout. + * fhandler.cc: Ditto. + * fhandler.h: Ditto. + * fhandler_clipboard.cc: Ditto. + * fhandler_disk_file.cc: Ditto. + * fhandler_dsp.cc: Ditto. + * fhandler_floppy.cc: Ditto. + * fhandler_mem.cc: Ditto. + * fhandler_proc.cc: Ditto. + * fhandler_process.cc: Ditto. + * fhandler_random.cc: Ditto. + * fhandler_registry.cc: Ditto. + * fhandler_tape.cc: Ditto. + * fhandler_termios.cc: Ditto. + * fhandler_virtual.cc: Ditto. + * fhandler_zero.cc: Ditto. + * mmap.cc: Ditto. + * pipe.cc: Ditto. + * syscalls.cc: Ditto. + * winsup.h: Ditto. + * include/cygwin/stat.h: Ditto. + * include/cygwin/types.h: Ditto. Remove definition of __off32_t + and __off64_t. + +2003-03-31 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (setup_handler): Make sure winapi lock is released when + exiting loop. + +2003-03-30 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/fs.h: Remove unneeded include. + * include/cygwin/in.h: Include sys/types.h rather than cygwin/types.h. + +2003-03-29 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (login): Fix comment. + (logout): Ditto. + +2003-03-29 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc: Slightly cleanup all utmp functions. + (login): Use mutex to secure against concurrent access to wtmp file. + (logout): Rewrite using POSIX calls. + (utmp_fd): Initialized to -1 now. Any value < 0 is treated as closed + in subsequent functions. + (utmp_readonly): New variable, indicating utmp file open for reading + only. + (internal_setutent): New function implementing setutent(). + (setutent): Call internal_setutent now. + (endutent): Reset utmp_readonly. + (getutent): Return immediately if utmp file can't be opened. + (getutid): Ditto. + (getutline): Ditto. + (pututline): Ditto. Use mutex to secure against concurrent access to + utmp file. + +2003-03-28 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Remove EXE_LDFLAGS. Fix fhandler_CFLAGS typo. Recognize .s suffix. + * configure.in: Remove EXE_LDFLAGS. + * configure: Regenerate. + +2003-03-28 Christopher Faylor <cgf@redhat.com> + + * include/sys/cygwin.h: Declare cygwin_internal as unsigned long. + * external.cc (cygwin_internal): Define as unsigned long. + +2003-03-27 Christopher Faylor <cgf@redhat.com> + + * include/sys/cygwin.h: Move cygwin_internal outside of WINVER + conditional. + +2003-03-27 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc: Change 1==foo equations to foo==1 throughout. + +2003-03-27 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h: Change class names, methods, members and local vars + according to the GNU coding style. + * thread.cc: Ditto. + * dcrt0.cc (dll_crt0_1): Rename pthread::initMainThread call to + pthread::init_mainthread. + * pthread.cc (pthead_getsequence_np): Rename pthread::isGoodObject + call to pthread::is_good_object. + +2003-03-27 Joe Buehler <jhpb@draco.hekimian.com> + + * autoload.cc: Add RegGetKeySecurity(). + * security.cc (get_nt_object_attribute): Use RegGetKeySecurity() for + performance. + +2003-03-25 Christopher Faylor <cgf@redhat.com> + Joe Buehler <jhpb@draco.hekimian.com> + + * fork.cc (fork_parent): Don't copy signals from parent to child here. + * sigproc.cc (proc_subproc): Copy signals from parent to child pinfo + here. + +2003-03-23 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (class List): Move inline code inside class declaration. + (List::forEach): Change callback parameter to template class member + function pointer. + (pthread_keys::fixup_before_fork): Change to inline. Use List::forEach + to fixup keys. + (pthread_keys::fixup_after_fork): Ditto. + (pthread_keys::runAllDestructors): Ditto. + (pthread_key::saveAKey): Remove. + (pthread_key::restoreAKey): Ditto. + (pthread_key::destroyAKey): Ditto. + (pthread_key::run_destructor): Rename to runDestructor. + (pthread_mutex::fixup_after_fork): Change to inline. Use List::forEach + to fixup mutexes after a fork. + (pthread_mutex::FixupAfterFork): New method. + (pthread_mutex::mutexes): New member. + (pthread_cond::fixup_after_fork): Change to inline. Use List::forEach + to fixup conds after a fork. + (pthread_cond::FixupAfterFork): New method. + (pthread_cond::conds): New member. + (pthread_rwlock::fixup_after_fork): Change to inline. Use + List::forEach to fixup rwlocks after a fork. + (pthread_rwlock::FixupAfterFork): New method. + (pthread_rwlock::rwlocks): New member. + (semaphore::fixup_after_fork): Change to inline. Use List::forEach to + fixup mutexes after a fork. + (semaphore::FixupAfterFork): New method. + (semaphore::semaphores): New member. + (MTinterface::mutexs): Remove. + (MTinterface::conds): Ditto. + (MTinterface::rwlocks): Ditto. + (MTinterface::semaphores): Ditto. + (pthread_equal): Add extern "C". + (pthread_mutex_lock): Ditto. + + * thread.cc (MTinterface::fixup_after_fork): Change fixup_after_fork + calls for pthread objects. + (semaphore::conds): Instantiate. + (pthread_cond::pthread_cond): Use List::Insert rather than custom list + code. + (pthread_cond::~pthread_cond): Use List::Remove rather than custom list + code. + (pthread_cond::fixup_after_fork): Rename to FixupAfterFork. + (pthread_rwlock::rwlocks): Instantiate. + (pthread_rwlock::pthread_crwlock): Use List::Insert rather than custom + list code. + (pthread_rwlock::~pthread_rwlock): Use List::Remove rather than custom + list code. + (pthread_rwlock::fixup_after_fork): Rename to FixupAfterFork. + (pthread_key::saveAKey): Remove. + (pthread_key::fixup_before_fork): Ditto. + (pthread_key::restoreAKey): Ditto. + (pthread_key::fixup_after_fork): Ditto. + (pthread_key::destroyAKey): Ditto. + (pthread_key::runAllDestructors): Ditto. + (pthread_key::run_destructor): Rename to runDestructor. + (pthread_mutex::mutexes): Instantiate. + (pthread_mutex::pthread_mutex): Use List::Insert rather than custom + list code. + (pthread_mutex::~pthread_mutex): Use List::Remove rather than custom + list code. + (pthread_mutex::fixup_after_fork): Rename to FixupAfterFork. + (semaphore::conds): Instantiate. + (semaphore::semaphore): Use List::Insert rather than custom list code. + (semaphores::~semaphore): Use List::Remove rather than custom list + code. + (semaphore::fixup_after_fork): Rename to FixupAfterFork. + +2003-03-22 Christopher Faylor <cgf@redhat.com> + + * pipe.cc (fhandler_pipe::dup): Don't dup input_handle if it doesn't + exist. + +2003-03-22 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (unlink): Be more defensive when SetFileAttributes is + called. Fix typo in debugging output. + +2003-03-21 Christopher Faylor <cgf@redhat.com> + + * fork.cc: Conditionalize use of slow_pid_reuse throughout. It's not + necessary for newer versions of bash. + +2003-03-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::sendto): Restrict EPIPE and + SIGPIPE handling to connection oriented sockets. Add comment. + +2003-03-19 Christopher Faylor <cgf@redhat.com> + + * sigproc.h (signal_fixup_after_exec): Eliminate argument in declaration. + * exceptions.cc (signal_fixup_after_exec): Eliminate argument in + definition. Don't reset signal handlers after spawm. Just treat like + fork/exec. + * dcrt0.cc (dll_crt0_1): Don't pass PROC_SPAWN argument to + signal_fixup_after_exec. + * syscalls.cc (unlink): Don't change attributes of file if not readonly/system. + Ditto for resetting of arguments. + +2003-03-19 Corinna Vinschen <corinna@vinschen.de> + + * glob.c: Eliminate __INSIDE_CYGWIN__ preprocessor conditionals + throughout. + +2003-03-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Fix + wrong usage of S_IFDIR. + * security.cc (get_attribute_from_acl): Ditto. + (get_file_attribute): Fix wrong usage of S_IFLNK. + (get_object_attribute): Ditto. + (alloc_sd): Fix wrong usage of S_IFDIR. + * syscalls.cc (chmod): Allow chmod'ing of socket files. + +2003-03-19 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES): + Define. + * glob.c (g_lstat): Use CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES + instead of numerical constants. + (g_stat): Ditto. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + + * pthread.cc (pthread_attr_init): Remove + (pthread_attr_destroy): Ditto. + (pthread_attr_setdetachstate): Ditto. + (pthread_attr_getdetachstate): Ditto. + (pthread_attr_setstacksize): Ditto. + (pthread_attr_getstacksize): Ditto. + (pthread_attr_setinheritsched): Ditto. + (pthread_attr_getinheritsched): Ditto. + (pthread_attr_setschedparam): Ditto. + (pthread_attr_getschedparam): Ditto. + (pthread_attr_setschedpolicy): Ditto. + (pthread_attr_getschedpolicy): Ditto. + (pthread_attr_setscope): Ditto. + (pthread_attr_getscope): Ditto. + (pthread_attr_setstackaddr): Ditto. + (pthread_attr_getstackaddr): Ditto. + (pthread_key_create): Ditto. + (pthread_key_delete): Ditto. + (pthread_setspecific): Ditto. + (pthread_getspecific): Ditto. + (pthread_kill): Ditto. + (pthread_sigmask): Ditto. + (pthread_equal): Ditto. + (pthread_mutex_lock): Ditto. + (pthread_mutex_trylock): Ditto. + (pthread_mutex_unlock): Ditto. + (pthread_mutex_destroy): Ditto. + (pthread_mutex_setprioceiling): Ditto. + (pthread_mutex_getprioceiling): Ditto. + (pthread_mutexattr_destroy): Ditto. + (pthread_mutexattr_getprioceiling): Ditto. + (pthread_mutexattr_getprotocol): Ditto. + (pthread_mutexattr_getpshared): Ditto. + (pthread_mutexattr_gettype): Ditto. + (pthread_mutexattr_init): Ditto. + (pthread_mutexattr_setprioceiling): Ditto. + (pthread_mutexattr_setprotocol): Ditto. + (pthread_mutexattr_setpshared): Ditto. + (pthread_mutexattr_settype): Ditto. + (pthread_cond_destroy): Ditto. + (pthread_cond_signal): Ditto. + (pthread_cond_broadcast): Ditto. + (pthread_condattr_init): Ditto. + (pthread_condattr_destroy): Ditto. + (pthread_condattr_getpshared): Ditto. + (pthread_condattr_setpshared): Ditto. + (pthread_rwlock_destroy): Ditto. + (pthread_rwlock_rdlock): Ditto. + (pthread_rwlock_tryrdlock): Ditto. + (pthread_rwlock_wrlock): Ditto. + (pthread_rwlock_trywrlock): Ditto. + (pthread_rwlock_unlock): Ditto. + (pthread_rwlockattr_init): Ditto. + (pthread_rwlockattr_getpshared): Ditto. + (pthread_rwlockattr_setpshared): Ditto. + (pthread_rwlockattr_destroy): Ditto. + (pthread_getconcurrency): Ditto. + (pthread_setconcurrency): Ditto. + (pthread_getschedparam): Ditto. + (pthread_setschedparam): Ditto. + + * thread.h (__pthread_attr_init): Remove prototype. + (__pthread_attr_destroy): Ditto. + (__pthread_attr_setdetachstate): Ditto. + (__pthread_attr_getdetachstate): Ditto. + (__pthread_attr_setstacksize): Ditto. + (__pthread_attr_getstacksize): Ditto. + (__pthread_attr_setinheritsched): Ditto. + (__pthread_attr_getinheritsched): Ditto. + (__pthread_attr_setschedparam): Ditto. + (__pthread_attr_getschedparam): Ditto. + (__pthread_attr_setschedpolicy): Ditto. + (__pthread_attr_getschedpolicy): Ditto. + (__pthread_attr_setscope): Ditto. + (__pthread_attr_getscope): Ditto. + (__pthread_attr_setstackaddr): Ditto. + (__pthread_attr_getstackaddr): Ditto. + (__pthread_key_create): Ditto. + (__pthread_key_delete): Ditto. + (__pthread_setspecific): Ditto. + (__pthread_getspecific): Ditto. + (__pthread_kill): Ditto. + (__pthread_sigmask): Ditto. + (__pthread_equal): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutexattr_destroy): Ditto. + (__pthread_mutexattr_getprioceiling): Ditto. + (__pthread_mutexattr_getprotocol): Ditto. + (__pthread_mutexattr_getpshared): Ditto. + (__pthread_mutexattr_gettype): Ditto. + (__pthread_mutexattr_init): Ditto. + (__pthread_mutexattr_setprioceiling): Ditto. + (__pthread_mutexattr_setprotocol): Ditto. + (__pthread_mutexattr_setpshared): Ditto. + (__pthread_mutexattr_settype): Ditto. + (__pthread_cond_destroy): Ditto. + (__pthread_cond_signal): Ditto. + (__pthread_cond_broadcast): Ditto. + (__pthread_condattr_init): Ditto. + (__pthread_condattr_destroy): Ditto. + (__pthread_condattr_getpshared): Ditto. + (__pthread_condattr_setpshared): Ditto. + (__pthread_rwlock_destroy): Ditto. + (__pthread_rwlock_rdlock): Ditto. + (__pthread_rwlock_tryrdlock): Ditto. + (__pthread_rwlock_wrlock): Ditto. + (__pthread_rwlock_trywrlock): Ditto. + (__pthread_rwlock_unlock): Ditto. + (__pthread_rwlockattr_init): Ditto. + (__pthread_rwlockattr_getpshared): Ditto. + (__pthread_rwlockattr_setpshared): Ditto. + (__pthread_rwlockattr_destroy): Ditto. + (__pthread_getconcurrency): Ditto. + (__pthread_setconcurrency): Ditto. + (__pthread_getschedparam): Ditto. + (__pthread_setschedparam): Ditto. + + * thread.cc: Rename __pthread_equal to pthread_equal throughout. + Change pthread_self parameter appropriate. + (__pthread_attr_init): Remove __ prefix. Change to extern "C". + (__pthread_attr_destroy): Ditto. + (__pthread_attr_setdetachstate): Ditto. + (__pthread_attr_getdetachstate): Ditto. + (__pthread_attr_setstacksize): Ditto. + (__pthread_attr_getstacksize): Ditto. + (__pthread_attr_setinheritsched): Ditto. + (__pthread_attr_getinheritsched): Ditto. + (__pthread_attr_setschedparam): Ditto. + (__pthread_attr_getschedparam): Ditto. + (__pthread_attr_setschedpolicy): Ditto. + (__pthread_attr_getschedpolicy): Ditto. + (__pthread_attr_setscope): Ditto. + (__pthread_attr_getscope): Ditto. + (__pthread_attr_setstackaddr): Ditto. + (__pthread_attr_getstackaddr): Ditto. + (__pthread_key_create): Ditto. + (__pthread_key_delete): Ditto. + (__pthread_setspecific): Ditto. + (__pthread_getspecific): Ditto. + (__pthread_kill): Ditto. + (__pthread_sigmask): Ditto. + (__pthread_equal): Ditto. + (__pthread_mutex_lock): Ditto. + (__pthread_mutex_trylock): Ditto. + (__pthread_mutex_unlock): Ditto. + (__pthread_mutex_destroy): Ditto. + (__pthread_mutex_setprioceiling): Ditto. + (__pthread_mutex_getprioceiling): Ditto. + (__pthread_mutexattr_destroy): Ditto. + (__pthread_mutexattr_getprioceiling): Ditto. + (__pthread_mutexattr_getprotocol): Ditto. + (__pthread_mutexattr_getpshared): Ditto. + (__pthread_mutexattr_gettype): Ditto. + (__pthread_mutexattr_init): Ditto. + (__pthread_mutexattr_setprioceiling): Ditto. + (__pthread_mutexattr_setprotocol): Ditto. + (__pthread_mutexattr_setpshared): Ditto. + (__pthread_mutexattr_settype): Ditto. + (__pthread_cond_destroy): Ditto. + (__pthread_cond_signal): Ditto. + (__pthread_cond_broadcast): Ditto. + (__pthread_condattr_init): Ditto. + (__pthread_condattr_destroy): Ditto. + (__pthread_condattr_getpshared): Ditto. + (__pthread_condattr_setpshared): Ditto. + (__pthread_rwlock_destroy): Ditto. + (__pthread_rwlock_rdlock): Ditto. + (__pthread_rwlock_tryrdlock): Ditto. + (__pthread_rwlock_wrlock): Ditto. + (__pthread_rwlock_trywrlock): Ditto. + (__pthread_rwlock_unlock): Ditto. + (__pthread_rwlockattr_init): Ditto. + (__pthread_rwlockattr_getpshared): Ditto. + (__pthread_rwlockattr_setpshared): Ditto. + (__pthread_rwlockattr_destroy): Ditto. + (__pthread_getconcurrency): Ditto. + (__pthread_setconcurrency): Ditto. + (__pthread_getschedparam): Ditto. + (__pthread_setschedparam): Ditto. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + + * cygwin.din: Add pthread_rwlock_destroy, pthread_rwlock_init, + pthread_rwlock_rdlock, pthread_rwlock_tryrdlock, + pthread_rwlock_wrlock, pthread_rwlock_trywrlock, + pthread_rwlock_unlock, pthread_rwlockattr_init, + pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared, + and pthread_rwlockattr_destroy. + * include/cygwin/version.h: Bump API minor number. + * include/pthread.h (PTHREAD_RWLOCK_INITIALIZER): Define a + reasonable value. + Add prototypes for pthread_rwlock_destroy, pthread_rwlock_init, + pthread_rwlock_rdlock, pthread_rwlock_tryrdlock, + pthread_rwlock_wrlock, pthread_rwlock_trywrlock, + pthread_rwlock_unlock, pthread_rwlockattr_init, + pthread_rwlockattr_getpshared, pthread_rwlockattr_setpshared, + and pthread_rwlockattr_destroy. + * thread.h (PTHREAD_ONCE_MAGIC): Remove superflous semicolon. + (PTHREAD_RWLOCK_MAGIC): New define. + (PTHREAD_RWLOCKATTR_MAGIC): Ditto. + (pthread_rwlockattr): New class. + (pthread_rwlock): Ditto. + (MTinterface::rwlocks): New member. + (MTinterface::MTinterface): Initialize rwlocks. + Add prototypes for __pthread_rwlock_destroy, + __pthread_rwlock_wrlock, __pthread_rwlock_trywrlock, + __pthread_rwlock_unlock, __pthread_rwlockattr_init, + __pthread_rwlockattr_getpshared, __pthread_rwlockattr_setpshared, + and __pthread_rwlockattr_destroy. + * thread.cc (MTinterface::Init): Initialize rwlock internal mutex. + (MTinterface::fixup_after_fork): Fixup rwlocks after fork. + (pthread_rwlockattr::isGoodObject): Implement. + (pthread_rwlockattr::pthread_rwlockattr): Ditto. + (pthread_rwlockattr::~pthread_rwlockattr): Ditto. + (pthread_rwlock::initMutex): Ditto. + (pthread_rwlock::pthread_rwlock): Ditto. + (pthread_rwlock::~pthread_rwlock): Ditto. + (pthread_rwlock::RdLock): Ditto. + (pthread_rwlock::TryRdLock): Ditto. + (pthread_rwlock::WrLock): Ditto. + (pthread_rwlock::TryWrLock): Ditto. + (pthread_rwlock::UnLock): Ditto. + (pthread_rwlock::addReader): Ditto. + (pthread_rwlock::removeReader): Ditto. + (pthread_rwlock::lookupReader): Ditto. + (pthread_rwlock::RdLockCleanup): Ditto. + (pthread_rwlock::WrLockCleanup): Ditto. + (pthread_rwlock::fixup_after_fork): Ditto. + (pthread_rwlock::isGoodObject): Ditto. + (pthread_rwlock::isGoodInitializer): Ditto. + (pthread_rwlock::isGoodInitializerOrObject): Ditto. + (pthread_rwlock::isGoodInitializerOrBadObject): Ditto. + (__pthread_rwlock_destroy): Ditto. + (pthread_rwlock::init): Ditto. + (__pthread_rwlock_rdlock): Ditto. + (__pthread_rwlock_tryrdlock): Ditto. + (__pthread_rwlock_wrlock): Ditto. + (__pthread_rwlock_trywrlock): Ditto. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread_cond::ExitingWait): Remove. + (pthread_cond::mutex): Ditto. + (pthread_cond::cond_access): Ditto. + (pthread_cond::win32_obj_id): Ditto. + (pthread_cond::TimedWait): Ditto. + (pthread_cond::BroadCast): Ditto. + (pthread_cond::Signal): Ditto. + (pthread_cond::waiting): Change type to unsigned long. + (pthread_cond::pending): New member. + (pthread_cond::semWait): Ditto. + (pthread_cond::mtxIn): Ditto. + (pthread_cond::mtxOut): Ditto. + (pthread_cond::mtxCond): Ditto. + (pthread_cond::UnBlock): New method. + (pthread_cond::Wait): Ditto. + * thread.cc: Update list of cancellation points. + (pthread_cond::pthread_cond): Rewrite. + (pthread_cond::~pthread_cond): Ditto. + (pthread_cond::TimedWait): Remove. + (pthread_cond::BroadCast): Ditto. + (pthread_cond::Signal): Ditto. + (pthread_cond::UnBlock): Implement. + (pthread_cond::Wait): Ditto. + (pthread_cond::fixup_after_fork): Rewrite. + (pthread_mutex::fixup_after_fork): Remove DETECT_BAD_APP + conditional. + (__pthread_cond_broadcast): Just return 0 if the condition is + not initialized. Call pthread_cond::UnBlock to release blocked + threads. + (__pthread_cond_signal): Ditto. + (__pthread_cond__dowait): Rewrite. + (pthread_cond_timedwait): Add pthread_testcancel call. Fix + waitlength calculation. + (pthread_cond_wait): Add pthread_testcancel call. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + + * include/pthread.h (PTHREAD_MUTEX_NORMAL): New define. + * thread.cc: Remove errno.h include. + (pthread::precreate): Change internal mutex type to normal. + (pthread_mutex::canBeUnlocked): Implement. + (pthread_mutex::pthread_mutex): Initialize lock_counter with 0. + (pthread_mutex::Lock): Rename to _Lock. Add self parameter. + Change lock_counter logic. Update SetOwner call. + (pthread_mutex::TryLock): Rename to _TryLock. Add self parameter. + Change lock_counter logic. Update SetOwner call. + (pthread_mutex::UnLock): Rename to _UnLock. Add self parameter. + Change lock_counter logic. + (pthread_mutex::Destroy): Rename to _Destroy. Update TryLock call. + (pthread_mutex::SetOwner): Move to thread.h as inline. + (pthread_mutex::LockRecursive): Ditto. + (pthread_mutex::fixup_after_fork): Change lock_counter logic. + (__pthread_mutexattr_settype): Add PTHREAD_MUTEX_NORMAL to valid + types check. + * thread.h: Include errno.h and limits.h. + (MUTEX_LOCK_COUNTER_INITIAL): Remove. + (MUTEX_OWNER_ANONYMOUS): New define. + (pthread_mutex::canBeUnlocked): New static method. + (pthread_mutex::lock_counter): Change type to unsigned long. + (pthread_mutex::GetPthreadSelf): New method. + (pthread_mutex::Lock): Call _Lock with pthread_self pointer. + (pthread_mutex::TryLock): Call _TryLock with pthread_self pointer. + (pthread_mutex::UnLock): Call _UnLock with pthread_self pointer. + (pthread_mutex::Destroy): Call _Destroy with pthread_self pointer. + (pthread_mutex::SetOwner): Moved from thread.cc as inline. + (pthread_mutex::LockRecursive): Ditto. + (pthread_mutex::_Lock): New method. + (pthread_mutex::_TryLock): New method. + (pthread_mutex::_UnLock): New method. + (pthread_mutex::_Destroy): New method. + +2003-03-18 Christopher January <chris@atomice.net> + + * fhandler_proc.cc (format_proc_cpuinfo): Use IsProcessorFeaturePresent + only on Windows NT. Read CPU Mhz value only on NT. Revert previous + change so cpuid instruction is called even on non-NT systems. + +2003-03-17 Corinna Vinschen <corinna@vinschen.de> + + * glob.c (g_lstat): Change API minor test to match API minor number + change in previous patch. + (g_stat): Ditto. + +2003-03-17 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Reorganize last two api versions so that + btowc and trunc exports show up before previous bump since there has + been no exported version of the DLL with the 64 bit changes yet but + 1.3.22 will have the btowc and trunc. + +2003-03-17 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Export btowc, trunc. + * include/cygwin/version.h: Reflect new exports. + * syscalls.cc (_stat): Rename to stat to avoid newlib wrapper. + * syscalls.cc (_fstat): Ditto. + +2003-03-16 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::close): Correct check for + current tty. Add debugging output when console is freed. + (set_console_state_for_spawn): Add debugging output. + * fhandler_tty.cc (fhandler_tty_slave::open): Don't decrement console + open flag when vforking. + * sigproc.cc (sigproc_terminate): Fix debugging output. + * spawn.cc (handle): Eliminate second argument. + (spawn_guts): Reflect elimination of argument change to handle. + * syscalls.cc (setsid): Add debugging output when console is freed. + +2003-03-14 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (rename): Revert assumption that DELETE_ON_CLOSE works on + Win9x. + +2003-03-13 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 23. + +2003-03-13 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (IsProcessorFeaturePresent): Add. + * fhandler_proc.cc (format_proc_cpuinfo): Add case for 9x systems. + +2003-03-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_cpuinfo): Fix vendor id in cpuid case. + +2003-03-13 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_rcmd): Use correct file descriptor in call to fdsock. + (cygwin_rexec): Ditto. + +2003-03-13 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty_slave::close): Fix typo in debug + output. + + * syscalls.cc (rename): Assume that DELETE_ON_CLOSE works on Win9x. + +2003-03-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): Don't call + fhandler_base::dup() but call DuplicateHandle directly instead to have + control over socket inheritence. + +2003-03-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid + using WinSock2 socket duplication methods. Add comment. + +2003-03-11 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_socket.cc (fhandler_socket::fixup_after_fork): + Set io_handle to INVALID_SOCKET in case of failure. + (fhandler_socket::dup): Return 0 if the io_handle is valid. + +2003-03-10 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Don't handle DELETE flag specially. + * security.cc (alloc_sd): Ditto. + +2003-03-09 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc: Change Copyright hint to include 2003. + +2003-03-09 Corinna Vinschen <corinna@vinschen.de> + + Switch to 32/64 datatypes: + * Makefile.in (OBSOLETE_FUNCTIONS): Add open acl aclcheck aclfrommode + aclfrompbits aclfromtext aclsort acltomode acltopbits acltotext chown + facl fchown fgetpos fopen freopen fseeko fsetpos fstat ftello + ftruncate getegid geteuid getgid getgrent getgrgid getgrnam getgroups + getpwuid getpwuid_r getuid initgroups lchown lseek lstat mknod mmap + seekdir setegid seteuid setgid setgroups setregid setreuid setuid stat + telldir truncate. + (NEW_FUNCTIONS): Add _open64 acl32 aclcheck32 aclfrommode32 + aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32 + acltotext32 chown32 facl32 fchown32 fgetpos64 fopen64 freopen64 + fseeko64 fsetpos64 fstat64 ftello64 ftruncate64 getegid32 geteuid32 + getgid32 getgrent32 getgrgid32 getgrnam32 getgroups32 getpwuid32 + getpwuid_r32 getuid32 initgroups32 lchown32 lseek64 lstat64 mknod32 + mmap64 seekdir64 setegid32 seteuid32 setgid32 setgroups32 setregid32 + setreuid32 setuid32 stat64 telldir64 truncate64 to substitute the + above. + * cygserver_shm.h (class client_request_shm): Change uid_t and gid_t + members to __uid32_t and __gid32_t. + * cygwin.din: Add symbols acl32 aclcheck32 aclfrommode32 + aclfrompbits32 aclfromtext32 aclsort32 acltomode32 acltopbits32 + acltotext32 facl32 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 + _fstat64 ftello64 _lseek64 mknod32 _open64. + * glob.c: Include perprocess.h. + (globtilde): Call getpwuid32 and getuid32 instead of getpwuid and + getuid. + (g_lstat): Check for applications API version to call the appropriate + typed gl_lstat function. + (g_stat): Ditto for gl_stat. + * shm.cc (client_request_shm::client_request_shm): Call geteuid32 + and getegid32 instead of geteuid and getegid throughout. + * syscalls.cc (_open64): New alias for open. + (_lseek64): New alias for lseek64. + (_fstat64): New alias for fseek64. + (mknod32): New function. + (mknod): Calls mknod32 now. + * winsup.h: Make function declarations for getuid32, geteuid32, + and getpwuid32 accessible for plain C sources. Add declarations + for getegid32 and getpwnam. + * include/cygwin/version.h: Bum API minor number to 78. + * include/sys/cygwin.h: Guard C++ specific members of struct + per_process against inclusion in plain C sources. + * include/sys/mman.h (mman): Add guard to avoid type clash when + compiling Cygwin. + +2003-03-09 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 22. + +2003-03-09 Christopher Faylor <cgf@redhat.com> + + Do some minor reformatting of 'extern "C"' use throughout. + +2003-03-06 Christopher January <chris@atomice.net> + + * autoload.cc (GetSystemTimes): Define new autoload function. + * fhandler_proc.cc (proc_listing): Add cpuinfo and partitions entries. + (fhandler_proc::fill_filebuf): Add PROC_CPUINFO and PROC_PARTITIONS + cases. + (format_proc_uptime): Use GetSystemTimes if available. + (read_value): New macro. + (print): New macro. + (cpuid): New function. + (can_set_flag): New function. + (format_proc_cpuinfo): New function. + (format_proc_partitions): New function. + +2003-03-09 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (unlink): Attempt to be more clever about setting + attributes of file. Only open file in query mode to avoid having to + mess with security stuff for reading. + +2003-03-09 Corinna Vinschen <corinna@vinschen.de> + + * rmsym: Fix regular expression. + +2003-03-09 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Change from using new-* to cygwin0 for temporary + targets. + +2003-03-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h: Set SOMAXCONN to Winsock2 value. + +2003-03-08 Christopher Faylor <cgf@redhat.com> + + * syscalls.cc (unlink): Always attempt to use FILE_FLAG_CLOSE_ON_DELETE + to delete files since this allows us to preserve the protection of hard + linked files. + (link): Generate full path for potentially recalculated .lnk target. + +2003-03-08 Christopher Faylor <cgf@redhat.com> + + Revert below changes regarding _pinfo::cmdline. + +2003-03-08 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Change n to __off64_t to match change + of _pinfo::cmdline. + * fhandler.h (class fhandler_virtual): Change filesize member to + __off64_t. + * fhandler_proc.cc (format_proc_meminfo): Change to return __off64_t. + (format_proc_stat): Ditto. + (format_proc_uptime): Ditto. + * fhandler_process.cc (format_process_stat): Ditto. + (format_process_status): Ditto. + (format_process_statm): Ditto. + * pinfo.cc (_pinfo::cmdline): Expect __off64_t parameter. + * pinfo.h (class _pinfo): Change declaration of cmdline accordingly. + +2003-03-07 Christopher Faylor <cgf@redhat.com> + + * path.h (PATH_LNK): New enum val. + (path_conv::is_lnk_symlink): New function. True if path represents + .lnk style symlink. + * path.cc (check_shortcut): Set PATH_LNK in pflags when appropriate. + (symlink_info::check): Ditto. Remove PATH_LNK from pflags initially. + * syscalls.cc (unlink): Always remove readonly attribute from a symlink + regardless of type. + (link): (from Corinna Vinschen) Allow links to symlinks. Reset + attributes on a symlink after successful link creation. + (chmod): Use is_lnk_symlink where appropriate. + (rename): Ditto. + +2003-03-07 Pierre Humblet <pierre.humblet@ieee.org> + + * tty.cc (create_tty_master): Call GetComputerName instead of + cygwin_gethostname. Set ut_id. + * syscalls.cc (login): Call endutent. + (setutent): Do not seek after a fresh open. + +2003-03-07 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (seteuid32): Fix formatting. + +2003-03-04 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (MTinterface::fixup_after_fork): Initialize mainthread + prior to pthread objects. + +2003-03-04 Jason Tishler <jason@tishler.net> + + * fhandler_socket.cc (fhandler_socket::dup): Initialize type. + +2003-03-03 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_tty_slave::close): Declare new function. + (fhandler_tty_slave::dup): Declare new function. + (fhandler_tty_slave::fixup_after_function): Declare new function. + * fhandler_tty.cc (fhandler_tty_slave_open): Only increment + fhandler_console::open_fhs when associated with a pty. + (fhandler_tty_slave::close): Define new function. Decrement + fhandler_console::open_fhs when associated with a pty. + (fhandler_tty_slave::dup): Define new function. Increment + fhandler_console::open_fhs when associated with a pty. + (fhandler_tty_slave::fixup_after_fork): Define new function. Increment + fhandler_console::open_fhs when associated with a pty. + +2003-03-03 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_pty_slave::open): Grudgingly increment + fhandler_console::open_fhs here. + (fhandler_pty_slave::close): Ditto for close. + +2003-03-02 Christopher Faylor <cgf@redhat.com> + + * lib/getopt.c: Refresh from NetBSD sources. + +2003-03-02 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::close): Don't decrement + in use counter if in vfork fixup stage. + +2003-03-02 Christopher Faylor <cgf@redhat.com> + + * lib/getopt.c: Nuke use of unneeded BSDisms. + +2003-03-02 Christopher Faylor <cgf@redhat.com> + + * dll_init.cc (dll_list::load_after_fork): Don't revert to LoadLibrary + if LoadLibraryEx fails. + * dtable.cc (dtable::dec_console_fds): Eliminate. + (dtable::release): Don't treat console specially. + (dtable::build_fhandler): Ditto. + * dtable.h (console_fds): Eliminate. + (dtable::dec_console_fds): Eliminate. + (dtable::inc_console_fds): Eliminate. + * fhandler.h (fhandler_console::open_fhs): New static element. + * fhandler_console.cc (fhandler_console::open): Increment open_fs. + (fhandler_console::close): Call FreeConsole if no more open consoles + and ctty is not associated with the console. + * syscalls.cc (setsid): Simplify check for when to call FreeConsole. + (check_pty_fds): Eliminate definition. + * winsup.h (check_pty_fds): Eliminate declaration. + +2003-03-02 Christopher Faylor <cgf@redhat.com> + + * dll_init.cc (dll_list::load_after_fork): Fix typo where result of + LoadLibrary was ignored. + +2003-03-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Open and write socket + file using Win32 calls. + +2003-03-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Open and read socket file using + Win32 calls. + +2003-02-28 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Wrap atexit and exit with cygwin, thread-safe functions. + * dcrt0.cc (cygwin_atexit): New function. + (cygwin_exit): Ditto. + +2003-02-28 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (fstat64): Pass get_name () to pc. + (access): Pass fn to stat_worker. + +2003-03-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (class sock_event): New class managing Winsock + events for interruptible socket calls. + (fhandler_socket::connect): Move support for interruptible call to + class sock_event. Use class object instead. + (fhandler_socket::accept): Ditto. Remove useless casts. + +2003-03-27 Thomas Pfaff <tpfaff@gmx.net> + + * fhandler_socket.cc (fhandler_socket::connect): Add support for + an interruptable connect. + +2003-02-27 Pierre Humblet <pierre.humblet@ieee.org> + + * uinfo.cc (internal_getlogin): Only update user.groups.pgsid + if the call to set the primary group succeeds. + +2003-02-27 Christopher Faylor <cgf@redhat.com> + + * cygthread::detach: Improve error message. + +2003-02-26 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_helper.cc (get_sids_info): debug_print owner_sid and group_sid. + +2003-02-25 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Fix returned address by taking the granularity + into account. + +2003-02-23 Pierre Humblet <pierre.humblet@ieee.org> + + * syslog.cc (syslog): Do not unlock the file before closing it + and remove debug_printf about stream errors. + +2003-02-22 Christopher Faylor <cgf@redhat.com> + + * cygmalloc.h: Remove MORECORE_CANNOT_TRIM. It's not true. + # cygwin.din: Export mallinfo. + # malloc_wrapper.cc (mallinfo): New function. + +2003-02-22 Pierre Humblet <pierre.humblet@ieee.org> + + * syslog.cc (syslog): Do not print the Windows pid. Print the Cygwin + pid as an unsigned decimal. On Win95 print a timestamp and attempt to + lock the file up to four times in 3 ms. + +2003-02-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Fix compiler + warning. + (fhandler_socket::fstat): Simplify. Set st_uid/st_gid to effective + uid/gid of current process in case of open sockets. + +2003-02-21 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::build_fhandler_from_name): Set some fhandler + data on sockets to evaluate AF_LOCAL sockets correctly. + (dtable::build_fhandler): Set unit number on sockets. + * fhandler.h (fhandler_socket): Add unit number. + (fhandler_socket::get_unit): New method. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Set unit + number. + (fhandler_socket::fstat): Reorganize to return more Linux-like + values. + * net.cc: include ctype.h. + (fdsock): Set unit number when building fhandler. + * path.cc (path_conv::check): Set device type to FH_SOCKET if file + is a AF_UNIX socket. + (get_devn): Evaluate unit for virtual socket devices. + (win32_device_name): Set windows path for sockets to unix_path with + just backslashes to keep the different names. + * syscalls.cc (fstat64): Don't override st_ino, st_dev and st_rdev + for sockets. + (stat_worker): Ditto. + +2003-02-21 Pierre Humblet <pierre.humblet@ieee.org> + + * autoload.cc (AccessCheck): Add. + (DuplicateToken): Add. + * security.h (check_file_access): Declare. + * syscalls.cc (access): Convert path to Windows, check existence + and readonly attribute. Call check_file_access instead of acl_access. + * security.cc (check_file_access): Create. + * sec_acl (acl_access): Delete. + +2003-02-19 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::open): Move some filesystem specific + stuff. + (fhandler_disk_file::open): Accept some filesystem specific stuff. + * sigproc.cc (wait_for_sigthread): Become slightly more thread safe. + (sig_send): Don't assume that signal thread is ready. + +2003-02-20 Corinna Vinschen <corinna@vinschen.de> + + * wincap.h (wincap): Remove unnecessary definition of + supports_sparse_files. + * wincap.cc: Ditto. + +2003-02-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check descriptor + created by cygheap_fdnew constructor. + * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto. + * fhandler_socket.cc (fhandler_socket::accept): Ditto and move + creation of file descriptor behind blocking OS call. + * net.cc (cygwin_socket): Ditto. + (cygwin_rcmd): Ditto. + (cygwin_rresvport): Ditto. + (cygwin_rexec): Ditto. + (socketpair): Ditto. + +2003-02-20 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetCompressedFileSize): Add. + * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Compute + st_blocks value from GetCompressedFileSize() if available. + +2003-02-18 Vaclav Haisman <V.Haisman@sh.cvut.cz> + + * wincap.h (wincaps::supports_sparse_files): New flag. + (wincapc::supports_sparse_files): New method. + * wincap.cc (wincap_unknown): Define value for the new flag. + (wincap_95): Ditto. + (wincap_95osr2): Ditto. + (wincap_98): Ditto. + (wincap_98se): Ditto. + (wincap_me): Ditto. + (wincap_nt3): Ditto. + (wincap_nt4): Ditto. + (wincap_nt4sp4): Ditto. + (wincap_2000): Ditto. + (wincap_xp): Ditto. + * path.h (path_conv::fs_flags): New method. + * fhandler_disk_file.cc: Include winioctl.h for DeviceIoControl. + (fhandler_disk_file::open): Set newly created and truncated files as + sparse on platforms that support it. + +2003-02-17 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (internal_getgroups): Handle properly tokens with + no groups. Fix bug introduced on 2003-02-04. + +2003-02-16 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Export all appropriate newlib libm functions. Sort. + * include/cygwin/version.h: Bump API minor number. + +2003-02-15 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Export all appropriate newlib libc functions. + * include/cygwin/version.h: Bump API minor number. + +2003-02-14 Jason Tishler <jason@tishler.net> + + * mmap.cc (mprotect): Add missing break. + +2003-02-13 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (try_to_debug): Don't reset priority when returning + from non-waitloop call. + +2003-02-13 Vaclav Haisman <V.Haisman@sh.cvut.cz> + Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::write_normal): Use MessageBeep + for bell sound. + * autoload.cc (MessageBeep): Add. + +2003-02-13 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/types.h: Use correct ifdef guard for u_ definitions. + +2003-02-13 Christopher Faylor <cgf@redhat.com> + + * environ.cc (environ_init): Use strechr. + +2003-02-13 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/in.h (sockaddr_in): Fix typo. + +2003-02-12 Christopher Faylor <cgf@redhat.com> + + * path.h (path_conv): Reorganize slightly. + +2003-02-12 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (process_input): Add sanity check to ensure that + console typeahead is cleared on signal. + +2003-02-12 Christopher Faylor <cgf@redhat.com> + + * spawn.cc (linebuf::~linebuf): Resurrect commented out (for + debugging?) code. + +2003-02-10 Ralf Habacker <ralf.habacker@freenet.de> + + * include/cygwin/in.h (in_attr_t): Define new type. + * include/arpa/inet.h (inet_addr): Change return type to in_addr_t. + (inet_lnaof): Ditto. + (inet_netof): Ditto. + (inet_network): Ditto. + +2003-02-10 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/types.h: Move many *_t typedefs here. Protect them + with ifdefs. + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Change ntsec_atts to mode_t. + * security.cc (get_attribute_from_acl): Accept mode_t attribute. + (get_nt_attribute): Ditto. + (get_file_attribute): Ditto. + (get_nt_object_attribute): Ditto. + (get_object_attribute): Ditto. + * security.h: Reflect above changes. + * syscalls.cc (chown_worker): Change attrib to mode_t. + +2003-02-08 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 21. + +2003-02-07 Christopher Faylor <cgf@redhat.com> + + * malloc.cc (DEFAULT_MMAP_THRESHOLD): Bump down to 16MB thanks to below + changes. + +2003-02-07 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::alloc_map): De-inline. Add offset and length + parameter. Only protect pages actually unused currently. Do job + of map_map() when initializing a map. + (mmap_record::map_map): Reduce functionality for the reuse case + of private anonymous mapping. + (mmap_record::fixup_map): Format change. + (list::add_record): Add offset and length parameter to call + mmap_record::alloc_map() correctly. + (mmap64): Rename `l' variable to `map_list'. Accommodate above changes. + (munmap): Rename `l' variable to `map_list'. + (msync): Ditto. + (fhandler_disk_file::mmap): Streamline code. + (mprotect): Ditto. + (fixup_mmaps_after_fork): Rename `l' variable to `map_list'. + +2003-02-07 Vaclav Haisman <V.Haisman@sh.cvut.cz> + Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (try_to_debug): Set priority of current thread rather + than the main thread. Make busy waiting loop less busy. Restore + priority when function returns. + +2003-02-07 Christopher Faylor <cgf@redhat.com> + + * malloc.cc (DEFAULT_MMAP_THRESHOLD): Set high to avoid mmaps. + +2003-02-07 Christopher Faylor <cgf@redhat.com> + + * pipe.cc (fhandler_pipe::close): Avoid extraneous this->. + +2003-02-06 Christopher Faylor <cgf@redhat.com> + + * heap.cc (heap_init): Remove debugging code. + +2003-02-06 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h: Introduce names UNKNOWN_UID and UNKNOWN_GID and delete + declaration of is_grp_member. + * uinfo.cc (internal_getlogin): Use UNKNOWN_GID. + * passwd.cc (pwdgrp::read_passwd): Use UNKNOWN_UID. + * grp.cc (pwdgrp::read_group): Change group name to provide better + feedback. + (getgrgid): Use gid16togid32. + * sec_helper.cc (is_grp_member): Delete. + +2003-02-05 Christopher Faylor <cgf@redhat.com> + + * path.cc: Change 'to_posix_p' to 'to_posix' throughout. + (conv_path_list_buf_size): Accommodate relative paths. + +2003-02-05 Christopher Faylor <cgf@redhat.com> + + * path.cc (etc::dir_changed): Fix debug printf. + +2003-02-05 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Move all permission settings to beginning of + loop. Set default rights to same values as in alloc_sd(). Set DELETE + for owner and default owner only if S_IWOTH is given. + +2003-02-05 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_acl.cc: Change all __aclent16_t to __aclent32_t except in + wrapper function definitions. Replace call to the aclXYZ functions by + calls aclXYZ32. + (searchace): Change type of third argument to __uid32_t and use + ILLEGAL_UID instead of -1; + (setacl): Remove some initializations. Only give STANDARD_RIGHTS_WRITE + for S_IWOTH. Replace -1 by ILLEGAL_UID. + (getacl): Change type of owner_sid, group_sid and ace_sid to cygpsid. + In last else clause, suppress second call to ace_sid.get_id and use + TRUE in first call. Replace EqualSid by ==. + (acl_access): Call internal_getgroups in USER and GROUP cases. + (acecmp: Define static. + (acl32): Create from 16 bit type. + (facl32): Ditto. + (lacl32): Ditto. + (aclcheck32): Ditto. + (aclsort32): Ditto. + (acltomode32): Ditto. + (aclfrommode32): Ditto. + (acltopbits32): Ditto. + (aclfrompbits32): Ditto. + (acltotext32): Ditto. + (aclfromtext32): Ditto, and use strechr. + (acl16to32): Create. + (acl): Make it a wrapper function. + (facl): Ditto. + (lacl): Ditto. + (aclcheck): Ditto. + (aclsort): Ditto. + (acltomode): Ditto. + (aclfrommode): Ditto. + (acltopbits): Ditto. + (aclfrompbits): Ditto. + (acltotext): Ditto. + (aclfromtext): Ditto. + * security.cc (write_sd): Call set_process_privilege and check + ownership. + (alloc_sd): Remove call to set_process_privilege and the owner check. + +2003-02-05 Christopher Faylor <cgf@redhat.com> + + * include/sys/cygwin.h: Use C-style comments. + +2003-02-05 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_helper.cc (get_sids_info): New function. + * security.cc (extract_nt_dom_user): Simplify with strechr. + (get_user_groups): Initialize glen to MAX_SID_LEN. + (get_user_local_groups): Ditto. + (get_attribute_from_acl): Define ace_sid as cygpsid. + (get_nt_attribute): Define owner_sid and group_sid as cygpsid. + Call get_sids_info instead of cygsid.get_{u,g}id and is_grp_member. + (get_nt_object_attribute): Ditto. + (alloc_sd): Define ace_sid as cygpsid. + +2003-02-04 Thomas Pfaff <tpfaff@gmx.net> + + * syscalls.cc (struct system_cleanup_args): New struct. + (system_cleanup): New function. + (system): Use pthread_cleanup_push and _pop to save and restore + signal handlers and sigprocmask. + +2003-02-04 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink): Create security attributes so that only the + user can modify the symlink. + * security.cc (set_security_attribute): Remove symlink special + handling. + +2003-02-04 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (internal_getgroups): Do not return without closing + the process handle. + +2003-02-04 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h (class cygpsid): New class. + (class cygsid): Use cygpsid as base. Remove members psid, get_id, + get_uid, get_gid, string, debug_printf and the == and != operators. + (cygsidlist::clear_supp): Only do work if setgroups has been called. + * sec_helper.cc: Define sid_auth NO_COPY. + (cygpsid::operator==): New operator. + (cygpsid::get_id): New function. + (cygpsid::string): New function. + (cygsid::string): Delete. + (cygsid::get_id): Delete. + * pwdgrp.h: Change arguments of internal_getpwsid, + internal_getgrsid and internal_getgroups to cygpsid. + * passwd.cc (internal_getpwsid): Change argument from cygsid to cygpsid. + * grp.cc (internal_getgrsid): Ditto. + (internal_getgroups): Ditto. + +2003-02-03 Christopher Faylor <cgf@redhat.com> + + Eliminate most unneeded this-> pointers throughout. + +2003-02-03 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h: Add third argument to set_process_privilege. + * autoload.cc: Add OpenThreadToken. + * sec_helper.cc (set_process_privilege): Add and use use_thread + argument. + * security.cc (alloc_sd): Modify call to set_process_privilege. + Remember the result in each process. If failed and file owner is not + the user, fail. + +2003-02-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Return buffer + length and don't set errno in case of WSAEMSGSIZE error. + (fhandler_socket::recvmsg): Ditto. + +2003-02-01 Christopher Faylor <cgf@redhat.com> + + * grp.cc (getgrent32): Only refresh group entries when at beginning. + (internal_getgrsid): Only refresh if uninitialized. + (internal_getgrent): Ditto. + * passwd.cc (getpwent): Only refresh passwd entries when at beginning. + (pwdgrp::read_passwd): linebuf *cannot* be NO_COPY. + (internal_getpwsid): Only refresh if uninitialized. + (getpass): No need to refresh passwd data here. + * pwdgrp.h (refresh): Eliminate default. + +2003-01-31 Christopher Faylor <cgf@redhat.com> + + * dlfcn.cc (dlerror): Only report load errors once per error. + +2003-01-31 Christopher Faylor <cgf@redhat.com> + + * fhandler_serial.cc (fhandler_serial::open): Avoid extraneous setting + of res. + + * termios.cc (tcsetattr): Correctly record errno after tcsetattr call. + +2003-01-31 Troy Curtiss <troyc@usa.net> + + * fhandler_serial.cc (fhandler_serial::tcsetattr): Add error-checking + so that if any Win32 SetComm*() calls fail, errno gets set to EINVAL + and tcsetattr() returns -1. Catch invalid bitrates, mostly. If baud + rate setting is B0, just drop DTR and leave Win32 DCB bitrate as-is + since 0 is not a valid Win32 setting. + (fhandler_serial::tcgetattr): If DTR is low, populate the bitrate as + B0, otherwise get it from the DCB. + +2003-01-31 Christopher Faylor <cgf@redhat.com> + + * passwd.cc (pwdgrp::read_passwd): linebuf *must* be static (from + Pierre Humblet). + * pwdgrp.h (pwdgrp::refresh): Avoid calling read function if we already + have lock since that means we are in the process of reading the file. + +2003-01-31 Jason Tishler <jason@tishler.net> + + * shared.cc (shared_info::heap_chunk_size): Use correct variable when + reading HKLM. + +2003-01-30 Christopher Faylor <cgf@redhat.com> + + * fhandler_registry.cc (fhandler_registry::exists): Fix off-by-one + error when inspecting path. + +2003-01-29 Christopher Faylor <cgf@redhat.com> + + * lib/getopt.c: Allow environment variable control of POSIXLY_INCORRECT + behavior. + +2003-01-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::accept): On successful execution + set connection state of returned socket to CONNECTED. + +2003-01-27 Christopher Faylor <cgf@redhat.com> + + * passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about + non-numeric fields. + +2003-01-26 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no + longer a valid return from next_str. + (pwdgrp::add_line): Duh. Revert to use strchr. + +2003-01-26 Christopher Faylor <cgf@redhat.com> + + * string.h (strechr): New function. + * uinfo.cc (pwdgrp::next_str): Search only for input char in string. + Return EOS on failure. Don't check for NULL since it shouldn't be + possible. + (pwdgrp::add_line): Revert to replacing '\n' in input line with '\0'. + (pwdgrp::next_num): Pass explicit separator character to next_str. + * grp.cc (pwdgrp::parse_group): Ditto. + * passwd.cc (pwdgrp::parse_passwd): Ditto. Revamp test for garbage + input. + * pwdgrp.h (pwdgrp::next_str): Don't use default parameter. + +2003-01-26 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (pwdgrp::load): Regularize strace output. Add warning for + CreateFile failure. + +2003-01-26 Christopher Faylor <cgf@redhat.com> + + * passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The + structure should always be completely filled out. + * grp.cc (pwdgrp::parse_group): Ditto. + +2003-01-26 Christopher Faylor <cgf@redhat.com> + + * grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating + gr_mem. + +2003-01-26 Christopher Faylor <cgf@redhat.com> + + * include/sys/strace.h (paranoid_printf): Define as not being part of + "all" output. + +2003-01-25 Christopher Faylor <cgf@redhat.com> + + * pwdgrp.h (pwdgrp::next_num): Rename from next_int. Returns + true/false if parse operation succeeded. + (pwdgrp::reparse): Remove. + (pwdgrp::raw_ptr): New function. Returns pointer in line. + (pwdgrp::next_num): New functions for parsing other than unsigned long. + * grp.cc (pwdgrp::parse_group): Reinstate previous parsing behavior. + Don't fill in fields with NULL and assign empty gr_mem to known pointer + rather than doing a pointless calloc. Streamline gr_mem parsing. + Don't increment curr_lines here. + * passwd.cc (pwdgrp::parse_passwd): Use new behavior of next_num. + Don't increment curr_lines here. + * uinfo.cc (pwdgrp::next_str): Keep returning EOL if out of data. + (pwdgrp::reparse): Remove. + (pwdgrp::next_num): Rename from next_int. Return bool indicating + success of parse, argument returns value parsed. + (pwdgrp::add_line): Increment curr_lines here on successful parse. + (pwdgrp::load): (from Pierre Humblet) Don't return status. Just report + it here. + +2003-01-25 Christopher Faylor <cgf@redhat.com> + + * pwdgrp.cc (pwdgrp::reparse): Declare. + * uinfo.cc (pwdgrp::reparse): Define. + * grp.cc (pwdgrp::parse_group): Use reparse. + +2003-01-25 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (seteuid32): On Win95 get the pw entry. If it exists + update the euid and call cygheap->user.set_name. Remove special + handling of ILLEGAL_UID. + (setgid32): Add a debug_printf. On Win95, always set the egid. + Remove special handling of ILLEGAL_GID. Do not compare gid and gr_gid. + * child_info.h (class cygheap_exec_info): Remove uid. + * spawn.cc (spawn_guts): Do not set ciresrv.moreinfo->uid. + * dcrto.cc (dll_crt0_1): Always call uinfo_init. + * uinfo.cc (uinfo_init): Reorganize and close handle if needed. + (cygheap_user::ontherange): Do not call internal_getpwnam if pw is NULL. + +2003-01-24 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::send_winch_maybe): Reset + scroll region if size changes. + +2003-01-24 Pierre Humblet <pierre.humblet@ieee.org> + Jason Tishler <jason@tishler.net> + + * cygwin.din: Export setreuid32, setreuid, setregid32, setregid. + * syscalls.cc (setreuid32): New function. + (setreuid): Ditto. + (setregid32): Ditto. + (setregid): Ditto. + * include/cygwin/version.h: Bump API minor number. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * pwdrp.h (pwdgrp::refresh): Lock entire test prior to reading. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * grp.cc (pwdgrp::parse_group): Eliminate arg and use class member + instead. Use next_str and next_int to parse arguments. + * passwd.cc (pwdgrp::parse_passwd): Ditto. + (grab_string): Eliminate. + (grab_int): Ditto. + * pwdgrp.h (pwdgrp::parse): Eliminate input arg. + (pwdgrp::parse_passwd): Reflect above change. + (pwdgrp::parse_group): Reflect above change. + (pwdgrp::next_str): New function. + (pwdgrp::next_int): Ditto. + (pwdgrp::gets): Eliminate. + * uinfo.cc (pwdgrp::next_str): New function. + (pwdgrp::next_int): Ditto. + (pwdgrp::add_line): Subsume gets. + (pwdgrp::gets): Eliminate. + (pwdgrp::load): Just call add_line to parse input buffer. + +2003-01-22 Thomas Pfaff <tpfaff@gmx.net> + + * include/pthread.h (PTHREAD_MUTEX_RECURSIVE): Revert changes from + 2003-01-09 mutex patch. + (PTHREAD_MUTEX_ERRORCHECK): Ditto. + +2003-01-22 Corinna Vinschen <corinna@vinschen.de> + + * cygrun.c: Move from here to ../testsuite. + * Makefile.in: Remove cygrun.exe dependencies. + +2003-01-21 Jason Tishler <jason@tishler.net> + + * cygwin.din: Export nanosleep(). + * signal.cc (nanosleep): New function. + (sleep): Move old functionality to nanosleep(). Call nanosleep(). + (usleep): Remove old functionality. Call nanosleep(). + * include/cygwin/version.h: Bump API minor number. + +2003-01-21 Christopher Faylor <cgf@redhat.com> + + * grp.cc: Call gr.refresh() rather than doing isunitialized tests + throughout. + (gr): Use constructor (sigh). + (pwdgrp::parse_group): Rename from parse_grp. + (pwdgrp::read_group): Rename from read_etc_group. Just call gr.load + with a single argument. + * passwd.cc: Call pr.refresh() rather than doing isunitialized tests + throughout. + (pr): Use constructor (sigh). + (pwdgrp::parse_passwd): Rename from "parse_pwd". + (pwdgrp::read_passwd): Rename from read_etc_passwd. Just call pr.load + with a single argument. + * pwdgrp.h (pwdgrp_state): Eliminate. + (pwdgrp): Reflect above renamings. + (pwdgrp::etc_ix): Rename from pwd_ix. + (pwdgrp::read): New element. + (pwdgrp::lock): New element. + (pwdgrp::refresh): New function. + (pwdgrp::load): Eliminate variations which take buffer arguments. + (pwdgrp::pwdgrp): New constructors. Initialize mutex here. + * uinfo.cc (pwdgrp::load): Accommodate pwd_ix -> etc_ix renaming. + (pwdgrp::load): Set initialized state to true rather than setting state + to loaded. + +2003-01-21 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number. + +2003-01-21 Pierre Humblet <pierre.humblet@ieee.org> + + * path.h (etc::change_possible): Revert the type to bool. + (etc::set_last_modified): Remove obsolete function. + * path.cc (etc::change_possible): Revert type to bool. + (etc::test_file_change): Do not test for negative values of + change_possible and do not set it to -res. + (etc::dir_changed): When the handle is NULL, call memset instead of + test_file_changed. When the handle is invalid, return true. Detect + filename change in /etc. + (etc::file_changed): Remove unneeded check for !fn[n]. + * uinfo.cc (pwdgrp::load): Eliminate spurious setting of fh to NULL. + * pwdgrp.h (pwdgrp::operator =): Eliminate. + +2003-01-19 Christopher Faylor <cgf@redhat.com> + + * pwdgrp.h (etc): Move to path.h. + (pwdgrp::max_lines): New field. + (pwdgrp::curr_lines): New field. + (pwdgrp::pwdgrp_buf): Ditto. + (pwdgrp_buf_elem_size): Ditto. + (pwdgrp_parse): Ditto. + (pwdgrp::gets): Just declare here. + (pwdgrp::load): Ditto. Just take one argument. + (pwdgrp::load): Define overloaded function accepting passwd buf. + (pwdgrp::load): Define overloaded function accepting group buf. + * grp.cc: Use pwdgrp elements rather than standalone static variables + throughout. + (curr_lines): Eliminate. + (max_lines): Ditto. + (add_grp_line): Ditto. + (parse_grp): Define as returning boolean. Accept void * arg and line + count. Coerce first argument into __group32 buf reference. Increment + curr_line as appropriate. + (read_etc_group): Pass pwdgrp buffer to gr.load. + * passwd.cc: Use pwdgrp elements rather than standalone static variables + throughout. + (curr_lines): Eliminate. + (max_lines): Ditto. + (add_grp_line): Ditto. + (parse_passwd): Define as returning boolean. Accept void * arg and line + count. Coerce first argument into passwd buf reference. Increment + curr_line as appropriate. + (read_etc_group): Pass pwdgrp buffer to pr.load. + * path.cc (etc::fn): Extend buffer size to allow index by 1 rather than + zero. + (etc::last_modified): Ditto. + (etc::change_possible): Ditto. Renamed from sawchange. Change to + signed char since elements are now tri-state. + (etc::init): Assume "handle" is 1 based rather than 0. + (etc::test_file_change): New function. Sets change_possible based on + file date comparison. + (etc::dir_changed): Check file states immediately after changed_h is + initialized to avoid a race. + (etc::file_changed): Use test_file_change to detect if file needs to be + updated. + * path.h (etc): Move class here from pwdgrp.h. + * uinfo.cc: Move etc:: functions to path.cc. Move pwdgrp functions + here. + (pwdgrp::gets): Eliminate buf checks. Just check eptr and set lptr. + (pwdgrp::add_line): New function. + (pwdgrp::load): Call generic add_line function which will call correct + parser. + +2003-01-17 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc: Change most 'int's to 'unsigned's. + (_cmalloc): Only check for size of malloced region when calculating + bucket. Add overhead when performing the sbrk. Previous change broke + _crealloc. + +2003-01-17 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (initialize_env): Use colon for CYGWIN_DEBUG separator. + * grp.cc: Change most statics to NO_COPY throughout. + * passwd.cc: Ditto. + +2003-01-17 Christopher Faylor <cgf@redhat.com> + + * pwdgrp.h: Change some BOOLs to bools. + (pwdgrp::pwdgrp): Remove unneeded constructor. + * passwd.cc: Change BOOL to bool throughout. + +2003-01-17 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add strerror_r. + * include/cygwin/version.h: Bump API minor number. + +2003-01-17 Christopher Faylor <cgf@redhat.com> + + * uinfo.cc (etc::dir_changed): Don't print a warning if can't open + /etc, unless debugging. + +2003-01-17 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (read_etc_group): On NT, add a line for gid = -1. Change name + "unknown" to "mkgroup". + (internal_getgrgid): Do not return default in nontsec case. + (internal_getgroups): Add argument srchsid and look for it in groups if + not NULL. + * passwd.cc (read_etc_passwd): On NT, add a line for uid = -1. Use + same default uid for Win95 and NT. Call cygheap_user::ontherange to + initialize HOME. + +2003-01-16 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cygheap::etc_changed): Move to uinfo.cc. + * cygheap.h (init_cygheap::etc_changed_h): Remove. + (init_cygheap::etc_changed): Ditto. + * grp.cc (group_state): Remove. Use gr instead throughout. + (gr): Define as class pwdgrp. + (read_etc_group): Remove gr definition. Remove calls to + set_last_modified and close. Pass add_grp to gr.load to load file. + * passwd.cc (passwd_state): Remove. Use pr instead, throughout. + (pr): Define as class pwdgrp. + (read_etc_passwd): Remove pr definition. Remove calls to + set_last_modified and close. Pass add_pwd_line to pr.load to load + file. + * pwdgrp.h (etc): New helper class for pwdgrp. + (pwdgrp): Combine pwdgrp_check and pwdgrp_read into one class. Remove + file_w32 and last_modified fields. + (pwdgrp::set_last_modified): Remove. + (pwdgrp::isinitializing): Remove FindFirstFile stuff. Move to + etc::file_changed. + (pwdgrp::load): Rename from 'open'. Call etc::init to initialize etc + scanning. Close file handle after reading buffer into memory. Parse + buffer by calling second argument. + (pwdgrp::gets): Reorganize slightly to rely on eptr starting at + beginning of buffer. + (pwdgrp::close): Remove. + * uinfo.cc (etc::dir_changed): New function. + (etc::init): Ditto. + (etc::file_changed): Ditto. + (etc::set_last_modified): Ditto. + +2003-01-16 Jason Tishler <jason@tishler.net> + + * mmap.cc (fixup_mmaps_after_fork): Add ERROR_NOACCESS to the list of + ReadProcessMemory() error codes that trigger a retry with temporary + PAGE_READONLY access. Note that this can occur on NT 4.0. + +2003-01-15 Christopher Faylor <cgf@redhat.com> + + * path.cc (normalize_posix_path): Convert win32 path separators to + slashes when full path is specified. + +2003-01-15 Pierre Humblet <pierre.humblet@ieee.org> + + * cmalloc.cc (_cmalloc): Fix memory leak. + +2003-01-15 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Fix copyright date. + * fhandler_dsp.cc: Ditto. + * mmap.cc: Ditto. + * net.cc: Ditto. + * ntdll.h: Ditto. + * signal.cc: Ditto. + * syscalls.cc: Ditto. + * uname.cc: Ditto. + * wait.cc: Ditto. + +2003-01-14 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fixup_mmaps_after_fork): Copy protection to child process. + Change ambiguous debug output. + +2003-01-14 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::access): Change argument type to caddr_t + for strictness. + (mprotect): Protect against calling VirtualProtect() for shared + pages on 9x/Me. + (fixup_mmaps_after_fork): If ReadProcessMemory() fails, try to + change protection of parent page to PAGE_READONLY, then try again. + Revert protection afterwards. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * syscalls.cc (system): Add pthread_testcancel call. + * thread.cc: Update list of cancellation points. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * wait.cc: Include thread.h + (wait4): Add pthread_testcancel call. + Wait for child process and cancellation event. + * thread.cc: Update list of cancellation points. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * signal.cc (sleep): Add pthread_testcancel call. + Wait for signal and cancellation event. + (usleep): Ditto. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * exceptions.cc (handle_sigsuspend): Add pthread_testcancel call. + Wait for signal and cancellation event. + * thread.cc: Update list of cancellation points. + +2003-01-14 David Huang <davehzhr@hotmail.com> + + * fhandler_dsp.cc (fhandler_dsp::ioctl): Add limited support for + SNDCTL_DSP_GETFMTS. + +2003-01-12 Christopher Faylor <cgf@redhat.com> + + * ntdll.h: Fix typo. + +2003-01-12 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Use cygwin_gethostname() to retrieve hostname. + +2003-01-12 Pierre Humblet <pierre.humblet@ieee.org> + + * sec_acl.cc (search_ace): Use id == -1, instead of < 0, as wildcard. + (setacl): Start the search for a matching default at the next entry. + Invalidate the type of merged entries instead of clearing it. + Use well_known_creator for default owner and owning group and do + not try to merge non-default and default entries in these cases. + (getacl): Recognize well_known_creator for default owner and group. + (acl_worker): Improve errno settings and streamline the nontsec case. + * security.cc (write_sd): Remove the call to set_process_privilege. + (alloc_sd): If the owner changes, call set_process_privilege and return + immediately on failure. Change inheritance rules: on new directories add + inherit only allow ACEs for creator_owner, creator_group and everyone. + Preserve all inheritances through chmod and chown calls. Introduce + isownergroup to implement the uid == gid case, to keep the inheritance + code simple. Do not initialize owner_sid and group_sid and stop using + the variable psd. + +2003-01-10 Christopher Faylor <cgf@redhat.com> + + * net.cc: Use gethostname define from winsock2.h. + +2003-01-10 Christopher Faylor <cgf@redhat.com> + + * path.cc: Unrevert below reversion except for + mount_info::conv_to_posix_path part. + +2003-01-10 Corinna Vinschen <corinna@vinschen.de> + + * path.cc: Revert patch from 2003-01-09 to normalize a windows path + rather than converting to posix. + +2003-01-10 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (gethostname): Make call optional, return 1 if function + can't get loaded. + * net.cc (cygwin_gethostname): Call GetComputerName if return value + of gethostname is non-zero. + +2003-01-10 Charles Wilson <cwilson@ece.gatech.edu> + + * cygwin.din: Add asprintf and vasprintf, as well as the reentrant + versions and underscore variants. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR. + +2003-01-10 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_gethostname): Fix call to wsock function gethostname. + +2003-01-09 Christopher Faylor <cgf@redhat.com> + + * cygthread.cc (cygthread::cygthread): Be more noisy about odd + condition. + * miscfuncs.cc (low_priority_sleep): Sleep in regular priority if + that's what we're currently running at. + +2003-01-09 Thomas Pfaff <tpfaff@gmx.net> + + * include/semaphore.h: Modify typedef for sem_t. + * include/cygwin/types.h: Modify typedefs for pthread_t, + pthread_mutex_t, pthread_key_t, pthread_attr_t, + pthread_mutexattr_t, pthread_condattr_t, pthread_cond_t, + pthread_rwlock_t and pthread_rwlockattr_t. + +2003-01-09 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (WAIT_CANCELED): New define. + (pthread::cancelable_wait): New static method. + * thread.cc (pthread::cancelable_wait): Implement. + (semaphore::Wait): Wait on semaphore and thread cancellation. + (pthread::join): Wait on joined thread and thread cancellation. + (semaphore::wait): Add testcancel to check for thread + cancellation even if the semaphore is available. + +2003-01-09 Thomas Pfaff <tpfaff@gmx.net> + + * include/pthread.h: Add define for errorchecking mutexes. + Change default mutex type. + * thread.cc (pthread_cond::TimedWait): Update mutex unlock + calls. + (pthread_mutex::pthread_mutex): New implement. + (pthread_mutex::~pthread_mutex): Ditto. + (pthread_mutex::Lock): Ditto. + (pthread_mutex::TryLock): Ditto. + (pthread_mutex::UnLock): Ditto. + (pthread_mutex::Destroy): Implement new method. + (pthread_mutex::SetOwner): Ditto. + (pthread_mutex::LockRecursive): Ditto. + (pthread_mutex::fixup_after_fork): Restore locking state after + fork. + (__pthread_mutex_lock): Return pthread_mutex::Lock errorcode. + (__pthread_mutex_trylock): Return pthread_mutex::TryLock + errorcode. + (__pthread_mutex_unlock): Return pthread_mutex::UnLock + errorcode. + (__pthread_mutex_destroy): Call pthread_mutex::Destroy to + destroy mutex. + (__pthread_mutexattr_settype): Allow errorchecking and recursive + types. + * thread.h (MUTEX_LOCK_COUNTER_INITIAL): New define. + (pthread_mutex::criticalsection): Remove. + (pthread_mutex::lock_counter): New member. + (pthread_mutex::recursion_counter): Ditto. + (pthread_mutex::owner): Ditto. + (pthread_mutex::type): Ditto. + (pthread_mutex::Destroy): New method. + (pthread_mutex::SetOwner): Ditto. + (pthread_mutex::LockRecursive): Ditto. + +2003-01-09 Thomas Pfaff <tpfaff@gmx.net> + + * pthread.cc (pthread_cond_init): Use new pthread_cond::init. + * thread.cc: Some white spaces cleanups. + Change __pthread_cond_init to pthread_cond::init throughout. + (nativeMutex): Move class methods outside pthread_mutex. + (MTinterface::Init): Initialize pthread_cond init lock. + (pthread_cond::condInitializationLock): Instantiate. + (pthread_cond::initMutex): New Method. + (pthread_cond::isGoodInitializerOrBadObject): Ditto. + * thread.h: Some white spaces cleanups. + (nativeMutex): Move class declaration outside pthread_mutex. + (pthread_cond::condInitializationLock): New static member. + (pthread_cond::initMutex): New Method. + (pthread_cond::isGoodInitializerOrBadObject): Ditto. + (__pthread_cond_init): Remove prototype. + +2003-01-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (num_entries): Return 2 as link count if + directory unreadable. + +2003-01-09 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_nt_attribute): Always return -1 when read_sd() + fails. + (get_file_attribute): Set permissions to 0 and owner/group to -1 + if security descriptor is unreadable. + +2003-01-09 Christopher Faylor <cgf@redhat.com> + + Use isdirsep rather than SLASH_P throughout. + * path.cc (iscygdrive): Disallow /cygdrive\x. + (normalize_posix_path): "Normalize" a windows path, if detected, rather + than converting to posix. + +2003-01-06 Troy Curtiss <troyc@usa.net> + + * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support and + capability checking for B230400 bitrate. + (fhandler_serial::tcgetattr): Add support for B230400 bitrate. + * include/sys/termios.h: Add B230400 definition for Posix support of + 230.4Kbps. + +2003-01-05 Christopher Faylor <cgf@redhat.com> + + * pinfo.cc (_pinfo::commune_send): Use myself->lock rather than just + lock when leaving. + +2003-01-03 Christopher Faylor <cgf@redhat.com> + + * dtable.h (dtable::in_vfork_cleanup): New function. True if vfork + cleanup needed. + * dtable.cc (dtable::vfork_parent_restore): Remove assertion. + * pipe.cc (fhandler_pipe::close): Don't close read_state during + fork_fixup since it wasn't inherited. + +2003-01-01 Christopher Faylor <cgf@redhat.com> + + * passwd.cc (getpwuid_r32): Revert previous change. + +2003-01-01 Christopher Faylor <cgf@redhat.com> + + * sysconf.cc (sysconf): Return arbitrary values for + _SC_GETGR_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_GETPW_R_SIZE_MAX. + + * passwd.cc (getpwuid_r32): Add uid/gid fields to size check + calculation. + diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2004 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2004 new file mode 100644 index 000000000..ebb696237 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2004 @@ -0,0 +1,3848 @@ +2004-12-30 Christopher Faylor <cgf@timesys.com> + + * devices.cc (device::isfs): Return true for the logical case of + devn == FH_FS. + +2004-12-28 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (_pinfo::dup_proc_pipe): DUPLICATE_CLOSE_SOURCE closes the + handle regardless, so revert previous change. + +2004-12-27 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::stub): Add better debug output. + (cygthread::cygthread): Ditto. + (cygthread::terminate_thread): Ditto. Move inuse test earlier or + suffer infinite loop. + * pinfo.cc (_pinfo::dup_proc_pipe): Close handle if DuplicateHandle + fails and process no longer exists. + * spawn.cc (spawn_guts): Create process in suspended state if OS + demands it. + * wincap.cc: Add "start_proc_suspended" throughout. + * wincap.h (wincaps): Ditto. + (wincapc): Ditto. + +2004-12-27 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (_pinfo::exit): Beef up debugging output. + * sigproc.cc (proc_subproc): Detached children apparently need a ppid + of 1. + +2004-12-26 Christopher Faylor <cgf@timesys.com> + + * init.cc (dll_entry): Previous code reversion was ill-advised. Revert + it. + * sigproc.cc (child_info::sync): Ditto. + * pinfo.cc (_pinfo::exit): Don't set myself.procinfo to NULL since it + is no longer required. + +2004-12-26 Christopher Faylor <cgf@timesys.com> + + * init.cc (dll_entry): Remove exit code setting. + * pinfo.cc (pinfo::init): Initialize exitcode to unset state rather + than SIGTERM. + (proc_waiter): Detect if exit code is unset and use status from + GetExitCodeProcess. + * sigproc.cc (child_info::sync): Remove exit code detection here since + proc_waiter now (again) detects it. + +2004-12-25 Christopher Faylor <cgf@timesys.com> + + * fhandler.cc (fhandler_base::fchmod): Do the right thing when changing + an "on disk" device or fifo. + (fhandler_base::fchown): Ditto for changing ownership. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Accommodate + device files on ntfs partitions. + * path.cc (path_conv::check): Use isfs function to figure out if a path + exists on a filesystem to make sure that device files are caught. + +2004-12-24 Christopher Faylor <cgf@timesys.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + (child_info::parent_wr_proc_pipe): Eliminate. + * pinfo.h (_pinfo::alert_parent): Move here from pinfo class. + (_pinfo::dup_proc_pipe): New method. + (_pinfo::sync_proc_pipe): Ditto. + * exceptions.cc (sig_handle_tty_stop): Reflect move of alert_parent. + * init.cc (dll_entry): Exit with status one if main process called + ExitProcess. + * pinfo.cc (set_myself): Remove handling of parent_wr_proc_pipe. + (_pinfo::exit): Reflect move of alert_parent. Set procinfo to NULL to + flag that we are exiting normally. Always use exitcode when exiting + (although this could be a little racy). + (pinfo::init): Set default exit to SIGTERM. This will be the exit code + reported if process is terminated. + (_pinfo::dup_proc_pipe): New function. + (pinfo::wait): Duplicate wr_proc_pipe to the right place. Use + dup_proc_pipe to move the pipe to the child. + (_pinfo::sync_proc_pipe): New function. + (_pinfo::alert_parent): Move to _pinfo. Make sure that wr_proc_pipe is + ours before using it. + * sigproc.cc (child_info::child_info): Remove handling of + parent_wr_proc_pipe. + * spawn.cc (spawn_guts): Pass our wr_proc_pipe to the child when + execing. Ensure that exit code of cygwin process started from windows + is correctly set. + +2004-12-23 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@timesys.com> + + * path.h (path_conv::set_normalized_path): Add second argument and fill + it in throughout. + * path.cc (path_conv::check): Declare, set and use "strip_tail". + (path_conv::set_normalized_path): Add and use second argument, + replacing all tail stripping tests. + +2004-12-23 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::cygthread): Guard debugging variable with + "ifdef DEBUGGING". + (cygthread::release): Ditto. + +2004-12-23 Christopher Faylor <cgf@timesys.com> + Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Don't strip the trailing slash from a + path consisting only of two slashes. + +2004-12-23 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::stub): Detect if thread function wants to + release itself here, to avoid a race. + (cygthread::release): Clear more stuff. Add a diagnostic for an + internal error. + * cygthread.h (auto_release): New function. + * pinfo.h (pinfo::remember): Add an argument to denote whether child is + detached. + * fork.cc (fork_parent): Reflect change in arguments to + pinfo::remember. + * pinfo.cc (_pinfo::exit): Signal exit more forcibly. + (proc_waiter): Use cygthread::auto_release to signify that + cygthread::stub should release the thread. This should avoid a race. + (pinfo::alert_parent): Don't signify an error when wr_proc_pipe == NULL. + * sigproc.cc (proc_subproc): Add support for PROC_DETACHED_CHILD. + * sigproc.h: Ditto. + * spawn.cc (spawn_guts): Specify whether child is detached or not when + calling pinfo::remember. + +2004-12-22 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (cygheap_setup_for_child): Add api_fatal to catch failing + MapViewOfFileEx. + * cygthread.cc (cygthread::stub): Previous change to make diagnostic + output more informative was really a bust. Try again. Capture previous + name in a new field in cygthread for diagnostic purposes. + (cygthread::cygthread): Ditto. + (cygthread::release): Add an argument to control whether h should be cleared + or not. + (cygthread::terminate_thread): Use 'inuse' for tests rather than 'h'. + (cygthread): Add some diagnostic fields. + (cygthread::release): Add an argument. + * pinfo.cc (proc_waiter): Accommodate change to cygthread::release. + +2004-12-22 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::stub): Make diagnostic output more informative. + +2004-12-22 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (proc_waiter): Zero wait_thread in child to avoid races with + process termination. + * cygthread.cc (cygthread::terminate): Clumsily detect when h has gone away + and attempt no further action. + +2004-12-22 Christopher Faylor <cgf@timesys.com> + + * cygthread.h (cygthread::release): Just declare here. + * cygthread.cc (cygthread::release): Define here. Use + InterlockedExchange to set inuse or suffer potential races. + (cygthread::terminate): Use release(). + +2004-12-22 Chris January <chris@atomice.net> + + * fhandler_process.cpp (format_process_status): Use tabs in formatting + instead of spaces. + +2004-12-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (set_normalized_path): Allow empty pathnames. + +2004-12-21 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Force parent to forget about P_DETACH'ed + process. + +2004-12-20 Christopher Faylor <cgf@timesys.com> + + * path.cc (normalize_win32_path): Remove unneeded check for dots. + +2004-12-20 Christopher Faylor <cgf@timesys.com> + + * path.cc (normalize_posix_path): Remove unneeded check for dots. + (path_conv::set_normalized_path): Strip trailing dots, similarly to + what had previously been done for the win32 path. + +2004-12-18 Christopher Faylor <cgf@timesys.com> + + * path.cc (normalize_win32_path): Make third arg pass-by reference. + Reorganize slightly to eliminate extra variables. + (normalize_posix_path): Ditto. + (path_conv::check): Reflect change in arguments. + (mount_info::conv_to_posix_path): Ditto. + (mount_info::add_item): Ditto. + +2004-12-18 Christopher Faylor <cgf@timesys.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Use updated value. + +2004-12-18 Christopher Faylor <cgf@timesys.com> + Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (path_conv::check): Check the output Win32 path for trailing + spaces and dots, not the input path. Disallow all use of foo./bar + since consistently getting this right is time consuming. Remove + strange test for "unc\" since no one seems to know what it's for. + +2004-12-18 Chris January <chris@atomice.net> + + * fhandler_proc.cc (proc_listing): Add entry for "self". + (proc_fhandlers): Add entry for "self". + * fhandler_process.cc (fhandler_process::fstate): Handle "self". + (fhandler_process::open): Handle "self". + +2004-12-17 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (proc_subproc): Fix long-standing problem. Only wait for + "all processes" if pid == -1 -- not just if pid is negative. + (proc_can_be_signalled): Fix another long-standing problem. Set + correct errno when detecting an exited process. + +2004-12-16 Thomas Wolff <towo@computer.org> + + * fhandler_console.cc (get_win32_attr): Avoid inappropriate intensity + interchanging that used to render reverse output unreadable when + non-reversed text is bright. + +2004-12-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add utmpx symbols. + * syscalls.cc: Include utmpx.h. Implement utmpx functions as stubs + to utmp functions. + (copy_ut_to_utx): New static function. + (pututline): Change from void to struct utmp * as on Linux. + (setutxent): New function. + (endutxent): New function. + (getutxent): New function. + (getutxid): New function. + (getutxline): New function. + (pututxline): New function. + * include/utmpx.h: New file. + * include/cygwin/utmp.h: New file. + * include/cygwin/version.h: Bump API minor number. + * include/sys/utmp.h: Include cygwin/utmp.h. Move stuff common with + utmpx functionality there. + (pututline): Declare struct utmp *. + +2004-12-14 Corinna Vinschen <corinna@vinschen.de> + + * tty.cc (tty_list::terminate): Guard releasing the tty with tty_mutex. + (tty::init): Set master_pid to 0. + +2004-12-14 Thomas Wolff <towo@computer.org> + + * fhandler_console.cc (read): Consider offset within scrolling + region of the console window. + +2004-12-13 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cwdstuff::get_drive): Release cwd_lock. + +2004-12-12 Bas van Gompel <cygwin-patch@bavag.tmfweb.nl> + + * fhandler.cc (fhandler_base::puts_readahead): Fix end-condition. + +2004-12-10 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_INVALID_ADDRESS to EINVAL instead of + EOVERFLOW. + +2004-12-10 Christopher Faylor <cgf@timesys.com> + + * include/sys/strace.h: Don't output paranoid_printf by default. + +2004-12-09 Christopher Faylor <cgf@timesys.com> + + * lib/libcmain.c (main): Properly deal with quoted first argument. + +2004-12-06 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (proc_pipe::*): Delete class. + * pinfo.cc (proc_pipe::*): Ditto. + +2004-12-05 Christopher Faylor <cgf@timesys.com> + + * fork.cc (fork_parent): Reinstate "childhProc" protection. Don't + close hProcess handle here since it is used to ensure that a new + process isn't created with the old pid after the old pid exits. + * spawn.cc (spawn_guts): Ditto. + * pinfo.cc (proc_waiter): Don't send any signals if we've execed since + this process doesn't officially exist. + * pinfo.h (pinfo::pid_handle): Eliminate. Just use hProc. + * sigproc.cc (sig_send): Don't send any signals if our sendsig doesn't + exist. That's a sign that we are execing. + (remove_proc): Eliminate pid_handle close. + +2004-12-05 Christopher Faylor <cgf@timesys.com> + + * cygthread.h (cygthread::terminate_thread): Make public. + * pinfo.h (pinfo::wait_thread): New element. + * pinfo.cc (pinfo::wait): Store "handle" to started thread in pinfo. + * sigproc.cc (proc_terminate): Kill any threads waiting for a process + pipe. + +2004-12-05 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (mychild): Reimplement as list scan. + (proc_subproc): Don't mess with pinfo if it's myself. + +2004-12-05 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info_types): Label enum for _PROC constants. + (child_info::child_info): New constructor. + (child_info::~child_info): New destructor. + (child_info::sync): Declare new function. + (child_info_fork::child_info_fork): New constructor. + (child_info_spawn::child_info_spawn): Remove old constructor. + (child_info_spawn::child_info_spawn): New constructor. + * dcrt0.cc (dll_crt0_0): Use correct sizeof when doing sanity check on + passed in child_info. Signal readiness to parent when not forking (and + not spawning). + * fork.cc (sync_with_child): Delete. + (resume_child): Remove extra argument. + (sync_with_parent): Use child_info method to sync with parent. + (fork_child): Don't close fork_info->subproc_ready since that is now + handled by the destructor. + (fork_parent): Remove subproc_ready stuff. Use child_info sync method + for waiting.. Set start time here for child. Rename "forked" to + "child". + (fork): Check ch.subproc_ready for validity here. + * pinfo.h (_pinfo::exec_sendsig): Temp storage for exec stub which may + be staying around to handle non-cygwin captive process. + (_pinfo::exec_dwProcessId): Ditto. + (_pinfo::_lock): Renamed from lock. + (_pinfo::lock): New method. + (_pinfo::unlock): Ditto. + (_pinfo::initialize_lock): Ditto. + * pinfo.cc (set_myself): Use initialize_lock method to initialize + myself lock. Set "exec" fields in _pinfo to zero to indicate that + we've started successfully. Set start time here when appropriate. + (_pinfo::commune_send): Use pinfo lock/unlock methods. + (proc_waiter): Remove special case for non-cywin processes. + Reinstitute handling for PID_NOCLDSTOP. + * sigproc.cc (proc_subproc): Set proper EAGAIN errno when process table + is filled. + (sig_send): Use exec_* fields from _pinfo for sending signals if the + the _pinfo sendsig never materializes. + (child_info::child_info): New constructor, renamed from init_child_info. + Zeroes child_info structure and sets appropriate fields in structure + based on chtype. + (child_info::~child_info): New destructor. Closes subproc_ready if it + exists. + (child_info_fork::child_info_fork): New constructor. + (child_info_spawn::child_info_spawn): New constructor. + (child_info::ready): New function. Signals parent when child is ready. + (child_info::sync): New function. Wait for child to signal us or + process to die. + (remove_proc): Remove closing of hProcess since this should now be + handled shortly after process creation. + * spawn.cc (spawn_guts): Use child_info_spawn constructor rather than + init_child_info. Save exec_sendsig and exec_dwProcessId in execing + _pinfo. Rely on child_info constructor to properly set + parent_wr_proc_pipe in ciresrv. Revert to previous determination on + whether to start a process in suspended mode. Remove reparenting + stuff. Just keep a stub around if starting a non-cygwin process. + +2004-12-05 Bas van Gompel <cygwin-patch@bavag.tmfweb.nl> + + * fhandler.cc (fhandler_base::read): Remove superfluous check in + __small_printf format for strace. + +2004-12-05 Bas van Gompel <cygwin-patch@bavag.tmfweb.nl> + + * fhandler.cc (fhandler_base::read): Don't debug_printf garbage when + copied_chars is zero. + +2004-12-03 Christopher Faylor <cgf@timesys.com> + + * environ.cc (environ_init): Alloc space for TERM if it is not set, + like all of the other environment variables. + +2004-12-02 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info_fork::parent_wr_proc_pipe): New element. + * fork.cc (fork_parent): Set parent_wr_proc. + * pinfo.cc (set_myself): Close child_proc_info->parent_wr_proc if it + exists rather than trying to get value from parent _pinfo. + +2004-12-02 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (enum parent_aleter): New enum. + (pinfo::alert_parent): Declare as returning a value. + (pinfo::parent_alive): New function. + * pinfo.cc (pinfo::alert_parent): Set wr_proc_pipe to invalid non-NULL + value when parent disappears. Return success of operation. + (proc_waiter): Use __ALERT_* enum for control since these are not really signals. + Implement __ALERT_ALIVE. + * sigproc.cc (my_parent_is_alive): Eliminate. + * sigproc.h (my_parent_is_alive): Ditto for declaration. + (__SIGREPARENT): Eliminate. + +2004-12-02 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::wait): Use better name for cygthread. + +2004-12-03 Pierre Humblet <pierre.humblet@ieee.org> + + * registry.h (reg_key::reg_key): Change arguments. + * shared_info.h (class mount_info): Remove had_to_create_mount_areas. + * registry.cc (reg_key::reg_key): Change constructors to always handle + HKLM and to avoid relying on HKCU. + Do not set mount_table->had_to_create_mount_areas. + * path.cc (mount_info::conv_to_win32_path): Improve update of + sys_mount_table_counter. + (mount_info::read_mounts): Use new reg_key constructor. + (mount_info::add_reg_mount): Ditto. + (mount_info::del_reg_mount): Ditto. + (mount_info::read_cygdrive_info_from_registry): Ditto. + (mount_info::write_cygdrive_info_to_registry): Ditto. + Update cygwin_shared->sys_mount_table_counter after registry update. + (mount_info::get_cygdrive_info): Ditto. + * shared.cc (shared_info::heap_chunk_size): Use new reg_key constructor. + * environ.cc (regopt): Ditto. + +2004-12-01 Christopher Faylor <cgf@timesys.com> + + * include/features.h: Include sys/cdefs.h, like linux. + +2004-12-01 Christopher Faylor <cgf@timesys.com> + + * syscalls.cc (truncate64): Don't second-guess errno if open fails. + * devices.in: Don't allow /dev/com0. + +2004-11-25 Christopher Faylor <cgf@timesys.com> + + * environ.cc (putenv): Accommodate recent newlib change in argument to + putenv. + +2004-11-25 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info_spawn::hexec_proc): Eliminate. + * dcrt0.cc (dll_crt0_0): Remove hexec_proc stuff. + * fork.cc (fork_child): Remove call to pinfo_fixup_after_fork. + * pinfo.cc (set_myself): Close and zero pid_handle if set. + (pinfo_fixup_after_fork): Delete. + (proc_waiter): Don't close vchild.hProcess here. Do that when we are + remove the vchild from procs. Save hProcess as pid_handle only on + first reparent operation. + (pinfo::wait): Don't set pid_handle here. + (pinfo::alert_parent): Always try to send signal. If unsuccessful then + close and zero wr_proc_pipe. + * pinfo.h (pinfo::pinfo): Make sure that appropriate parts of the class + are zeroed on construction. + (pinfo::alert_parent): Take char argument. + (pinfo_fixup_after_fork): Delete declaration. + (hexec_proc): Ditto. + * sigproc.cc (remove_proc): Close pid_handle and hProcess if + appropriate. + * spawn.cc (spawn_guts): Set cygheap->pid_handle on first exec. + +2004-11-25 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (init_cygheap::pid_handle): New element. + * pinfo.cc (set_myself): Clear previously existing cygheap->pid_handle + when a new process has been started. + (pinfo::wait): Make sure that a handle to the newly forked/spawned + process is kept around so that the pid will not be reused. + * pinfo.h (_pinfo::pid_handle): Move. + (pinfo::pid_handle): to here. + * spawn.cc (spawn_guts): Create a pid_handle in cygheap prior to + spawning to ensure that the pid does not get reused during the lifetime + of the "cygwin pid". + +2004-11-25 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (pinfo::alert_parent): New function. + * exceptions.cc (sig_handle_tty_stop): Use alert_parent to send + "signals" to parent. + * fork.cc (fork_parent): Don't close pi.hProcess. Let the waiter + thread do that. + * pinfo.cc (proc_waiter): Detect case where process exits without + setting the exit code and use value from GetExitCodeProcess. + Reluctantly implement __SIGREPARENT. + (pinfo::alert_parent): Define. + * sigproc.h (__SIGREPARENT): New enum. + * spawn.cc (spawn_guts): Send reparent signal to parent on exec. + Always create process in suspended state to avoid races. + +2004-11-25 Christopher Faylor <cgf@timesys.com> + + Remove cygthread.h in favor of cygtls.h throughout since cygtls now + includes cygthread.h. Eliminate ppid_handle usage throughout. + * child_info.h: Regenerate magic number + (child_info): Remove pppid_handle. + * cygthread.h (cygthread::release): New method. Frees thread without + waiting. + * cygthread.cc (cygthread::stub): Set _ctinfo in _mytls to point to + information for executing thread. Don't call SetEvent if thread is no + longer in use. + (cygthread::simplestub): Ditto. + * cygtls.h (_cygtls::_ctinfo): New element contains pointer to + information about executing cygthread, if any. + * dcrt0.cc: Remove last vestiges of per_thread stuff. + (dll_crt0_0): Ditto. Remove accommodation for ppid_handle. + (do_exit): Remove obsolete reparenting test. + (_exit): Exit with a more SUSv3-like exit value. + * dtable.cc (dtable::stdio_init): Check for myself->cygstarted rather + than myself->ppid_handle to see if we were started by a cygwin process. + * exceptions.cc (open_stackdumpfile): Ditto. + (handle_exceptions): Ditto. + (ctrl_c_handler): Ditto. + (sig_handle_tty_stop): Ditto. Let parent send signal to itself on + STOP. + (sigpacket::process): Comment out vfork test. + (signal_exit): Use more SUSv3-like exit value on signal. + * external.cc (fillout_pinfo): Don't set hProcess. + * fork.cc: Remove VFORK cruft. + (per_thread::set): Delete. + (fork_child): Remove perthread stuff. + (fork_parent): Remove obsolete subproc_init. Accommodate new method + for tracking subprocesses. + * pinfo.cc (set_myself): Accommodate new pinfo/_pinfo layout. Set some + things here that used to be set in wait_sig. + (_pinfo::exit): Set exitcode here. Close process pipe. + (_pinfo::commune_send): Accommodeate new pinfo/_pinfo layout. + (proc_waiter): New function. Waits, in a thread for subprocess to go + away. + (pinfo::wait): New function. Initialization for proc_waiter. + * pinfo.h (_pinfo::exitcode): New element. + (_pinfo::cygstarted): Ditto. + (_pinfo::wr_proc_pipe): Ditto. + (_pinfo::ppid_handle): Delete. + (_pinfo::hProcess): Delete. + (_pinfo::lock): Delete. + (pinfo::hProcess): New element. + (pinfo::lock): Ditto. + (pinfo::wait): Declare new function. + (pinfo::preserve): Define new function. + * sigproc.cc: Remove old stuff from wait_subproc thread based method. + (zombies): Remove. + (procs): New. + (my_parent_is_alive): Just check that the parent pid exists. + (mychild): Just use pinfo methods to determine if child is mine. + (proc_subproc): Revamp PROC_ADDCHILD to use pinfo::wait. Remove + PROC_CHILDTERMINATED logic. Use different method to remove processes + from list when SIGCHLD == SIG_IGN. + (proc_terminate): Gut. + (subproc_init): Delete. + (init_child_info): Remove setting of pppid_handle. + (checkstate): Revamp to only scan procs array. + (remove_proc): Rename from remove_zombie. Don't close hProcess or + pid_handle. Don't release memory if it's myself. + (stopped_or_terminated): Change logic to handle new consolidated + proc/zombie array. + (wait_subproc): Delete. + * sigproc.h: Remove obsolete EXIT_* defines. + (subproc_init): Remove declaration. + * spawn.cc (spawn_guts): Remove reparenting stuff. Use standard wait + logic to wait for child if started from a non-cygwin process. + * tlsoffsets.h: Regenerate. + * tty.cc (tty_init): Check for myself->cygstarted rather than + myself->ppid_handle to see if we were started by a cygwin process. + * include/sys/signal.h (external_pinfo::exitcode): Replace hProcess. + * include/sys/wait.h (WCOREDUMP): Define. + + * fhandler_tty.cc (fhandler_tty_slave::read): Add debugging output for + timeout case. + * signal.cc (abort): Flag that we are exiting with the ABORT signal. + +2004-11-22 Christopher Faylor <cgf@timesys.com> + + * select.cc (select_stuff::test_and_set): Remove extraneous tests of + "window_handle". + +2004-11-20 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler::write): Remove debug_printf. + * pipe.cc (fhandler_pipe::create): Edit syscall_printf format. + +2004-11-20 Pierre Humblet <pierre.humblet@ieee.org> + + * cygheap.h (cygheap_user::get_windows_id): New method. + * registry.h (get_registry_hive_path): Change argument type. + (load_registry_hive): Ditto. + * registry.cc (get_registry_hive_path): Change argument type and take + Win9x keys into account. + (load_registry_hive): Ditto. + * uinfo.cc (cygheap_user::env_userprofile): Use get_windows_id, even + for SYSTEM. + * shared.cc (user_shared_initialize): Use get_windows_id. + * syscalls.cc (seteuid32): Load the registry hive and reload the user + shared also on Win9x. + +2004-11-11 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 13. + +2004-10-28 Christopher Faylor <cgf@timesys.com> + + * fork.cc (NPIDS_HELD): Reduce to former number now that bash problem + has been identified. + +2004-10-28 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (mount_info::from_registry): Deimpersonate while + accessing HKLM. + (mount_info::read_cygdrive_info_from_registry): Ditto. + * cygheap.h: Define NO_IMPERSONATION. + (cygheap_user::issetuid): Replace INVALID_HANDLE_VALUE by + NO_IMPERSONATION. + (cygheap_user::has_impersonation_tokens): Ditto. + (cygheap_user::close_impersonation_tokens): Ditto. + * uinfo.cc (uinfo_init): Ditto. + * syscalls.cc (seteuid32): Ditto. + * security.cc (set_impersonation_token): Ditto. + +2004-10-26 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::fixup_after_fork): Wipe out exitsock local since + it should not be used by the child. + * select.cc (start_thread_socket): Turn off inheritance for exitsock. + Don't add exitsock to exception mask since it should never get an + exception. + (socket_cleanup): Change some debug messages for consistency. + * fhandler_socket.cc (fhandler_socket::dup): Change comment wording + slightly. + +2004-10-26 Pierre Humblet <pierre.humblet@ieee.org> + + * registry.cc (get_registry_hive_path): Simplify and add a + debug_printf in case of failure. + (load_registry_hive): Revert the 2004-04-19 change. + +2004-10-20 Christopher Faylor <cgf@timesys.com> + + * select.cc (start_thread_socket): Remove attempt to delay reading of + exitsock or suffer occasional mysterious 60 second hangs. + (socket_cleanup): Empty the exitsock here after the thread has + terminated. + +2004-10-19 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::fixup_after_exec): Fix error + message. + +2004-10-12 Christopher Faylor <cgf@timesys.com> + + * select.cc (start_thread_socket): Remove unused code. + +2004-10-11 Christopher Faylor <cgf@timesys.com> + + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Revert previous checkin. + +2004-10-10 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (exitsock): New element. + (exitsock_sin): Ditto. + * cygtls.cc (_cygtls::init_thread): Initialize exitsock to invalid handle. + (_cygtls::call2): Close exitsock if it is valid. + * select.cc (struct socketinf): Remove sin element. + (start_thread_socket): Initialize one SOCK_DGRAM socket per thread + instead of (apparently) expensive opening and closing of socket with + each select call. + (socket_cleanup): Send a byte to the exitsock socket as a way to + potentially signal a waiting-for-socket thread to exit. + * tlsoffsets.h: Regenerate. + +2004-10-07 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class cygheap_user): Add psystemroot member and + env_systemroot method. + * environ.cc (struct spenv): Add add_always member. + (spenvs): Accommodate new add_always member. Add + cygheap_user::env_systemroot method to SYSTEMROOT entry. + (build_env): Check add_always member when adding missing environment + variables from spenvs. + * uinfo.cc (cygheap_user::env_systemroot): New method. + +2004-10-07 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): Drop duplicated line. + +2004-10-07 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (pthread_cleanup::oldmask): Default to invalid signal mask. + (do_cleanup): Test for invalid signal mask to decide whether to restore + the mask rather than assuming zero mask indicates that there is nothing + to do. + +2004-10-07 Mark Paulus <mark.paulus@mci.com> + + * fhandler_tty.cc (fhandler_tty_slave::read): Use previously + evaluated time_to_wait value. + +2004-10-05 Pierre Humblet <pierre.humblet@ieee.org> + + * external.cc (check_ntsec): Do not call wincap.has_security. + * path.cc (path_conv::check): Ditto. + * security.cc (get_object_attribute): Ditto. + (get_file_attribute): Ditto. + +2004-10-05 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * pinfo.cc (_pinfo::commune_send): Correct debugging output. + +2004-10-04 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/signal.h: Add siginterrupt definition. + +2004-10-02 Pierre Humblet <pierre.humblet@ieee.org> + + * path.h (enum path_types): Delete PATH_ISDISK. + (path_conv::isdisk): Delete method. + (path_conv::set_isdisk): Ditto. + * path.cc (path_conv::check): Do not call set_isdisk. + * uinfo.cc(pwdgrp::load): Do not call pc.isdisk. + +2004-09-28 Christopher Faylor <cgf@timesys.com> + + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Disallow attempts + to set the process group to a nonexistent process group. + +2004-09-27 Corinna Vinschen <corinna@vinschen.de> + + * lib/_cygwin_crt0_common.cc: Revert patch from 2004-09-16. Brakes + newly built DLLs. + +2004-09-24 Christopher Faylor <cgf@timesys.com> + Sergey Ivanov <seriv@parkheights.dyndns.org> + + * path.cc (mount_info::read_cygdrive_info_from_registry): Default + /cygdrive to binary mode. + +2004-09-22 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (normalize_win32_path): Only look for : in second position. + Avoid infinite loop with names starting in double dots. + (mount_info::conv_to_win32_path): Do not worry about a trailing dot. + (hash_path_name): Ditto. + +2004-09-20 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (sig_handle_tty_stop): Set flag earlier. + +2004-09-20 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (sig_handle_tty_stop): Set flag that we are in a cygwin + function to avoid a probably erroneous stack walk. + +2004-09-17 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink): Don't use "delete on close" on remote shares. + +2004-09-17 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (_impure_ptr): Add export again. There are libs out there. + +2004-09-16 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (_impure_ptr): Don't export. + (reent_data): Export. + * lib/_cygwin_crt0_common.cc (_impure_ptr): Drop entirely. Don't + initialize _impure_ptr or u->impure_ptr_ptr. + +2004-09-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (_impure_ptr): Export. + (reent_data): Don't export. + * dcrt0.cc (reent_data): Drop. + (__cygwin_user_data): Initialize impure_ptr as GLOBAL_REENT. + (_dll_crt0): Initialize _impure_ptr as GLOBAL_REENT. + * lib/_cygwin_crt0_common.cc (_impure_ptr): Drop. Declare extern as + dllimport instead. + +2004-09-14 Christopher Faylor <cgf@timesys.com> + + * cygtls.h: Add alignment kludge to fix disparity between compilers. + * tlsoffsets.h: Regenerate. + + * fork.cc (slow_pid_reuse): Use define to control number of pids held + to prevent pid reuse. + +2004-09-14 Sam Steingold <sds@gnu.org> + + * autoload.cc (EnumProcessModules): Add. + * dlfcn.cc (dlsym): Handle RTLD_DEFAULT using EnumProcessModules(). + * include/dlfcn.h (RTLD_DEFAULT): Define to NULL. + +2004-09-13 Christopher Faylor <cgf@timesys.com> + + * fork.cc (slow_pid_reuse): Temporarily double the number of pids held + to prevent pid reuse. + +2004-09-12 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (wait_sig): Ensure that waiting threads are awoken after + returning from a hold condition. + +2004-09-12 Christopher Faylor <cgf@timesys.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + +2004-09-11 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@timesys.com> + + * exceptions.cc: (ctrl_c_handler): Do nothing while a Cygwin subprocess + is starting. + +2004-09-10 Christopher Faylor <cgf@timesys.com> + + * child_info.h (init_child_info): Remove pid argument from declaration. + * cygheap.h (init_cygheap::pid): New element. + * dcrt0.cc (dll_crt0_0): Eliminate handling of now-noexistent cygpid + parameter in child_info struct. Set forkee to 'true' rather than + cygpid since the pid value was never used. + (dll_crt0_1): Ditto. + (_dll_crt0): Ditto. + * fork.cc (fork_child): Don't wait for sigthread. This is handled in + the fork call now. + (fork_parent): Remove obsolete pid argument from init_child_info call. + Don't do anything special with cygpid when DEBUGGING. + (fork): Delay all signals during fork. + (fork_init): Don't do anything special when DEBUGGING. + * pinfo.cc (set_myself): Remove pid parameter. Use new pid field in + cygheap. + (pinfo_init): Don't pass pid argument to set_myself. + * sigproc.cc (sig_send): Wait for dwProcessId to be non-zero as well as + sendsig. + (init_child_info): Eliminate handling of pid. + (wait_sig): Implement method to temporarily hold off sending signals. + * sigproc.h (__SIGHOLD): New enum. + (__SIGNOHOLD): Ditto. + * spawn.cc (spawn_guts): Remove obsolete pid argument from + init_child_info call. + +2004-09-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::dup): Use debug_printf. + +2004-09-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Create libutil.a from bsdlib.o exports. + * bsdlib.cc (logwtmp): Move from syscalls.cc to here. + (login): Ditto. + (logout): Ditto. + + * winsup.h (EXPORT_ALIAS): New macro. + * exec.cc: Define alias symbols using EXPORT_ALIAS macro. + * syscalls.cc: Ditto. + * times.cc: Ditto. + +2004-09-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::open): Fix typo. + +2004-09-09 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * pipe.cc (create_selectable_pipe): Work around bug in Windows 95 + where CreateNamedPipe returns NULL. + +2004-09-08 Pierre Humblet <pierre.humblet@ieee.org> + + * cygheap.h (cwdstuff::drive_length): New member. + (cwdstuff::get_drive): New method. + * path.cc (normalize_win32_path): Simplify by using cwdstuff::get_drive. + (mount_info::conv_to_win32_path): Use cwdstuff::get_drive as default for /. + (cwdstuff::set): Initialize drive_length. + +2004-09-07 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::init_thread): Set __sdidinit to negative value to + indicate that it is "special". + * thread.cc (pthread::exit): If __sdidinit is < 0, it was never really + initialized so reset it to 0 before calling _reclaim_reent. + +2004-09-05 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 12. + +2004-09-03 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: Fix a few more strace_prints. + +2004-09-02 Christopher Faylor <cgf@timesys.com> + + Regularize most strace_prints throughout so that %E is always preceded + by a comma and elminate most uses of "foo = %s" to "foo %s". + +2004-09-02 Bob Byrnes <byrnes@curl.com> + Christopher Faylor <cgf@timesys.com> + + * autoload.cc (NtQueryInformationFile): Return nonzero on error. + * ntdll.h (FILE_PIPE_LOCAL_INFORMATION): Add. + (NtQueryInformationFile): Fix types for last two arguments. + * pipe.cc: Include stdlib.h, limits.h, and ntdll.h. + (create_selectable_pipe): New function to create a pipe that can be + used with NtQueryInformationFile for select. + (fhandler_pipe::create): Call create_selectable_pipe instead of + CreatePipe. + (pipe): Use DEFAULT_PIPEBUFSIZE as argument to create_pipe. + * select.cc: Include limits.h and ntdll.h. + (peek_pipe): Add select_printf output. Call NtQueryInformationFile to + implement select for write on pipes. + (fhandler_pipe::select_read): Reorder field assignments to be + consistent with fhandler_pipe::select_write. + (fhandler_pipe::select_write): Initialize startup, verify, cleanup, and + write_ready fields for select_record. + (fhandler_pipe::select_except): Tweak indentation to be consistent with + fhandler_pipe::select_write. + +2004-08-30 Pierre Humblet <pierre.humblet@ieee.org> + + * fork.cc (fork_parent): Return the cygpid directly derived from the + winpid. + +2004-08-30 Christopher Faylor <cgf@timesys.com> + + * fork.cc (fork_parent): Record child's pid when we're sure that it has + been filled out by the child. + * pinfo.cc (pinfo::init): Trivial change. + +2004-08-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Allow to report + success on systems with ntsec and ntea set. + +2004-08-28 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler_base::write): In the lseek_bug case, set EOF + before zero filling. Combine similar error handling statements. + +2004-08-28 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (ftruncate64): On 9x, call write with a zero length + to zero fill when the file is extended. + +2004-08-24 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (link): Avoid compiler warning. + +2004-08-21 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (set_ntea): New function. + (set_ntsec): Ditto. + (set_smbntsec): Ditto. + (parse_thing): Change ntea, ntsec and smbntsec settings to call + appropriate functions. + +2004-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::raw_read): Use ?: instead of + if/else. + (fhandler_dev_tape::raw_write): Return -1 in case of error. + +2004-08-19 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (_sys_errlist): Change various text to their english Linux + counterparts. Unify layout. + (strerror): Remove switch statement. + +2004-08-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Set shared flags to 0 when + opening a tape device. + +2004-08-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::dup): Increment dtable's + need_fixup_before counter on successful dup. + * net.cc (cygwin_getpeername): Add file descriptor to debug output. + +2004-08-17 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.h (fhandler_dev_dsp:~fhandler_dev_dsp): Delete. + (fhandler_dev_dsp::open_count): Delete. + (fhandler_dev_dsp::close_audio_in): New method declaration. + (fhandler_dev_dsp::close_audio_in): Ditto. + * fhandler_dsp.cc: Add and edit debug_printf throughout. + (fhandler_dev_dsp::Audio::denyAccess): Delete. + (fhandler_dev_dsp::Audio::fork_fixup): Ditto. + (fhandler_dev_dsp::Audio::getOwner): Ditto. + (fhandler_dev_dsp::Audio::clearOwner): Ditto. + (fhandler_dev_dsp::Audio::owner_): Ditto. + (fhandler_dev_dsp::Audio::setformat): Ditto, rename to setconvert. + (fhandler_dev_dsp::Audio::lock): Ditto, move to queue. + (fhandler_dev_dsp::Audio::unlock): Ditto. + (fhandler_dev_dsp::Audio::lock_): Ditto. + (fhandler_dev_dsp::Audio::bufferIndex_): New member, from Audio_out + and Audio_in. + (fhandler_dev_dsp::Audio::pHdr_): Ditto. + (fhandler_dev_dsp::Audio::wavehdr_): Ditto. + (fhandler_dev_dsp::Audio::bigwavebuffer_): ditto. + (fhandler_dev_dsp::Audio::Qisr2app_): Ditto. + (fhandler_dev_dsp::Audio::setconvert): New method, from old setformat. + (fhandler_dev_dsp::Audio::queue::lock): New method. + (fhandler_dev_dsp::Audio::queue::unlock): Ditto. + (fhandler_dev_dsp::Audio::queue::dellock): Ditto. + (fhandler_dev_dsp::Audio::queue::isvalid): Ditto. + (fhandler_dev_dsp::Audio::queue::lock_): New member. + (fhandler_dev_dsp::Audio::queue::depth1_): Delete. + (fhandler_dev_dsp::Audio_out::fork_fixup): New method. + (fhandler_dev_dsp::Audio_out::isvalid): New method. + (fhandler_dev_dsp::Audio_out::start): Remove arguments. + (fhandler_dev_dsp::Audio_out::parsewav): Change arguments and set + internal state. + (fhandler_dev_dsp::Audio_out::emptyblocks): Delete. + (fhandler_dev_dsp::Audio_out::Qapp2app_): Ditto. + (fhandler_dev_dsp::Audio_out::Qisr2app_): Ditto, move to Audio. + (fhandler_dev_dsp::Audio_out::bufferIndex_): Ditto. + (fhandler_dev_dsp::Audio_out::pHdr_): Ditto. + (fhandler_dev_dsp::Audio_out::wavehdr_): Ditto. + (fhandler_dev_dsp::Audio_out::bigwavefuffer_): Ditto. + (fhandler_dev_dsp::Audio_out::freq_): New member. + (fhandler_dev_dsp::Audio_out::bits_): New member. + (fhandler_dev_dsp::Audio_out::channels_): New member. + (fhandler_dev_dsp::Audio_in::fork_fixup): New method. + (fhandler_dev_dsp::Audio_in::isvalid): New method. + (fhandler_dev_dsp::Audio_in::Qapp2app_): Delete. + (fhandler_dev_dsp::Audio_in::Qisr2app_): Ditto, move to Audio. + (fhandler_dev_dsp::Audio_in::bufferIndex_): Ditto. + (fhandler_dev_dsp::Audio_in::pHdr_): Ditto. + (fhandler_dev_dsp::Audio_in::wavehdr_): Ditto. + (fhandler_dev_dsp::Audio_in::bigwavefuffer_): Ditto. + (fhandler_dev_dsp::Audio::queue::queue): Simplify. + (fhandler_dev_dsp::Audio::queue::send): Use lock. + (fhandler_dev_dsp::Audio::queue::query): Do not use depth1_. + (fhandler_dev_dsp::Audio::queue::recv): Ditto. + (fhandler_dev_dsp::Audio::Audio): Adapt to new class members. + (fhandler_dev_dsp::Audio::~Audio): Ditto + (fhandler_dev_dsp::Audio_out::start): Reorganize. + (fhandler_dev_dsp::Audio_out::stop): Simplify. + (fhandler_dev_dsp::Audio_out::init): Reset the queue and clear flag. + (fhandler_dev_dsp::Audio_out::write): Reorganize to allocate audio_out. + (fhandler_dev_dsp::Audio_out::buf_info): Use appropriate block size. + (fhandler_dev_dsp::Audio_out::callback_sampledone): Do not use lock. + (fhandler_dev_dsp::Audio_out::waitforspace): Simplify. + (fhandler_dev_dsp::Audio_out::waitforallsent):Ditto. + (fhandler_dev_dsp::Audio_out::sendcurrent): Reorganize. + Clear flag before requeuing. + (fhandler_dev_dsp::Audio_out::parsewav): + (fhandler_dev_dsp::Audio_in::start): Reorganize. + (fhandler_dev_dsp::Audio_in::stop): Simplify. + (fhandler_dev_dsp::Audio_in::queueblock): Ditto. + Requeue header in case of error. + (fhandler_dev_dsp::Audio_in::init): Reset the queue and clear flag. + (fhandler_dev_dsp::Audio_in::waitfordata): Simplify. + Do not UnprepareHeader if the flag is zero. + (fhandler_dev_dsp::Audio_in::buf_info): Ditto. + (fhandler_dev_dsp::Audio_in::callback_blockfull): Do not use lock. + (fhandler_dev_dsp::open_count): Delete. + (fhandler_dev_dsp::open): Only check existence, do not allocate + anything. Set flags appropriately. Create archetype. + (fhandler_dev_dsp::write): Call archetype as needed. Create audio_out. + (fhandler_dev_dsp::read): Call archetype as needed. Create audio_in. + (fhandler_dev_dsp::close): Call archetype as needed. + Call close_audio_in and close_audio_out. + (fhandler_dev_dsp::close_audio_in): New function. + (fhandler_dev_dsp::close_audio_out): New function. + (fhandler_dev_dsp::dup): Use archetypes. + (fhandler_dev_dsp::ioctl): Call archetype as needed. Reorganize for + new structures. + (fhandler_dev_dsp::fixup_after_fork): Call archetype as needed. + (fhandler_dev_dsp::fixup_after_exec): Call archetype as needed. + Clear audio_in and audio_out. + +2004-08-14 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler_base::open_9x): Set file attributes + for new files. + +2004-08-11 Christopher Faylor <cgf@timesys.com> + + * net.cc (cygwin_gethostbyname): Show failing host name on error. + +2004-08-10 Christopher Faylor <cgf@redhat.com> + + * select.cc (select_stuff::wait): Correctly check for w4 array bounds. + +2004-08-03 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Add ERROR_TOO_MANY_LINKS -> EMLINK mapping. + * syscalls.cc (link): Only copy files if FS doesn't support hard links. + +2004-07-26 Christopher January <chris@atomice.net> + + * fhandler_proc.cc (format_proc_cpuinfo): Remove Intel-specific flags + from /proc/cpuinfo on non-Intel processors. Added new AMD-specific + flags. Changed Intel flag names to match Linux. + +2004-07-24 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Use proper boolean arguments. + * pinfo.cc (pinfo::init): Don't consider MapViewOfFileEx error to be + fatal if exiting. + * pinfo.h (pinfo::init): Eliminate default argument and supply the + argument in the one case that needed it. + +2004-07-24 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <cgf@timesys.com> + + * autoload.cc (GetNativeSystemInfo): Add. + (IsWow64Process): Add. + * init.cc (respawn_wow64_process): New function. + (dll_entry): If process has been started from a 64 bit + process, call respawn_wow64_process. + * uname.cc (uname): On 64 bit systems, use GetNativeSystemInfo. + Show actual CPU type. + +2004-07-23 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::get_debugger_info): Make stderr r/w according + to SUSv3. + +2004-07-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::open): Use requested flag + values also when copying fhandler from archetype. + +2004-07-22 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Print handle in hex when MapViewOfFile fails. + +2004-07-20 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc: Whitespace fixes. + +2004-07-20 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (clean): Remove cygwin.def since it is autogenerated. + +2004-07-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::init): Fix non-ISO + expression. + * fhandler_floppy.cc (fhandler_dev_floppy::open): Remove unused + variable. + * fhandler_proc.cc (format_proc_meminfo): Fix compiler warning. + +2004-07-16 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Guard against MapViewOfFileEx failure. + +2004-07-15 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::alloc_page_map): Mark pages as allocated even + on Windows 9x, FWIW. + +2004-07-15 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mprotect): When MAP_WRITE protection is requested, use + READWRITE or WRITECOPY protection, whatever has been used when the + page has been allocated initially. + +2004-07-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_raw): Remove is_writing flag. + Remove declaration of writebuf. + (class fhandler_dev_floppy): Remove declaration of close. + * fhandler_floppy.cc (fhandler_dev_floppy::close): Delete. + (fhandler_dev_floppy::lseek): Remove calls to writebuf. Set + eom_detected to false after successful seek. + * fhandler_raw.cc (fhandler_dev_raw::writebuf): Delete. + (fhandler_dev_raw::raw_read): Remove calls to writebuf. + (fhandler_dev_raw::raw_write): Always invalidate buffer. + +2004-07-15 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (class mmap_record): Fix return type of get_offset. + (mmap_record::fixup_page_map): Fix off by one error. + (list::search_record): Use long as type of "start" argument in both, + declaration and definition. Use long as type for local variable "i". + +2004-07-14 Dave Korn <dk@artimi.com> + + * fhandler_registry.cc (registry_listing): Correct typo. + (fhandler_registry::fill_filebuf): Set size of newly expanded buffer + prior to calling RegQueryValueEx. + +2004-07-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::raw_write): Remove buffered + write entirely. + +2004-07-07 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Check if script is executable. + +2004-06-30 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (hires_ms::usecs): Don't overreact. + +2004-06-30 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (hires_ms::usecs): Reinit timer when system time overflows. + +2004-06-27 Christopher Faylor <me@cgf.cx> + + * thread.cc (__cygwin_lock_lock): Don't bother locking when there is + only one known thread. + (__cygwin_lock_unlock): Ditto for unlocking. + +2004-06-23 Tomas Ukkonen <tomas.ukkonen@iki.fi> + + * fhandler_proc.cc (format_proc_cpuinfo): Test CPU vendor and print + AMD specific 3dnow capabilities. + +2004-06-23 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_socket.cc (fhandler_socket::release): Call + WSASetLastError last. + +2004-06-21 Christopher Faylor <cgf@alum.bu.edu> + + * autoload.cc (wsock_init): Keep lock while modifying return address. + +2004-06-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Remove 9x specific code. + +2004-06-17 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (fhandler_base::open_9x): Do not check for null name. + Move debug_printf to common code line. + (fhandler_base::open): Ditto. Initialize upath. Remove second argument + of pc.get_nt_native_path. + * path.h (path_conv::get_nt_native_path): Remove second argument. + * path.cc (path_conv::get_nt_native_path): Ditto. Call str2uni_cat. + * security.h (str2buf2uni_cat): Delete declaration. + (str2uni_cat): New declaration. + * security.cc (str2buf2uni): Get length from sys_mbstowcs call. + (str2buf2uni_cat): Delete function. + (str2uni_cat): New function. + * miscfuncs.cc (sys_mbstowcs): Add debug_printf. + +2004-06-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Substitute FILE_SUPERSEDE with + FILE_OVERWRITE_IF. + +2004-06-09 Christopher Faylor <cgf@alum.bu.edu> + + * include/cygwin/version.h: REALLY bump dll minor version to 11. + +2004-06-08 Egor Duda <deo@corpit.ru> + + * include/cygwin/ipc.h: Make IPC_INFO visible only for ipc system + utilities, to make it consistent with declaration of struct seminfo. + +2004-06-08 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (fchdir): Pass the Posix path to chdir. + +2004-06-07 Christopher Faylor <cgf@alum.bu.edu> + + * dtable.cc (dtable::find_fifo): Release lock after fifo found (still + racy). + * fhandler.h (fhandler_fifo::get_io_handle): New fifo-specific method. + * fhandler_fifo.cc (fhandler_fifo::close): Close output_handle only if + it is open. + (fhandler_fifo::open_not_mine): Reorganize slightly. Don't call _pinfo + methods when the fifo is owned by me or suffer dtable lock_cs deadlock. + (fhandler_fifo::open): Call open_not_mine first, otherwise open myself + (racy). + * pinfo.cc (_pinfo::commune_recv): Duplicate fifo handles here in + requesting processes arena to avoid one potential race (of many). + (_pinfo::commune_send): Move all PICOM_FIFO code under one case + statement. + + * thread.cc (pthread::init_mainthread) Use existing hMainProc handle + rather than calling GetCurrentProcess. + +2004-06-04 Christopher Faylor <cgf@alum.bu.edu> + + * winbase.h (ilockincr): Add more neverending changes from the + inexplicable world of gcc asm constraint magic. Should stop random + crashes. + (ilockdecr): Ditto. + +2004-06-03 Christopher Faylor <cgf@alum.bu.edu> + + * autoload.cc (IsDosDeviceName_U): Define. + * ntdll.h (IsDosDeviceName_U): Declare. + * fhandler.cc (fhandler_base::open): Check to see if win32_name is a + dos device and just call the 9x open if so. + +2004-06-03 Christopher Faylor <cgf@alum.bu.edu> + + * winbase.h (ilockincr): More changes from the inexplicable world of + gcc asm magic. + (ilockdecr): Ditto. + +2004-06-03 Christopher Faylor <me@cgf.cx> + + * winbase.h (ilockincr): YA correction to ensure correct operation with + no optimization. + (ilockdecr): Ditto. + +2004-06-03 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.h (CYGWIN_SERVER_VERSION_API): Bump. + +2004-06-03 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/ipc.h (IPC_KEY_IS_SHMID): Redefine to a more sensible + value. + +2004-06-02 Christopher Faylor <cgf@alum.bu.edu> + + * cygheap.cc (cmalloc): Add debugging hook. + +2004-06-02 Christophe Jaillet <christophe.jaillet@wanadoo.fr> + + * spawn.cc (find_exec): Use has_slash to determine if path has a slash + rather than calculating this twice. + +2004-05-30 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (mount_info::add_item): Make sure native path has drive + or UNC form. Call normalize_xxx_path instead of [back]slashify. + Remove test for double slashes. Reorganize to always debug_print. + +2004-05-28 Pierre Humblet <Pierre.Humblet@ieee.org> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only try to open + the file if it uses an acl. + +2004-05-28 Pierre Humblet <Pierre.Humblet@ieee.org> + + * path.cc (chdir): Always use the normalized_path as posix_cwd, except + if it starts with a drive. + +2004-05-25 Christopher Faylor <cgf@alum.bu.edu> + + * winbase.h: Semi-revert previous patch as it caused strange behavior. + Use syntax similar to that recommended in mingw-dvlpr. + +2004-05-25 Christopher Faylor <cgf@alum.bu.edu> + + * include/cygwin/version.h: Bump DLL minor number to 11. + +2004-05-25 Christopher Faylor <cgf@alum.bu.edu> + + * winbase.h: Add proper attributions for memory operands throughout. + +2004-05-24 Christopher Faylor <cgf@alum.bu.edu> + + * include/cygwin/version.h: Bump api minor version number. + +2004-05-24 Christopher Faylor <cgf@alum.bu.edu> + + * cygwin.din: Export atoll. + +2004-05-20 Christopher Faylor <cgf@alum.bu.edu> + + * tty.cc (tty_list::allocate_tty): Leave tty_mutex armed on successful + return from !with_console + * fhandler_tty.cc (fhandler_pty_master::open): Release tty_mutex here + after all initialization is done. + +2004-05-17 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgrgid_r): Replace struct group by struct __group32 in + argument definition. + (getgrnam_r): Ditto. + +2004-05-17 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Add symbols flockfile, ftrylockfile, funlockfile, + getgrgid_r, getgrnam_r and getlogin_r. + * grp.cc (getgrgid_r): New function. + (getgrnam_r): Ditto. + * syscalls.cc (flockfile): Ditto. + (ftrylockfile): Ditto. + (funlockfile): Ditto. + * sysconf.cc (sysconf): Return LOGIN_NAME_MAX in case of + _SC_LOGIN_NAME_MAX. + * thread.cc (__cygwin_lock_trylock): Define int. Return value from + call to pthread_mutex_trylock. + * uinfo.cc (getlogin_r): New function. + * include/limits.h: Define LOGIN_NAME_MAX. + * include/cygwin/version.h: Bump API minor number. + * include/sys/lock.h: Add declarations for __cygwin_lock_xxx functions. + * include/sys/stdio.h: Add define for _ftrylockfile. + +2004-05-17 Christopher Faylor <cgf@alum.bu.edu> + + * tty.cc (tty_list::init): Move hmaster initialization earlier to + prevent compilation error. + +2004-05-17 Christopher Faylor <cgf@alum.bu.edu> + + Change the name "title_mutex" to "tty_mutex" throughout. + * tty.h (tty_list::allocate_tty): Turn argument into a boolean. + * tty.cc (tty_list::init): Protect entire allocation operation with + tty_mutex (formerly title_mutex) to protect against allocation races. + +2004-05-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Use original flags + value in each WSARecvFrom call. + (fhandler_socket::recvmsg): Ditto. Reformat slightly. + +2004-05-15 Christopher Faylor <cgf@alum.bu.edu> + + * cygthread.cc (cygthread::is): Eliminate. + * cygthread.h (cygthread::is): Eliminate declaratin. + * fhandler_console.cc (fhandler_console::read): Only wait for + signal_arrived in the main thread. + * fhandler_socket.cc: Include new "wininfo.h". + (fhandler_socket::ioctl): Use 'winmsg' rather than 'gethwnd()'. + * sync.cc (muto::grab): Define new function. + (muto::acquire): Use tls pointer rather than tid. + (muto::acquired): Ditto. + (muto::reset): Delete. + (muto::release): Ditto. Also implement "close on last release". + * sync.h (muto::tid): Delete. + (muto::tls): New field. + (muto::ismine): Delete. + (muto::owner): Delete. + (muto::unstable): Delete. + (muto::reset): Delete. + (muto::upforgrabs): New method. + (muto::grab): Ditto. + (new_muto_name): New define. + * wininfo.h: New file. + (wininfo): New class. + * window.cc: Rework throughout to use winfo class for controlling + invisible window operation. + (gethwnd): Delete definition. + * winsup.h (gethwnd): Delete declaration. + +2004-05-15 Christopher Faylor <cgf@alum.bu.edu> + + * cygheap.h: Remove some parameter names from declarations throughout. + (cygheap::set): Reflect changes in declaration for arguments and return + value from previous checkin. + +2004-05-15 Pierre Humblet <pierre.humblet@ieee.org> + + * cygheap.h (cwdstuff::set): Modify return value and arguments. + * path.cc (chdir): Specify PC_POSIX. Do not call SetCurrentDirectory. + Set posix_cwd in a way that does not break find.exe. Change call to + cwd.set. + (cwdstuff::get_initial): Do not call GetCurrentDirectory here. + (cwdstuff::set): Call SetCurrentDirectory and GetCurrentDirectory as + needed. + +2004-05-12 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Don't bail out with error if path is "//". + +2004-05-12 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct init_cygheap): Add mt_h member. + * fhandler_tape.cc (mt_h): Drop in favor of cygheap based handle. + (mtinfo_init): Use cygheap->mt_h handle. Protect it. + +2004-05-12 Pierre Humblet <pierre.humblet@ieee.org> + + * tty.h: Remove the %d or %x from all cygtty strings. + (tty::open_output_mutex): Only declare. + (tty::open_input_mutex): Ditto. + (tty::open_mutex): New definition. + * fhandler_tty.cc (fhandler_tty_slave::open): Declare buf with + size CYG_MAX_PATH and replace __small_printf calls by shared_name. + * tty.cc (tty::create_inuse): Ditto. + (tty::get_event): Ditto. + (tty::common_init): Ditto. + (tty::open_output_mutex): New method definition. + (tty::open_input_mutex): Ditto. + (tty::open_mutex): New method. + +2004-05-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Set file attributes to correct + value when creating files. + * path.h (class path_conv): Add write accessor for file_attributes. + +2004-05-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add "owner" status flag. + * fhandler_socket.cc (wait): Take flag parameter to take FD_OOB into + account. Don't wait infinitely. + (fhandler_socket::recvfrom): Also wait for FD_OOB if socket owner. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + (fhandler_socket::fcntl): Set owner status flag if F_SETOWN with own + pid is called. + +2004-05-09 Pierre Humblet <pierre.humblet@ieee.org> + + * environ.cc (build_env): Only try to construct required-but-missing + variables while issetuid. + +2004-05-08 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@timesys.com> + + * syscalls.cc: Include environ.h. + (chroot): Set errno in case of path error. Call getwinenv. + * environ.cc: Remove the NO_COPY attribute of conv_envvars. + +2004-05-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mem.cc (fhandler_dev_mem::fhandler_dev_mem): Move + initialization of "mem_size" from here... + (fhandler_dev_mem::open): ...to here. Fix typo in FH_PORT case. + +2004-05-07 Gerd Spalink <Gerd.Spalink@t-online.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Move delete of + bigwavebuffer_ so that it is always cleaned, also in child processes. + (fhandler_dev_dsp::Audio_in::stop): Ditto. + (fhandler_dev_dsp::close): Stop audio play immediately in case of + abnormal exit. + +2004-05-07 Corinna Vinschen <corinna@vinschen.de> + + Revert code reversion from 2004-04-03. So, revert to async I/O again. + * fhandler.h (status): Add "closed" flag. + (prepare): New method declaration. + (wait): Ditto. + (release): Ditto. + * fhandler_socket.cc: Don't include wsock_event.h. + (fhandler_socket::prepare): New method, moved from wsock_event. + (fhandler_socket::wait): Ditto. + (fhandler_socket::release): New method. + (fhandler_socket::recvfrom): Simplify loop. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + * net.cc: Don't include wsock_event.h. + (wsock_event::prepare): Remove. + (wsock_event::wait): Ditto. + * wsock_event.h: Remove. + +2004-05-06 Christopher Faylor <cgf@alum.bu.edu> + + * thread.cc (pthread::create): Move postcreate call to avoid a + potential race. + (pthread::cancelable_wait): Don't allow signal interrupt unless main + thread. + +2004-05-07 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@timesys.com> + + * path.cc (mount_info::conv_to_posix_path): Return proper status when + chrooted. + +2004-05-06 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (path_conv::check): Strip trailing dots and spaces and + return error if the final component had only dots and spaces. + (normalize_posix_path): Revert 2004-04-30. + (chdir): Do not check for trailing spaces. Do not set native_dir + to c:\ for virtual devices. Pass only native_dir to cwd.set. + (cwdstuff::set): Assume posix_cwd is already normalized. + +2004-05-04 Christopher Faylor <cgf@alum.bu.edu> + + * path.cc (normalize_win32_path): Detect components with only dots. + Remove a final . if it follows '\\'. + (mount_info::conv_to_win32_path): Only backslashify the path when no + mount is found. + (chdir): Do not look for components with only dots. + +2004-05-04 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@alum.bu.edu> + + * path.cc (is_unc_share): Remove redundant tests. + +2004-05-04 Corinna Vinschen <corinna@vinschen.de> + + * crt0.o (mainCRTStartup): 16 byte align stack for main function. + +2004-05-04 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (check_sysfile): Don't scan string twice. + +2004-05-03 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (writable_directory): Remove. + (mkdir): Remove call to writable_directory. + * syscalls.cc (unlink): Ditto. + (rename): Ditto. + * winsup.h (writable_directory): Remove declaration. + +2004-04-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Call path_conv::get_nt_native_path + for evaluating NT path. + * path.cc (normalize_posix_path): Remove trailing dots and spaces. + (path_conv::get_nt_native_path): New function. + * path.h (class path_conv): Declare get_nt_native_path method. + +2004-04-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Fix NT native path evaluation + to allow opening serial ports. + +2004-04-30 DJ Delorie <dj@redhat.com> + + * init.cc (threadfunc_fe): Hack to make thread stacks always 16 + byte aligned. + +2004-04-21 Yitzchak Scott-Thoennes <sthoenna@efn.org> + + * syscalls.cc (lseek64): Fix debug_printf format string. + (truncate64): Ditto. + +2004-04-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::lseek): Force res to -1 on error. + +2004-04-20 Christopher Faylor <cgf@alum.bu.edu> + + * path.cc (is_unc_share): Rename from slash_unc_prefix_p throughout. + +2004-04-20 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (normalize_posix_path): Process all Posix paths and map three + or more initial slashes to a single one. Simplify processing following + two initial slashes. + (normalize_win32_path): Make last argument non-optional and do not + check for NULL value. + +2004-04-20 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_disk_file.cc (fhandler_base::open_fs): Change + set_file_attribute call to indicate that NT security isn't used. + (fhandler_disk_file::fchmod): Rearrange to isolate 9x related + statements. + Do not set FILE_ATTRIBUTE_SYSTEM. + (fhandler_disk_file::fchown): Check noop case first. + * fhandler.cc (fhandler_base::open9x): Remove ntsec related statements. + (fhandler_base::set_name): Do not set namehash. + * fhandler.h (fhandler_base::get_namehash): Compute and set namehash if + needed. + * syscalls.cc (access): Verify that fh is not NULL. Do not set PC_FULL. + (chmod): Ditto. + (chown_worker): Ditto. + (stat_worker): Ditto. Verify if the path exists. + +2004-04-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Remove special DEV_FLOPPY_MAJOR + treatment. + * fhandler_raw.cc (fhandler_dev_raw::open): Simplify write-only case. + * fhandler_tape.cc (fhandler_dev_tape::raw_write): Add accidentally + dropped condition. + +2004-04-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES when + only GENERIC_WRITE access is requested. + +2004-04-19 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/mtio.h (GMT_ASYNC): New define. + (MT_ST_ASYNC_WRITES): Remove "Not supported" comment. + +2004-04-19 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Handle ERROR_IO_PENDING. + * fhandler.cc (fhandler_base::open): Make tape I/O asynchronous. + * fhandler.h (class fhandler_dev_tape): Add mt_evt member. + * fhandler_tape.cc (mtinfo_drive::initialize): Initialize async_writes. + (mtinfo_drive::close): Handle async writes. + (mtinfo_drive::read): Add mt_evt parameter. Use overlapped I/O. + (mtinfo_drive::async_wait): New function. + (mtinfo_drive::write): Add mt_evt parameter. Use overlapped I/O. + Handle async writes. + (mtinfo_drive::_set_pos): Handle async writes. + (mtinfo_drive::set_partition): Ditto. + (mtinfo_drive::prepare): Ditto. + (mtinfo_drive::get_status): Drop useless "else". Handle async_writes + flag. + (mtinfo_drive::set_options): Handle async_writes flags. + (fhandler_dev_tape::close): Close mt_evt handle. + (fhandler_dev_tape::raw_read): Create mt_evt handle and use in call + to mtinfo_drive::read. + (fhandler_dev_tape::raw_write): Create mt_evt handle and use in call + to mtinfo_drive::write. + * mtinfo.h (MTINFO_VERSION): Bump. + (enum dirty_state): Add async_write_pending state. + (class mtinfo_drive): Add OVERLAPPED struct "ov". Add async_writes + flag. + (mtinfo_drive::async_wait): Add declaration. + (mtinfo_drive::read): Add mt_evt parameter. + (mtinfo_drive::write): Ditto. + + * registry.cc (load_registry_hive): Call enable_restore_privilege + instead of set_process_privilege. + +2004-04-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo_drive::_set_pos): Take additional dont_wait + parameter. Use in call to SetTapePosition. + (mtinfo_drive::set_pos): Accommodate _set_pos calls to above change. + (mtinfo_drive::set_partition): Ditto. + * mtinfo.h (mtinfo_drive::_set_pos): Change declaration accordingly. + +2004-04-16 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtCreateFile): Add. + * dir.cc (mkdir): Change set_file_attribute call to indicate that + NT security isn't used. + * fhandler.cc (fhandler_base::open_9x): New method, created from + fhandler_base::open. + (fhandler_base::open): Rearrange to use NtCreateFile instead of + CreateFile. + * fhandler.h (enum query_state): Redefine query_null_access to + query_stat_control. query_null_access isn't allowed in NtCreateFile. + (fhandler_base::open_9x): Declare. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use + query_stat_control first, query_read_control if that fails. + (fhandler_disk_file::fchmod): Call enable_restore_privilege before + trying to open for query_write_control. Don't fall back to + opening for query_read_control. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::facl): Only request restore privilege and query + access necessary for given cmd. + * fhandler_raw.cc (fhandler_dev_raw::open): Call fhandler_base::open + instead of opening device here. + * ntdll.h (NtCreateFile): Declare. + * path.cc (symlink_worker): Change set_file_attribute call to indicate + that NT security isn't used. + * sec_acl.cc (getacl): Fix bracketing. + * sec_helper.cc (enable_restore_privilege): New function. + * security.cc (str2buf2uni_cat): New function. + (write_sd): Don't request restore permission here. + * security.h (set_process_privileges): Drop stale declaration. + (str2buf2uni): Declare. + (str2buf2uni_cat): Declare. + (enable_restore_privilege): Declare. + * syscalls.cc (fchown32): Return immediate success on 9x. + +2004-04-15 Christopher Faylor <cgf@alum.bu.edu> + + * autoload.cc (dll_chain1): Rename to dll_chain. Remove old dll_chain + code. + (wsock_init): Avoid unneeded winsock_active tests. + * winsup.h (winsock_active): Delete. + +2004-04-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Try opening + in query_read mode if query_write fails. + * fhandler_disk_file.cc (fhandler_disk_file::fchown): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::facl): Ditto. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: Fix copyright date. + * sec_acl.cc (acl_worker): Delete allocated fhandler. + * syscalls.cc (chown_worker): Ditto. + (chmod): Ditto. + (stat_worker): Use get_namehash instead of hash_path_name. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (getacl): Avoid compiler warning. + * security.cc (write_sd): Ditto. Fix error handling. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (fstat64): Use get_namehash instead of hash_path_name. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Simplify access evaluation + expression. + (fhandler_base::facl): New method. + * fhandler.h: Declare facl method in fhandler_base, + fhandler_disk_file and fhandler_virtual. + * fhandler_disk_file.cc (fhandler_disk_file::facl): New method. + * fhandler_virtual.cc (fhandler_virtual::facl): New method. + * sec_acl.cc: Remove forward declaration for aclsort32 and acl32. + (setacl): Remove static. Add and use handle parameter. + (getacl): Ditto. + (acl_worker): Reorganize to call fhandler's facl method eventually. + (facl32): Ditto. + * security.cc (get_nt_object_security): Remove static. + * security.h: Add extern declarations for get_nt_object_security, + aclsort32, acl32, getacl and setacl. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Accommodate query_write_control + query_state. + (fhandler_base::fchown): New method. + * fhandler.h: Declare fchown method in fhandler_base, + fhandler_disk_file and fhandler_virtual. + (enum query_state): Add query_write_control. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Set query_state + to query_write_control. Only remove FILE_ATTRIBUTE_READONLY if not + setting security descriptor. + (fhandler_disk_file::fchown): New method. + * fhandler_virtual.cc (fhandler_virtual::fchown): New method. + * sec_acl.cc (setacl): Call write_sd with additional handle attribute. + * security.cc (write_sd): Take handle argument. Only request owner + if getting SE_RESTORE_NAME privilege failed. Only open file if + NtSetSecurityObject failed or handle is NULL. + (set_nt_attribute): Call write_sd with additional handle attribute. + * security.h (write_sd): Declare with additional handle argument. + * syscalls.cc (chown_worker): Reorganize to call fhandler's fchown + method eventually. + (fchown): Ditto. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtSetSecurityObject): Add. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only request + READ_CONTROL rights when opening the file. + * ntdll.h (NtSetSecurityObject): Add declaration. + * security.cc (write_sd): Call NtSetSecurityObject instead of + BackupWrite. + (get_nt_object_security): Don't free security descriptor here. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (ttyname): Use buffer of length TTY_NAME_MAX + 1. + * sysconf.cc (sysconf): Handle _SC_TTY_NAME_MAX request. + * include/limits.h: Define TTY_NAME_MAX and _POSIX_TTY_NAME_MAX. + +2004-04-14 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export rand_r and ttyname_r. + * syscalls.cc (ttyname_r): New function. + (ttyname): Move functionality to ttyname_r. Call it from here. + * include/cygwin/version.h: Bump API minor number. + +2004-04-14 Pierre Humblet <pierre.humblet@ieee.org> + + * path.h (path_conv::set_symlink): Add argument. + (path_conv::get_symlink_length): New method. + (path_conv::symlink_length): New member. + * path.cc (path_conv::check): Pass symlen to set_symlink. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): For symlinks + set st_size from get_symlink_length. + +2004-04-13 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_nt_attribute): Only call get_nt_object_security + if handle is NULL. + +2004-04-13 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (mkdir): Call set_file_attribute with additional handle + argument. + * fhandler.cc (fhandler_base::fchmod): New method. + * fhandler.h: Declare fchmod method in fhandler_base, + fhandler_disk_file and fhandler_virtual. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): New method. + (fhandler_base::open_fs): Call set_file_attribute with additional + handle argument. + * fhandler_virtual.cc (fhandler_virtual::fchmod): New method. + * path.cc (symlink_worker): Call set_file_attribute with additional + handle argument. + * security.cc (get_nt_object_security): New function. + (get_nt_object_attribute): Call get_nt_object_security. + (set_nt_attribute): Add handle argument. Call get_nt_object_security + first, read_sd only if that fails. + (set_file_attribute): Add handle argument. + * security.h (set_file_attribute): Declare with additional handle + argument. + * syscalls.cc (stat_suffixes): Move to beginning of file. + (chown_worker): Call set_file_attribute with additional handle argument. + (chmod): Reorganize to call fhandler's fchmod method eventually. + (fchmod): Ditto. + +2004-04-13 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtQuerySecurityObject): Add. + * ntdll.h (STATUS_BUFFER_TOO_SMALL): Add definition. + (NtQuerySecurityObject): Add declaration. + * security.cc (get_nt_object_attribute): Always use + NtQuerySecurityObject to retrieve security descriptor. + +2004-04-13 Gerd Spalink <Gerd.Spalink@t-online.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Add optional + boolean argument so that playing can be stopped without playing + pending buffers. + (fhandler_dev_dsp::ioctl): Stop playback immediately for + SNDCTL_DSP_RESET. Do not reset audio parameters in this case. + Add support for ioctl SNDCTL_DSP_GETISPACE. + (fhandler_dev_dsp::Audio_out::emptyblocks): Now returns the number of + completely empty blocks. + (fhandler_dev_dsp::Audio_out::buf_info): p->fragments is now the number + of completely empty blocks. This conforms with the OSS specification. + (fhandler_dev_dsp::Audio_out::parsewav): Ignore wave headers that are + not aligned on four byte boundary. + (fhandler_dev_dsp::Audio_in::buf_info): New, needed for + SNDCTL_DSP_GETISPACE. + +2004-04-13 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (IMPLEMENT_STATUS_FLAG): New macro to define status flag + accessor methods unambiguously. + * fhandler.h: Use IMPLEMENT_STATUS_FLAG throughout where possible. + * fhandler_termios.cc (fhandler_termios::tcinit): Call corrected + accessor for initialized status flag. + * mtinfo.h (class mtinfo_drive): Use IMPLEMENT_STATUS_FLAG throughout. + * path.cc (fs_info::update): Remove duplicate call to flags(). + * path.h (struct fs_info): Use IMPLEMENT_STATUS_FLAG where possible. + (path_conv::is_auto_device): Fix spacing. + * tty.h (class tty_min): Use IMPLEMENT_STATUS_FLAG throughout. + +2004-04-12 Christopher Faylor <cgf@alum.bu.edu> + + * thread.cc (pthread::thread_init_wrapper): Wait later to get more + parallel behavior. + +2004-04-12 Christopher Faylor <cgf@alum.bu.edu> + + * thread.cc (pthread::create): Use thread mutex to control + synchronization rather than creating a suspended thread. Wait for + "cancellation event" to indicate that started thread has been properly + initialized. + (pthread::thread_init_wrapper): Use set_tls_self_pointer() to set tid + and cygtls. Signal with cancel_event when done. + +2004-04-12 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (path_conv::check): Fix "tail filling" logic. + +2004-04-11 Christopher Faylor <cgf@alum.bu.edu> + + * cygheap.h: Replace inexplicably removed closing brace. + +2004-04-11 Christopher Faylor <cgf@alum.bu.edu> + + * cygheap.h (CYGHEAP_SLOP): Reduce drastically to avoid collisions. + +2004-04-11 Pierre Humblet <pierre.humblet@ieee.org> + + * dtable.cc (dtable::extend): Change order of memcpy and cfree. + +2004-04-10 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (sync): Define void according to SUSv3. + +2004-04-10 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Use correct offset when trying to combine + standard and default entry of same type. + +2004-04-10 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.cc (rootdir): Add and use second argument. + * winsup.h (rootdir): Add second argument in declaration. + * path.cc (fs_info::update): Modify call to rootdir. + * syscalls.cc (check_posix_perm): Ditto. + (statfs): Ditto. Move syscall_printf near top. + +2004-04-10 Corinna Vinschen <corinna@vinschen.de> + + * Use new unified status_flag accessor methods from classes fhandler_*, + tty_min, mtinfo and fs_info thoroughout. + * fhandler.h: Redefine all set_close_on_exec methods to take a bool + argument. + (enum conn_state): Rename from connect_state. + (class fhandler_base): Rename some status flags to align with + accessor method names. Drop encoded flag entirely. Unify status + accessor methods. Const'ify all read accessor methods. + (class fhandler_socket): Ditto. + (class fhandler_dev_raw): Ditto. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use fs.fs_is_fat() + instead of evaluating FATness of file system here. + (fhandler_disk_file::opendir): Drop call to set_encoded(). + (fhandler_disk_file::readdir): Use pc.isencoded() directly. + * mtinfo.h (class mtinfo_drive): Const'ify all read accessor methods. + * path.cc (fsinfo_cnt): Add. + (fs_info::update): Accommodate class changes. Evaluate file system + name specific flags right here. Add thread safety for reading and + writing global fsinfo array. + * path.h (enum path_types): Drop values for flags kept in fs already. + (struct fs_info): Move status informatin into private struct type + status_flags. Add accessor methods. Remove path and file system + name string arrays in favor of status bits. + (class path_conv): Use new fs_info status information where + appropriate. + (path_conf::fs_has_ea): Rename from fs_fast_ea. + (path_conf::fs_has_acls): New method. + (path_conf::root_dir): Remove. + (path_conf::volname): Remove. + * syscalls (statfs): Evaluate root dir locally. + * tty.h (class tty_min): Unify status accessor methods. Const'ify + all read accessor methods. + +2004-04-09 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread::init_mainthread): Remove parameter forked. + (pthread::set_tls_self_pointer): New static function. + * thread.cc (MTinterface::fixup_after_fork): Change call to + pthread::init_mainthread. + (pthread::init_mainthread): Remove parameter forked. Simplify thread + self pointer handling. + (pthread::self): Set thread self pointer to null_pthread if thread has + not been initialized. + (pthread::set_tls_self_pointer): New static function. + +2004-04-05 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (path_conv::check): Optimize symlink replacements. + +2004-04-09 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (normalize_posix_path): Add "tail" argument and set it. + Always have a final slash for directories. Pass 3rd argument to + normalize_win32_path. + (path_conv::check): Pass tail to normalize_posix_path. Set + need_directory and remove final slash after that call. Remove last + argument to mount_table->conv_to_win32_path(). Remove noop dostail + check. Remove fs.update() from inner loop. Improve tail finding + search. + (normalize_win32_path): Add and set tail argument. + (mount_item::build_win32): Avoid calling strcpy. + (mount_info::conv_to_win32_path): Remove third argument and simplify + because the source is normalized. Keep /proc path in Posix form. Call + win32_device_name() only once. + (mount_info::conv_to_posix_path): Add and use 3rd argument to + normalize_win32_path to avoid calling strlen. + (cwdstuff::set): Add 3rd argument to normalize_posix_path and remove + final slash if any. + * shared_info.h (mount_info::conv_to_win32_path): Remove last argument + in declaration. + +2004-04-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_raw): Move status bits into protected + bitfield struct type status_flags. Drop unused has_written bit. + Add accessor methods. + (fhandler_dev_raw::clear): Remove. + (fhandler_dev_raw::reset_devbuf): Remove. + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Use accessor method + for is_writing. + * fhandler_raw.cc: Use status accessor methods throughout. + (fhandler_dev_raw::clear): Remove. + (fhandler_dev_raw::fhandler_dev_raw): Drop clear call. + (fhandler_dev_raw::~fhandler_dev_raw): Ditto. + * fhandler_tape.cc: Use mtinfo::status accessor methods throughout. + (mtinfo_drive::close): Fix conditional to enable BSD semantics + correctly. + (mtinfo_drive::get_status): Rename from mtinfo_drive::status. + * mtinfo.h (class mtinfo_drive): Move status bits into private bitfield + struct type status_flags. Add accessor methods. + Rename status method to get_status. + +2004-04-09 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fsinfo): Global storage for file system information. + (fs_info::update): Store file system information also in fsinfo and + short circuit GetVolumeInformation by using alredy stored file system + information. + +2004-04-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::status): Declare private. + (fhandler_base::open_status): Ditto. + (class fhandler_socket): Move status bits into private bitfield struct + type status_flags. Change accessor methods appropriately. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accommodate + above status bit changes. + * tty.h: Remove status bit enumerator. + (TTYISSETF): Remove. + (TTYSETF): Remove. + (TTYCLEARF): Remove. + (TTYCONDSETF): Remove. + (tty_min::status): Define as private bitfield struct type status_flags. + Add appropriate accessor methods. + * fhandler_console.cc: Use tty_min::status accessor methods throughout. + * fhandler_termios.cc: Ditto. + * winsup.h (__ISSETF): Remove. + (__SETF): Remove. + (__CLEARF): Remove. + (__CONDSETF): Remove. + +2004-04-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::write): Use bool parameter in calls to + set_did_lseek. + (fhandler_base::fhandler_base): Accommodate new status and open_status + constructor. + * fhandler.h: Remove status bit enumerator. + (FHDEVN): Remove. + (FHISSETF): Remove. + (FHSETF): Remove. + (FHCLEARF): Remove. + (FHCONDSETF): Remove. + (FHSTATOFF): Remove. + (UNCONNECTED, CONNECT_PENDING, CONNECTED): Substitute by enum + connect_state. + (fhandler_base::status): Define as bitfield struct type status_flags. + Remove unused flags entirely. Accommodate all status access methods. + (open_status): Define as bitfield struct type status_flags. + (fhandler_socket): Move socket related status bits to here. Redefine + had_connect_or_listen to be part of these status bits. Accommodate + related access methods. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Use pc.issymlink + instead of dropped method get_symlink_p. + (fhandler_base::open_fs): Remove setting dropped status flags. + * fhandler_socket.cc: Use values from enum connect_state throughout. + (fhandler_socket::fhandler_socket): Initialize status bits. + * fhandler_virtual.cc (fhandler_virtual::open): Remove setting dropped + status flags. + * net.cc: Use values from enum connect_state throughout. + * select.cc: Ditto. + * shared_info.h: Protect struct console_state using _FHANDLER_H_ + instead of FHDEVN. + +2004-04-09 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_file_attribute): Fix conditional. + +2004-04-08 Christopher Faylor <cgf@bosbc.com> + + * child_info.h: Update CHILD_INFO_MAGIC after 2004-04-03 change. + +2004-04-08 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (hash_path_name): Replace hash algorithm with SDBM. + +2004-04-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Set query access mode according + to query_open setting. + (fhandler_base::fhandler_base): Initialize query_open. + * fhandler.h (FH_QUERYOPEN): Drop. + (enum query_state): Add. + (class fhandler_base): Add query_open member. + (fhandler_base::get_query_open): Redefine to use query_open. + (fhandler_base::set_query_open): Ditto. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Remove O_DIROPEN + from open_flags since it's added in open_fs anyway. Remove + query_open_already. Use new query_open settings. Rearrange slightly. + (fhandler_base::fstat_helper): Add get_io_handle as parameter to + get_file_attribute. + * security.cc (get_nt_object_attribute): Make returning an int. + Return -1 on error, 0 otherwise. + (get_file_attribute): Take an object handle as argument. Move down + to allow calling get_nt_object_attribute in case a non-NULL handle + is given. + * security.h (get_file_attribute): Add handle to argument list. + * syscalls.cc (chown_worker): Accommodate new definition of + get_file_attribute. + +2004-04-07 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (path_prefix_p): Optimize test order. + +2004-04-06 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (EXTRALIBS): Add libtextreadmode.a. + (INSTOBJS): Add textreadmode.o. + * textreadmode.c: New file. + +2004-04-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Request + compressed size only if the matching attributes are set. Use + NtQueryInformationFile instead of GetCompressedFileSize. + (fhandler_base::fstat_by_handle): Remove NT 3.5 cruft since + local.dwVolumeSerialNumber isn't used subsequently. + * ntdll.h: Add typedefs for FILE_COMPRESSION_INFORMATION and + FILE_INFORMATION_CLASS. + +2004-04-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::open): Actually use "options". + +2004-04-04 Gerd Spalink <Gerd.Spalink@t-online.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Add implementation + for ioctl codes SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS. + +2004-04-03 Christopher Faylor <cgf@bosbc.com> + + * child_info.h (child_info::cygheap_reserve_sz): Rename from + cygheap_alloc_sz. + * cygheap.cc: Rename alloc_sz to reserve_sz throughout. + +2004-04-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Remove has_been_closed member. + * fhandler_socket.cc (fhandler_socket::recvfrom): Revert to + overlapped I/O. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + * net.cc (wsock_event::prepare): Ditto. + (wsock_event::wait): Ditto. Evaluate overlapped result also after + calling CancelIo (thanks to Patrick Samson <p_samson@yahoo.com>). + (wsock_event::release): Remove. + * wsock_event.h: Revert to overlapped I/O. + +2004-04-02 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (wsock_event::release): Use NULL handle in call to + WSAEventSelect to resolve KB 168349. + +2004-04-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Rearrange loop + so that WSARecvFrom is always called before waiting. + (fhandler_socket::recvmsg): Ditto. + +2004-04-01 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (wsock_event::wait): Make wsa_err an int. Don't set + ret to 0 if any error has happened. + +2004-04-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::sendto): Drop out of loop if + has_been_closed gets set. + (fhandler_socket::sendmsg): Ditto. + * net.cc (wsock_event::wait): Don't initialize evts. Don't try to + evaluate network events if WSAEnumNetworkEvents fails. + (wsock_event::release): Save last WSA error and set it again unless + resetting to blocking socket fails. + * wsock_event.h (class wsock_event): Remove destructor. + +2004-03-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo::initialize): Fix fatal error message. + +2004-03-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Always initialize + ret to 0 when using in Winsock call. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + +2004-03-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo_drive::get_pos): Only set partition if + GetTapePosition returned a non-zero partition number. + (mtinfo_drive::create_partitions): Reinitialize to partition 0. + Support TAPE_DRIVE_INITIATOR and TAPE_DRIVE_FIXED partitioning. + (mtinfo_drive::set_partition): Initialize new partition. + (mtinfo_drive::status): Readd accidentally dropped setting of mt_resid. + + * net.cc (wsock_event::prepare): Always print debug output in case + of error. + +2004-03-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::sendmsg): Add SIGPIPE handling. + +2004-03-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Initialize res to + SOCKET_ERROR. Use SOCKET_ERROR instead of -1 throughout. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + * net.cc (wsock_event::prepare): Call WSASetLastError instead of + SetLastError. + (wsock_event::wait): Use SOCKET_ERROR instead of -1. + +2004-03-30 Thomas Pfaff <tpfaff@gmx.net> + + * thread.h (pthread::init_mainthread): Add parameter forked. Set + forked default to false.. + * thread.cc (MTinterface::fixup_after_fork): Call + pthread::init_mainthread with forked = true. + (pthread::init_mainthread): Add parameter forked. Do not change thread + self pointer when forked. + +2004-03-30 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (shmat): If shmid is unknown, call a special variation + of shmget to retrieve the shared memory segment from Cygserver + instead of failing immediately. + * include/cygwin/ipc.h (IPC_KEY_IS_SHMID): New internal flag for + shmget when called from shmat. + +2004-03-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add has_been_closed member. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize + has_been_closed to 0. + (fhandler_socket::recvfrom): Use new asynchronous I/O driven + wsock_event methods. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + * net.cc (wsock_event::prepare): Reimplement using asynchronous I/O. + (wsock_event::wait): Ditto. + (wsock_event::release): New method. + * wsock_event.h (class wsock_event): Remove ovr member. Accommodate + new implementation of prepare and wait methods. Add release method. + +2004-03-29 Thomas Pfaff <tpfaff@gmx.net> + + * thread.cc (pthread::atforkprepare): Call + MT_INTERFACE->fixup_before_fork at the end of atforkprepare. + +2004-03-29 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (wsock_event::wait): Change scope of local "len" variable. + +2004-03-28 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (shmat): Return (void *) -1 on error instead of NULL. + +2004-03-27 Christopher Faylor <cgf@redhat.com> + + * fhandler_nodevice.cc (fhandler_nodevice::open): Assume that errno has + already been set if pc.error is nonzero. + +2004-03-26 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (cygheap_fixup_in_child): Improve strace output. + +2004-03-26 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_SHARING_VIOLATION to EBUSY, + ERROR_EOM_OVERFLOW and ERROR_NO_DATA_DETECTED to EIO. Add mappings + for ERROR_NO_MEDIA_IN_DRIVE, ERROR_DEVICE_REQUIRES_CLEANING and + ERROR_DEVICE_DOOR_OPEN. + * fhandler.h (class fhandler_dev_raw): Drop varblkop member. + (fhandler_dev_raw::is_eom): De-virtualize. + (fhandler_dev_raw::is_eof): Ditto. + (class fhandler_dev_tape): Drop lasterr and dp member. Add mt_mtx + member. Drop all private methods formerly used by ioctl. + (fhandler_dev_tape::is_rewind_device): Use get_minor for clarity. + (fhandler_dev_tape::driveno): New method. + (fhandler_dev_tape::drive_init): New method. + (fhandler_dev_tape::clear): Remove method. + (fhandler_dev_tape::is_eom): Ditto. + (fhandler_dev_tape::is_eof): Ditto. + (fhandler_dev_tape::write_file): Ditto. + (fhandler_dev_tape::read_file): Ditto. + (fhandler_dev_tape::_lock): New method. + (fhandler_dev_tape::unlock): New method. + (fhandler_dev_tape::raw_read): New method. + (fhandler_dev_tape::raw_write): New method. + * fhandler_raw.cc (fhandler_dev_raw::is_eom): New method. + (fhandler_dev_raw::is_eof): New method. + (fhandler_dev_raw::open): Allow setting write through option by + using the O_TEXT flag as ... flag. + (fhandler_dev_raw::writebuf): Remove usage of varblkop and other + tape specific code. + (fhandler_dev_raw::raw_read): Ditto. + (fhandler_dev_raw::dup): Ditto. + * fhandler_tape.cc: Rewrite tape operations entirely. Implement + new tape driver classes mtinfo, mtinfo_drive and mtinfo_part. + Reduce fhandler_dev_tape methods to mostly just calling appropriate + mtinfo_drive methods. + (mtinfo_init): New function adding the mtinfo shared memory area. + * mtinfo.h: New file, containing the definition of the new tape + driver classes. + * shared.cc: Include mtinfo.h. + (offsets): Add entry for mtinfo shared memory area. + (memory_init): Call mtinfo_init. + * shared_info.h (shared_locations): Add SH_MTINFO shared location. + * include/cygwin/mtio.h: Change and add various comments. Add GMT_xxx + macros for new generic flags. Add MT_ST_xxx bitfield definitions + for MTSETDRVBUFFER ioctl. + * include/cygwin/version.h: Bump API minor version number. + +2004-03-26 Christopher Faylor <cgf@redhat.com> + + * path.cc (path_conv::check): Use 'strchr' rather than 'strrchr' to + find end of string, for efficiency. + +2004-03-26 Thomas Pfaff <tpfaff@gmx.net> + + * include/cygwin/_types.h: New file. + * include/sys/lock.h: Ditto. + * include/sys/stdio.h: Ditto. + * thread.cc: Include sys/lock.h + (__cygwin_lock_init): New function. + (__cygwin_lock_init_recursive): Ditto. + (__cygwin_lock_fini): Ditto. + (__cygwin_lock_lock): Ditto. + (__cygwin_lock_trylock): Ditto. + (__cygwin_lock_unlock): Ditto. + (pthread::atforkprepare): Lock file pointer before fork. + (pthread::atforkparent): Unlock file pointer after fork. + (pthread::atforkchild): Ditto. + +2004-03-26 Corinna Vinschen <corinna@vinschen.de> + + * sem.cc (semget): Fix debug string. + (semop): Ditto. + * shm.cc (fixup_shms_after_fork): Ditto. + (shmat): Ditto. + (shmdt): Ditto. + (shmget): Ditto. + +2004-03-26 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig): Make sure that SIGCHLD is handled regardless + of whether a signal is queued. + +2004-03-26 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (wait_sig): Report if not trying to send signal due to + queued signal. + +2004-03-25 Christopher Faylor <cgf@redhat.com> + + * path.cc (normalize_posix_path): Reorganize to short circuit to DOS + path handling whenever a '\' is detected. + + * signal.cc (sigaction): Make strace output more informative. + * sigproc.cc (pending_signals::add): Just index directly into signal + array rather than treating the array as a heap. + (pending_signals::del): Ditto. + (wait_sig): Don't send signal if we already have a similar signal + queued. + * sigproc.h (call_signal_handler_now): Remove obsolete declaration. + +2004-03-23 Gerd Spalink <Gerd.Spalink@t-online.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::write): Remove type + cast from argument to audio_out_->parsewav() to make reference + work properly. Now .wav file headers are properly discarded. + +2004-03-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use created + handle regardless of nohandle state. Clean up afterwards. + +2004-03-23 Gerd Spalink <Gerd.Spalink@t-online.de> + + * autoload.cc: Load eight more functions for waveIn support. + * fhandler.h (class fhandler_dev_dsp): Add class Audio, class Audio_in + and class Audio_out members and audio_in_, audio_out_ pointers so + that future changes are restricted to file fhandler_dsp.cc. + * fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add this class to treat + things common to audio recording and playback. + Add more format conversions. + (fhandler_dev_dsp::Audio::queue): New queues for buffer management + to fix incomplete cleanup of buffers passed to the wave device. + (fhandler_dev_dsp::Audio_in): New, added class to implement audio + recording. + (fhandler_dev_dsp::Audio_out): Rework to use functionality provided + by fhandler_dev_dsp::Audio. Allocate memory audio buffers late, + just before write. + (fhandler_dev_dsp::Audio_out::start): Size of wave buffer allocated + here depends on audio rate/bits/channels. + (fhandler_dev_dsp::Audio_in::start): Ditto. + (fhandler_dev_dsp::setupwav): Replaced by following function. + (fhandler_dev_dsp::Audio_out::parsewav): Does not setup wave device + any more. Discard wave header properly. + (fhandler_dev_dsp::open): Add O_RDONLY and_RDWR as legal modes. + Protect against re-open. Activate fork_fixup. + (fhandler_dev_dsp::ioctl): Protect against actions when audio is + active. SNDCTL_DSP_GETFMTS only returns formats supported by + mmsystem wave API, not all supported formats. SNDCTL_DSP_GETBLKSIZE + result now depends on current audio format. + (fhandler_dev_dsp::fixup_after_fork): Call fork_fixup for the Audio + classes to let them duplicate the CRITICAL_SECTION. + +2004-03-19 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@redhat.com> + + * init.cc (munge_threadfunc): Handle all instances of search_for. + (prime_threads): Test threadfunc_ix[0]. + +2004-03-21 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cheap): Set initial_sz to something or suffer + spurious output. + (cygheap_fixup_in_child): Set alloc_sz to passed in size to ensure that + children will have the right size heap. + (_csbrk): Make output conditional on DEBUGGING. + +2004-03-21 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cheap): Conditionalize debugging code. + +2004-03-21 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cheap): Add ability to specify minimal cygwin heap + size when debugging. + (_csbrk): Report error in allocation to stderr. + (ccalloc): Ditto. + * dtable.cc (dtable::find_fifo): Remove use of atoms. + * dtable.h (dtable::find_fifo): Ditto. + * fhandler.h (fhandler_fifo): Ditto. + * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Ditto. + (fhandler_fifo::set_use): Ditto. + (fhandler_fifo::open_not_mine): Ditto. + (fhandler_fifo::open): Ditto. + * pinfo.cc (_pinfo::commune_recv): Ditto. + (_pinfo::commune_send): Ditto. + +2004-03-19 Pierre Humblet <pierre.humblet@ieee.org> + + * dir.cc (rmdir): Reorganize error handling to reduce indentation. + +2004-03-19 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 10. + +2004-03-18 Christopher Faylor <cgf@redhat.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset to new value. + (child_info::cygheap_alloc_sz): New field. + * cygheap.cc (init_cheap): Reduce size of cygwin stack until minimal + hit when attempting initial allocation. + (cygheap_setup_for_child): Use alloc_sz to create secondary memory + mapped entry. Store alloc_sz in cygheap_alloc_sz. + (cygheap_fixup_in_child): Use cygheap_alloc_sz to map parent's cygheap. + * cygheap.h (_CYGHEAPSIZE_SLOP): New define. + (CYGHEAPSIZE): Use _CYGHEAPSIZE_SLOP. + +2004-03-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_meminfo): On NT, try to figure out + real swap file usage by requesting SystemPagefileInformation. Use + GlobalMemoryStatus as fallback. + * ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemPagefileInformation. + (struct _SYSTEM_PAGEFILE_INFORMATION): Define. + +2004-03-17 Christopher Faylor <cgf@redhat.com> + + * pipe.cc (fhandler_pipe::dup): Fix debugging message. + +2004-03-17 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 9. + +2004-03-16 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (proc_terminate): Release sync_proc_subproc when done + terminating or suffer potential hangs. + (get_proc_lock): Reorganize debugging output slightly. + +2004-03-15 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (_cygtls::fixup_after_fork): Just manipulate the signal + stack if a signal occurred during the parent's fork. Otherwise leave + it alone. + +2004-03-15 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (try_to_debug): Report on tid of caller. + + * sync.cc (muto::acquire): Fix some races. + * sync.h (muto): Expose some fields for easier debugging. + +2004-03-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_tape::tape_get_pos): Declare with extra + parameter for partition number. + (fhandler_dev_tape::_tape_set_pos): Ditto. + (fhandler_dev_tape::tape_partition): New method. + (fhandler_dev_tape::tape_set_partition): New method. + * fhandler_tape.cc (fhandler_dev_tape::open): Call private methods + directly instead of ioctl. + (fhandler_dev_tape::ioctl): Use long erase on MTERASE by default. + Don't use absolute positioning on MTSEEK. Call tape_set_partition + on MTSETPART, tape_partition on MTMKPART. + (fhandler_dev_tape::tape_get_pos): Add partition number parameter. + Prefer logical position information over absolute position information. + Return partition number. + (fhandler_dev_tape::_tape_set_pos): Add partition number parameter. + Use in SetTapePosition. + (fhandler_dev_tape::tape_set_pos): Remove special TAPE_ABSOLUTE_BLOCK + handling. + (fhandler_dev_tape::tape_erase): Rewind before erasing. + (fhandler_dev_tape::tape_status): Rearrange slightly. Try to get a + MediaType even if no tape is loaded. Store active partition in + mt_resid as on Linux. + (fhandler_dev_tape::tape_partition): New method. + (fhandler_dev_tape::tape_set_partition): New method. + * include/cygwin/mtio.h: Fix copyright. Add comment to explain + mt_resid content. + * include/cygwin/version.h: Bump API minor number. + +2004-03-14 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (_cygtls::remove): Call remove_wq even when we can't + necessarily get the cygtls table lock. + * cygtls.h (_cygtls::remove_wq): Add wait argument. + * sigproc.cc (_cygtls::remove_wq): Honor wait argument when acquiring + lock. + (proc_terminate): Don't NULL sync_proc_subproc since other threads may + still try to access it. + +2004-03-14 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_BEGINNING_OF_MEDIA and + ERROR_SETMARK_DETECTED to EIO instead of ESPIPE. + Handle ERROR_FILEMARK_DETECTED. + * fhandler_tape.cc (TAPE_FUNC): Add comment that ERROR_BUS_RESET + has still to be handled correctly. + (fhandler_dev_tape::open): Accommodate fact that get.mt_dsreg + also contains density code. + (fhandler_dev_tape::ioctl): Rearrange slightly. Reset devbuf also on + MTNOP, MTWSM, MTSETBLK, MTSETDRVBUFFER, MTSETPART and MTMKPART. + (fhandler_dev_tape::tape_set_pos): Rearrange. Match behaviour to + the Linux tape driver. + (fhandler_dev_tape::tape_status): Call IOCTL_STORAGE_GET_MEDIA_TYPES_EX + if available. Return device type and density code in appropriate + mtget members. + * wincap.h (wincaps::has_ioctl_storage_get_media_types_ex): New element. + * wincap.cc: Implement above element throughout. + * include/cygwin/mtio.h: Add tape device types as returned by + IOCTL_STORAGE_GET_MEDIA_TYPES_EX. + (MT_TAPE_INFO): Use above type codes. + (struct mtget): Change mt_dsreg comment. + +2004-03-14 Pierre Humblet <pierre.humblet@ieee.org> + + * dir.cc (rmdir): Construct real_dir with flag PC_FULL. + Use a loop instead of recursion to handle the current directory. + +2004-03-14 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (_cygtls::remove): Call remove_wq to ensure that wait stuff + is removed from proc_subproc linked list. + * cygtls.h (_cygtls::remove_wq): Declare. + * sigproc.cc (_cygtls::remove_wq): Define. + (proc_subproc): Label event handle appropriately. + * spawn.cc (spawn_guts): Return -1 when wait() fails for spawn types + that require waiting. + +2004-03-13 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Handle ERROR_BUS_RESET. + * fhandler.h (fhandler_dev_raw::write_file): New method, created + from former static function. + (fhandler_dev_raw::read_file): Ditto. + (reset_devbuf): New inline method. + (class fhandler_dev_tape): Add TAPE_GET_DRIVE_PARAMETERS + member `dp'. + (fhandler_dev_tape::write_file): New method. + (fhandler_dev_tape::read_file): Ditto. + (fhandler_dev_tape::tape_get_feature): Convert to inline method. + (fhandler_dev_tape::tape_error): New method, created from former + static function. + (fhandler_dev_tape::tape_get_blocksize): Remove declaration. + * fhandler_raw.cc (fhandler_dev_raw::write_file): New method, created + from former static function. + (fhandler_dev_raw::read_file): Ditto. + (fhandler_dev_raw::writebuf): Accommodate the fact that no devbuf + exists under variable block size condition. + (fhandler_dev_raw::raw_read): Ditto. Add local p pointer to simplify + pointer arithmetic. + (fhandler_dev_raw::raw_write): Always set devbufend to 0 when starting + with writing. Accommodate the fact that no devbuf exists under + variable block size condition. + * fhandler_tape.cc: Various formatting changes. + (TAPE_FUNC): New macro. Use throughout as tape function loop. + (get_ll): Convert into macro. + (IS_EOM): New macro. + (IS_EOF): New macro. + (fhandler_dev_tape::is_eom): Use IS_EOM macro. + (fhandler_dev_tape::is_eof): Use IS_EOF macro. + (fhandler_dev_tape::write_file): New method. + (fhandler_dev_tape::read_file): New method. + (fhandler_dev_tape::open): Get drive information block here once. + (fhandler_dev_tape::lseek): Remove unneeded duplicate code. + (fhandler_dev_tape::dup): Duplicate drive information block. + (fhandler_dev_tape::ioctl): Remove drvbuf in variable block size mode. + Return ERROR_INVALID_BLOCK_LENGTH instead of ERROR_MORE_DATA if + buffer contains data which would get lost on buffer size changing. + Use absolute tape positioning also if drive only supports logical + block positioning. + (fhandler_dev_tape::tape_error): New method, created from former + static function. + (fhandler_dev_tape::tape_get_pos): Allow logical block reporting. + Workaround tape driver bug. + (fhandler_dev_tape::_tape_set_pos): Reset device buffer and flags + after successful repositioning. + (fhandler_dev_tape::tape_set_pos): Allow logical block positioning. + Workaround tape driver bug. + (fhandler_dev_tape::tape_erase): Use dp instead of calling + GetTapeParameters. + (fhandler_dev_tape::tape_prepare): Ditto. + (fhandler_dev_tape::tape_get_blocksize): Remove. + (fhandler_dev_tape::tape_set_blocksize): Don't call tape_get_blocksize. + Error handling already done in fhandler_dev_tape::ioctl. + (fhandler_dev_tape::tape_status): Remove local `dp' variable. + Accommodate logical tape reporting. Call tape_get_feature instead + of accessing feature words directly. + (fhandler_dev_tape::tape_compression): Use dp instead of calling + GetTapeParameters. Fix resetting datcompression. + +2004-03-12 Christopher Faylor <cgf@redhat.com> + + * wait.cc (wait4): Initialize pointer on entry. Avoid calling + call_signal_handler twice since that guarantees exiting with errno set + to EINTR. + +2004-03-12 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (sigpacket::process): Simplify code slightly. + +2004-03-11 Christopher Faylor <cgf@redhat.com> + + * cygtls.h (waitq): Declare structure here. + (_cygtls::wq): Declare. + * cygtls.cc (_cygtls::fixup_after_fork): Clear wq.thread_ev to avoid + using an invalid event handle in forked process. + * dcrt0.cc (waitq_storage): Delete. + (threadstuff): Remove waitq_storage. + * perthread.h (per_thread_waitq): Delete. + (waitq_storage): Delete declaration. + * sigproc.cc (sigproc_init): Remove perthread waitq consideration. + * sigproc.h (waitq): Delete declaration. + * wait.cc (wait4): Use _my_tls waitq structure rather than per_thread. + +2004-03-11 Pierre Humblet <pierre.humblet@ieee.org> + + * cygtls.h (_cygtls::newmask): Delete member. + (_cygtls::deltamask): New member. + * gendef (_sigdelayed): Replace the call to set_process_mask by a call + to set_process_mask_delta. + * exceptions.cc (handle_sigsuspend): Do not filter tempmask. Or + SIG_NONMASKABLE in deltamask as a flag. + (_cygtls::interrupt_setup): Set deltamask only. + (set_process_mask_delta): New function. + (_cygtls::call_signal_handler): Replace the first call to + set_process_mask by a call to set_process_mask_delta. + * tlsoffsets.h: Regenerate. + +2004-03-11 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (_cygtls::fixup_after_fork): Remove unneeded setting of + oldmask. + * exceptions.cc: Remove some __I386__ conditionals. + (handle_exceptions): Move ppid test to outside of a loop for + efficiency. + (setup_handler): Make debugging output more wordy. + (_cygtls::call_signal_handler): To avoid a race, use lock/unlock to + synchronize with signal thread and ensure that signal_arrived event has + actually been set. + * gendef (_sigfe): Use ebx for all sigstack manipulations to ensure + that the register is saved. Move setting of incyg to within stack lock + to avoid setup_handler confusion. + (_sigbe): Use ebx for all sigstack manipulations to ensure that the + register is saved. + (_cygtls::pop): Ditto. + (_cygtls::lock): Ditto. + (stabilize_sig_stack): Ditto. + (setjmp): Ditto. + (longjmp): Ditto. + +2004-03-08 Jaakko Hyvatti <jaakko.hyvatti@iki.fi> + + * fhandler_serial.cc (fhandler_serial::ioctl): Implement TIOCSBRK and + TIOCCBRK. + * include/sys/termios.h: Define TIOCSBRK and TIOCCBRK. + +2004-03-08 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (setup_handler): Avoid suspending a thread if it is in + a cygwin function, in an exception, spinning, or locked. + * gendef (_sigfe): Move incyg setting earlier. + (sigreturn): Set incyg flag to avoid interrupting called cygwin + functions. + (sigdelayed): Ditto. + (stabilize_sig_stack): Ditto. + + * sigproc.cc (proc_subproc): Don't restore process lock early in exec + case. + + * cygtls.h: Reorganize fields in _cygtls slightly. + * tlsoffsets.h: Regenerate. + +2004-03-06 Christopher Faylor <cgf@redhat.com> + + * fork.cc (fork_parent): Save parent pid in a temporary variable since + child could conceivably exit before function returns, rendering the + child's shared memory area invalid. + + * cygtls.h (_cygtls::incyg): Declare new field. + (_cygtls::in_exception): Define new function. + * exceptions.cc (setup_handler): Remove locked flag. Use 'incyg' flag + and in_exception function to determine when we're in a cygwin function. + (_cygtls::call_signal_handler): Decrement incyg flag prior to calling a + handler. Increment it on return. + * gendef (_sigfe): Increment incyg flag. Use testl for zero testing + rather than orl, for consistency. + (_sigbe): Decrement incyg flag. Use testl for zero testing rather than + orl, for consistency. + (_cygtls::pop): Use testl for zero testing rather than orl, for + consistency. + (stabilize_sig_stack): Ditto. + + * tlsoffsets.h: Regenerate. + +2004-03-05 Christopher Faylor <cgf@redhat.com> + + * gendef (sigdelayed): Handle return here rather than going through + sigbe to ensure that flags are properly restored. + +2004-03-04 Thomas Pfaff <tpfaff@gmx.net> + + * include/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): New + define. + (PTHREAD_NORMAL_MUTEX_INITIALIZER_NP): Ditto. + (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Ditto. + * thread.cc (pthread_mutex::is_good_initializer): Check for all + posssible initializers + (pthread_mutex::is_good_initializer_or_object): Ditto. + (pthread_mutex::is_good_initializer_or_bad_object): Ditto. + (verifyable_object_isvalid): Support up to three static initializers. + (verifyable_object_isvalid (void const *,long)): Remove. + (pthread_cond::is_good_initializer_or_bad_object): Remove unneeded + objectState var. + (pthread_cond::init): Condition remains unchanged when creation has + failed. + (pthread_rwlock::is_good_initializer_or_bad_object): Remove unneeded + objectState var. + (pthread_rwlock::init): Rwlock remains unchanged when creation has + failed. + (pthread_mutex::init): Remove obsolete comment. Mutex remains + unchanged when creation has failed. Add support for new initializers. + (pthread_mutex_getprioceiling): Do not create mutex, just return + ENOSYS. + (pthread_mutex_lock): Simplify. + (pthread_mutex_trylock): Remove unneeded local themutex. + (pthread_mutex_unlock): Just return EPERM if mutex is not initialized. + (pthread_mutex_setprioceiling): Do not create mutex, just return + ENOSYS. + * thread.h (verifyable_object_isvalid): Support up to three static + initializers. + (verifyable_object_isvalid (void const *,long)): Remove prototype. + (pthread_mutex::init): Add optional initializer to parameter list. + +2004-03-03 Christopher Faylor <cgf@redhat.com> + + * gendef (sigreturn): Call stabilize_sig_stack to ensure that there are + no pending signals. Restore edx later. + (sigdelayed): Save edx earlier. + + * malloc_wrapper.cc (malloc_init): Add some more debugging output. + +2004-03-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::raw_read): When reading with + variable block size, read only one block, read directly into user + supplied buffer, return ENOMEM if user supplied buffer is smaller + than size of next block to read. Use read2 instead of bytes_to_read + to count number of bytes read. + * fhandler_tape.cc (fhandler_dev_tape::open): Add debug output. + +2004-02-26 Brian Ford <ford@vss.fsi.com> + + * miscfuncs.cc (check_invalid_virtual_addr): Assure the last page + in the range is always tested. Add appropriate const. + * mmap.cc (mmap_record::alloc_fh): Remove unused static path_conf object. + +2004-02-25 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (setup_handler): Signal event for any sigwaitinfo, if it + exists, to force signal to be handled. Zero event here to prevent + races. + * signal.cc (sigwaitinfo): Use local handle value for everything since + signal thread could zero event element at any time. Detect when + awaking due to thread not in mask and set return value and errno + accordingly. Don't set signal number to zero unless we've recognized + the signal. + * sigproc.cc (sigq): Rename from sigqueue throughout. + + * thread.cc (pthread::join): Handle signals received while waiting for + thread to terminate. + +2004-02-25 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Export sighold, sigqueue. + * exceptions.cc (sighold): Define new function. + * signal.cc (handle_sigprocmask): Set correct errno for invalid signal. + Simplify debugging output. + (sigqueue): Define new function. + * include/cygwin/signal.h (sighold): Declare new function. + (sigqueue): Ditto. + * include/cygwin/version.h: Bump API minor version number. + * include/limits.h (TIMER_MAX): Define. + (_POSIX_TIMER_MAX): Ditto. + +2004-02-25 Brian Ford <ford@vss.fsi.com>, + Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (check_invalid_virtual_addr): New function. + * winsup.h (check_invalid_virtual_addr): Declare. + * mmap.cc (munmap): Call check_invalid_virtual_addr instead of + IsBadReadPtr. + +2004-02-24 Christopher Faylor <cgf@redhat.com> + + * gendef (stabilize_sig_stack): Correctly align this pointer for call + to _cygtls::call_signal_handler. + * gentls_offsets: Output sizeof field. + * tlsoffsets.h: Regenerate. + +2004-02-24 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (_dll_crt0): Don't check sync_startup if threadfunc_ix is set. + + * external.cc (cygwin_internal): Implement CW_GET_BINMODE. + * include/sys/cygwin.h: Declare CW_GET_BINMODE. + +2004-02-24 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (_dll_crt0): Add some stern internal errors. + +2004-02-24 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::cancelable_wait): Rearrange slightly. + Add do_sig_wait parameter. Wait for signal_arrived if set to true. + Return WAIT_SIGNALED if signal arrived. + (pthread_cond::wait): Accommodate change to pthread::cancelable_wait. + (pthread::join): Ditto. + (semaphore::_timedwait): Ditto. + (semaphore::_wait): Ditto. Change to return int to allow status + feedback. + (semaphore::wait): Return return value from semaphore::_wait. + * thread.h (WAIT_SIGNALED): New definition. + (pthread::cancelable_wait): Change declaration. Define do_sig_wait + as false by default to not interfere with existing calls accidentally. + (semaphore::_wait): Declare int. + +2004-02-21 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sigpacket::process): Make sure that tls is filled in + for SIGSTOP condition. + (_cygtls::call_signal_handler): Restore signal mask using saved oldmask + rather than current oldmask. + +2004-02-20 Christopher Faylor <cgf@redhat.com> + + * path.cc (conv_path_list): Return error condition. + (copy1): New function. + (copyenc): New function. + (mount_item::fnmunge): Return error condition. Use new functions to + copy strings. + (mount_item::build_win32): Ditto. + (mount_info::conv_to_win32_path): Return error condition. + (cygwin_conv_to_posix_path): Return result of path conversion. + (cygwin_conv_to_full_posix_path): Ditto. + (return_with_errno): New macro. + (cygwin_win32_to_posix_path_list): Use new macro to potentially set + errno. + (cygwin_posix_to_win32_path_list): Ditto. + * path.h (mount_item::fnmunge): Add size argument. + (mount_item::build_win32): Ditto. + +2004-02-20 Corinna Vinschen <corinna@vinschen.de> + + * getopt.c: Avoid useless compiler warnings. + +2004-02-20 Corinna Vinschen <corinna@vinschen.de> + + * getopt.c: Replace with latest vanilla(!) OpenBSD version 1.16. + +2004-02-18 Christopher Faylor <cgf@redhat.com> + + * fork.cc (fork_child): Invert sense of test which defeated correct + handling in a fork from a non-main thread. + + * dcrt0.cc (initial_env): Eliminate parameter and just send DebugBreak + when appropriate. + (dll_crt0_0): Reflect parameter change to initial_env. + (dll_crt0_1): Don't call initial_env. + +2004-02-18 Christopher Faylor <cgf@redhat.com> + + * gendef (stabilize_sig_stack): New function. + (setjmp): Import, add sig stack handling. Store sig stack info. + (longjmp): Call stabilize_sig_stack. Restore sig stack info. + * config/i386/setjmp.c: Remove. + +2004-02-17 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork_child): Move fixup_shms_after_fork so that + signal_arrived is initialized when calling it. + +2004-02-17 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (clean): Clean libserver, too. + + * fhandler.cc (fhandler_base::~fhandler_base): Remove path_conv cleanup. + * syscalls.cc (chroot): Ditto. + * path.cc (path_conv::~path_conv): Define new destructor. + (conv_path_list_buf_size): Remove explicit path_conv cleanup. + * path.h (path_conv::~path_conv): Declare new destructor. + +2004-02-16 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Compile flock.o with -fomit-frame-pointer. + +2004-02-16 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Compile dlfcn.o with -fomit-frame-pointer. + +2004-02-16 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Compile delqueue.o with -fomit-frame-pointer. + +2004-02-16 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (rename): Do not test the MoveFile error code + where MoveFileEx exists. + +2004-02-15 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (_csbrk): Report more debugging details on failing + condition. + +2004-02-14 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Compile syscalls.o with -fomit-frame-pointer. + + * sigproc.cc: Eliminate unused variable. + +2004-02-14 Corinna Vinschen <corinna@vinschen.de> + + * getopt.c: Replace with latest NetBSD version 1.16. Keep Cygwin + specific changes as minimal as possible. + +2004-02-13 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (proc_subproc): Change warning back to silent debug + output. + +2004-02-13 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (alloc_stack_hard_way): Revert to previous implementation. + (alloc_stack): Ditto. + * exceptions.cc (ctrl_c_handler): Add debugging output. + +2004-02-13 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (clean): Remove sigfe.s. + (sigfe.s): Ensure that sigfe.s will be regenerated if it does not exist. + * dll_init.cc (dll_dllcrt0): Simplify initializing tests. + + * exceptions.cc (setup_handler): Detect when stub caller is either + spinning or has acquired the lock after being suspended to avoid + windows problems with suspending a win32 API call. + + * cygtls.h (_cygtls::spinning): Declare new element. + * gendef: Remove unused _siglist_index and _siglist declaration. + (_sigfe): Set spinning element when potentially looping, waiting for lock. + (_sigbe): Ditto. + (_cygtls::lock): Ditto. + (_longjmp): Ditto. + * tlsoffsets.h: Regenerate. + * pinfo.cc (_pinfo::exit): Set final exit state here. Call sigproc_terminate if + invoked with 'norecord'. Clear any residual _cygtls stuff. + * winsup.h (exit_states): Define ES_FINAL. + * spawn.cc (spawn_guts): Don't call proc_terminate specifically when + execing. Let _pinfo::exit handle that case. + + * sigproc.cc (wait_subproc): Always exit loop early when proc_loop_wait. + + * init.cc (munge_threadfunc): Eliminate unused argument. + (dll_entry): Reflect above change in call to munge_threadfunc. + +2004-02-11 Christopher Faylor <cgf@redhat.com> + + * gendef (_sigbe): Zero location on pop. + (_cygtls::pop): Ditto. + +2004-02-11 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (alloc_stack_hard_way): Eliminate second argument. + (alloc_stack): Remove use of 'b' throughout. + +2004-02-11 Christopher Faylor <cgf@redhat.com> + + Rename _threadinfo to _cygtls, throughout. + * cygtls.h (_cygtls::call_signal_handler): Rename from + call_signal_handler_now. + (_cygtls::push): Make second argument mandatory. + (_cygtls::fixup_after_fork): Declare new function. + (_cygtls::lock): Ditto. + * cygtls.cc (_cygtls::fixup_after_fork): Define new function. + * dcrt0.cc (cygwin_finished_initializing): Define as bool. + (alloc_stack): Use _tlstop rather than arbitrary variable in probably + vain attempt to avoid strange fork problem on CTRL-C. + (dll_crt0_0): Remove obsolete winpids::init call. + * dll_init.cc (dll_dllcrt0): Detect forkee condition as equivalent to + initializing. + * winsup.h (cygwin_finished_initializing): Declare as bool. + * exceptions.cc (handle_exceptions): Rely on + cygwin_finished_initializing to determine how to handle exception + during process startup. + (_cygtls::call_signal_handler): Rename from call_signal_handler_now. + (_cygtls::interrupt_now): Fill in second argument to push. + (signal_fixup_after_fork): Eliminate. + (setup_handler): Initialize locked to avoid potential inappropriate + unlock. Resume thread if it has acquired the stack lock. + (ctrl_c_handler): Just exit if ctrl-c is hit before cygiwn has finished + initializing. + * fork.cc (sync_with_child): Don't call abort since it can cause exit + deadlocks. + (sync_with_child): Change debugging output slightly. + (fork_child): Set cygwin_finished_initializing here. Call _cygtls fork + fixup and explicitly call sigproc_init. + (fork_parent): Release malloc lock on fork failure. + (vfork): Call signal handler via _my_tls. + * sigproc.cc (sig_send): Ditto. + * syscalls.cc (readv): Ditto. + * termios.cc (tcsetattr): Ditto. + * wait.cc (wait4): Ditto. + * signal.cc (nanosleep): Ditto. + (abort): Ditto. + (kill_pgrp): Avoid killing self if exiting. + * sync.cc (muto::acquire): Remove (temporarily?) ill-advised + exiting_thread check. + * gendef (_sigfe): Be more agressive in protecting stack pointer from + other access by signal thread. + (_cygtls::locked): Define new function. + (_sigbe): Ditto. + (_cygtls::pop): Protect edx. + (_cygtls::lock): Use guaranteed method to set eax to 1. + (longjmp): Aggressively protect signal stack. + * miscfuncs.cc (low_priority_sleep): Reduce "sleep time" for secs == 0. + * pinfo.cc (winpids::set): Counterintuitively use malloc's lock to + protect simultaneous access to the pids list since there are + pathological conditions which can cause malloc to call winpid. + (winpids::init): Eliminate. + * pinfo.h (winpids::cs): Eliminate declaration. + * pinfo.h (winpids::init): Eliminate definition. + +2004-02-11 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_nt_object_attribute): Fix error handling. + +2004-02-09 Ralf Habacker <ralf.habacker@freenet.de> + + * fhandler_socket.cc (fhandler_socket::ioctl): Add FIONREAD handling. + +2004-02-08 Christopher Faylor <cgf@redhat.com> + + * debug.h (console_printf): Define for non-debugging condition. + + * cygtls.h (_threadinfo::lock): Remove wait argument. + (_threadinfo::interrupt_setup): Remove retaddr argument. + * exceptions.cc (_threadinfo::interrupt_setup): Ditto. + (_threadinfo::interrupt_now): Accommodate change to interrupt_setup + argument. + (setup_handler): Ditto. Always lock sig stack prior to determining + interrupt method. + * gendef (_sigfe): Correct thinko regarding cmpxchg. + (_sigbe): Ditto. + (_threadinfo::lock): Ditto. + (_threadinfo::pop): Eliminate left-over stack unlock. + * sigproc.cc (proc_subproc): Change debugging output to printed + warning. + +2004-02-08 Christopher Faylor <cgf@redhat.com> + + * localtime.cc (localtime_r): Call tzset. + + * Makefile.in: Make version.h/cygwin.din version check a warning since + it is not foolproof. + + * cygheap.h (CYGHEAPSIZE): Bump size down. + + * cygtls.h (_threadinfo::stacklock): New element. + (_threadinfo::pop): Make regparm. + (_threadinfo::lock): New function. + (_threadinfo::unlock): New function. + * cygtls.cc (_threadinfo::push): Wait for a lock on the stack before + performing the operation. + (_threadinfo::pop): Move to another file. + * cygwin.din: More SIGFE changes. + * exceptions.cc (try_to_debug): Always display messages on console. + (handle_exceptions): Unwind stack only when actually about to call + sig_send. + (setup_handler): Lock stack prior to performing any operations. + * gendef (_sigfe): Ditto. + (_sigbe): Ditto. + (_threadinfo::pop): Ditto. Move here. + * gen_tlsoffsets: Generate positive offsets. + * tlsoffsets.h: Regenerate. + +2004-02-06 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.h (CYGWIN_SERVER_VERSION_API): Bump. + * cygserver_ipc.h (struct proc): Add signal_arrived member. + (ipc_set_proc_info): Inititalize blk.signal_arrived. + +2004-02-06 Pierre Humblet <pierre.humblet@ieee.org> + + * uinfo.cc (cygheap_user::init): Use sec_user_nih to build a + security descriptor. Set both the process and the default DACLs. + * fork.cc (fork_parent): Use sec_none_nih security attributes. + * spawn.cc (spawn_guts): Ditto. + +2004-02-05 Christopher Faylor <cgf@redhat.com> + + * cygwin.din: Make many more functions SIGFE. + * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump. + +2004-02-05 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h (SID): New macro. + (well_known_*_sid): Change type to cygpsid. + (cygsid::init): Delete declaration. + * sec_helper.cc (well_known_*_sid): Define using above SID macro. + (cygsid::init): Delete. + * dcrt0.cc (dll_crt0_0): Do not call cygsid::init. + * security.cc (get_user_local_groups): Change the second argument type + to cygpsid. + +2004-02-03 Christopher Faylor <cgf@redhat.com> + + * cygtls.h (_local_storage::signamebuf): Increase size to prevent + overflow on really odd values. + * tlsoffsets.h: Regenerate. + +2004-02-03 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (DLL_OFILES): Add strsig.o. + * cygtls.h (_local_storage::signamebuf): New element. + * sysconf.cc (sysconf): Implement _SC_RTSIG_MAX. + * tlsoffsets.h: Regenerate. + * include/limits.h (_POSIX_RTSIG_MAX): New define. + (RTSIG_MAX): Ditto. + * include/cygwin/signal.h (SIGRTMIN): New define. + (SIGRTMAX): Ditto. + (NSIG): Bump. + * strsig.cc: New file. + +2004-02-03 Jason Tishler <jason@tishler.net> + + * window.cc (Winmain): Show windows error code in error output when + RegisterClass fails. + +2004-02-02 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (*::fixup_after_exec): Eliminate unused handle argument. + * fhandler.h (dtable::fixup_after_exec): Eliminate unused handle + argument. + * dcrt0.cc (dll_crt0_1): Reflect elimination of unused handle argument + to fixup_after_exec. + * dtable.cc (dtable::fixup_after_exec): Ditto. + * fhandler_console.cc (fhandler_console::fixup_after_exec): Ditto. + * fhandler_dsp.cc (fhandler_dsp::fixup_after_exec): Ditto. + * fhandler_raw.cc (fhandler_raw::fixup_after_exec): Ditto. + * fhandler_socket.cc (fhandler_socket::fixup_after_exec): Ditto. + * fhandler_virtual.cc (fhandler_virtual::fixup_after_exec): Ditto. + * pipe.cc (fhandler_pipe::fixup_after_exec): Ditto. + +2004-02-02 Pierre Humblet <pierre.humblet@ieee.org> + + * spawn.cc (spawn_guts): Do not set ciresrv.parent. + * child_info.h (child_info_spawn::~child_info_spawn): Do not close + parent. Update CURR_CHILD_INFO_MAGIC. + * dcrt0.cc (dll_crt0_0): Do not close spawn_info->parent. Pass NULL to + cygheap->fdtab.fixup_after_exec(). + +2004-02-02 Christopher Faylor <cgf@redhat.com> + + Throughout, change name from set_inheritance to set_no_inheritance to + better reflect input arguments of this function. + + * cygheap.h (CYGHEAPSIZE): Increase size of cygheap to something closer + to the 21st century. + +2004-02-02 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (set_errno): Replace semicolon with comma in non-DEBUGGING + version to avoid compile time error. + +2004-02-01 Christopher Faylor <cgf@redhat.com> + + * cygerrno.h (set_errno): Set global errno whenever setting thread + specific version. + * debug.cc (__set_errno): Ditto. + + * exceptions.cc (handle_sigsuspend): Remove spurious + sig_dispatch_pending call. + (set_signal_mask): When there seem to be pending signals to dispatch, + tell signal_dispatch_pending/sig_send not to specifically call any + handlers. + * sigproc.h (sig_dispatch_pending): Change declaration to void. + * sigproc.cc (sig_dispatch_pending): Change definition to void. Take + an argument to determine whether to tell sig_send to wait for handler + to be called. + * sigproc.cc (sig_send): Don't call signal handler when sig == + __SIGFLUSHFAST. + (wait_sig): Honor __SIGFLUSHFAST. Guard against sigpacket::process + nuking si_signo. + * sigproc.h (__SIGFLUSHFAST): Define new special signal. + (sig_dispatch_pending): Change declaration to void. Take optional + boolean argument. + + * fork.cc (vfork): Add debugging output. + +2004-01-26 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle_tty_stop): Avoid races by waiting for both + signal_arrived and for sigCONT. + (sigpacket::process): Enforce sending of both signal_arrived and + sigCONT, where appropriate. + * gendef (sigreturn): Save tls pointer in ebx so that it can jump into + sigdelayed and use the same register. + +2004-01-26 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (_threadinfo::init_thread): Add more local reent stdio + initialization. + * dcrt0.cc (initial_env): Can it really be true that XP doesn't allow + attaching a debugger during DLL attach? Add temporary workaround. + (dll_crt0_0): Ensure that _impure_ptr stdio is initialized before any + threads. + (dll_crt0_1): Move _impure_ptr initialization to dll_crt0_0. + * exceptions.cc (try_to_debug): Reinstate old method for looping while + debugging. + * syscalls.cc (_cygwin_istext_for_stdio): Regularize debugging output. + Remove hopefully extraneous check. + (setmode_helper): Add debugging output for improbable case. Use + "binary" rather "raw" for consistency. + +2004-01-25 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::fhaccess): Avoid always setting errno to + EACCESS when return value is < 0. Rely on errno being set properly. + +2004-01-25 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (proc_subproc): Don't protect *child's* handle. + +2004-01-24 Christopher Faylor <cgf@redhat.com> + + * fhandler.h (fhandler_base::fhaccess): Return int for compatibility + with access. + * fhandler.cc (fhandler_base::fhaccess): Return int. Use consistent + variable name for exit value. Exit at bottom, printing debugging + information, like other cygwin functions. + +2004-01-23 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cygheap::close_ctty): Protect YA vforkism. + * fhandler.h (fhandler_base::has_acls): Make pass through for path_conv + method. + (fhandler_base::isremote): Ditto. + (fhandler_base::is_fs_special): Ditto. + (fhandler_base::has_attribute): Ditto. Define new function. + (fhandler_base::fhaccess): Declare new function based on access_worker. + (fhandler_base::set_has_acls): Eliminate obsolete function. + (fhandler_base::set_isremote): Ditto. + * fhandler.cc (fhandler_base::fhaccess): Move from syscalls.cc and into + fhandler_base class. Use fhandler methods to access data rather than + path_conv stuff. + (fhandler_base::device_access_denied): Use fhaccess method. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. + (fhandler_base::open_fs): Remove calls to obsolete functions. + * fhandler_virtual.cc (fhandler_virtual::open): Ditto. + * winsup.h (access_worker): Remove obsolete access_worker declaration. + *syscalls.cc (access_worker): Move function to fhandler.cc. + (access): Use fhaccess method. + + * pinfo.cc (_pinfo::set_ctty): Clarify debugging output. + * sigproc.cc (sig_dispatch_pending): Ditto. + * syscalls.cc (setsid): Perform minor rearrangement. + +2004-01-23 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_socket.cc (fhandler_socket::create_secret_event): Avoid + creating multiple handles. Always allow event inheritance but set the + handle inheritance appropriately. Improve error handling. + (fhandler_socket::check_peer_secret_event): Improve error handling. + (fhandler_socket::close_secret_event): Simply call CloseHandle. + (fhandler_socket::set_close_on_exec): Set secret event inheritance. + +2004-01-23 Christopher Faylor <cgf@redhat.com> + + * configure.in: Remove NEWVFORK default. + * configure: Regenerate. + * dcrt0.cc: Conditionalize vfork stuff throughout. + * dtable.cc: Ditto. + * perthread.h: Ditto. + * pipe.cc (fhandler_pipe::close): Ditto. + * spawn.cc (spawnve): Ditto. + * syscalls.cc (setsid): Ditto. + * exceptions.cc (sigpacket::process): Use macro to refer to vfork pid. + + * debug.cc (verify_handle): Define new function. + * debug.h (VerifyHandle): Define new macro. + (verify_handle): Declare new function + * fhandler.cc (fhandler_base::dup): Verify that dup'ed handle is not + supposed to be in use. + (fhandler_base::set_inheritance): Ditto. + (fhandler_base::fork_fixup): Ditto. + * fhandler_socket.cc (fhandler_socket::dup): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + * net.cc (set_socket_inheritance): Ditto. + * pinfo.cc (pinfo_fixup_after_exec): Ditto. + * sigproc.cc (proc_subproc): Ditto. + (sig_send): Ditto. + * spawn.cc (spawn_guts): Ditto. + * thread.cc (pthread::init_mainthread): Ditto. + * pipe.cc (fhandler_pipe::close): Close read_state with + ForceCloseHandle since it was protected. + (fhandler_pipe::fixup_after_exec): Protect read_state handle. + (fhandler_pipe::dup): Correctly close open handles on error condition. + Verify that dup'ed handle is not supposed to be in use. + (fhandler_pipe::create): Protect read_state. + +2004-01-23 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (sig_handle_tty_stop): Fix boneheaded mistake by using + correct check for parent state rather than inverted check mistakenly + introduced on 2003-09-15. + +2004-01-22 Brian Ford <ford@vss.fsi.com> + + * fhandler_serial.cc (fhandler_serial::raw_write): Prevent a deadlock + when the input buffer overflows. + (fhandler_serial::raw_read): Correct to print the actual error and only + call PurgeComm when necessary. + +2004-01-22 Christopher Faylor <cgf@redhat.com> + + * dcrt0.cc (reent_data): Make global. + * cygwin.din: Reexport reent_data. + +2004-01-22 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (_threadinfo::remove): Don't assume that we are removing + _my_tls. + * exceptions.cc (setup_handler): Improve debugging output. + (call_signal_handler_now): Remove ill-advised debugger call. + * sigproc.cc (sigcomplete_main): Delete. + (sig_send): Honor FIXME and avoid using main thread's completion event + for everything or suffer races. + (pending_signals::add): Default stored mask to current process mask + rather than mask at time of signal send. + (wait_sig): Add debugging output. + * sigproc.h (sigpacket::mask_storage): Delete. + +2004-01-22 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::open): Revert isfs change. + +2004-01-21 Christopher Faylor <cgf@redhat.com> + + * devices.in: Change raw com device to more correct form. + +2004-01-21 Christopher Faylor <cgf@redhat.com> + + * fhandler.cc (fhandler_base::open): Use major numbers rather than + device numbers to control special behavior for devices which take + units. + * fhandler_raw.cc (fhandler_dev_raw::writebuf): Ditto. + (fhandler_dev_raw::fstat): Ditto. + (fhandler_dev_raw::open): Ditto. + (fhandler_dev_raw::ioctl): Ditto. + +2004-01-21 Nicholas Wourms <nwourms@netscape.net> + + * signal.cc (sigaction): Fix if-statement typo. + +2004-01-21 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (handle_threadlist_exception): Change logic, improve + debugging output. + +2004-01-21 Christopher Faylor <cgf@redhat.com> + + * fhandler_tty.cc (fhandler_tty::ioctl): Semi-revert 2003-09-26 change + for TIOCSWINSZ. It is not an error for ioctl_request_event to be + missing. + +2004-01-20 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (pending_signals::save): New function. + (pending_signals::restore): Ditto. + (sig_clear): Save/restore current queue pointer. + (wait_sig): Delete signals marked as such. + * sigproc.h (__SIGDELETE): New enum. + +2004-01-20 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 8. + + * cygmalloc.h: Make more concessions to attempts to get debugging + malloc working. + * debug.h: Ditto. + * dlmalloc.cc: Ditto. + * dlmalloc.h: Ditto. + * malloc_wrapper.cc: Ditto. + + * perthread.h (perthread::create): Use calloc to ensure zeroed memory. + +2004-01-20 Christopher Faylor <cgf@redhat.com> + + * sec_acl.cc (setacl): Make sure sd_ret is large enough. + +2004-01-19 Christopher Faylor <cgf@redhat.com> + + * sigproc.cc (sigproc_terminate): Don't close sendsig handle when + execing since we're not closing what we think we're closing. + (sig_send): Improve debugging when exiting due to no_signals_available. + + * wincap.h (wincaps::cant_debug_dll_entry): New element. + * wincap.cc: Implement above element throughout. + * dcrt0.cc (initial_env): Accommodate changes necessary to allow + initial debugging for systems which do not allow debugging in + dll_entry. + (dll_crt0_0): Add initial_env call back here. + + * Makefile.in (install-man): Use mandir as target for installation. + +2004-01-19 Christopher Faylor <cgf@redhat.com> + + * include/cygwin/version.h: Bump DLL minor number to 7 (should have been + done earlier). + +2004-01-19 Christopher Faylor <cgf@redhat.com> + + * cygwin/include/signal.h: Add copyright notice. + + * cygwin.din: Make clock SIGFE. Add clock_gettime, sigwaitinfo, + timer_create, timer_delete, timer_settime. + * include/cygwin/version.h: Reflect above additions. + * fork.cc (fork_child): Call fixup_timers_after_fork. + * signal.cc (sigwait): Remove unused variable. + * timer.cc: New file. + (clock_gettime): Define new function. + (timer_tracker): Define new struct used by timer functions. + (timer_tracker::timer_tracker): New function. + (to_us): New function. + (timer_thread): New function. + (timer_tracker::settime): New function. + (timer_create): New function. + (timer_settime): New function. + (timer_delete): New function. + (fixup_timers_after_fork): New function. + * cygthread.cc: Bump thread count. + +2004-01-17 Christopher Faylor <cgf@redhat.com> + + * signal.cc (sigwaitinfo): Define new function. + (sigwait): Redefine based on sigwaitinfo. + * include/cygwin/signal.h (sigwaitinfo): Declare. + (sigwait): Ditto. + +2004-01-17 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::vfork_parent_restore): Avoid double close of ctty + when ctty == ctty_on_hold. + +2004-01-16 Christopher Faylor <cgf@redhat.com> + + * cygtls.h (_threadinfo::threadkill): New element. + (_threadinfo::set_threadkill): Declare new function. + (_threadinfo::reset_threadkill): Declare new function. + * dcrt0.cc (dcrt0_1): Call here so that it will be possible to attach + to running process with #(*& Windows Me/9x. + (initial_env): Try to initialize strace if uninitialized. + * gendef: Don't zero signal if threadkill is set since that will happen + in the called function. + * signal.cc (sigwait): Ensure cleanup in error conditions. + * sigproc.cc (sig_send): Clear packet mask storage. + (wait_subproc): Fill in child exit code in siginfo_t structure. + * thread.cc (pthread_kill): Set threadkill flag. + * tlsoffsets.h: Regenerate. + +2004-01-16 Christopher Faylor <cgf@redhat.com> + + Throughout, use siginfo_t to fill out all signal information for + "kernel" signals. + * cygtls.h (_threadinfo::set_siginfo): Declare new function. + * cygtls.cc (_threadinfo::set_siginfo): Define new function. + * dcrt0.cc (do_exit): Accommodate siginfo_t considerations. + * exceptions.cc (handle_exceptions): Ditto. + (sig_handle_tty_stop): Ditto. + (ctrl_c_handler): Use killsys() to send signal. + (sigpacket::process): Rename from sig_handle. Use siginfo_t field from + sigpacket for everything. + (tty_min::kill_pgrp): Accommodate siginfo_t considerations. + (fhandler_termios::bg_check): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use killsys() to send signal. + * signal.cc (kill_worker): Rewrite to use siginfo_t second argument. + (kill_pgrp): Ditto. + (kill0): Define new function pulled from kill(). + (kill): Rewrite as frontend to kill0. + (killsys): Define new function. + * sigproc.cc (sigelem): Eliminate. + (sigpacket): Move to sigproc.h. Subsume sigelem. + (pending_signals): Use sigpacket rather than sigelem for everything. + (sig_clear): Ditto. + (wait_sig): Ditto. + (sig_send): Rewrite to use siginfo_t argument. + (sig_send): New function wratpper to sig_send with siginfo_t argument. + (wait_subproc): Accommodate siginfo_t considerations. + * thread.cc (pthread_kill): Ditto. + * sigproc.h (sigpacket): Move here. + (sigpacket::process): Declare "new" function. + (sig_handle): Eliminate declaration. + (sig_send): Declare with new paramaters. + (killsys): Declare new function. + (kill_pgrp): Declare. + * winsup.h: Move some signal-specific stuff to sigproc.h. + * include/cygwin/signal.h: Tweak some siginfo_t stuff. + +2004-01-16 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::close): Remove obsolete test + for vfork_cleanup. + * pipe.cc (fhandler_pipe::close): Add comment. + +2004-01-16 Christopher Faylor <cgf@redhat.com> + + * cygheap.cc (init_cygheap::close_ctty): Don't NULL ctty if it is still + active. + +2004-01-16 Christopher Faylor <cgf@redhat.com> + + * dtable.cc (dtable::vfork_parent_restore): Store ctty_on_hold prior to + calling close_all_files since it will be zeroed. + +2004-01-15 Christopher Faylor <cgf@redhat.com> + + * gentls_offsets: Reinstate unlink of temp files. + +2004-01-14 Christopher Faylor <cgf@redhat.com> + + * fhandler_console.cc (fhandler_console::close): Fix debugging output. + (fhandler_console::fixup_after_fork): Decrement open_fhs prior to call + to fhandler_console::open since this would cause incrementing too much + incrementing in child processes. (Probably needs to be handled more + elegantly someday) + (fhandler_console::fixup_after_exec): Ditto. + +2004-01-14 Christopher Faylor <cgf@redhat.com> + + * cygtls.h (_threadinfo::call): Remove regparm declaration to work + around compiler bug. + +2004-01-13 Christopher Faylor <cgf@redhat.com> + + * autoload.cc (TryEnterCriticalSection): Remove. + * dcrt0.cc (dll_crt0_0): Delete inappropriate setting of + _my_tls.stackptr to NULL since it has really bad consequences. Make + 'si' an automatic variable. + +2004-01-13 Christopher Faylor <cgf@redhat.com> + + * cygtls.cc (_threadinfo::init_thread): Correct thinko which caused + thread list to be allocated every time. + * cygtls.h (CYGTLS_PADSIZE): Define as const int. + * sync.h: Make multiple inclusion safe. + (muto::next): Eliminate. + (muto::exiting_thread): New variable. + (muto::set_exiting_thread): New function. + (new_muto): Change to use different section for mutos since c++ give + inexplicable warning in some cases otherwise. + (new_muto1): Ditto. + * dcrt0.cc (do_exit): Call muto::set_exiting_thread here. + * sync.cc (muto_start): Eliminate. + (muto::acquire): Always give exiting thread a lock. Never give thread + a lock if exiting. + (muto::release): Ditto for releasing. + * dtable.cc (dtable::init_lock): Unline function and define here. + * dtable.h (lock_cs): Define as a muto since critical sections seem to + work oddly on Windows Me. + (lock): Accommodate switch to muto. + (unlock): Ditto. + * exceptions.cc (setup_handler): Don't worry about acquiring mutos + since that hasn't mattered for a long time. + (signal_exit): Ditto: muto stuff will be handled automatically on exit + now. + +2004-01-12 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (DLL_IMPORTS): Link advapi32 to ensure proper DLL + initialization. + * autoload.cc (RegCloseKey): Arbitrarily choose this function as a + "seed" to pull the advapi32 link library in. So, comment out the + autoloading. + * cygtls.cc (_threadinfo::init_thread): Just clear CYGTLS_PADSIZE. + (_threadinfo::remove): Add debugging. + (_threadinfo::find_tls): Ditto. + * cygtls.h (_threadinfo::padding): Make zero length (for now?). + * dcrt0.cc (dll_crt0_0): Move more initialization here from dll_crt0_1. + (dll_crt0_1): See above. + * dtable.h (dtable::lock): Remove commented out critical section + locking. + * dtable.h (dtable::init_lock): Remove commented out critical section + locking. + * dtable.h (dtable::unlock): Remove commented out critical section + locking. + * exceptions.cc (interruptible): bool'ize. + * init.cc (threadfunc_fe): Revert to storing threadfunc at stack + bottom. + (munge_threadfunc): Ditto. Avoid adding overhead to + calibration_thread. + (prime_threads): Don't initialize tls stuff. + (dll_entry): Make minor change to initialization order. + * tlsoffsets.h: Regenerate. + + * sigproc.cc (wait_sig): Add sanity check for end of process thread + exit. + + * select.h: Make minor formatting change. + +2004-01-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add still more -fomit-frame-pointer functions. + * dtable.h (dtable::lock): New function. + (dtable::unlock): New function. + (dtable::init_lock): New function. + * cygheap.h (HEAP_TLS): Declare new enum value. + (init_cygheap::threadlist): Declare new array. + (init_cygheap::sthreads): Declare new variable. + (cygheap_fdmanip::~cygheap_fdmanip): Use new dtable lock/unlock + functions. + (cygheap_fdnew::cygheap_fdnew): Ditto. + (cygheap_fdget::cygheap_fdget): Ditto. + * dtable.cc (dtable_init): Initialize fdtab critical section. + (dtable::fixup_after_fork): Ditto. + (dtable::fixup_after_exec): Ditto. + (dtable::dup2): Use lock/unlock calls to protect access to fdtab. + (dtable::find_fifo): Ditto. + (dtable::fixup_before_fork): Ditto. + (dtable::fixup_before_exec): Ditto. + (dtable::set_file_pointers_for_exec): Ditto. + (dtable::vfork_child_dup): Ditto. + (dtable::vfork_parent_restore): Ditto. + * syscalls.cc (close_all_files): Ditto. + * sync.h (muto::acquired): Declare new function. + (new_muto1): Declare new macro used to specify name of muto storage. + * sync.cc (muto::acquired): Define new function. + + * cygthread.cc (cygthread::stub): Remove signal chain removal call + since it is handled during initialization now. + * cygthread.cc (cygthread::simplestub): Remove signal chain removal + call since it is handled during initialization now. + * cygtls.cc (sentry): New class used for locking. Use throughout. + (_threadinfo::reset_exception): Don't pop stack. + (_threadinfo::find_tls): Move from exceptions.cc. + (_threadinfo::init_thread): Initialize array of threads rather than + linked list. Take second argument indicating thread function for this + thread. + (_threadinfo::remove): Search thread array rather than linked list. + Use sentry to lock. Only unlock if we got the lock. + (_threadinfo::find_tls): Ditto for first two. + (handle_threadlist_exception): Handle exceptions when manipulating the + thread list in case of premature thread termination. + (_threadinfo::init_threadlist_exceptions): Ditto. + * cygtls.h (TLS_STACK_SIZE): Decrease size. + (_threadinfo::padding): Add element to avoid overwriting lower part of + stack. + (_threadinfo::remove): Add a "wait" argument to control how long we + wait for a lock before removing. + * exceptions.cc (init_exception_handler): Make global. Take argument + to control exception handler being set. + (ctrl_c_handler): Wait forever when removing self from signal chain. + (_threadinfo::find_tls): Move to cygtls.cc. + (sig_handle): Reorganize detection for thread-specific signals. + * heap.cc (heap_init): Rework slightly. Make fatal error more verbose. + Remove malloc initialization since it can't happen during dll attach. + * init.cc (search_for): Move address to search for on stack here. + (threadfunc_ix): Ditto for stack offset. Make shared so that stack + walk potentially only has to be done once when cygwin processes are + running. + (threadfunc_fe): Use standard tls to store thread function (may change + back later). + (calibration_thread): New function. Potentially called to find + threadfunc_ix. + (munge_threadfunc): Search for "search_for" value on stack. Output + warning when thread func not found on stack. Use standard tls to store + thread function. + (prime_threads): New function. Called to prime thread front end. + (dll_entry): Call dll_crt0_0 here when DLL_PROCESS_ATTACH. Call + prime_threads here. Try to remove thread from signal list here. + * sigproc.cc (wait_sig): Initialize threadlist exception stuff here. + * thread.cc (pthread::exit): Pass argument to signal list remove + function. + * thread.h: Remove obsolete *ResourceLock defines. + + * tlsoffsets.h: Regenerate. + + * winsup.h (spf): Define temporary debug macro to be deleted later. + + * dcrt0.cc (dll_crt0_0): New function, called during DLL + initialization. Mainly consists of code pulled from dll_crt0_1. + (dll_crt0_1): See above. + (_dll_crt0): Wait for initial calibration thread to complete, if + appropriate. Move some stuff to dll_crt0_0. + (initialize_main_tls): Accommodate argument change to + _thread_info::init_thread. + * fork.cc (fork_child): Ditto. + (sync_with_child): Fix debug message. + * external.cc (cygwin_internal): Remove special considerations for + uninitialized dll since initialization happens during dll attach now. + + * dlfcn.cc (dlopen): Remove obsolete *ResourceLock calls. + (dlclose): Ditto. + +2004-01-05 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (init_cygheap::close_ctty): Declare new function. + * cygheap.cc (init_cygheap::close_ctty): Define new function. + * syscalls.cc (close_all_files): Use close_ctty. + (setsid): Ditto. + + * cygthread.cc (cygthread::stub): Remove exception initialization. + * cygthread.cc (cygthread::stub): Remove exception initialization. + (cygthread::simplestub): Ditto. + * thread.cc (pthread::thread_init_wrapper): Ditto. + * cygtls.cc (_last_thread): Make static. + (_threadinfo::call2): Initialize exception handler here. + (_threadinfo::find_tls): Move here. + * exceptions.cc (_threadinfo::find_tls): Move. + + * dcrt0.cc (__api_fatal): Add prefix info to message here rather than + including it in every call to function. + * winsup.h (api_fatal): Accommodate above change. + * debug.cc (add_handle): Don't do anything if cygheap not around. + (mark_closed): Ditto. + + * dll_init.cc (dll_list::detach): Fix debug output. + * fork.cc (sync_with_child): Ditto. + (vfork): Improve debug output. + * heap.cc (heap_init): Ditto. + + * exceptions.cc (try_to_debug): Clarify message when debugger attaches. + +2004-01-03 Christopher Faylor <cgf@redhat.com> + + * exceptions.cc (_threadinfo::interrupt_now): Avoid double call to + sigdelayed. + * pinfo.cc (_pinfo::commune_send): Avoid inexplicable test which caused + most pids to be shown as "<defunct>" on Win9x. + +2004-01-02 Christopher Faylor <cgf@redhat.com> + + * cygheap.h (init_cygheap): Play more vfork shell games and move + ctty_on_hold and open_fhs_on_hold (back) here. + * dcrt0.cc (_dll_crt0): Just set impure_ptr_ptr here and let later + initialization deal with tls. + * dtable.cc (dtable::vfork_child_fixup): Move ctty considerations here. + (dtable:vfork_parent_restore): And here. + * fork.cc (vfork): Reflect change to ctty handling. + * perthread.h (vfork_save::fhctty): Eliminate. + + * cygwin.din: Make more exports NOSIGFE that will never be interrupted + by a signal. + + * init.cc (dll_entry): Set stackptr to NULL to catch problems earlier. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2005 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2005 new file mode 100644 index 000000000..a44ab5832 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2005 @@ -0,0 +1,5813 @@ +2005-12-31 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc (vsyslog): Decrement len if trailing \n has been removed. + Add \n when writing to stderr if LOG_PERROR option is set. + +2005-12-31 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in.h: Drop including stdint.h. Move definition + of in_port_t and in_addr_t to top of file and use throughout. Use + sa_family_t type where appropriate. + (struct in6_addr): Change `unsigned char' to `uint8_t'. + (struct sockaddr_in6): Add sin6_scope_id member. Add comments. + * include/cygwin/socket.h: Include stdint.h. Move definition of + socklen_t to top of file. Define sa_family_t. Define struct + sockaddr_storage as per SUSv3. + * include/sys/un.h: Include cygwin/socket.h. Use sa_family_t type. + +2005-12-29 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Use + strace method rather than accessing field directly. + (fhandler_tty_common::__release_output_mutex): Ditto. + +2005-12-29 Christopher Faylor <cgf@timesys.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. + (child_info::dwProcessId): Delete. + (child_info::straced): New variable. + (child_info::handle_fork): New member function. + * dcrt0.cc (in_forkee): New global variable. + (__cygwin_user_data::forkee): Mark as obsolete. + (do_global_ctors): Use in_forkee rather than user_data->forkee. + (get_cygwin_startup_info): Ditto. Deal with new straced field to allow + strace to deal with children of attached processes. + (initial_env): Accommodate changes to strace::hello. + (child_info_fork::handle_fork): Rename from plain old 'handle_fork'. + Move alloc_stack() call elsewhere. + (dll_crt0_0): Fill out more of user_data. Reference handle_fork via + fork_info. Add some debugging output. + (_dll_crt0): Don't wait for sync thread if sync_startup is invalid. + Zero sync_startup here. Call alloc_stack() here, if appropriate. + (dll_crt0_1): Use in_forkee rather than user_data->forkee. + (dll_crt0): Ditto. + * malloc_wrapper.cc (malloc_init): Ditto. + * dll_init.cc (in_forkee): Remove local static version of this + variable. + (dll_list::load_after_fork): Don't set in_forkee here. + * external.cc (cygwin_internal): Use strace method rather than + accessing field directly. + * fhandler.cc (fhandler_base::read): Ditto. + * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto. + * fork.cc (frok::parent): Invoke strace write_childpid to communicate + with potential strace. + (child_copy): Add more detail to debugging output. + * init.cc (calibration_id): New static variable. + (prime_threads): Set sync_startup to invalid handle if we already know + about thread_func_ix. Use static calibration_id to hold calibration + thread id. + * munge_threadfunc (munge_threadfunc): Don't try to debug if we don't + find threadfunc_ix. + (dll_entry): Avoid calling munge_threadfunc and _cygtls::remove on + non-cygwin threads invoked during process startup. + * pinfo.cc (set_myself): Always call strace.hello here regardless of + DEBUGGING. + * sigproc.cc (child_info::child_info): Remove spurious handling of + dwProcessId. Set straced as appropriate. + * spawn.cc (spawn_guts): Rename ciresrv to ch. Invoke strace + write_childpid to communicate with potential strace. + * strace.cc: Include child_info.h. + (strace::hello): Remove inited test. Use active() method to test if + strace has been activated. Handle case where we are started before + (mypid): New function. + (strace::vsprntf): Try to deal more intelligently with case where + progname may not be filled out. Put pid in parentheses if it is a + windows pid rather than a cygwin pid. myself has been filled out. + (strace::write_childpid): New function for notifying strace about the + creation of children. + (strace::vprntf): Use strace method rather than accessing field + directly. + (strace_printf): Ditto. + (strace::wm): Ditto. + * winsup.h (in_forkee): Declare. + * include/sys/strace.h (strace::write_childpid): Declare new function. + (strace::attached): Define new function. + (strace::active): Ditto. + (strace::active_val): Ditto. + (_STRACE_ON): Delete. + (_STRACE_OFF): Ditto. + (define_strace0): Use strace method rather than accessing field + directly. + (strace_printf_wrap): Ditto. + (strace_printf_wrap1): Ditto. + +2005-12-28 Christopher Faylor <cgf@timesys.com> + + * environ.cc (win_env::add_cache): Don't add variables to the + environment during initialization. + +2005-12-27 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::handle_exceptions): Drop redundant `break'. + +2005-12-27 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (inside_kernel): Rename from interruptible. + Accommodate change throughout file. + +2005-12-27 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (interruptible): New function, code stripped from + _cygtls::interrupt_now. + (_cygtls::handle_exceptions): Handle STATUS_DATATYPE_MISALIGNMENT as + SIGBUS error. Differ between unmapped memory (SEGV_MAPERR) and access + violation (SEGV_ACCERR) in case of STATUS_ACCESS_VIOLATION. Write + kernel log message in case of uncatched STATUS_ACCESS_VIOLATION. + (_cygtls::interrupt_now): Just call interruptible now instead of + evaluating interruptibility here. + +2005-12-27 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Rework loop removing trailing dots + and spaces. + + * syslog.cc (vklog): Set facility to LOG_KERN if not set. + +2005-12-26 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (__api_fatal): Simplify to just use strace mechamisms. + (do_exit): Move minimal_printf... + * pinfo.cc (pinfo::exit): ...into here. + * strace.cc (strace::vprntf): Guarantee output to the console when + system_printf/api_fatal. + + * heap.cc (heap_init): Wait a second before issuing an error when + ERROR_INVALID_ADDRESS since this is probably due to a CTRL-C handler + sneaking in, using the memory that we want to use for the heap, and, + eventually exiting. + +2005-12-23 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::handle_threadlist_exception): Make an error + fatal. + * cygtls.h (sockaddr_in): Use header rather than defining our own + structure. + * exceptions.cc (_cygtls::interrupt_setup): Use exact contents of + sa_mask rather than assuming that current sig should be masked, too. + (_cygtls::call_signal_handler): Use more aggressive locking. + * gendef (_sigbe): Wait until later before releasing incyg. + (_sigreturn): Remove more arguments to accommodate quasi-sa_sigaction + support. + (_sigdelayed): Push arguments for sa_sigaction. More work needed here. + * signal.cc (sigaction): Implement SA_NODEFER. + * tlsoffsets.h: Regenerate. + + * sigproc.cc (wait_sig): Use default buffer size or Windows 9x + complains. + + * pinfo.cc (_onreturn::dummy_handle): Remove. + (_onreturn::h): Make this a pointer. + (_onreturn::~_onreturn): Detect whether pointer is NULL rather than + value is NULL. + (_onreturn::_onreturn): Set h to NULL initially. + (_onreturn::no_close_p_handle): Set h to NULL. + (winpids::add): Initialize onreturn with value from p.hProcess + immediately. + +2005-12-22 Christopher Faylor <cgf@timesys.com> + + * fork.cc (fork): Honor error return from sig_send. Don't continue + with fork if we couldn't suspend signals. + * sigproc.cc (sig_send): Set sigCONT event when we see __SIGNOHOLD. + (wait_sig): Remove holding_signals. Create pipe with a buffer which + will theoretically cause blocking if there is nothing reading on the + pipe. Wait for sigCONT at end of loop when we have a __SIGHOLD. + +2005-12-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::issymlink): New method. + * syscalls.cc (open): Handle O_NOFOLLOW flag. + * include/fcntl.h (_FNOFOLLOW): New define. + (O_NOFOLLOW): Ditto. + * include/cygwin/version.h: Bump API minor number. + +2005-12-22 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (winpids::add): Increment nelem when winpid is true since we + don't care if it's a cygwin process in that case. + +2005-12-22 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (winpids::release): Fix typo. + +2005-12-21 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Clarify comment slightly. + (_onreturn): New helper class. + (winpids:add): Remove copied stuff. Try to put process handle into + pinfo in question and use _onreturn class to control when to close it. + (winpids::release): Remove use of copied array. Free procinfo when + hProcess is NULL. Otherwise call release and call CloseHandle on + hProcess. + * pinfo.h (winpids::copied): Remove throughout class. + +2005-12-21 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Remove spurious low_priority_sleep. + +2005-12-21 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Hide the window whenever ctty == -1, not just + when we have no console. + +2005-12-21 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (init_cygheap::manage_console_count): Revert previous + change. Handle this a different way. + * external.cc (cygwin_internal): Accommodate extra + hook_or_detect_cygwin argument. + * hookapi.cc (cygwin_internal): Fill in subsys variable with the + subsystem of the executable. + * spawn.cc (av::iscui): New variable. + (spawn_guts): Hide window when we don't have a console and this isn't + NT/XP/2003. + (av::fixup): Set iscui flag. + * winsup.h (hook_or_detect_cygwin): Accommodate extra argument. + +2005-12-21 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (init_cygheap::manage_console_count): Don't call + FreeConsole on 9x/Me. + +2005-12-21 Corinna Vinschen <corinna@vinschen.de> + + * (fhandler_disk_file::fchown): Remove execute bits from "sensible" + permissions. Use same setting as in symlink. + +2005-12-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix inode number + debug output. + (fhandler_disk_file::fchown): Always set sensible permission values + when creating the ACL for symlinks. + +2005-12-20 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (flush_file_buffers): Define as inline function. + * miscfuncs.cc (flush_file_buffers): Remove. + +2005-12-20 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (flush_file_buffers): Declare new function. + (FLushFileBuffers): New define. + * miscfuncs.cc (flush_file_buffers): Define new function. + +2005-12-20 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (fhandler_termios::fixup_after_exec): Make non-inlined. + * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Don't call + fixup_after_fork if close_on_exec'ed. + +2005-12-19 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (_cygtls::interrupt_now): Subsume interruptible(). + (interruptible): Delete. + (setup_handler): Remove interruptible call and just use return from + interrupt_now. + +2005-12-19 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (set_console_state_for_spawn): Add an argument to the + declaration. + * fhandler_console.cc (set_console_state_for_spawn): Ditto for the + definition. Only set invisible console for non-cygwin process. Remove + debugging leftover. + * spawn.cc (spawn_guts): Pass argument denoting whether this is a + cygwin process to set_console_state_for_spawn and only call this + function when exec'ing. + +2005-12-19 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fhandler_dev_zero::mmap): Call VirtualFree(MEM_RELEASE) + with zero length parameter, otherwise it fails. + (fhandler_dev_zero::munmap): Ditto. + +2005-12-18 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (fhandler_console::invisible_console): Declare new + variable. + (fhandler_pipe::fixup_in_child): Declare new function. + (fhandler_console::need_invisible): Ditto. + (fhandler_console::has_a): Ditto. + * fhandler_console.cc (set_console_state_for_spawn): Eliminate return + value. Set up an invisible console if necessary prior to spawning. + (fhandler_console::invisible_console): Define. + * fhandler_tty.cc (fhandler_tty_slave::open): Use + fhandler_console::invisible_console to setup an invisible console. + * pipe.cc (fhandler_pipe::fixup_in_child): Define new function from + fixup_after_exec. + (fhandler_pipe::fixup_after_exec): Use fixup_in_child when appropriate. + (fhandler_pipe::fixup_after_fork): Ditto. + * spawn.cc (handle): Reorganize and modernize a little. + (spawn_guts): Rely on set_console_state_for_spawn to set the console + into the right state but don't create the process with "detached" flag + if we have no controlling tty since that confuses 'cmd'. + * dtable.cc (dtable::stdio_init): Don't set console as controlling + terminal if we have an invisible console. + + * sigproc.cc (child_info::sync): Use correct name in ForceCloseHandle1. + +2005-12-18 Christopher Faylor <cgf@timesys.com> + + * include/sys/dirent.h: Change __deprecated_d_ino to __invalid_d_ino + throughout to make things a little clearer. + * dir.cc (readdir_worker): Reflect above change. + +2005-12-16 Christopher Faylor <cgf@timesys.com> + + * winsup.h (child_copy): Change prototype to match new functionality. + * cygheap.cc (cygheap_fixup_in_child): Accommodate new child_copy + arguments. + * dcrt0.cc (dll_data_start): Move definition here from fork. + (dll_data_end): Ditto. + (dll_bss_start): Ditto. + (dll_bss_end): Ditto. + (handle_fork): New function. Called when forked to deal with fork + issues and copy data to this process from the parent. + (dll_crt0_0): Call handle_fork when _PROC_FORK condition. + (dll_crt0): Don't copy user_data when we've forked. Don't zero first + element of main_environment ever. + (cygwin_dll_init): Ditto. + * fork.cc (child_copy): Rename from fork_copy and change arguments so + that each pair of things to copy gets its own descriptor. + (frok::child): Remove fixup_mmaps_after_fork call here. Move to + handle_fork in dcrt0.cc. + (frok::parent): Use child_copy rather than fork_copy and accommodate + changes in parameters. + + * exceptions.cc (setup_handler): Delay test of whether we're locked + until after GetThreadContext has been called since there are apparently + cases where SuspendThread does not cause an immediate thread + suspension. + +2005-12-16 Christopher Faylor <cgf@timesys.com> + + * init.cc (dll_entry): Call prime_threads after dll_crt0_0 to avoid + conflicts between heap allocation and thread stack allocation. + +2005-12-16 Christopher Faylor <cgf@timesys.com> + + * hookapi.cc (putmem): Remove query of previous memory protection since + we get that for free the first time we call VirtualProtect. + +2005-12-15 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fhandler_dev_zero::fixup_mmap_after_fork): Use + system_printf like any other fixup_mmap_after_fork. + +2005-12-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (ACCFLAGS): Remove macro. + (fhandler_base::get_default_fmode): Use O_ACCMODE instead of ACCFLAGS + and or'ed read/write flags. + (fhandler_base::open_9x): Use O_ACCMODE instead of or'ed read/write + flags. + (fhandler_base::open): Ditto. + * fhandler_disk_file.cc (fhandler_base::open_fs): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::open): Ditto. + +2005-12-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open_9x): Handle O_SYNC and O_DIRECT + flags. + (fhandler_base::open): Ditto. + * fhandler_floppy.cc (fhandler_dev_floppy::open): Don't allocate devbuf + in O_DIRECT case. + * fhandler_raw.cc (fhandler_dev_raw::ioctl): Don't allow buffer + changes in O_DIRECT case. Allow returning a buffer size 0, which + indicates O_DIRECT. + * fhandler_tape.cc (fhandler_dev_tape::open): Use O_SYNC flag to + hand down the !buffer_writes case. Don't allocate devbuf in O_DIRECT + case. + (fhandler_dev_tape::raw_read): Don't mess with devbuf if it's NULL. + * include/fcntl.h: Define _FDIRECT, O_DIRECT, O_DSYNC and O_RSYNC. + * include/cygwin/version.h: Bump API minor version. + +2005-12-13 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Don't bother if we're exiting. + * sigproc.cc (_cygtls::remove_wq): Ditto. + +2005-12-13 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty::open): Enhance comment. + +2005-12-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty::open): Close newly created window + station after switching to original window station. + +2005-12-13 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty::open): Add a comment. + +2005-12-12 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::usecs): Subtract from slop from system time or + we'll always end up priming the pump. + +2005-12-12 Nick Duffek <nick@duffek.com> + + * times.cc (systime): Correct precision referenced in comment. + +2005-12-12 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Don't free original + windows station since that will cause strange problems displaying + fonts. Reset windows station to original station after creating + console. + * times.cc (hires_ms::usecs): Only reprime when calculated time is less + than system time. + +2005-12-12 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (winpids::add): Don't copy procinfo when there is no cygwin + process associated with the pid, i.e., procinfo == NULL. + +2005-12-12 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::usecs): Correct order when checking if high + precision time is <= current time. + +2005-12-12 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (size_copied): New convenience macro. + (winpids::add): Alias the element that we are working on for slightly + better clarity. Honor the "make_copy" flag. + (winpids::release): Free and zero procinfo field if it was allocated + via malloc. + (winpids::~winpids): Free copied array. + * pinfo.h (class pinfo): Make winpids class a friend. + (winpids::make_copy): New field. + (winpids::copied): New array. + (winpids::reset): Reset npids after releasing pinfos or suffer a memory + leak. + (winpids::winpids): Try harder to zero all fields in the class. + +2005-12-12 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetSystemTimes): Remove. + +2005-12-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_uptime): Drop usage of GetSystemTimes. + Use NtQuerySystemInformation to evaluate uptime and idle_time from + all CPU's processor times. Fallback to GetTickCount. + +2005-12-12 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (gen_create_protect): Always generate WRITECOPY protection + for private maps. + (fixup_mmaps_after_fork): Fix calculation of WRITECOPY protection for + VirtualProtect. Add some words to the comment. + +2005-12-10 Christopher Faylor <cgf@timesys.com> + + * dirent.h: Change the rest of the d_ino's to __deprecated_d_ino. + +2005-12-10 Christopher Faylor <cgf@timesys.com> + + * malloc.cc: Update to version 2.8.3. + * cygmalloc.h (MSPACE): Remove unneeded definition. + +2005-12-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::ioctl): Only allow 0, 1 or a + multiple of 512 as new buffersize. + +2005-12-08 Pekka Pessi <ppessi@gmail.com> + Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Mask flags with + MSG_WINMASK for Windows socket calls. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendmsg): Ditto. + +2005-12-07 Christopher Faylor <cgf@timesys.com> + + * hires.h (hires_ms::initime_ms): Delete. + (hires_ms::initime_us): Just define as LONGLONG. + (hires_ms::uptime): New function. + * select.cc (select_stuff::wait): Use gtod for timing to attempt to + avoid windows 32 bit wraparound. + * times.cc (systime): New function. + (times): Replace GetTickCount with gtod.uptime. + (hires_us::prime): Use systime() to calculate system time rather than + calling GetSystemTimeAsFileTime directly. + (hires_ms::prime): Ditto. Eliminate initime_ms. + (hires_ms::usecs): Try harder to detect wraparound. + + * fhandler_proc.cc (format_proc_partitions): Set drive_size to zero to + avoid a compiler warning. + +2005-12-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Use modern IOCTLs + to determine drive size as far as possible. + +2005-12-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix INVALID_PARAMETER + condition. Only copy devbuf to buf if buf is non-NULL. + +2005-12-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix setting devbuf + when rd_parm is 0 or 1. + +2005-12-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Fix test for + valid file position at EOM. + +2005-12-07 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/stdlib.h: Guard compilation of *unsetenv* in newlib. + +2005-12-07 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::handle_exceptions): In case of a + STATUS_ACCESS_VIOLATION, check if the page is a mmaped page beyond + a file's EOF. Generate SIGBUS instead of SIGSEGV then. + * mmap.cc (__PROT_ATTACH): New define. + (__PROT_FILLER): Ditto. + (fh_anonymous): Rename from fh_paging_file; + (fh_disk_file): New global static variable. + (attached): New inline function. + (filler): Ditto. + (gen_create_protect): Split off from gen_protect to use the file's + access mode to create mapping always with maximum allowed protections. + (gen_protect): Accommodate pages attached beyond EOF. Use symbolic + values instead of numerics when possible. Drop create parameter. + (gen_access): Use file's access mode instead of protection. + (CreateMapping9x): Create named mapping names so that different + creation access modes result in different mappings. + (CreateMappingNT): Only reserve attached pages, don't commit them. + (MapViewNT): Ditto. Set AT_ROUND_TO_PAGE for all non-NULL base + addresses. + (mmap_func_t): Define CreateMapping and MapView function pointers + with additional openflags parameter. + (class mmap_record): Add openflags member. + (mmap_record::mmap_record): Add openflags parameter. + (mmap_record::get_openflags): New accessor. + (mmap_record::attached): Call global attached function. + (mmap_record::filler): Call global filler function. + (mmap_record::gen_create_protect): Call global gen_create_protect + function. + (mmap_record::gen_protect): Drop create parameter. + (mmap_record::alloc_fh): Set fhandler's access flags. + (list::search_record): Accommodate filler pages. + (list::set): Use inode number as hash value. + (map::get_list_by_fd): Check hash value against file's inode number. + (mmap_is_attached_page): New function to evaluate if a given address + is on a attached page. Called from _cygtls::handle_exceptions. + (mmap_worker): New function to do mapping and bookkeeping in a + single call. + (mmap64): Use roundup2 to round length to pagesize alignment. + Initialize global fhandlers. Simplify anonymous initialization. + Add SUSv3 compatible check of file open mode vs. requested protection. + Try creating new file handles to allow maximum page protection. + Allow creating attached pages in case of mapping beyond EOF. + Close new file handle if one has been created. + (munmap): Align len to pagesize. + (msync): Rework argument checks. Align len to pagesize. + (mprotect): Ditto. Accommodate attached pages. + (mlock): Use roundup/rounddown macros instead of homemade expressions. + (munlock): Add page alignment as in mlock. + (fhandler_dev_zero::munmap): Fix unmapping of non-private mappings. + (fhandler_dev_zero::fixup_mmap_after_fork): Accommodate filler pages. + (fixup_mmaps_after_fork): Don't fail if attached pages couldn't be + created in child. Avoid superfluous call to VirtualFree. Check for + original allocation protection to fix PAGE_WRITECOPY protection. + * ntdll.h: Revert deletion of AT_ROUND_TO_PAGE define. + * winsup.h (mmap_is_attached_page): Declare. + +2005-12-05 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/stdlib.h: New file. + * environ.cc (unsetenv): Change to return -1 on input error. + * include/cygwin/version.h: Add more description to latest api bump. + +2005-12-05 Christopher Faylor <cgf@timesys.com> + + * dir.cc (readdir_workdir): Only fill out d_ino when linked into older + app. + * include/cygwin/version.h: Bump api minor number to 147, reflecting + obsolescence of d_ino. + (CYGWIN_VERSION_USER_API_VERSION_COMBINED): New convenience macro. + (CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): New convenience macro. + * include/sys/dirent.h: Change d_ino field to __deprecated_d_ino. + +2005-12-05 Christopher Faylor <cgf@timesys.com> + + Remove unneeded whitespace. + * cygtls.cc (_cygtls::set_state): Delete. + (_cygtls::reset_exception): Ditto. + (_cygtls::init_thread): Set initialized state directly here. + (_cygtls::push): Remove exception argument. Don't treat exceptions + specially. + * cygtls.h (_cygtls::push): Ditto. + (_cygtls::isinitialized): Don't treat exceptions specially. + (_cygtls::reset_exception): Delete. + (_cygtls::set_state): Ditto. + (_cygtls::handle_exceptions): Don't push ebp on the stack prior to + calling sig_send. Just set incyg instead. + (_cygtls::interrupt_setup): Accommodate _cygtls::push argument change. + (_cygtls::interrupt_now): Ditto. + (setup_handler): Don't treat exceptions specially. + * gendef (longjmp): Always zero incyg flag. + +2005-12-04 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (spenvs): Add "windir" as an "always export" variable + to accommodate WinSock on Windows 95. + +2005-12-02 Christopher Faylor <cgf@timesys.com> + + * include/exceptions.h (exception_list): Revert previous change. + Windows doesn't care. + (exception_handler): Use real exception_list parameter type rather than + void * + * tlsoffsets.h: Regenerate. + * cygtls.h (_cygtls::handle_exceptions): Use real exception_list + parameter type rather than void *. + (handle_threadlist_exception): Ditto. + (init_exception_handler): Ditto. + * cygtls.cc (_cygtls::handle_threadlist_exception ): Ditto. + (_cygtls::init_exception_handler): Add kludge to terminate linked list + with a loop, which seems to solve problem of RtlUnwind causing problems + * exceptions.cc (rtl_unwind): Use real exception_list parameter type + rather than void *. + (_cygtls::handle_exceptions): Ditto. + +2005-12-02 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (_cygtls::el): New field. + (_cygtls::handle_exceptions): New function declaration. + (_cygtls::handle_threadlist_exception): Ditto. + (_cygtls::init_exception_handler): Ditto. + (_cygtls::init_threadlist_exceptions): Remove arg from declaration. + * cygtls.cc (_cygtls::call2): Don't initialize exceptions here. + (_cygtls::init_thread): Do it here instead and use member function. + (_cygtls::handle_threadlist_exception): Move into _cygtls class. + (_cygtls::init_exception_handler): Ditto. Rely on existence of 'el' + memmber in _cygtls. + (_cygtls::init_threadlist_exceptions): Ditto. + * dcrt0.cc (dll_crt0_1): Remove exception_list definition and setting + since it now commonly resides in the tls. + * exceptions.cc (init_exception_handler): Move to cygtls.cc. + (init_exceptions): Ditto. + (rtl_unwind): New, safe wrapper function for RtlUnwind. + (_cygtls::handle_exceptions): Move to _cygtls. Call rtl_unwind to + unwind frames and eliminate copying of structures. Put address of + failing instruction in si_addr, not the address on the stack. Return 0 + to indicate that we've handled this exception. + * external.cc (cygwin_internal): Make CW_INIT_EXCEPTIONS a no-op. + * sigproc.cc (wait_sig): Accommodate argument change to + _cygtls::init_threadlist_exceptions. + * tlsoffsets.h: Regenerate. + * include/exceptions.h (exception_list): Add more stuff to the + exception list. Apparently windows needs this? + (init_exceptions): Remove bogus declaration. + + * include/cygwin/signal.h (SI_USER): Redefine as zero as per SUSv3. + * include/cygwin/version.h: Bump API minor version number to 146. + + * thread.cc (pthread_kill): Set si_pid and si_uid. + + * timer.cc (timer_thread): Set si_code to SI_TIMER. + +2005-12-01 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (getstack): Try harder to modify memory. + (alloc_stack): Alloc page prior to stack top, too. + +2005-12-01 Christopher Faylor <cgf@timesys.com> + + * devices.h (_major): Revert previous ill-advised change. + (_minor): Ditto. + +2005-12-01 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (handle_exceptions): Translate a guard page exception + to a "SIGBUS". + +2005-12-01 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Make debug output more consistently. Fix some comments. + (gen_protect): Convert to inline function. + (gen_access): Ditto. + (mmap_record::gen_protect): Add create parameter as in global function. + (mmap_record::alloc_page_map): Change condition so that always the + correct protection setting is set after mapping has been established. + (mmap64): For anonymous mappings set offset always to 0. + (fixup_mmaps_after_fork): Always call fixup_mmap_after_fork method + with the MAP_FIXED flag set. + +2005-12-01 Christopher Faylor <cgf@timesys.com> + + * devices.h (_minor): Coerce argument to proper type before + manipulating. + (_major): Ditto. + (device::is_fs_special): New function. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set the size to + 0 for devices rather than reporting the size of the symlink. + (fhandler_disk_file::readdir): Use is_fs_special to determine if .lnk + should be stripped. + * path.cc: Rename symlink_info::is_symlink to symlink_info::issymlink + throughout. + (symlink_info::isdevice): New field. + (path_conv::check): Use 'isdevice' to determine if just-parsed entity + is a device rather than relying on non-zero major/minor. + (symlink_info::parse_device): Set isdevice to true if we've discovered + a device. + (symlink_info::check): Clear isdevice field prior to processing. Use + isdevice to control debugging output. + (symlink_info::set): Set isdevice to false. + * path.h (path_conv::is_fs_special): New function. + * devices.cc: Regenerate. + +2005-11-30 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::prime): Remove debugging stuff. + (hires_ms::usecs): Ditto. + +2005-11-30 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (list::try_map): New method, implementing trying to map + within another already existing map, moved from mmap64 here. + (mmap64): Just call try_map now. + (fhandler_dev_zero::fixup_mmap_after_fork): Always create new private + map with PAGE_READWRITE protection. + (fixup_mmaps_after_fork): Fix comment. + +2005-11-29 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump API minor version. + +2005-11-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_zero::mmap): Add method. + (fhandler_dev_zero::munmap): Ditto. + (fhandler_dev_zero::msync): Ditto. + (fhandler_dev_zero::fixup_mmap_after_fork): Ditto. + * mmap.cc: Implement anonymous mapping using fhandler_dev_zero class. + Implement private anonymous maps using VirtualAlloc/VirtualFree. Fix + or add some more comments. + (fh_paging_file): Change to type fhandler_dev_zero. + (priv): New static inline function to avoid having lots of flag bit + tests in the code. Use throughout were appropriate. + (fixed): Ditto. + (anonymous): Ditto. + (noreserve): Ditto. + (autogrow): Ditto. + (gen_protect): Never generate PAGE_WRITECOPY protection for + private anonymous maps. + (gen_access): Drop FILE_MAP_EXECUTE handling since it's not supported + correctly on 9x. + (VirtualProt9x): Move comment from mmap64 here. + (mmap_record::mmap_record): Gegerate correct device entry for + anonymous maps, though unused right now. + (mmap_record::priv): Call global priv function. + (mmap_record::fixed): Call global fixed function. + (mmap_record::anonymous): Call global anonymous function. + (mmap_record::noreserve): Call global noreserve function. + (mmap_record::autogrow): Call global autogrow function. + (list::anonymous): New method. Use throughout were appropriate. + (mmap_record::compatible_flags): Drop now useless ifdef. + (mmap_record::alloc_page_map): Accommodate private anonymous maps. + (mmap_record::map_pages): Accommodate MAP_NORESERVE mappings. + (mmap_record::unmap_pages): Accommodate private anonymous maps. + (mmap64): Simplify argument check. Don't remove the MAP_PRIVATE flag + for anonymous mappings on 9x anymore since that's now handled + gracefully. + (mprotect): Accommodate MAP_NORESERVE mappings. Fix case when + non-mmap areas are just MEM_RESERVEd. + (fhandler_dev_zero::mmap): Implement anonymous mapping here. + (fhandler_dev_zero::munmap): Ditto. + (fhandler_dev_zero::msyn): Ditto. + (fhandler_dev_zero::fixup_mmap_after_fork): Ditto. + (fixup_mmaps_after_fork): Accommodate private anonymous maps. Enhance + debug output in case VirtualProtect fails. + * include/sys/mman.h: Really define MAP_NORESERVE now. + +2005-11-28 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtCreateSection): Define. + * cygheap.cc (_csbrk): Call getpagesize instead of getshmlba. + * dcrt0.cc (dll_crt0_0): Call mmap_init. + * external.cc (cygwin_internal): Call getpagesize instead of getshmlba. + * fhandler.h (fhandler_base::mmap): Change access to prot parameter. + (fhandler_base::fixup_mmap_after_fork): Ditto. + (fhandler_disk_file::mmap): Ditto. + (fhandler_disk_file::fixup_mmap_after_fork): Ditto. + (fhandler_dev_mem::mmap): Ditto. + (fhandler_dev_mem::fixup_mmap_after_fork): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::write): Call getsystempagesize + instead of getpagesize. + (fhandler_dev_mem::read): Ditto. + (fhandler_dev_mem::fstat): Ditto. + (fhandler_dev_mem::mmap): Move to mmap.cc. + (fhandler_dev_mem::munmap): Ditto. + (fhandler_dev_mem::msync): Ditto. + (fhandler_dev_mem::fixup_mmap_after_fork): Ditto. + * fhandler_proc.cc (format_proc_meminfo): Call getsystempagesize + instead of getpagesize. + * fhandler_process.cc (format_process_stat): Ditto. + (format_process_status): Ditto. + (get_mem_values): Ditto. + * mmap.cc: Fix formatting. Try to make more readable and modular. + Take advantage of pagesize==granularity. + (gen_protect): New static function to evaluate Windows + protection bits from POSIX protection and flags. + (gen_access): Ditto for Windows access mode. + (VirtualProt9x): Wrapper function to call VirtualProtect on 9x. + (VirtualProtNT): Ditto for NT. + (VirtualProtEx9x): Ditto for VirtualProtectEx on 9x. + (VirtualProtExNT): Ditto for NT. + (CreateMapping9x): Wrapper function for creating a mapping handle on 9x. + (CreateMappingNT): Ditto for NT. + (MapView9x): Wrapper function to map a view on 9x. + (MapViewNT): Ditto for NT. + (mmap_funcs_9x): Structure containing function pointers to wrapper + functions for 9x. + (mmap_funcs_nt): Ditto for NT. + (mmap_func): Pointer to wrapper functions used in subsequent code. + (mmap_init): Initialize mmap_func depending on OS. + (class mmap_record): Use sensible member names. Add POSIX protection + member. Drop Windows access flags member. Constify more methods. + Use accessors instead of direct member access inside of own methods. + (mmap_record::gen_protect): Class wrapper to evaluate matching + Windows protection bits. + (mmap_record::gen_access): Ditto for Windows access flags. + (mmap_record::compatible_flags): New function to check if flags are + compatible with flags of existing map. + (list::add_record): Drop offset and length arguments. + (class map): Change counters to unsigned. Match usage throughout. + (mmapped_areas): Convert from pointer to global struct. + (mmap_record::alloc_page_map): Simplify. + (mmap_record::map_pages): Ditto. + (mmap_record::fixup_page_map): Delete. + (mmap64): Simplify. Add workaround for Windows 98 bug. Fix bug on + NT that existing anonymous mappings weren't searched for a match. + (munmap): Add workaround for Windows 98 bug. + (msync): Simplify. + (mprotect): Handle existing maps correctly. + (mlock): Add local pagesize variable and enlightening comment. + (fhandler_disk_file::mmap): Main functionality now in CreateMapping/ + MapView wrapper functions. + (fhandler_disk_file::fixup_mmap_after_fork): Call MapView wrapper. + (fhandler_dev_mem::mmap): Moved from fhandler_mem.cc. Simplify by + calling MapViewNT. + (fhandler_dev_mem::munmap): Moved from fhandler_mem.cc. + (fhandler_dev_mem::msync): Ditto. + (fhandler_dev_mem::fixup_mmap_after_fork): Ditto. Call MapViewNT. + (fixup_mmaps_after_fork): Restructure and hopefully speed up loop for + setting protection and memory content on MAP_PRIVATE maps. + * ntdll.h (AT_ROUND_TO_PAGE): Remove define. + (AT_EXTENDABLE_FILE): Add define. + (NtCreateSection): Add prototype. + * syscalls.cc (getpagesize): Return granularity as pagesize now. + (getsystempagesize): New function to retrieve "real" pagesize. + (getshmlba): Delete since it's replaced by getpagesize now. + * wincap.h (wincaps::has_mmap_alignment_bug): New element. + * wincap.cc: Implement above element throughout. + * winsup.h (getshmlba): Drop prototype. + (getsystempagesize): Add prototype. + (mmap_init): Ditto. + * include/sys/mman.h: (Not yet) define MAP_NORESERVE. + +2005-11-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't rely on + has_acl() state for evaluating inodes. Temporarily(?) enable "real" + inodes for remote drives. + +2005-11-25 Christopher Faylor <cgf@timesys.com> + + * heap.cc: Remove spurious getpagesize declaration. + +2005-11-25 Christian Franke <Christian.Franke@t-online.de> + + * exceptions.cc (ctrl_c_handler): Distinguish CTRL-BREAK from CTRL-C in + some cases. + +2005-11-23 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Reset the current windows + station whenever ctty == -1 regardles of whether there's a windows + station already assigned. Close the old windows station in this + situation. + * pinfo.cc (_pinfo::set_ctty): Reinstate incrementing of console count + when recording ctty so that the current tty is always around. + * autoload.cc (CloseWindowStation): Define. + +2005-11-18 Christopher Faylor <cgf@timesys.com> + + * strptime.cc (_strptime): Fix gcc warnings. + +2005-11-18 Christopher Faylor <cgf@timesys.com> + + * memmem.cc: Move from here. + * lib/memmem.cc: Move to here. + +2005-11-18 Corinna Vinschen <corinna@vinschen.de> + + * libc: Add subdirectory. + * Makefile.in (VPATH): Add libc subdir. + (DLL_OFILES): Add strptime.o and timelocal.o. + * cygwin.din: Export timelocal and timegm. + * localtime.cc: Define STD_INSPIRED unconditionally. + * include/cygwin/time.h (timelocal): Add declaration. + (timegm): Ditto. + * include/cygwin/version.h: Bump API minor version. + * libc/strptime.cc: New file. + * libc/timelocal.cc: New file. + * libc/timelocal.h: New file. + +2005-11-18 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/sys_time.h: Move futimes and lutimes declaration here + from newlib. + +2005-11-18 Christopher Faylor <cgf@timesys.com> + + * times.cc (timezone): Put back (void). + * include/cygwin/time.h: Add more cygwin stuff from newlib. + +2005-11-18 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/sys_time.h: Rename from include/cygwin/time.h. + * include/cygwin/time.h: New file. + +2005-11-17 Christopher Faylor <cgf@timesys.com> + + * fork.cc (fork): Move top-of-stack calculation later. + + * pinfo.cc (_pinfo::set_ctty): Use __ctty to print current console in + debugging output. + +2005-11-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::open): Don't expect that + service applications have no window station attached. + +2005-11-16 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::prime): Don't escalate the priority. + +2005-11-14 Christopher Faylor <cgf@timesys.com> + + * include/sys/elf64.h: Fix types to reflect linux usage. + +2005-11-14 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <cgf@timesys.com> + + * fhandler.h (fhandler_console::fixup_after_fork_exec): Define with + additional bool parameter. + (fhandler_console::fixup_after_exec): Accommodate + fixup_after_fork_exec's parameter. + (fhandler_console::fixup_after_fork): Ditto. + * fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Avoid + opening new console only when close_on_exec AND execing. + +2005-11-14 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (fhandler_console::fixup_after_fork_exec): Declare new function. + (fhandler_console::fixup_after_fork): Use fixup_after_fork_exec. + (fhandler_console::fixup_after_exec): Ditto. + * fhandler_console.cc (fhandler_console::fixup_after_fork): Delete definition. + (fhandler_console::fixup_after_fork_exec): Rename from fixup_after_exec. + * pinfo.cc (_pinfo::set_ctty): Don't play with console count here. + * syscalls.cc (close_all_files): Don't close cygheap ctty if hExeced + since the child will be copying information from us. + (setsid): Use myctty() rather than raw ctty #. + +2005-11-13 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (init_cygheap::manage_console_count): Declare new function. + (init_cygheap::console_count): Renamed from open_fhs. Make private. + * cygheap.cc (init_cygheap::manage_console_count): Define new function. + * dtable.cc (dtable::fixup_after_exec): Always call fixup_after_exec on + elements of fd even when they are about to be closed. + * fhandler.h (report_tty_counts): Remove open_fhs from debugging + output. + * fhandler_console.cc (fhandler_console::open): Use + manage_console_count rather than manipulating count directly. + (fhandler_console::close): Ditto. + (fhandler_console::fixup_after_fork): Ditto. + (fhandler_console::fixup_after_exec): Ditto. Don't close handles if + close_on_exec. + * fhandler_tty.cc (fhandler_tty_slave::open): Use + manage_console_count() rather than manipulating count directly. + Reflect change in arguments to report_tty_counts(). + (fhandler_tty_slave::close): Ditto for both. + (fhandler_tty_slave::dup): Ditto for both. + (fhandler_tty_slave::ioctl): Use myctty() rather than raw ctty #. + (fhandler_tty_slave::fixup_after_fork): Reflect change in arguments to + report_tty_counts(). + (fhandler_tty_master::init_console): Use manage_console_count() rather + than manipulating count directly. + * fhandler_clipboard.cc (fhandler_dev_clipboard::fixup_after_exec): + Don't perform any operations if close_on_exec. + * fhandler_dsp.cc (fhandler_dev_dsp::fixup_after_exec): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::fixup_after_exec): Ditto. + * fhandler_serial.cc (fhandler_serial::fixup_after_exec): Ditto. + * pinfo.h (_pinfo::_ctty): Declare new function. + (myctty): Declare new macro. + (__ctty): Declare new macro. + * pinfo.cc (_pinfo::_ctty): Define new function. + (_pinfo::set_ctty): Use manage_console_count() rather than manipulating + count directly. + * signal.cc (kill_pgrp): Use myctty() and __ctty() macros rather than + raw ctty #. + * syscalls.cc (setsid): Ditto. Use manage_console_count() rather than + manipulating count directly. + +2005-11-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Just return 0 (EOF) + in case of WSAESHUTDOWN. + (fhandler_socket::recvmsg): Ditto. + * poll.cc (poll): Set revents to POLLIN instead of POLLHUP. Add comment. + +2005-11-11 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (init_cygheap::_gtod): Remove. + * cygwin.din: Export clock_getres and clock_setres. + * hires.h (hires_ms::minperiod): Delete declaration. + (hires_ms::began_period): Ditto. + (hires_ms::prime): Make void. + (hires_ms::resolution): Just define here. + (hires_ms::usecs): Remove unneeded argument. + (gtod): Redeclare as a variable. + * timer.cc (timer_thread): Eliminate argument to gtod.usecs(). + (timer_tracker::gettime): Ditto. + (timer_tracker::settime): Ditto. + * times.cc (gettimeofday): Ditto. + (hires_ms::began_period): Delete declaration. + (hires_us::prime): Remove debugging. + (hires_ms::prime): Make void. Eliminate period stuff. + (hires_ms::usecs): Eliminate argument to gtod.usecs(). + (hires_ms::resolution): New function. + (clock_getres): Ditto. + (clock_setres): Ditto. + * version.h: Bump API version to 143. + * include/cygwin/time.h: New file. + +2005-11-10 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::prime): Comment out call to timeBeginPeriod for + now. + (hires_ms::usecs): Call prime if haven't called began_period(). + + * param.h: Don't define stuff that is already defined in endian.h. + +2005-11-10 Christopher Faylor <cgf@timesys.com> + + * include/endian.h: Remove USE_BSD ifdef since it is never defined on + Cygwin. + +2005-11-10 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc (setlogmask): Don't mask the mask. + (vsyslog): Fix priority check. + +2005-11-10 Scott Finneran <scottf@pacom.com> + + * include/cygwin/signal.h: Add missing sigrelse prototype. + +2005-11-08 Christopher Faylor <cgf@timesys.com> + + * fhandler_base.cc (fhandler_base::readv): Free buf, not a pointer into + the middle of buf. + +2005-11-08 Christopher Faylor <cgf@timesys.com> + + * memmem.cc: New file. + * include/cygwin/version.h: Bump API version number to 142. + * cygwin.din: Export memmem. + * Makefile.in: Build memmem.o. + +2005-11-08 Christopher Faylor <cgf@timesys.com> + + * environ.cc (spenvs): Make "SYSTEMDRIVE" an "always export". + +2005-11-07 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (futimes): Redirect to utimes_worker if given file + descriptor is opened R/O. + +2005-11-06 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Initialize security data first so that it can + be used by subsequent handle creation. + +2005-11-04 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (init_cygheap::_gtod): New hires_ms element. + * hires.h (hires_ms::minperiod): Remove static designation. + (hires::began_period): New field. + * signal.cc: Include headers required for cygheap.h now that gtod lives + in the cygheap. + * timer.c: Ditto. + * times.cc (gtod): Delete variable. + (gtod::minperiod): Ditto. + (gtod::began_period): Define. + (hires_ms::prime): Add more debugging output. Call timeBeginPeriod + only when !began_period. + +2005-11-04 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::prime): More debugging. + (hires_ms::usecs): Ditto. + +2005-11-03 Christopher Faylor <cgf@timesys.com> + + * times.cc (stupid_printf): Define and use throughout -- temporarily. + +2005-11-03 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::prime): Add lots of temporary debugging output. + +2005-11-02 Christopher Faylor <cgf@timesys.com> + + * times.cc (hires_ms::minperiod): Make copy-on-fork. + (gettimeofday): Remove temporary debugging. + (hires_us::prime): Add lots of temporary debugging output. + +2005-11-02 Christopher Faylor <cgf@timesys.com> + + * times.cc (gettimeofday): Add temporary debugging output. + +2005-11-01 Christopher Faylor <cgf@timesys.com> + + * include/sys/cygwin.h: Define CYGWIN_SIGNAL_STRING. + * exceptins.cc (sigpacket::process): Send a _CYGWIN_SIGNAL_STRING to + gdb if the process is being debugged. A WIP. + +2005-10-29 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (signal_exit): Eliminate setting of main thread + priority since process lock should make that unnecessary. + * fork.cc (stack_base): Eliminate. + (frok::parent): Subsume stack_base and just set stack stuff here. + Report on priority class in debugging output. + * spawn.cc (spawn_guts): Report on priority class in debugging output. + +2005-10-29 Christopher Faylor <cgf@timesys.com> + + * fork.cc (frok::child): Change order of cleanup prior to return. + (fork): Save more of the stack. + + * gendef: Fix some comments. + + * sigproc.cc (wait_sig): Clarify debug output. + +2005-10-29 Christopher Faylor <cgf@timesys.com> + + * child_info.h (CHILD_INFO_MAGIC): Reset. + +2005-10-24 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (_pinfo::fds): Lock fdtab while enumerating. + +2005-10-24 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Don't leave the function with return inside + pthread cleanup brackets. + +2005-10-24 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (cygheap_fdenum): Remove start_fd stuff. + (cygheap_fdenum::rewind): Ditto. + * pipe.cc (fhandler_pipe::open): Lock fdtab while enumerating. + * times.cc (utimes_worker): Ditto. + +2005-10-23 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (cygheap_fdenum::cygheap_fdenum): Record locked state or + suffer deadlocks. + (class locked_process): Move to another header. + * sync.h (lock_process): Define here. + * cygtls.cc (_cygtls::fixup_after_fork): Reset spinning state as well + as stacklock state. + * dcrt0.cc (lock_process::locker): Define. + (dtable::lock_cs): Delete. + (dll_crt0_0): Initialize process lock here ASAP. + * dtable.cc (dtable_init): Eliminate call to init_lock(). + (dtable::fixup_after_fork): Ditto. + (dtable::init_lock): Delete definition. + * dtable.h (dtable::init_lock): Delete declaration. + (dtable::lock): Use process lock rather than dtable-specific lock. + (dtable::unlock): Ditto. + + * sigproc.cc (sigproc_init): Minor change to debugging output. + + * times.cc (utime_worker): Use build_fh_pc rather than reinterpreting + the posix path name again. Return any error from path_conv immediately. + +2005-10-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::connect): Don't restrict + WSAEINVAL -> WSAEISCONN conversion to nonblocking sockets. + (fhandler_socket::accept): Use event driven technique to implement + interuptible accept. + (fhandler_socket::wait): Allow FD_ACCEPT handling. + * net.cc (cygwin_accept): Remove workaround for allowing blocking + accept. That's entirely in fhandler_socket::accept now. + +2005-10-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add timeout parameter to wait() + method. + * fhandler_socket.cc (fhandler_socket::connect): Use event driven + technique (prepare/wait/release) to implement interuptible connect. + (fhandler_socket::wait): Add timeout parameter. Allow FD_CONNECT + handling. + * net.cc (cygwin_connect): Remove braindead workaround for allowing + blocking connect. That's entirely in fhandler_socket::connect now. + +2005-10-22 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Fix typo. + +2005-10-21 Christopher Faylor <cgf@timesys.com> + + * dir.cc (rmdir): Eliminate nonsensical code. + + * fork.cc (fork): Move exit debug_printf to last statement. + +2005-10-20 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (futimes): Export. + (lutimes): Export. + * times.cc (utimes_worker): Created from utimes, add nofollow flag + to implement utimes and lutimes. + (utimes): Just call utimes_worker. + (lutimes): New function. + (futimes): Ditto. + * include/cygwin/version.h: Bump API minor version. + +2005-10-19 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (child_info::sync): Move check for !wr_proc_pipe lower. + * spawn.cc (spawn_guts): Correct check for top-level process. + +2005-10-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Revert loading rcmd, rexec, rresvport and inet_network + from wsock32.dll since these symbols are not exported from ws2_32.dll. + +2005-10-19 Christopher Faylor <cgf@timesys.com> + + * times.cc (utimes): Only consider fds opened with write access. + +2005-10-19 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_base::utimes_fs): Use existing handle + if fhandler has one. + * times.cc (utimes): Scan open fds for matching paths and use existing + fhandler if one exists. + +2005-10-19 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (_pinfo::dup_proc_pipe): Make warning more severe by + actually printing it. + (_pinfo::alert_parent): Fix comment. Don't send to parent if we are in + an exec stub. + +2005-10-18 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (handle_threadlist_exception): Improve diagnostic output. + + * sigproc.cc (child_info::sync): Only clear hProcess when execing. + (wait_sig): Protect readsig handle. + +2005-10-18 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtLockVirtualMemory): Import. + (NtUnlockVirtualMemory): Import. + (GetProcessWorkingSetSize): Import. + (SetProcessWorkingSetSize): Import. + * cygwin.din (mlock): Export. + (munlock): Export. + * mmap.cc (mlock): New function. + (munlock): Ditto. + * ntdll.h (STATUS_WORKING_SET_QUOTA): Define. + (LOCK_VM_IN_WSL): Define. + (LOCK_VM_IN_RAM): Define. + (NtLockVirtualMemory): Declare. + (NtUnlockVirtualMemory): Declare. + * sysconf.cc (sysconf): Implement _SC_MEMLOCK_RANGE. + * wincap.h: Implement has_working_virtual_lock throughout. + * wincap.cc: Ditto. + * include/cygwin/version.h: Bump API minor version. + * include/sys/mman.h (mlock): Declare, + (munlock): Declare. + +2005-10-18 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (child_info::sync): Use correct name when closing to + prevent warnings when DEBUGGING. + * spawn.cc (spawn_guts): Set myself.hProcess to pi.hProcess since this + may have been zeroed by the previous sync. + +2005-10-18 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (child_info::sync): Fix typo which caused hProcess to + never be cleared. Only clear hProcess when not forking. + +2005-10-17 Christopher Faylor <cgf@timesys.com> + + Change process_lock to lock_process throughout. + Change all calls to new cygthread to handle extra argument, throughout. + * cygthread.h (cygthread::callproc): Declare new method. + (cygthread::cygthread): Add optional length argument to allow copying + arguments to executing thread. + * cygthread.cc (cygthread::callproc): Define new method. + (cygthread::stub): Use callfunc to invoke thread func to allow + potentially allocating stack memory which will be returned. + (cygthread::simplestub): Ditto. + (cygthread::cygthread): Accept arglen argument. Reset ev here prior to + activating thread. Wait for ev after activating thread if we're + copying contents to the thread. Wait until the end before setting h, + to allow thread synchronization. + (cygthread::release): Don't reset ev here. Rely on that happening the next + time the thread is activated. + * pinfo.h (commune_process): Rename declaration from _pinfo::commune_process. + * pinfo.cc (commune_process): Ditto for definition. Modify slightly to allow + running as a separate cygthread. + * sigproc.cc (child_info::sync): Always wait for both subproc_ready and + any hProcess if we have a cygwin parent. + (talktome): Change argument to be a pointer to siginfo_t. Contiguously + allocate whole siginfo_t structure + any needed extra for eventual passing + to commune_process thread. + (wait_sig): Accommodate change in talktome argument. + + * pipe.cc (fhandler_pipe::fixup_after_exec): Remove debugging. + +2005-10-17 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Never load wsock32.dll. Load all wsock32 function + from ws2_32. Rearrange symbol order accordingly. None of the ws2_32 + functions is optional right now. + (wsadata): Move from net.cc here. Define NO_COPY. + (wsock_init): Drop unused symbols ws2_32_handle and wsock32_handle. + (load_wsock32): Remove. + (WSACleanup): Remove. + * fhandler_socket.cc: Drop Winsock 1 accommodations throughout. + (fhandler_socket::readv): Accommodate new POSIX style struct msghdr. + (fhandler_socket::writev): Ditto. + (fhandler_socket::recvmsg): Ditto. Handle "old" applications using + former struct msghdr correctly. + * net.cc: Drop Winsock 1 accommodations throughout. + (wsadata): Move definition to autoload.cc. + (set_socket_inheritance): Remove. + (convert_ws1_ip_optname): New static function to convert Winsock1 + IPPROTO_IP option values into Winsock2 IPPROTO_IP option values. + (cygwin_setsockopt): Remove wrong and incomplete cleartext printing + of optname. For "old" applications, convert optname from Winsock1 + to Winsock2 values before using them. Add comment to describe the + IP_TOS weirdness on W2K and above. + (cygwin_getsockopt): Remove wrong and incomplete cleartext printing + of optname. For "old" applications, convert optname from Winsock1 + to Winsock2 values before using them. + * select.cc (start_thread_socket): Forget about winsock2_active. + * winsup.h (wsock32_handle): Remove declaration. + (ws2_32_handle): Ditto. + (netapi32_handle): Ditto. + (wsadata): Ditto. + (winsock2_active): Remove definition. + * include/cygwin/socket.h: Change formatting slightly. + (socklen_t): Move definition up in file. + (struct msghdr): Convert to POSIX style. + (struct cmsghdr): New type. + (CMSG_ALIGN): New macro. + (CMSG_LEN): Ditto. + (CMSG_SPACE): Ditto. + (CMSG_FIRSTHDR): Ditto. + (CMSG_NXTHDR): Ditto. + (CMSG_DATA): Ditto. + (SCM_RIGHTS): Ditto. + (struct OLD_msghdr): Define old msghdr structure for Cygwin internal + purposes. + (MSG_TRUNC): New macro. + (MSG_CTRUNC): Ditto. + (IP_OPTIONS): Redefine IPPROTO_IP option values to Winsock2 values. + Keep Winsock1 values for Cygwin internal purposes. + * include/cygwin/version.h: Bump API minor version. + (CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR): Define to check for + applications using old struct msghdr. + (CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES): Define to check for + applications using old Winsock1 IPPROTO_IP values. + +2005-10-13 David Rothenberger <daveroth@acm.org> + Christopher Faylor <cgf@timesys.com> + + * Makefile.in (MKDIRP): Just use raw $(INSTALL) rather than + $(INSTALL_DATA). Create directories with 755 permissions. + +2005-10-12 Christopher Faylor <cgf@timesys.com> + + * dir.cc (mkdir): Abandon use of PC_WRITABLE. + (rmdir): Ditto. + * path.h (PC_WRITABLE): Delete. + * path.cc (path_conv::check): Remove PC_WRITABLE accommodations. + Revisit later. + +2005-10-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Convert an + ERROR_INVALID_FUNCTION into an ERROR_FILE_NOT_FOUND. Add comment + to explain why. + +2005-10-11 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Make sure that directories are created prior to copying + to them. + +2005-10-11 Christopher Faylor <cgf@timesys.com> + + * net.cc (cygwin_gethostbyname): Remove debugging. + +2005-10-11 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc (try_connect_syslogd): Add priority parameter. Use writev + to add the priority to the message in a syslog conformant way. + (vsyslog): If facility isn't set in the priority, use default facility + as given in call to openlog. Fix agressive use of spaces in syslog + output. Call try_connect_syslogd with priority parameter. + +2005-10-11 Christopher Faylor <cgf@timesys.com> + + * (symlink_info::set_error): Change to return bool if input error + should be ignored. + (symlink_info::check): Treat path as a normal file if set_error returns + false. + +2005-10-03 Christopher Faylor <cgf@timesys.com> + + * cygheap.h (class process_lock): New class. + * dtable.h (class dtable): Add class process_lock as a friend. + * dcrt0.cc (get_exit_lock): Delete. + (do_exit): Use process_lock class instead of get_exit_lock. + * exceptions.cc (signal_exit): Ditto. + * pinfo.cc (pinfo::exit): Ditto. + (_pinfo::commune_process): Set process lock around this whole function. + (_pinfo::commune_request): Use process_lock rather than myself.lock. + * pinfo.h (pinfo::_lock): Delete. + (pinfo::initialize_lock): Delete. + (pinfo::lock): Delete. + (pinfo::unlock): Delete. + * winsup.h (get_exit_lock): Delete declaration. + +2005-10-03 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Disable use of GetNativeSystemInfo. + +2005-10-01 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (get_exit_lock): Use myself.lock rather than exit_lock. + * exceptions.cc (exit_lock): Delete. + (events_init): Don't init exit_lock. + * (_pinfo::commune_process): Add per-PICOM debugging. + * sigproc.cc (talktome): Add some temporary debugging statements. + + * fhandler_proc.cc (format_proc_cpuinfo): Cosmetic change. + (format_proc_partitions): Ditto. + * syscalls.cc (locked_append): Ditto. + +2005-09-30 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (do_exit): Don't set ES_SET_MUTO here. Call get_exit_lock() + instead. + (get_exit_lock): New function. Grabs the lock and sets initial + exit_state. + * exceptions.cc (try_to_debug): Use low_priority_sleep. + (sigpacket::process): Avoid handler if this is an exec stub. + (signal_exit): Use get_exit_lock rather than manipulating the exit_lock + critical section directly. + * pinfo.cc (pinfo::exit): Ditto. + * winsup.h (get_exit_lock): Declare. + (exit_lock): Delete declaration. + +2005-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc: Change calls to pc.set_attributes into + calls to pc.file_attributes throughout. + * path.h (class path_conv): Remove superfluous set_attributes method. + +2005-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Use + fhandler method to access major device number. Add comment to + explain floppy weirdness. + +2005-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Also use + attributes stored in this->pc if call to GetFileInformationByHandle + failed. + +2005-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Only write + attributes if call to GetFileInformationByHandle was successful. + +2005-09-29 Christopher Faylor <cgf@timesys.com> + + * fork.cc (frok::parent): Simplify error messages. Don't issue an + error when child.remember fails. + (fork): When appropriate, build up an error message from grouped.error. + +2005-09-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Don't call + EX ioctls on floppy drives. + +2005-09-29 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (mkdir): Check for trailing /. or /.. component. + (rmdir): Ditto. + * path.cc (has_dot_last_component): New function. + * path.h (has_dot_last_component): Add declaration. + +2005-09-29 Corinna Vinschen <corinna@vinschen.de> + + * crt0.cc: Remove PPC considerations. + (WinMainCRTStartup): Add symbol as alias to mainCRTStartup. + +2005-09-28 Christopher Faylor <cgf@timesys.com> + + Change name from commune_recv to commune_process throughout. + Change name from commune_send to commune_request throughout. + * pinfo.h (PICOM_EXTRASTR): New flag. + (PICOM_FIFO): Define with new flag. + (_pinfo::hello_pid): Delete. + (_pinfo::tothem): Delete. + (_pinfo::fromthem): Delete. + (_pinfo::commune_process): Rename from commune_recv. Add a siginfo_t + argument to declaration. + (_pinfo::commune_request): Rename from commune_send. Change DWORD to + __uint32_t in declaration. + * pinfo.cc (_pinfo::commune_process): Rename from commune_recv. Add + siginfo_t argument. Use information from argument rather than reading + from another pipe. Synchronize with other process's commune event. + (_pinfo::commune_request): Rename from commune_send. Change DWORD to + __uint32 in argument. Fill out information in new siginfo_t element + and rely on extended operation of sig_send rather than trying to deal + with synchronization issues here. Use process handle and read pipe + information filled out by sig_send to gather information from the other + process. + * sigproc.cc (sig_send): Take special action if "communing" to ensure + synchronization with the other process and to return information about + the other process to the caller. + (talktome): Accept a siginfo_t and handle arguments. Read additional + information from the signal pipe when _si_commune._si_code has the + PICOM_EXTRASTR flag set. + (wait_sig): Pass the transmitted siginfo_t struct and the pipe handle + to talktome. Close pipe read handle as soon as possible after we + detect that we're exiting. + +2005-09-28 Christopher Faylor <cgf@timesys.com> + + * hookapi.cc (hook_or_detect_cygwin): Correct inverted test for whether + to allocate a buffer by always allocating a buffer. + +2005-09-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_raw): Delete current_position and + eof_detected status flag. Delete is_eom and is_eof methods. + Move drive_size, bytes_per_sector, eom_detected status flag, as well + as the methods read_file, write_file, raw_read and raw_write to ... + (class fhandler_dev_floppy): ... here. Remove is_eom and is_eof + methods. Add dup method. + * fhandler_floppy.cc (IS_EOM): New macro. + (fhandler_dev_floppy::is_eom): Remove. + (fhandler_dev_floppy::is_eof): Remove. + (fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags. + (fhandler_dev_floppy::get_drive_info): Only call EX functions on + systems supporting them and stop suffering strange delays. + (fhandler_dev_floppy::read_file): Move here, drop setting + current_position. + (fhandler_dev_floppy::write_file): Move here, drop setting + current_position. + (fhandler_dev_floppy::open): Rearrange comment. + (fhandler_dev_floppy::dup): New method. + (fhandler_dev_floppy::get_current_position): New inline method. Use + instead of former current_position were appropriate. + (fhandler_dev_floppy::raw_read): Move here. Drop EOF handling. + (fhandler_dev_floppy::raw_write): Move here. Drop EOF handling. + (fhandler_dev_floppy::lseek): Remove useless conditions. Convert + sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call. + (fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case + to here. + * fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove. + (fhandler_dev_raw::is_eof): Remove. + (fhandler_dev_raw::write_file): Remove. + (fhandler_dev_raw::read_file): Remove. + (fhandler_dev_raw::raw_read): Remove. + (fhandler_dev_raw::raw_write): Remove. + (fhandler_dev_raw::dup): Drop copying removed members. + (fhandler_dev_raw::ioctl): Drop blocksize testing. + * wincap.h: Implement has_disk_ex_ioctls throughout. + * wincap.cc: Ditto. + (wincap_vista): Preliminary wincaps for Windows Vista/Longhorn. + (wincapc::init): Add Vista/Longhorn handling. + +2005-09-28 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (getstack): New function. + (alloc_stack): Use tls stuff for stack info rather than calling + VirtualQuery. + (dll_crt0_0): Initialize _impure_ptr stuff much earlier. Move + init_console_handler here. + * fork.cc (class frok): New class renamed from local fork() struct. + (stack_base): Change argument type. Use tls stuff to determine stack + info rather than calling VirtualQuery. + (frok::child): Rename from fork_child. Eliminate now unneeded + arguments. + (frok::parent): Rename from fork_parent and ditto. Set error and errno + as appropriate. Fixup impersonation in cleanup, if needed. Try harder + to set errno appropriately. + (fork): Define "grouped" as a frok type. Deal with errors from + fork_parent here. + * init.cc (dll_entry): Remove init_console_handler call. + +2005-09-28 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (_pinfo::dup_proc_pipe): Ignore error if the child process + has just gone away. + +2005-09-27 Christopher Faylor <cgf@timesys.com> + + * init.cc (prime_threads): Make this static, as it should be. + (dll_entry): Apply cosmetic changes to define closer to the way MSDN + suggests. + +2005-09-27 Corinna Vinschen <corinna@vinschen.de> + + * pthread.cc (mangle_sem_name): Use cygheap->shared_prefix instead + of fiddling with wincap.has_terminal_services manually. + +2005-09-27 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely + since hProcImpToken isn't initialized here. + * shared.cc (open_shared): Always print mapname instead of name in + debug output. + +2005-09-27 Christopher Faylor <cgf@timesys.com> + + * strace.cc (strace::vsprntf): Avoid printing a zero pid. + +2005-09-27 Corinna Vinschen <corinna@vinschen.de> + + * init.cc (dll_entry): Call IsWow64Process with GetCurrentProcess + as process handle since hMainProc isn't initialized here. + +2005-09-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Always + try IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and + IOCTL_DISK_GET_PARTITION_INFO_EX ioctls first, to allow access to GPT + partitioned disks. Fall back to old non-EX ioctls otherwise. + Add comment to explain NT4 weirdness. + +2005-09-26 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_SEEK and ERROR_SECTOR_NOT_FOUND. + +2005-09-26 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (_cygtls::call_signal_handler): Minor cleanup. + +2005-09-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_raw): Add drive information members + drive_size, current_position and bytes_per_sector. + (fhandler_dev_floppy::get_drive_info): Declare. + * fhandler_floppy.cc (fhandler_dev_floppy::is_eom): Define ERROR_SEEK + and ERROR_SECTOR_NOT_FOUND as end-of-medium conditions. + (fhandler_dev_floppy::get_drive_info): New method to have one function + retrieving drive info. + (fhandler_dev_floppy::open): Call get_drive_info to get drive + information right from the start. + (fhandler_dev_floppy::lseek): Use and set drive information members. + Especially keep track of current_position. + (fhandler_dev_floppy::ioctl): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::write_file): Keep track of + current_position. + (fhandler_dev_raw::read_file): Ditto. + (fhandler_dev_raw::raw_read): Never try to read beyond end-of-medium. + (fhandler_dev_raw::dup): Handle new drive information members. + +2005-09-26 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (handle_exceptions): Just set si_code to SI_KERNEL + first and let it be overridden. + +2005-09-26 Yitzchak Scott-Thoennes <sthoenna@efn.org> + + * exceptions.cc (_cygtls::call_signal_handler): Call signal handler + with extra siginfo_t * and void * parameters when SA_SIGINFO flag is + set. + * signal.cc (signal): Clear SA_SIGINFO flag. + (sigqueue): Fix incorrect setting of si_code. + * sigproc.cc (signal_fixup_after_exec): Clear SA_SIGINFO flag when + setting handler to SIG_DFL. + +2005-09-26 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (proc_waiter): Properly fill out si_code as according to SUSv3. + +2005-09-26 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (handle_exceptions): Properly fill out si_code as + according to SUSv3. + +2005-09-25 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (wait_sig): Cosmetic change. + * pinfo.cc (pinfo::exit): Don't explicitly remove myself since some + other thread may still be using it. + +2005-09-24 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (sigproc_terminate): More reversion of + always-exit-from-sigthread change. + +2005-09-23 Christopher Faylor <cgf@timesys.com> + + * shared.cc (open_shared): Add crucial bit of debugging info. + +2005-09-23 Christopher Faylor <cgf@timesys.com> + + Semi-reversion of always-exit-from-sigthread change of 2005-09-15. + * exceptions.cc (sigpacket::process): Eliminate return after call to + reinstated noreturn function. + (signal_exit): Allow function to exit when a captive process has been + terminated. + * pinfo.cc (pinfo::exit): Enter exit_lock here. Once again exit here + under control of exit_lock. + * sigproc.cc (sig_send): Don't wait for completion if process is exiting. + Remove special __SIGEXIT accommodations. + (wait_sig): Just exit the thread when a __SIGEXIT has been detected. + Don't exit the process. + +2005-09-23 Christopher Faylor <cgf@timesys.com> + + * net.cc (cygwin_gethostbyname): Remove debugging cruft. + +2005-09-23 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::exit): Call ExitProcess if called from signal + thread. + +2005-09-23 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::exit): Eliminate use of _my_tls.thread_handle. + * tlsoffsets.h: Regenerate. + +2005-09-23 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (struct _cygtls::thread_handle): Remove/revert. + * sigproc.h (struct sipacket::thread_handle): Put thread_handle here. + * sigproc.cc (sigproc_terminate): Move setting of thread_handle... + (sig_send): ...to here. Put it in packet being sent. Only close + pack.wakeup when we're waiting for completion. + (wait_sig): Use thread_handle directly from received packet. + +2005-09-22 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (cygheap_fixup_in_child): It's not just for exec. + * cygtls.h (struct _cygtls::thread_handle): New field. + * dcrt0.cc (exit_lock): Remove declaration. + * winsup.h (exit_lock): Add declaration. + * exceptions.cc (sigpacket::process): Properly return after + signal_exit. + * pinfo.cc (pinfo::exit): Only exit the process if + _my_tls.thread_handle has not been filled out -- which should be an + impossible event. + * sigproc.cc (sigproc_terminate): Fillout _my_tls.thread_handle to + provide something for wait_sig to wait for. Use the siginfo_t version + of sig_send and fill out the tls argument with _my_tls. + (wait_sig): Wait for the thread specified in pack.tls or (for now) + complain bitterly if it doesn't exit. + * tlsoffsets.h: Regenerate. + +2005-09-22 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (set_myself): Call strace.hello unconditionally when + DEBUGGING. + (pinfo::init): Sleep and issue debugging output before looping when a + PID_EXITED is found. + +2005-09-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix copy/paste + bug. + +2005-09-22 Christopher Faylor <cgf@timesys.com> + + * strace.cc (strace::vsprntf): Avoid accessing myself->pid if !myself. + +2005-09-22 Christopher Faylor <cgf@timesys.com> + + * include/sys/strace.h (_STRACE_ON): Remove semicolon from definition. + (_STRACE_OFF): Remove semicolon from definition. + +2005-09-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::fstat_helper): Declare with additional + file attributes argument. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Use + file attributes evaluated from NtQueryFileInformation or + FileInformationByHandle in call to fstat_helper. + Set pc.fileattr from just evaluated file attributes here. + (fhandler_base::fstat_by_name): Use file attributes evaluated from + FindFileFirst or default attribute in call to fstat_helper. + Set pc.fileattr from just evaluated file attributes here. + (fhandler_base::fstat_helper): Use file attributes given as argument, + not file attributes stored in this fhandler, since this information + is potentially wrong. Add comment to explain this. + * path.h (has_attribute): New global inline function. + (path_conv::set_attributes): New method to change fileattr. + +2005-09-21 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::operator new): Just use getenv() to look for + CYGWIN_FREERANGE_NOCHECK since the Windows environment may be truncated + by being previously execed. + +2005-09-20 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (av::fixup): Just blindly run any file if it has a .bat or + .cmd extension. + +2005-09-19 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (do_exit): Only call sigproc_terminate from one location -- + pinfo::exit. + * pinfo.cc (pinfo::exit): Move sigproc_terminate later so that signals + can be processed while waiting for hExeced child. + (pinfo::maybe_set_exit_code_from_windows): Set exit code from sigExeced + if it is non-zero. Set exit_state to ES_EXEC_EXIT prior to waiting for + captive process exit code. + * exceptions.cc (sigExeced): New global variable. + (signal_exit): Remove noreturn attribute from declaration. + (signal_exit): Just terminate captive process and return if hExeced on + the theory that the exit will be subsequently handled in the main + thread. + * sigproc.cc (sigproc_terminate): Eliminate test for + ES_SIGPROCTERMINATE and use ES_FINAL instead. + (sig_send): Use no_signals_available instead of duplicate test. + * winsup.h (ES_EXEC_EXIT): New enum. + (ES_SIGPROCTERMINATE): Delete. + +2005-09-19 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (talktome): Take siginfo_t argument. Don't scan all pids + trying to find one that's talking to me. Just use the pid from + siginfo_t. + (wait_pid): Pass siginfo_t argument to talktome. + +2005-09-17 Christopher Faylor <cgf@timesys.com> + + * pipe.cc (fhandler_pipe::open): Use 'cfree' to free buffer since it is + now allocated by cmalloc. + +2005-09-17 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_inet_ntop): Change len argument to socklen_t to + follow SUSv3. + * include/arpa/inet.h (inet_ntop): Ditto. + * include/cygwin/in.h: Include cygwin/socket.h to get socklen_t. + +2005-09-16 Christopher Faylor <cgf@timesys.com> + + * environ.cc (build_env): Use "kilo"bytes not "mega"bytes. Return + immediately on error. + * spawn.cc (spawn_guts): Set return value to -1 on error from + build_env. + +2005-09-16 Christopher Faylor <cgf@timesys.com> + + * environ.cc (build_env): Clear envblock and return NULL on attempt to + use env var > 32K. + * spawn.cc (spawn_guts): Set E2BIG if build_env detects an error. + +2005-09-16 Christopher Faylor <cgf@timesys.com> + + * environ.cc (environ_init): Protect with a 'myfault' in case + GetEnvironmentStrings misbehaves. + +2005-09-16 Christopher Faylor <cgf@timesys.com> + + * environ.cc (environ_init): Add debugging output with value returned + from GetEnvironmentStrings. + +2005-09-16 Christopher Faylor <cgf@timesys.com> + + * environ.cc (environ_init): Issue an error if GetEnvironmentStrings + fails and return. + +2005-09-15 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (EXITCODE_SET): Move out of range of Windows error. + (EXITCODE_NOSET): Ditto. + * sigproc.cc (no_signals_available): Remove check for hwait_sig. Just + rely on my_sendsig. Pass in an argument controlling when it is + appropriate to test EXITCODE_SET. + (proc_can_be_signalled): Remove checks for myself since this function + is never called in that context. + (sigproc_init): Pre-initialize my_sendsig to non-zero so that + proc_can_be_signalled will know that we expect to be signalable soon. + (sig_send): Change debugging output. + +2005-09-15 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (no_signals_available): Return true if sending to self + from the signal thread. + (wait_sig): Correct so that WaitForSingleObject is called when + hMainThread is != 0, rather than the reverse. + + * cygheap.cc (cygheap_fixup_in_child): Clarify potential error message. + + * fork.cc (fork_copy): Cosmetic change. + +2005-09-15 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (wait_sig): Reorganize exit case so that ExitProcess is + always called, since that is the intent of sending a __SIGEXIT. Wait + forever for main thread to go away since, presumably, the main thread + told us it was going away. + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (av::fixup): Avoid breaking out of the wrong "loop". + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + * hookapi.cc (hook_or_detect_cygwin): Simplify very slightly. + * spawn.cc (av::fixup): Guard against problems reading an executable + which does not match Microsoft's documentation about PE format. + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (av::error): Eliminate. + (av::av): Remove reference to error. + (av::replace0_maybe): Ditto. + (av::dup_maybe): Ditto. + (av::dup_all): Ditto. + (av::unshift): Ditto. + (spawn_guts): On a fault, return E2BIG only if ENOMEM has been set. + Otherwise return EFAULT. + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (san): New structure. + (cygtls::andreas): New element. Replaces _myfault and _myfault_errno. + (cygtls::fault_guarded): Use andreas. + (cygtls::return_from_fault): Ditto. + (cygtls::setup_fault): Add a parameter denoting where to store old + fault handler, if any and use it to "stack" faults. + (cygtls::reset_fault): Restore fault from parameter. + (myfault::sebastian): New variable. + (myfault::~myfault): Pass sebastian to reset_fault. + (myfault::myfault): Store old fault values in sebastian. + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + * heap.cc (heap_init): Revert 2005-09-11 patch as it seems to + inexplicably cause problems with emacs. + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + Remove some more unneeded 'return;'s throughout. + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + * sigproc.h: Protect declaration so that it only happens when + __INSIDE_CYGWIN__. + +2005-09-14 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (sigtid): Remove declaration. + (handle_exceptions): Use _sig_tls rather than sigtid to determine if + this is the signal thread. + (set_signal_mask): Ditto for conditionalized CGF code. + * pinfo.cc (pinfo::exit): Exit the thread if we forcefully terminated + the main thread. + * sigproc.cc (sigtid): Delete. + (_sig_tls): Define. + (sig_clear): Use _sig_tls rather than sigtid to determine if this is + the signal thread. + (sig_dispatch_pending): Ditto. + (wait_sig): Set _sig_tls here. + +2005-09-13 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (do_exit): Move sigproc_terminate call later since signal + handling was still needed for subsequent stuff. Call sigproc_terminate + with new exit_state value. + * pinfo.cc (pinfo::exit): Call sigproc_terminate with new exit_state + value. + * sigproc.cc (proc_terminate): Remove unnecessary (void) parameter. + (sigproc_terminate): Ditto. Add new argument to accept exit state to + be set. + (wait_sig): Reorganize __SIGEXIT handling. Add more debugging output. + * winsup.h (sigproc_terminate): Declare with new exit_state argument. + (exit_states): Reorganize to reflect new exit ordering of + sigproc_terminate. + +2005-09-13 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (do_exit): Rely on sigproc_terminate to set exit_state + appropriately. + * pinfo.cc (pinfo::exit): Always call sigproc_terminate here. Rely on + sigproc_terminate to signal signal thread to handle eventual process + exit. + * sigproc.cc (no_signals_available): Change criteria for determining if + this process can handle signals to itself. + (my_sendsig): New variable. Copy of my sendsig handle. + (proc_can_be_signalled): Don't send signals if exit code is set. + (sigproc_terminate): Use and set exit_state appropriately to determine + when to do anything. Send __SIGEXIT to self to control process exit. + (sig_send): Use my_sendsig for sending signals. Don't call + proc_can_be_signalled for myself since the criteria is now different + for sending signals to myself. + (wait_sig): Copy myself->sendsig to my_sendsig for future use. Exit + signal loop when __SIGEXIT is received. Wait for main thread to exit + and use its exit status to actually exit process. + * sigproc.h (__SIGEXIT): New enum. + +2005-09-13 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (alloc_stack): Eliminate superfluous "return;". + * debug.cc (add_handle): Ditto. + * devices.in (device::parse): Ditto. + * dtable.cc (dtable::vfork_parent_restore): Ditto. + (dtable::vfork_child_fixup): Ditto. + * environ.cc (parse_options): Ditto. + * errno.cc (seterrno_from_win_error): Ditto. + * exceptions.cc (sig_handle_tty_stop): Ditto. + (set_signal_mask): Ditto. + * fhandler.cc (fhandler_base::read): Ditto. + (fhandler_base::operator delete): Ditto. + (fhandler_base::seekdir): Ditto. + (fhandler_base::rewinddir): Ditto. + * fhandler_console.cc (fhandler_console::read): Ditto. + (fhandler_console::fixup_after_exec): Ditto. + * sigproc.cc (sigproc_init): Ditto. + (sigproc_terminate): Ditto. + + * devices.cc: Regenerate. + +2005-09-13 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (wait_sig): Be more defensive about detecting when we're + exiting. + +2005-09-12 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::cygthread): Add more info to fatal error. + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Temporarily + remove insertion of /dev into root directory. + * path.cc (path_conv::check): Ditto. + +2005-09-11 Christopher Faylor <cgf@timesys.com> + + * heap.cc (heap_init): Allocate heap from top down as a hedge against + subsequent ERROR_INVALID_ADDRESS in forked processes when CTRL-C is + pressed. + +2005-09-09 Christopher Faylor <cgf@timesys.com> + + * heap.cc (heap_init): Be slightly more aggressive when trying to + allocate heap. Change fatal error message 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. + +2005-09-08 Christopher Faylor <cgf@timesys.com> + + * fhandler_serial.cc (fhandler_serial::tcgetattr): Just zero c_cflag + here rather than clearing CBAUD after the fact. + * termios.cc (tcgetattr): Revert previous change. + +2005-09-08 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-09-08 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (ctrl_c_handler): Disable any special CTRL_LOGOFF_EVENT + handling and add longish comment about the reasons. + +2005-09-07 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-09-06 Christopher Faylor <cgf@timesys.com> + + * 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. + (handle_sigsuspend): Make cancelable when called from non-main thread. + + * 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". + +2005-09-06 Corinna Vinschen <corinna@vinschen.de> + + * thread.h: Revert patch from 2005-09-05. + * thread.cc (pthread_mutex::can_be_unlocked): Return true also if + mutex is owned by MUTEX_OWNER_ANONYMOUS. + +2005-09-05 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-09-05 Corinna Vinschen <corinna@vinschen.de> + + * thread.h (pthread_mutex::get_pthread_self): Remove. + (pthread_mutex::lock): Use ::pthread_self as self parameter. + (pthread_mutex::trylock): Ditto. + (pthread_mutex::unlock): Ditto. + (pthread_mutex::destroy): Ditto. + +2005-09-02 Dave Korn <dave.korn@artimi.com> + + * Makefile.in (CXXFLAGS): Use 'override' to correctly set flags to + generate dependencies when invoked from top-level make. + +2005-08-28 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (set_process_mask_delta): Conditionalize debugging + output. + * sigproc.cc (proc_subproc): Make strace output a little more verbose. + +2005-08-28 Christopher Faylor <cgf@timesys.com> + + * 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. + (_ljfault): Return from a __sjfault without bothering with signals. + +2005-08-28 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (_local_storage::strerror_buf): Allocate more space. + * errno.cc (strerror_worker): New function, adapted from strerror. + (strerror): Use strerror_worker. + * tlsoffsets.h: Regenerate. + + * exceptions.cc (set_signal_mask): Minimize time during which mask_sync + is held. + +2005-08-28 Christopher Faylor <cgf@timesys.com> + + * cygwin.din: Correct readdir_r typo. + +2005-08-27 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * dir.cc (readdir_r): Invert sense on error test. + +2005-08-25 Corinna Vinschen <corinna@vinschen.de> + + * 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. + +2005-08-25 Corinna Vinschen <corinna@vinschen.de> + + * 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. + +2005-08-25 Corinna Vinschen <corinna@vinschen.de> + + * 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. + +2005-08-25 Christopher Faylor <cgf@timesys.com> + + * errno.cc (errmap): Translate ERROR_NO_MORE_ITEMS to ENMFILE. + +2005-08-24 Christopher Faylor <cgf@timesys.com> + + * 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). + +2005-08-24 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-24 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-24 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (endusershell): Reset shell_fp to NULL to allow + subsequent getusershell calls. + +2005-08-24 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-24 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-23 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-22 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-22 Corinna Vinschen <corinna@vinschen.de> + + * mtinfo.h (mtinfo_drive::error): Fix argument bug in debug_printf call. + +2005-08-20 Christopher Faylor <cgf@timesys.com> + + * cygerrno.h (geterrno_from_win_error): Change declaration to default + to using GetLastError and EACCESS. + * cygwin.din: Export readdir_r. + * include/cygwin/version.h: Bump API version number to 138. + * syscalls.cc (readdir_worker): New function, renamed from old + readdir() function. + (readdir): Use readdir_worker. + (readdir_r): New function. + * fhandler.h (fhandler_base::readdir): Accommodate second argument + indicating dirent buffer. + (fhandler_disk_file::readdir): Ditto. + (fhandler_cygdrive::readdir): Ditto. + (fhandler_proc::readdir): Ditto. + (fhandler_netdrive::readdir): Ditto. + (fhandler_registry::readdir): Ditto. + (fhandler_process::readdir): Ditto. + * fhandler.cc (fhandler_base::readdir): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto. + * fhandler_cygdrive.cc (fhandler_cygdrive::readdir): Ditto. + * fhandler_proc.cc (fhandler_proc::readdir): Ditto. + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto. + * fhandler_registry.cc (fhandler_registry::readdir): Ditto. + * fhandler_process.cc (fhandler_process::readdir): Ditto. + * include/sys/dirent.h (readdir_r): Add declaration. + +2005-08-19 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-19 Christopher Faylor <cgf@timesys.com> + + * 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_isroot 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. + +2005-08-19 Christopher Faylor <cgf@timesys.com> + + * winsup.h (create_pipe): Declare new function. + (CreatePipe): New define. + * miscfuncs.cc (create_pipe): Define new function. + +2005-08-18 Christopher Faylor <cgf@timesys.com> + + * 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. + +2005-08-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvfrom): Always initialize + ret to 0. + (fhandler_socket::recvmsg): Ditto. + +2005-08-18 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (strerror): Check errnum for underflow. + +2005-08-17 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_1): Tweak debugging stuff. + +2005-08-17 Pavel Tsekov <ptsekov@gmx.net> + + * 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. + +2005-08-14 Corinna Vinschen <corinna@vinschen.de> + + * 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. + +2005-08-11 Troy Curtiss <trcurtiss@gmail.com> + + * fhandler_serial.cc (fhandler_serial::tcgetattr): Return current baud + rate regardless of current DTR state. + +2005-08-11 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc: Remove ld_preload declaration. + * winsup.h: Move ld_preload declaration here. + * fork.cc (fork_child): Call ld_preload() before returning. + +2005-08-11 Christopher Faylor <cgf@timesys.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 allocate 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. + +2005-08-08 Christopher Faylor <cgf@timesys.com> + + * include/sys/cdefs.h: Remove extra line. + +2005-08-08 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_reg_security): New static function. + (get_nt_object_security): Call get_reg_security for registry keys + to circumvent problems with predefined registry keys. + +2005-08-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (fhandler_process::open): Allow opening of + /proc/<pid>/fd for reading. + * fhandler_registry.cc (fhandler_registry::open): Ditto for registry + keys. + +2005-08-08 Christopher Faylor <cgf@timesys.com> + + * include/sys/cdefs.h (__CONCAT): Define. + * include/elf.h: New file. + * include/sys/elf32.h: Ditto. + * include/sys/elf64.h: Ditto. + * include/sys/elf_common.h: Ditto. + * include/sys/elf_generic.h: Ditto. + +2005-08-08 Christopher Faylor <cgf@timesys.com> + + * cygwin.sc: Use simpler method to align .cygheap. + * dllfixdbg: Just copy .stab and .stabstr sections when making + cygwin1.dbg, rather than relying on objcopy to keep only the debug + sections since objcopy seems to get it wrong. + +2005-08-08 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (build_fh_pc): Check setting fh to fhandler_nodevice for + NULL, too. + +2005-08-08 Corinna Vinschen <corinna@vinschen.de> + + * ftw.c: Include winsup.h. + * nftw.c: Ditto. + * include/ftw.h: Guard declarations appropriately. + +2005-08-08 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add fts.o, ftw.o, nftw.o. + * cygwin.din: Export fts_children, fts_close, fts_get_clientptr, + fts_get_stream, fts_open, fts_read, fts_set, fts_set_clientptr, + ftw, nftw. + * fts.c: New file, imported from FreeBSD. + * ftw.c: Ditto. + * nftw.c: Ditto. + * include/fts.h: Ditto. + * include/ftw.h: Ditto. + * include/cygwin/version.h: Bump API minor number. + +2005-08-07 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (dtable_CFLAGS): Use -fomit-frame-pointer and + -fcheck-new. + * cygheap.cc (cmalloc): Only emit system_printf warnings on failure if + DEBUGGING. + (crealloc): Ditto. + (ccalloc): Ditto. + * dtable.cc (build_fh_name): Treat NULL return from cnew as indicative + of EMFILE condition. + (build_fh_dev): Ditto. + (dtable::dup_worker): Handle NULL return from build_fh_pc. + (dtable::vfork_child_dup): Trust dup_worker to set errno. + * fhandler.h (fhandler_base::new): Mark as nothrow. + +2005-08-07 Christopher Faylor <cgf@timesys.com> + + * dllfixdbg: New perl script. + * configure.in: Detect objcopy, objdump, strip. + * configure: Regenerate. + * Makefile.in: Pass target objcopy/objdump to new dllfixdbg script. + Remove previous perl check. + * cygwin.sc: Add .gnu_debuglink_overlay section for eventual + replacement with .gnu_debuglink section. Revert move of cygheap to end + of image. + +2005-08-06 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Allow previous patch to work in a 64 bit environment. + +2005-08-06 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Warn when end of cygheap is not on 64k boundary. + * cygwin.sc: Try harder to ensure that cygheap is on a 64k boundary. + Move cygheap to end of image to stop interference from unstripped debug + regions. + +2005-08-06 Christopher Faylor <cgf@timesys.com> + + * include/endian.h: Move everything into this file and define things + more like linux. + * include/cygwin/types.h: Include endian.h. + * include/sys/dirent.h: Define DT_* types and conversion macros. + + * pinfo.cc (pinfo::init): Remove special handling for PID_ALLPIDS and + execed code, even though it probably still isn't quite right. + +2005-08-05 Michael Gorse <mgorse@alum.wpi.edu> + + * thread.cc (pthread::create(3 args)): Make bool. + (pthread_null::create): Ditto. + (pthread::create(4 args)): Check return of inner create rather than + calling is_good_object(). + * thread.h: Ditto. + +2005-08-05 Vaclav Haisman <v.haisman@sh.cvut.cz> + + * fhandler_tty.cc (fhandler_tty_slave::tcflush): Return either 0 or -1. + +2005-08-05 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread_cond_timedwait): Check abstime for validity + according to SUSv3. Rewrite timeout check and waitlength calculation + to avoid overflow problems. + +2005-08-02 Yitzchak Scott-Thoennes <sthoenna@efn.org> + + * include/sys/termios.h: Define TIOCMBIS and TIOCMBIC. + * fhandler.h (class fhandler_serial): Declare switch_modem_lines. + * fhandler_serial.cc (fhandler_serial::switch_modem_lines): New + static function to set or clear DTR and/or RTS. + (fhandler_serial::ioctl): Use switch_modem_lines for TIOCMSET + and new TIOCMBIS and TIOCMBIC. + * include/cygwin/version.h: Bump API minor number. + +2005-07-29 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_base::pread): Don't move file offset + pointer after I/O. + (fhandler_base::pwrite): Ditto. + +2005-07-29 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (fhandler_base::pread): Declare new function. + (fhandler_base::pwrite): Ditto. + (fhandler_disk_file::pread): Ditto. + (fhandler_disk_file::pwrite): Ditto. + * fhandler.cc (fhandler_base::pread): Define new function. + (fhandler_base::pwrite): Ditto. + * fhandler_disk_file.cc (fhandler_base::pread): Ditto. + (fhandler_base::pwrite): Ditto. + * syscalls.cc (pread): Define new function. + (pwrite): Ditto. + * cygwin.din: Export pread, pwrite. + + * include/sys/ioctl.h: Guard some _IO* declarations to avoid conflict + with socket.h. + +2005-07-29 Christopher Faylor <cgf@timesys.com> + + * include/sys/ioctl.h: Add some linux defines. + +2005-07-29 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Put back accidentally removed debug_printf. + +2005-07-29 Arto Huusko <arto.huusko@wmdata.fi> + + * cygthread.cc (cygthread::simplestub): Wait for h to be filled out + by main thread before assigning it. + +2005-07-29 Arto Huusko <arto.huusko@wmdata.fi> + + * pinfo.cc (pinfo::init): Sleep before retrying open_shared(). + +2005-07-29 Arto Huusko <arto.huusko@wmdata.fi> + + * fork.cc (fork_parent): Fix null deref if pinfo creation fails. + +2005-07-28 Christopher Faylor <cgf@timesys.com> + + * cygmalloc.h (MSPACES): Define. This dropped through the cracks after + the last malloc update. + * dcrt0.cc: Fix a comment. + * malloc.cc (internal_malloc): Fix definition so that it can be safely + coerced. + +2005-07-27 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/in.h (INET_ADDRSTRLEN): Add new definition. + +2005-07-27 Christopher Faylor <cgf@timesys.com> + + * gendef: Use nocr to remove \r's from input. + gendef (nocr): New function. + +2005-07-27 Christopher Faylor <cgf@timesys.com> + + * fhandler_clipboard.cc (fhandler_dev_clipboard::close): Set membuffer + to NULL. + (fhandler_dev_clipboard::fixup_after_exec): Don't call close here. + Just set variables directly. + +2005-07-25 Christopher Faylor <cgf@timesys.com> + + * include/byteswap.h: New file. + +2005-07-25 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/types.h: Define loff_t. + +2005-07-16 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info::sync): Pass pid and HANDLE rather than + using pinfo. + (child_info::child_info): Accept an argument controlling whether to + create proc_subproc. + (child_info_spawn::child_info_spawn): Ditto. + * sigproc.cc (child_info::child_info): Ditto. + (child_info_spawn::child_info_spawn): Ditto. + (child_info::sync): Use passed in pid and HANDLE. + * fork.cc (fork_parent): Reflect additional arguments required for + child_info::sync. + * hookapi.cc (hook_or_detect_cygwin): Rename. Change so that NULL 'fn' + argument just returns "true", indicating that program uses cygwin1.dll. + * spawn.cc (av::win16_exe): New element. + * spawn.cc (av::iscygwin): New element. + (av::fixup): New function. + (spawn_guts): Protect against SEGV. Use fixup function to detect when + it is safe to wait for a spawned (as opposed to an execed) program. + Reflect changes in child_info::sync arguments. + * external.cc (cygwin_internal): Reflect function renaming to + hook_or_detect_cygwin. + + * cygheap.cc (cygheap_fixup_in_child): Close handle after debug fixup + has been done to prevent false positives in handle collision. + + * exceptions.cc (try_to_debug): Notify debugger if already being + debugged. + +2005-07-09 Christopher Faylor <cgf@timesys.com> + + * path.cc (mount): Only check win32_path when we know we need it. + +2005-07-09 Nicholas Wourms <nwourms@gmail.com> + + * cygwin.din (getline): Export. + (getdelim): Export. + * include/sys/stdio.h (getline): Replace macro with function prototype. + (getdelim): Likewise. + * include/cygwin/version.h: Bump API minor number. + +2005-07-08 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (__getline): Export. + (__getdelim): Export. + * include/sys/stdio.h (getline): Define as __getline. + (getdelim): Define as __getdelim. + * include/cygwin/version.h: Bump API minor number. + +2005-07-06 Christopher Faylor <cgf@timesys.com> + + Eliminate (void) cast on standalone function calls throughout. + +2005-07-05 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (cygwin_exit): Mark as "noreturn". + * sigproc.cc (child_info::ready): Don't signal parent that we are a + cygwin process if we are dynamically loaded. + +2005-07-05 Christopher Faylor <cgf@timesys.com> + + * malloc.cc: Update to version 2.8.2. + +2005-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::close): Don't do "extra stuff" + when we know we're execing. + +2005-07-04 Christopher Faylor <cgf@timesys.com> + + Change foo (void) to foo () for all c++ functions throughout. + Remove all fhandler_*::dump functions throughout. + + * fhandler.h (fhandler_dev_mem::close): Remove pass-through function in + favor of virtual method. + (handler_dev_raw::close): Ditto. + (fhandler_dev_clipboard::fixup_after_exec): New method. + * fhandler_dev_mem.cc (fhandler_dev_mem::close): Eliminate pass through + function in favor of virtual method. + * fhandler_dev_raw.cc (fhandler_dev_raw::close): Ditto. + * fhandler_clipboard.cc (fhandler_dev_clipboard::close): Don't go to + extra effort when execing. + (fhandler_dev_clipboard::fixup_after_exec): New function. + * fhandler_console.cc (fhandler_console::close): Don't do "extra stuff" + when we know we're execing. + * fhandler_disk_file.cc (fhandler_disk_file::close): Ditto. + * fhandler_dsp.cc (fhandler_dev_dsp::close): Ditto. + * fhandler_fifo.cc (fhandler_fifo.cc::close): Ditto. function in favor + of base function. + * fhandler_random.cc (fhandler_dev_random::close): Ditto. + * fhandler_registry.cc (fhandler_registry::close): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::close): Ditto. + * fhandler_virtual.cc (fhandler_virtual::close): Ditto. + + * pinfo.cc (proc_waiter): Remove unneeded hExeced declaration. + * sigproc.cc: Ditto. + * winsup.h (hExeced): Define here. + + * fhandler_virtual.cc (fhandler_virtual::fixup_after_exec): Just call + close() to reinitialize things to known state. + +2005-07-04 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (_cygtls): Perform minor reformatting. + + * winsup.h (close_all_files): Reflect argument change. + * dtable.cc (close_all_files): Ditto. + * dtable.h: Ditto. + * fhandler.h: Ditto. + * spawn.cc (spawn_guts): Move close_all_files back to its original + location in first P_OVERLAY test but use argument denoting that handles + are only supposed to be closed, not released (more work to be done + here). + * syscalls.cc (close_all_files): Take an argument denoting whether to + release closed files or not. + + * path.cc (symlink): Change argument names to reflect linux man page. + (symlink_worker): Ditto. Also appropriately set ENOENT for empty + strings. + + +2005-07-04 Pierre Humblet <pierre.humblet@ieee.org> + + * cygheap.h (struct init_cygheap): Delete cygwin_regname member. + * external.cc (cygwin_internal): Use cygpsid::get_id for + CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID. + Turn CW_SET_CYGWIN_REGISTRY_NAME and CW_GET_CYGWIN_REGISTRY_NAME + into noops. + +2005-07-03 Christopher Faylor <cgf@timesys.com> + + * thread.cc (pthread_mutex::init): Remove unneeded efault/mutex check. + +2005-07-02 Christopher Faylor <cgf@timesys.com> + + * thread.h (verifyable_object_state verifyable_object_isvalid): Delete + function declaration that should have been static. + * thread.cc (verifyable_object_state verifyable_object_isvalid): Make + inline static. + (pthread*::is_good_object): Move to directly after + verifyable_object_state verifyable_object_isvalid and make inline. + (check_valid_pointer): Delete function. + (pthread_cond_timedwait): Use myfault to detect valid pointer. + (pthread_mutex::init): Ditto. + +2005-07-02 Christopher Faylor <cgf@timesys.com> + + Replace valid memory checks with new myfault class "exception + handling", almost everywhere. Leave some thread.cc stuff alone for + now. + * cygtls.h: Kludge some definitions to avoid including a problematic + windows header. + (_cygtls::_myfault): New entry. + (_cygtls::_myfault_errno): Ditto. + (_cygtls::fault_guarded): New function. + (_cygtls::setup_fault): Ditto. + (_cygtls::return_from_fault): Ditto. + (_cygtls::clear_fault): Ditto. + (myfault): New class. + * exceptions.cc (handle_exceptions): Handle case of guarded fault in + system routine. + * gendef: Add another entry point for setjmp that the compiler doesn't + know about and won't complain about. + * gentls_offsets: Just include windows.h rather than kludging a HANDLE + def. + * miscfuncs.cc (check_null_str): Delete. + (check_null_empty_str): Ditto. + (check_null_empty_str_errno): Ditto. + (check_null_str_errno): Ditto. + (__check_null_invalid_struct): Ditto. + (__check_null_invalid_struct_errno): Ditto. + (__check_invalid_read_ptr): Ditto. + (__check_invalid_read_ptr_errno): Ditto. + (dummytest): New function. + (check_iovec_for_read): Delete. + (chec_iovec): Rename from check_iovec_for_write. Take a read/write + parameter. + * tlsoffsets.h: Regenerate. + * winsup.h: Remove check_* declarations. + (check_iovec_for_read): Delete declaration. Turn into a define + instead. + (check_iovec_for_write): Ditto. + (check_iovec): New declaration. + + * thread.h: Use ifdef guard name consistent with other header files. + +2005-07-02 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 19. + +2005-06-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::readv): Use malloc/free instead of alloca. + (fhandler_base::writev): Ditto. + +2005-06-29 Christopher Faylor <cgf@timesys.com> + + * cygerrno.h: Make multi-inclusion safe. + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Deal with EINTR. + * dcrt0.cc (dll_crt0_0): Accommodate init_console_handler argument + change. + * winsup.h: Ditto. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + * exceptions.cc (init_console_handler): Ditto. Ignore console events + if we're not attached to a terminal. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + * wincap.cc: Implement has_null_console_handler_routine throughout. + * wincap.h: Ditto. + +2005-06-29 Christopher Faylor <cgf@timesys.com> + + * autoload.cc (LoadDLLprime): Use a more descriptive name for autoload + text sections. + * cygwin.sc: Ditto. + +2005-06-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::facl): Add missing break. + +2005-06-24 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Don't strip trailing dots and spaces + at the start of the path. + +2005-06-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (rootdir): Don't set errno. + * syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed. + +2005-06-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_tape): Add declaration for + fixup_after_fork and set_close_on_exec. + * fhandler_tape.cc (fhandler_dev_tape::open): Create mt_mtx mutex + inheritable. + (fhandler_dev_tape::close): Close mt_mtx. + (fhandler_dev_tape::dup): Duplicate mt_mtx and mt_evt as necessary. + (fhandler_dev_tape::fixup_after_fork): New method. + (fhandler_dev_tape::set_close_on_exec): New method. + +2005-06-21 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_initgroups_sidlist): Drop special_pgrp parameter. + (get_setgroups_sidlist): Avoid duplicate groups in group list. + (create_token): Remove special_pgrp local variable. Accommodate + change to get_initgroups_sidlist call. + +2005-06-21 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (uinfo_init): Call reimpersonate to set the main thread's + impersonation token. + +2005-06-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Only list recognized + partitions. Use partition number given by PartitionNumber member. + +2005-06-18 Corinna Vinschen <corinna@vinschen.de> + + * glob.c: (glob0): New local variable `limit`. Use in calls to glob1 + and globextend. + (glob1): Add `limit' parameter. + (glob2): Ditto. + (glob3): Ditto. + (globextend): Ditto. Implement GLOB_LIMIT handling. + * include/glob.h (GLOB_LIMIT): New define. + * include/cygwin/version.h: Bump API minor number. + +2005-06-17 Christopher Faylor <cgf@timesys.com> + + * wincap.h (wincaps::detect_win16_exe): Declare. + (wincapc::detect_win16_exe): Implement. + * wincap.cc: Populate detect_win16_exe where appropriate. + * spawn.cc (spawn_guts): Only go out of the way to detect 16-bit apps + on systems which are flummoxed by them. + +2005-06-17 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Detect when executing a 16-bit application and + avoid setting the process pipe since this causes conniptions in Windows + 9x. + +2005-06-17 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (inet_pton): Export. + (inet_ntop): Export. + * net.cc (cygwin_inet_pton): Implement inet_pton for AF_INET for now. + (cygwin_inet_ntop): Implement inet_ntop for AF_INET for now. + * include/arpa/inet.h (inet_pton): Declare. + (inet_ntop): Declare. + * include/cygwin/version.h: Bump API minor number. + +2005-06-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_union): Add missing members corresponding to + fhandler_fifo and fhandler_netdrive. + +2005-06-16 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (statvfs): Handle the case when GetDiskFreeSpaceEx + succeeds but GetDiskFreeSpace fails by faking bytes-per-sector and + sectors-per-cluster values. + +2005-06-15 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::detach): Fix debugging output. + * dcrt0.cc (dll_crt0_1): Create signal_arrived early -- before any + filename manipulation. + * sigproc.cc (sigproc_init): Don't create signal_arrived here. + * fork.cc (fork_child): Ditto. + * sigproc.h (create_signal_arrived): Declare. + +2005-06-14 Christopher Faylor <cgf@timesys.com> + + * path.cc (path_conv::check): Always reset to FH_FS when component != 0 + and FH_NETDRIVE to fix problems with strict case checking. + +2005-06-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recvmsg): Avoid SEGV in OpenSSH + when trying to pass file descriptor by setting msg->msg_accrightslen + to 0. + +2005-06-11 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Avoid initial heap allocation since cygwin has its own + heap. + +2005-06-11 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::read): Fix a compiler warning. + +2005-06-10 Christopher Faylor <cgf@timesys.com> + + * include/pthread.h: Change PTHREAD_MUTEX_DEFAULT to + PTHREAD_MUTEX_NORMAL. Revert PTHREAD_MUTEX_INITIALIZER to + PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP since that is actually closer + to what linux does. + * thread.h (cw_cancel_action): New enum. + (cancelable_wait): Use cw_cancel_action as third argument. + * thread.cc (cancelable_wait): Ditto. Don't wait for cancel if + cancel_action == cw_no_cancel. + (pthread::create): Don't wait for cancel event since that is racy. + (pthread_mutex::pthread_mutex): Set default to PTHREAD_MUTEX_ERRORCHECK. + (pthread_mutexattr::pthread_mutexattr): Ditto. + (pthread_mutex::_lock): Tell cancelable_wait not to wait for + cancellation event. + (semaphore::_timedwait): Accommodate change in cancelable_wait args. + (pthread::join): Ditto. + +2005-06-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::sendto): Always initialize + ret to 0. + (fhandler_socket::sendmsg): Ditto. + +2005-06-10 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (imaxabs): Export. + (imaxdiv): Export. + (llabs): Export. + (lldiv): Export. + (strtoimax): Export. + (strtoumax): Export. + * include/inttypes.h (imaxabs): Activate declaration. + (imaxdiv): Ditto. + (strtoimax): Ditto. + (strtoumax): Ditto. + * include/cygwin/version.h: Bump API minor. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::detach): Improve diagnostics for what should + be an impossible failure condition. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (_local_storage::setmode_file): New element. + (_local_storage::setmode_mode): New element. + * tlsoffsets.h: Regenerate. + * cygwin.din (setmode): Define as cygwin_getmode. + * syscalls.cc (setmode_helper): Use setmode_* variables from tls rather + than using unthreadsafe static. + (setmode): Break out fwalk stuff. + (cygwin_setmode): New function. Put fwalk stdio stuff here. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + * thread.cc (pthread_mutex::_lock): Use cancelable_wait rather than + WaitForSingleObject. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + * cygwin.sc: Place .cygwin_dll_common in a more sensible spot. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + * cygwin.sc: Place .cygwin_dll_common. + * init.cc (threadfunc_ix): Use a more common name for the section name. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + * include/pthread.h (PTHREAD_MUTEX_INITIALIZER): Change to + PTHREAD_NORMAL_MUTEX_INITIALIZER_NP to be closer to linux default. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + * thread.cc (cancelable_wait): No-op change to make sure that res is + always a valid WFMO return. + +2005-06-09 Christopher Faylor <cgf@timesys.com> + + Change pthread::cancelable_wait to just cancelable_wait, throughout. + * thread.h (cw_sig_wait): New enum. + (fast_mutex::lock): Use cancelable_wait with resumable signal. + (cancelable_wait): Change fourth argument to cw_sig_wait enum. + * thread.cc (cancelable_wait): Ditto. Loop on signal detection if + fourth argument == cw_sig_resume. + +2005-06-08 Christopher Faylor <cgf@timesys.com> + + * cygwin.sc: Apparently nonloading sections need to go last. + +2005-06-08 Christopher Faylor <cgf@timesys.com> + + * cygwin.sc: Restore resource and reloc sections and use more modern + syntax for stabs sections. + +2005-06-08 Christopher Faylor <cgf@timesys.com> + + * environ.cc (spenvs): Remove cut/paste error which associated + CYGWIN_DEBUG with HOME. + +2005-06-08 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (cygwin_logon_user): Run LogonUser in the primary + process token context. Fix potential handle leak. + +2005-06-07 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo::init): Define sa_buf as PSECURITY_ATTRIBUTES and + allocate dynamically. + (pinfo::set_acl): Replace sa_buf by dynamically allocated acl_buf. + * sec_acl.cc (setacl): Allocate acl dynamically. + * sec_helper.cc (sec_acl): Add test for alignment of acl when + DEBUGGING is defined. + (__sec_user): Same for sa_buf. + * security.cc (verify_token): Define sd_buf as PSECURITY_DESCRIPTOR + and allocate dynamically. + (alloc_sd): Allocate acl dynamically. + security.h (sec_user_nih): Change first parameter to + SECURITY_ATTRIBUTES *. + (sec_user): Ditto. + * sigproc.cc (wait_sig): Define sa_buf as PSECURITY_ATTRIBUTES and + allocate dynamically. + * syscalls.cc (seteuid32): Define dacl_buf as PACL and allocate + dynamically. + * uinfo.cc (cygheap_user::init): Define sa_buf as PSECURITY_ATTRIBUTES + and allocate dynamically. + * winbase.h (ilockincr): Mark first argument of inline assembly as + earlyclobber. + (ilockdecr): Ditto. + +2005-06-07 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::detach): Make error message a little more + detailed. + * fhandler.cc (fhandler_base::raw_read): Ditto for debug message. + * dcrt0.cc (do_exit): Add some more synchronization tests. + * fhandler_fifo.cc (fhandler_fifo::dup): Don't duplicate a nonexistent + handle. Use derived return value rather than always retuning 0. + * fhandler_netdrive.cc (fhandler_netdrive::exists): Wnet -> WNet. + * winsup.h (exit_states): Add a couple of new exit states. + +2005-06-06 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): If GetFileAttributes returns + with ERROR_SHARING_VIOLATION, the file exists. + +2005-06-06 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Change "amd64" to "x86_64" as on Linux. + +2005-06-06 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Add missing break. + +2005-06-05 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Build sync.o with -fomit-frame-pointer and -O3. + +2005-06-05 Christopher Faylor <cgf@timesys.com> + + * sync.cc (muto::acquire): Remove unneeded brackets and fix whitespace. + +2005-06-04 Christopher Faylor <cgf@timesys.com> + + * malloc.cc: Update to Doug Lea's malloc v2.8.0. + +2005-06-03 Max Kaehn <slothman@electric-cloud.com> + + * dcrt0.cc (cygwin_dll_init): Initialize main_environ and cygtls. Add + comment to explain the caveats of this method. + * how-cygtls-works.txt: New file. + +2005-06-02 Christopher Faylor <cgf@timesys.com> + + * dlfcn.cc (get_full_path_of_dll): Use a relative path when converting + so that the standard Windows rules for finding a library will be used + if no path is given. Stop explicitly searching /usr/bin since that is + now in effect. + +2005-06-01 Christopher Faylor <cgf@timesys.com> + + Revert 2005-05-30 close_all_files changes. + * spawn.cc (spawn_guts): When execing, close all files after the child + has synced with us. + +2005-06-01 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_disk_file::fchown): Make sure that + disk open is called in case we're passed in a non-existent device. + +2005-06-01 Christopher Faylor <cgf@timesys.com> + + * include/machine/stdlib.h: New file. + +2005-06-01 Christopher Faylor <cgf@timesys.com> + + * thread.h (List_remove): Revert most of 2005-05-30 change. + +2005-06-01 Christopher Faylor <cgf@timesys.com> + + * cygwin.sc: Don't output .reloc or .rsrc sections. Clean up stuff + around .cygheap and use a workaround to get things working with newer + (broken?) binutils. + +2005-05-31 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (cygheap_end): Remove bogus section attribute. + * cygwin.sc: Make __cygheap_mid absolute. Remove unused _cygheap_foo. + +2005-05-30 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info::cygheap_h): Delete. + (child_info::dwProcessId): New field. + * cygheap.cc (init_cheap): Delete. + (dup_now): Ditto. + (cygheap_setup_for_child): Ditto. + (cygheap_setup_for_child_cleanup): Ditto. + (cygheap_fixup_in_child): Simplify. Use new "child_copy" function to + copy heap from parent. + (_csbrk): Don't attempt allocation if within cygheap section. Fix so + that more than one allocation will succeed. + (cygheap_init): Reset possibly-nonzero region to zero. + * cygheap.h (cygheap_setup_for_child): Delete declaration. + (cygheap_setup_for_child_cleanup): Ditto. + (cygheap_start): Define as an array. + * cygwin.sc: Modernize. Remove unneeded sections. Define cygheap + here. + * dcrt0.cc (do_exit): Reflect argument change to close_all_files. + * dtable.cc (dtable::vfork_parent_restore): Ditto. + * dtable.h: Ditto. + * fhandler.h: Ditto. + * fork.cc (fork_copy): Call ReadProcessMemory if there is no thread + (indicating that we're execing). + (fork_child): Don't mess with hParent. + (fork_parent): Remove hParent stuff. It happens earlier now. + Remove call to cygheap_setup_for_child* stuff. + (fork): Put child_info_stuff in grouped structure. Issue error if + parent handle is not set. + (child_copy): New function. + * sigproc.cc (child_info::child_info): Put cygheap settings here. Set + parent handle. + (child_info::~child_info): Close parent handle if it exists. + * spawn.cc (spawn_guts): Reorganize so that ciresrv is allocated at + only the last minute so that cygheap changes are reflected. Delete + cygheap_setup* calls. + * syscalls.cc (close_all_files): Add an argument to flag when the fd + entry should be released. + * winsup.h (close_all_files): Add an argument to close_all_files + declaration. Declare child_copy. + +2005-05-30 Vaclav Haisman <v.haisman@sh.cvut.cz> + + * thread.h (List_remove): Make node parameter const. Use simple + comparison and assignment rather than InterlockedCompareExchangePointer + since access is already synchronized. + +2005-05-30 Christopher Faylor <cgf@timesys.com> + + * dlfcn.cc (set_dl_error): Use UNIX error rather than Windows error. + +2005-05-29 Christopher Faylor <cgf@timesys.com> + + * cygmagic: Remove debugging cruft missed on 2005-05-21. + +2005-05-29 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Move component to function scope. Set + PATH_RO only on *real* FH_NETDRIVEs or on non-FH_NETDRIVE virtual + paths. Allow non-retrievable shares to be handled as files. + +2005-05-29 Eric Blake <ebb9@byu.net> + + * include/limits.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Always define. + +2005-05-28 Christopher Faylor <cgf@timesys.com> + + * thread.h (pthread_key::set): Inline. + (pthread_key::get): Ditto. + * thread.cc (pthread::set): Delete. + (pthread::get): Ditto. + +2005-05-28 Christopher Faylor <cgf@timesys.com> + + * cygwin.din: Remove signal front end from pthread_[gs]etspecific. + +2005-05-28 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty_slave:tcflush): Use signed comparison. + +2005-05-28 Christopher Faylor <cgf@timesys.com> + + * times.cc (time_ms::usecs): Coerce comparison to signed or whole test + is a no-op. + +2005-05-27 Christopher Faylor <cgf@timesys.com> + + * cygheap.h: Reference _cygheap_start via .cygheap section. + + * environ.cc: Fix force_into_environment typo throughout. + (spenvs): Export CYGWIN_DEBUG if DEBUGGING. + +2005-05-26 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 18. + +2005-05-25 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.h (fhandler_base::mkdir): New virtual method. + (fhandler_base::rmdir): Ditto. + (fhandler_disk_file:mkdir): New method. + (fhandler_disk_file:rmdir): Ditto. + * dir.cc (mkdir): Implement with fhandlers. + (rmdir): Ditto. + * fhandler.cc (fhandler_base::mkdir): New virtual method. + (fhandler_base::rmdir): Ditto. + (fhandler_disk_file::mkdir): New method. + (fhandler_disk_file::rmdir): Ditto. + +2005-05-24 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump API minor number to 129. + +2005-05-24 Christopher Faylor <cgf@timesys.com> + + * cygwin.din: Export mkdtemp. + * mktemp.cc: New file. + * Makefile.in (DLL_OFILES): Add mktemp.o + +2005-05-23 Eric Blake <ebb9@byu.net> + + * include/stdint.h (INTMAX_C, UINTMAX_C): Fix definition. + +2005-05-21 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (find_exec): Accept a PATH-like string in place of an + environment variable. + * dlfcn.cc (get_full_path_of_dll): Search /usr/bin (for windows + compatibility) and /usr/lib (for UNIX compatibility) when looking for + shared libraries. + * environ.cc (conv_envvars): Put back LD_LIBRARY_PATH since it is used + by get_full_path_of_dll(). + * errno.cc (errmap): Map MOD_NOT_FOUND to ENOENT. + + * cygmagic: Remove debugging cruft. + +2005-05-19 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in.h: Add comment. + +2005-05-19 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in.h: Define IPPROTO_xxx values as macros to + accommodate SUSv3. + +2005-05-19 Christopher Faylor <cgf@timesys.com> + + * include/limits.h: Include features.h, as on linux. + +2005-05-19 Christopher Faylor <cgf@timesys.com> + + * include/endian.h: New file. + +2005-05-19 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc: Add Dwarf-2 debug sections. + +2005-05-19 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Make granularity an automatic variable. + +2005-05-19 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (fhandler_cygdrive::seekdir): Delete declaration. + (fhandler_cygdrive::seekdir): Delete. + +2005-05-19 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.h (fhandler_cygdrive::iscygdrive_root): Delete method. + (fhandler_cygdrive::telldir): Delete declaration. + * fhandler_disk_file.cc: Remove all uses of + fhandler_cygdrive::iscygdrive_root. + (fhandler_disk_file::mkdir): New method. + (fhandler_disk_file::rmdir): Ditto. + (fhandler_cygdrive::telldir): Delete. + +2005-05-18 Christopher Faylor <cgf@timesys.com> + + * external.cc: Move pids declaration to file scope and use less + enthusiastic constructor. + * pinfo.h (winpids::winpids): Remove default setting. + * fhandler_fifo.cc (fhandler_fifo::open_not_mine): Accommodate removal + of default setting. + * fhandler_proc.cc (fhandler_proc::readdir): Ditto. + +2005-05-18 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (_local_storage::unknown_thread_name): New buffer. + * tlsoffsets.h: Regenerate. + * cygthread.cc (cygthread::name): Use new thread-local buffer. + * exceptions.cc (handle_exceptions): Avoid unnecessary initialization + of static variables to zero. + * fork.cc (slow_pid_reuse) Ditto. + +2005-05-18 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Avoid compiler warning. + * ntea.cc (NTReadEA): Ditto. + * hires.h (hires_base): Remove useless usecs function. + +2005-05-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (fhandler_netdrive::telldir): Remove since it's + equivalent to fhandler_virtual::telldir now anyway. + * fhandler.h (class fhandler_netdrive): Remove telldir. + +2005-05-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (fhandler_netdrive::telldir): Implement. + (fhandler_netdrive::seekdir): Implement. + (fhandler_netdrive::closedir): Call rewinddir to have only one point + of calling WNetCloseEnum. + +2005-05-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_netdrive): Add method rewinddir. + * fhandler_netdrive.cc (struct netdriveinf): New structure to + store thread arguments. + (thread_netdrive): Thread handling all potentially blocking + WNet... calls. + (create_thread_and_wait): Start and wait for above thread. + (fhandler_netdrive::exists): Change to call create_thread_and_wait + instead of calling WNet... function. + (fhandler_netdrive::readdir): Ditto. Fix error handling. + (fhandler_netdrive::rewinddir): New method. + +2005-05-17 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Avoid compiler warning. + +2005-05-16 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Don't do fixup_after_exec if dynamically + loaded since the state of fds is unknown at this point. + +2005-05-16 Christopher Faylor <cgf@timesys.com> + + * include/sys/cygwin.h (enum cygwin_getinfo_types): Add CW_DEBUG_SELF. + * external.cc (cygwin_internal): Implement CW_DEBUG_SELF. + + * init.cc (dll_entry): Minor rearrangement of code. + +2005-05-16 Christopher Faylor <cgf@timesys.com> + + * path.cc (path_conv::check): Remove embedded dots before slashes. + +2005-05-16 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (conv_envvars): Remove LD_LIBRARY_PATH entirely. + It doesn't belong here. + +2005-05-15 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (conv_envvars): Treat LD_LIBRARY_PATH as path list. + +2005-05-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Check + return code from GetFileSize and set file size to 0 if necessary. + * fhandler_netdrive.cc (fhandler_netdrive::fstat): Set permissions + to read/execute for all. + +2005-05-13 Christopher Faylor <cgf@timesys.com> + + * path.cc (normalize_posix_path): Do normalization on . and .. after + a '//'. + +2005-05-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_netdrive::readdir): Remove useless comment. + +2005-05-13 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (WNetGetResourceParentA): Import. + (WNetOpenEnumA): Import. + (WNetEnumResourceA): Import. + (WNetCloseEnum): Import. + * fhandler.h (fhandler_netdrive::telldir): Add declaration. + (fhandler_netdrive::seekdir): Ditto. + (fhandler_netdrive::closedir): Ditto. + * fhandler_netdrive.cc: Drop explicit including windows.h. Include + winnetwk.h instead of shlwapi.h. Include dirent.h. + (fhandler_netdrive::readdir): Implement. + (fhandler_netdrive::telldir): New method. + (fhandler_netdrive::seekdir): New method. + (fhandler_netdrive::closedir): Ditto. + +2005-05-13 Christopher Faylor <cgf@timesys.com> + + Remove PC_FULL from path_conv usage throughout. + * path.h (enum pathconv_arg): Change PC_FULL to PC_NOFULL. + * path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL. + (cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path. + +2005-05-13 Christopher Faylor <cgf@timesys.com> + + * fhandler_netdrive.cc (fhandler_netdrive::exists): Assert that "//" + exists. + +2005-05-12 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Eliminate compiler warning. + + * dir.cc (mkdir): Check path for writability. + (rmdir): Ditto. Remove check for special directories. + * path.cc (path_conv::check): Set PATH_RO for virtual devices. Set + error if read-only and asked for writability. + * path.h (pathconv_arg): Add PC_WRITABLE. + (path_types): Add PATH_RO. + (path_conv::isro): Add (currently unused) check for read-only + filesystem. Return "ENOSHARE" when we know a share doesn't exist. + * include/sys/mount.h: Add MOUNT_RO flag. + * autoload.cc (WNetGetResourceInformationA): Import. + * fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual + existence of remote system rather than always assuming that it exists. + +2005-05-11 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (do_global_dtors): Don't call dll_global_dtors here. + (__main): Reinstate atexit of do_global_dtors. + (cygwin_exit): Call dll_global_dtors here. + (do_exit): And here. + + +2005-05-10 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Clear exitsock after close. + * fhandler_console.cc (fhandler_console::write_normal): Store character + in a local variable for potential future inspection. + +2005-05-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add fhandler_mailslot.o. + * devices.h (FH_KMSG): Define new device. + * devices.in: Add "/dev/kmsg" entry. + * devices.cc: Regenerate. + * dtable.cc (build_fh_pc): Handle case FH_KMSG. + * fhandler.h (class fhandler_mailslot): New class. + (class select_stuff): Add device_specific_mailslot pointer. + * fhandler_mailslot.cc: New file. + * select.cc (peek_mailslot): New function. + (verify_mailslot): Ditto. + (struct mailslotinf): New stuct to handle select on mailslots. + (thread_mailslot): New function. + (start_thread_mailslot): Ditto. + (mailslot_cleanup): Ditto. + (fhandler_mailslot::select_read): New method. + * syslog.cc (klog_guard): New muto. + (dev_kmsg): Local mailslot for kernel message device. + (vklog): New function. + (klog): Ditto. + * winsup.h (vklog): Declare. + (klog): Ditto. + * include/sys/syslog.h: Define _PATH_KLOG. + +2005-05-10 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_1): Call cygwin_exit to ensure that destructors + are handled correctly. + +2005-05-10 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Set correct file attributes for socket + files. + +2005-05-09 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler.h (class fhandler_netdrive): New class. + * fhandler_netdrive.cc (fhandler_netdrive::fhandler_netdrive): New constructor. + (fhandler_netdrive::exists): New method. + (fhandler_netdrive::fstat): Ditto. + (fhandler_netdrive::readdir): Ditto. + (fhandler_netdrive::open): Ditto. + * dtable.cc (build_fh_pc): Handle case FH_NETDRIVE. + * path.cc (isvirtual_dev): Add FH_NETDRIVE. + (mount_info::conv_to_win32_path): Detect netdrive device and bypass mount + search for network paths. + +2005-05-08 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (get_cygwin_startup_info): New function pulled from + dll_crt0_0. + (dll_crt0_0): Use get_cygwin_startup_info to retrieve cygwin-specific + startup pointer. + * external.cc (cygwin_internal): Implement CW_ARGV and CW_ENVP. + * include/sys/cygwin.h: Implement CW_ARGV and CW_ENVP. + +2005-05-07 Christopher Faylor <cgf@timesys.com> + + * path.cc (normalize_posix_path): Don't treat '//' specially since + newer versions of bash now get this right. + +2005-05-07 Christopher Faylor <cgf@timesys.com> + + * devices.cc: Regenerate with correct name for dev_netdrive_storage. + +2005-05-06 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (DLL_O_FILES): Add fhandler_netdrive.o. + * fhandler_netdrive.cc: Placeholder file for future development. + * devices.h (FH_NETDRIVE): Define new virtual device type. + (netdrive_dev): Define. + * devices.in (dev_netdrive_storage): Define. + * devices.cc: Regenerate. + +2005-05-04 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (__set_errno): Remove useless parentheses. + +2005-05-04 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (__set_errno): Define as inline function here. + (set_errno): Always define as call to __set_errno. + * debug.cc (__set_errno): Move to cygerrno.h. + +2005-05-03 Christopher Faylor <cgf@timesys.com> + + * shared.cc (user_shared_initialize): Rework locking so that nothing is + checked until cb is non-zero. + +2005-05-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't treat + inability to open file as failure if only SetFileAttributes is + going to be called. Only call set_file_attribute if really necessary. + +2005-05-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Add missing __seterrno call. + +2005-05-01 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty_slave::read): Actually read input when + vmin == vtime == 0. + +2005-04-30 Christopher Faylor <cgf@timesys.com> + + * environ.cc (spenv::force_into_environment): Rename from add_always. + (spenv::add_if_exists): Rename from force. + (build_env): Accommodate name changes. Make sure that stuff that is + always supposed to be in the environment is actually added to the + environment. + + * shared.cc (open_shared): Restore VirtualFree eliminated by 2005-04-28 + change. + +2005-04-30 Christopher Faylor <cgf@timesys.com> + + * errno.cc (errmap): Sort table. + +2005-04-29 Christopher Faylor <cgf@timesys.com> + + * errno.cc (errmap): Map ERROR_NETNAME_DELETED to ENOSHARE. + +2005-04-28 Corinna Vinschen <corinna@vinschen.de> + + * shared_info.h (cygwin_shared_address): Bump to a higher value to avoid + collision with large data areas. + +2005-04-28 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::get_tty_stuff): Accommodate + changes to open_shared arguments. + * fhandler_tape.cc (mtinfo_init): Ditto. + * pinfo.cc (pinfo::init): Use open_shared rather than win32 mmap calls. + * shared.cc (user_shared_initialize): Ditto. + (memory_init): Ditto. + (open_shared): Change to allow use a smore general mmap handler. + * shared_info.h (shared_locations): Add SH_JUSTCREATE, SH_JUSTOPEN. + (open_shared): Change declaration to match new usage. + + * autoload.cc (LoadDLLfuncEx2): Define in terms of LoadDLLfuncEx3. + (LoadDLLfuncEx3): New macro. + +2005-04-27 Christopher Faylor <cgf@timesys.com> + + * fhandler.cc (fhandler_base::open_9x): Remove (broken) check for + O_CREAT|O_EXCL. + * syscalls.cc (open): Do O_CREAT|O_EXCL check here first. + +2005-04-26 Christopher Faylor <cgf@timesys.com> + + * environ.cc (build_env): Ensure that win32 array is properly filled in + when a missing value has to be generated. + +2005-04-26 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 17. + +2005-04-24 Pavel Tsekov <ptsekov@gmx.net> + + * how-to-debug-cygwin.txt: Fix typo. + +2005-04-22 Christopher Faylor <cgf@timesys.com> + + * shared.cc (user_shared_initialize): Implement locking similar to + shared_info when initializing shared region. + +2005-04-22 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (dev_console::set_color): Define new function. + (dev_console::set_default_attr): Ditto, moved from fhandler_console. + (dev_console::fillin_info): Ditto. Accommodate this change throughout + this file. + (fhandler_console::get_win32_attr): Eliminate. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Properly set + default attributes on initialization. + (fhandler_console::open): Set current attributes rather than default + color on open. + (fhandler_console::get_win32_attr): Eliminate. + (dev_console::set_color): New function. Move get_win32_attr stuff + here. + (dev_console::set_default_attr): New function, moved from + fhandler_console. + (dev_console::fillin_info): Ditto. + (fhandler_console::char_command): Call set_color to set screen + characteristics. + +2005-04-22 Christopher Faylor <cgf@timesys.com> + + * fhandler.cc (fhandler_base::read): Remove unused signal state tweaks. + * fhandler.h (fhandler_pipe::create_selectable): Declare. + (fhandler_fifo::close_one_end): Declare. + * fhandler_fifo.cc (fhandler_fifo::close_one_end): Define. + (fhandler_fifo::open_not_mine): Use close_one_end to close appropriate + end of pipe. + * pinfo.cc (_pinfo::commune_recv): Ditto. + * pipe.cc (fhandler_pipe::create_selectable): Rename from + create_selectable_pipe. Reorganize. + (fhandler_pipe::create): Use create_selectable. + +2005-04-21 Christopher Faylor <cgf@timesys.com> + + * shared.cc (shared_info::initialize): Test previous version of shared + memory magic rather than current version when determining if there has + been a shared memory mismatch. + +2005-04-20 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (proc_subproc): Fix handling of waiting for pids with zero + value. + + * strace.cc (strace::hello): Report parent pid of executing process. + +2005-04-20 Christopher Faylor <cgf@timesys.com> + + * path.cc (path_conv::check): Fix problem reading symlinks introduced + in below change by reverting the change and adding an additional test + for nonexistent files in /proc. + +2005-04-20 Christopher Faylor <cgf@timesys.com> + + * path.cc (path_conv::check): Punt when attempting to access a + nonexistent directory or file in /proc. + +2005-04-19 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Remove DELETE bit from user's ACE if + allow_traverse is set. + +2005-04-19 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (pselect): Export. + * select.cc (pselect): New function. + * include/cygwin/version.h: Bump API minor number. + * include/sys/select.h: Include signal.h. Declare pselect. + +2005-04-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (enum conn_state): Add connect_failed state. + * fhandler_socket.cc (fhandler_socket::connect): Set connect_state to + connect_failed when connect failed. + * poll.cc (poll): Change errno to EINVAL if allocating memory fails, + according to SUSv3. Add socket descriptors always to except_fds. Test + for failed connect and set revents flags appropriately. + * select.cc (set_bits): Set connect_state to connect_failed when + select indicates failed nonblocking connect. + (fhandler_dev_null::select_except): Set except_ready to false so that + /dev/null is not always in except state. + (peek_socket): Fix bogus conditional. + (fhandler_socket::select_write): Treat all connect_states except + unconnected equivalent to return consistent results. + (fhandler_windows::select_except): Set except_ready to false so that + /dev/windows is not always in except state. + +2005-04-18 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 16. + +2005-04-18 Pierre Humblet <pierre.humblet@ieee.org> + + * grp.cc (initgroups32): Return the correct value. + +2005-04-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::utimes_fs): Ignore + ERROR_NOT_SUPPORTED to workaround Win9x weirdness. + * path.cc (symlink_info::check): Remap ERROR_INVALID_FUNTION to + ERROR_FILE_NOT_FOUND for the same reason. + +2005-04-16 Corinna Vinschen <corinna@vinschen.de> + Pierre Humblet <pierre.humblet@ieee.org> + + * security.h (cygsidlist::addfromgr): Allow duplicate entries. + (get_server_groups): Declare new function. + * security.cc (is_group_member): Simplify. + (get_server_groups): New function. + (get_initgroups_sidlist): Call get_server_groups. + (verify_token): Allow token when supplementary sids are not in + /etc/group but are in the token. + Streamline the code. + * grp.cc (initgroups32): New implementation. + (getgroups32): Handle case where the supplementary groups are set. + +2005-04-16 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (environ_init): Don't set traverse checking as default. + +2005-04-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::utimes_fs): Drop touching + ChangeTime. + +2005-04-16 Christopher Faylor <cgf@timesys.com> + + * fhandler.cc (fhandler::dup): Duplicate flags, too. + * fhandler.h (fhandler_fifo::owner): Eliminate. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Handle on-disk + devices better. + (fhandler_base::fstat_helper): Ditto. + * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Don't initialize + obsolete "owner". + (fhandler_fifo::open_not_mine): Add some debugging. Duplicate correct + handle when we own it. + (fhandler_fifo::open): Set flags from input, not from first pipe. Flag + that fork fixup is needed. + (fhandler_fifo::dup): Set errno correctly when DuplicateHandle fails. + * pinfo.cc (commune_send): Add debugging for fifo. + + * cygwin/version.h: Bump API minor version to 127 to reflect exporting + of sigrelese. + +2005-04-14 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * syscalls.cc (setuid32): Correct debugging output. + +2005-04-14 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (do_global_dtors): Run DLL dtors. + (__main): Don't rely on atexit to run dtors. + (do_exit): Specifically call do_global_dtors here. + (cygwin_exit): Ditto. + * dll_init.cc (dll_global_dtors): Make global. Only run dtors once. + (dll_list::init): Just set flag that dtors should be run. Don't rely on atexit. + * dll_init.h (dll_global_dtors): Declare. + + * exceptions.cc (sigrelse): Define. + + * path.h (is_fs_device): New method. + (is_lnk_special): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::link): Use + "is_lnk_special" rather than "is_lnk_symlink". + * syscalls.cc (rename): Ditto. + + * hookapi.cc (ld_preload): Use colon as a separator rather than space. + +2005-04-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Remove utimes. + * fhandler_socket.cc (fhandler_socket::utimes): Remove. + +2005-04-13 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (__seterrno_from_nt_status): Define. Always set Win32 + error code as well as errno. Use throughout where errno is set from + NT status. + (set_errno): Evaluate val only once. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fix typo in + debug output. + * fhandler_mem.cc (fhandler_dev_mem::open): Rely on + __seterrno_from_nt_status setting Win32 error code in debug output. + * fhandler_proc.cc (format_proc_uptime): Ditto. + (format_proc_stat): Ditto. + * fhandler_process.cc (format_process_stat): Ditto. + * sysconf.cc (sysconf): Ditto. + +2005-04-13 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (fhandler_base::utimes_fs): New method. + * fhandler.cc (fhandler_base::utimes): Call utimes_fs if on-disk + special file. + * fhandler_disk_file.cc (fhandler_disk_file::utimes): Use utimes_fs. + (fhandler_base::utimes_fs): Handle on-disk device files. + +2005-04-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::utimes): Don't set errno + if open fails, it has already been set by open. + +2005-04-12 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtQueryVolumeInformationFile): Add. + * fhandler.cc (fhandler_base::raw_write): Don't touch has_changed flag. + * fhandler.h (enum change_state): Remove. + (fhandler_base::status): Revert has_changed to a simple bit. + (fhandler_base::fstat_helper): Add nAllocSize parameter. Rename + ftCreationTime to ftChangeTime. + * fhandler_disk_file.cc: Call fstat_helper with additional + allocation size throughout. + (fhandler_base::fstat_by_handle): Use NT native functions to get + full file information on NT. Call fstat_helper with LastWriteTime + as ctime, if ChangeTime is not available. + (fhandler_base::fstat_by_name): Call fstat_helper with LastWriteTime + as ctime. + (fhandler_base::fstat_helper): Add comment. Drop special FAT + handling since it's useless. Use nAllocSize for st_blocks if available. + (fhandler_disk_file::touch_ctime): Only touch LastWriteTime. + (fhandler_disk_file::fchmod): Set has_changed on 9x only. + (fhandler_disk_file::fchown): Don't set has_changed. + (fhandler_disk_file::facl): Ditto. + (fhandler_disk_file::ftruncate): Ditto. + (fhandler_disk_file::link): Set has_changed on 9x only and on original + file only. + (fhandler_base::open_fs): Don't set has_changed in O_TRUNC case. + * ntdll.h (FILE_BASIC_INFORMATION): Define. + (FILE_STANDARD_INFORMATION): Define. + (FILE_INTERNAL_INFORMATION): Define. + (FILE_EA_INFORMATION): Define. + (FILE_ACCESS_INFORMATION): Define. + (FILE_POSITION_INFORMATION): Define. + (FILE_MODE_INFORMATION): Define. + (FILE_ALIGNMENT_INFORMATION): Define. + (FILE_NAME_INFORMATION): Don't define with arbitrary FileName size. + (FILE_ALL_INFORMATION): Define. + (FILE_INFORMATION_CLASS): Add FileAllInformation. + (FILE_FS_VOLUME_INFORMATION): Define. + (FS_INFORMATION_CLASS): Define. + (NtQueryVolumeInformationFile): Define. + +2005-04-11 Corinna Vinschen <corinna@vinschen.de> + + Revert previous patch. + * autoload.cc (GetVolumePathNamesForVolumeNameA): Remove. + (GetVolumeNameForVolumeMountPointA): Add. + * syscalls.cc (sync): Rewrite guid case to skip floppies also on + Windows 2000. + +2005-04-11 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (sync): Use renamed has_get_volume_pathnames wincap. + * wincap.h (wincaps::has_get_volume_pathnames): Rename from + has_guid_volumes + * wincap.cc: Accommodate above rename throughout. Set to false on + Windows 2000. + +2005-04-08 Christopher Faylor <cgf@timesys.com> + + * pipe.cc (fhandler_pipe::open): Remove O_CREAT limitation. + +2005-04-07 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc (try_connect_guard): Remove useless conditionalized code. + +2005-04-07 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc: Include sys/socket.h. + (try_connect_guard): New static variable. + (syslogd_inited): Ditto. + (syslogd_sock): Ditto. + (try_connect_syslogd): New function to connect and write syslog to + local syslogd. + (vsyslog): Log to stderr if LOG_PERROR flag has been given to openlog. + Try logging to syslogd. Use Event Log resp. log file as fallback. + (closelog): Close socket to syslogd. + * include/sys/syslog.h (_PATH_LOG): Define. + (INTERNAL_NOPRI): Define if SYSLOG_NAMES is defined. + (INTERNAL_MARK): Ditto. + (struct _code): Ditto. + (prioritynames): Ditto. + (facilitynames): Ditto. + +2005-04-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Add type parameter to return + unix socket type. Read socket type from unix socket file. + (fhandler_socket::bind): Write socket type to unix socket file. + (fhandler_socket::connect): Return with errno EPROTOTYPE if + socket type of socket doesn't match socket type of unix socket + trying to connect to. + +2005-04-06 Pierre Humblet <pierre.humblet@ieee.org> + + * security.h (cygsidlist::addfromgr): Avoid duplicate entries. + * grp.cc (initgrousp): Add syscall_printf. + (setgroups): Add syscall_printf and make sure sids are added only once. + +2005-04-06 Christopher Faylor <cgf@timesys.com> + + * net.cc (cygwin_getservbyname): Return (possibly NULL) return value of + dup_ent rather than assuming that tls buffer is valid. + (cygwin_getservbyport): Ditto. + (cygwin_gethostbyname): Ditto. + (cygwin_gethostbyaddr): Ditto. + +2005-04-05 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Don't free or close stuff if we're being + called in a "non-standard" way. + +2005-04-05 Christopher Faylor <cgf@timesys.com> + + * sync.h (muto::initforce): Delete flawed implementation. + * pwdgrp.h (pwdgrp::pglock): Make static. + * grp.cc (pwdgrp::pwdgrp): Eliminate use of initforce. + +2005-04-05 Christopher Faylor <cgf@timesys.com> + + * sync.h (muto::initforce): Force initialization even when name != + NULL. + * grp.cc (pwdgrp::pwdgrp): Use initforce since the enclosing structure + is !NO_COPY. + +2005-04-05 Christopher Faylor <cgf@timesys.com> + + * sync.h (muto::operator int): New operator. + (locker): Remove unused class. + (new_muto): Delete. + (new_muto1): Ditto. + (new_muto_name): Ditto. + * cygheap.cc (cygheap_setup_for_child): Reflect use of static storage + for muto rather than pointer. + (_csbrk): Ditto. + (_cmalloc): Ditto. + (_cmalloc): Ditto. + (_cfree): Ditto. + * cygheap.h (cwdstuff::cwd_lock): Ditto. + (cwdstuff::get_drive): Ditto. + * cygmalloc.h (__malloc_lock): Ditto. + (__malloc_unlock): Ditto. + * cygtls.cc (sentry::lock): Ditto. + (sentry::sentry): Ditto. + (~sentry): Ditto. + (_cygtls::init): Ditto. + * dcrt0.cc: Ditto. + (cygwin_atexit): Ditto. + (cygwin_exit): Ditto. + * debug.cc (lock_debug::locker): Ditto. + (lock_debug::lock_debug): Ditto. + (lock_debug::unlock): Ditto. + (debug_init): Ditto. + * dtable.cc (dtable::init_lock): Ditto. + * dtable.h (dtable::lock_cs): Ditto. + (dtable::lock): Ditto. + (dtable::unlock): Ditto. + * exceptions.cc (mask_sync): Ditto. + (sighold): Ditto. + (set_process_mask_delta): Ditto. + (set_signal_mask): Ditto. + (events_init): Ditto. + * grp.cc (pwdgrp::pwdgrp): Ditto. + * malloc_wrapper.cc (mallock): Ditto. + (malloc_init): Ditto. + * path.cc (cwdstuff::cwd_lock): Ditto. + (cwdstuff::get_hash): Ditto. + (cwdstuff::get_hash): Ditto. + (cwdstuff::init): Ditto. + (cwdstuff::set): Ditto. + (cwdstuff::get): Ditto. + * pwdgrp.h (pwdgrp::pglock): Ditto. + (pwdgrp::refresh): Ditto. + * sigproc.cc (sync_proc_subproc): Ditto. + (get_proc_lock): Ditto. + (proc_subproc): Ditto. + (_cygtls::remove_wq): Ditto. + (proc_terminate): Ditto. + (sigproc_init): Ditto. + * timer.cc (lock_timer_tracker::protect): Ditto. + (lock_timer_tracker::lock_timer_tracker): Ditto. + (lock_timer_tracker::~lock_timer_tracker): Ditto. + * wininfo.cc (wininfo::_lock;): Ditto. + (wininfo::winthread): Ditto. + (operator HWND): Ditto. + (wininfo::lock): Ditto. + (wininfo::release): Ditto. + * wininfo.h (wininfo::_lock;): Ditto. + +2005-04-04 Christopher Faylor <cgf@timesys.com> + + * path.cc (path_conv::check): Only check for PC_NO_ACCESS_CHECK in end + component. + +2005-04-04 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Don't call set_cygwin_privileges on 9x. + + * fhandler.h (enum change_state): Add. + (fhandler_base::status): Add a bit to has_changed flag. + (fhandler_base::has_changed): Implement with type change_state. + * fhandler.cc (fhandler_base::raw_write): Accommodate type change + of has_changed. + * fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): Also + touch modification time if has_changed == data_changed. + (fhandler_disk_file::fchmod): Also open on 9x, otherwise we can't + touch ctime. Accommodate type change of has_changed. + (fhandler_disk_file::fchown): Accommodate type change of has_changed. + (fhandler_disk_file::facl): Ditto. + (fhandler_disk_file::ftruncate): Ditto. + (fhandler_disk_file::link): Ditto. + (fhandler_base::open_fs): Ditto. + +2005-04-03 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Accommodate set_process_privilege change. + * cygheap.h (cygheap_user::curr_primary_token): New member. + (cygheap_user::primary_token): New method. + (cygheap_user::deimpersonate): Always revert to processes' + impersonation token. + (cygheap_user::reimpersonate): Set processes' or setuid token as + necessary. + (cygheap_user::has_impersonation_tokens): Look for curr_primary_token + value. + (cygheap_user::close_impersonation_tokens): Close curr_primary_token + here if necessary. Don't reset token values to NO_IMPERSONATION since + that's done in uinfo_init anyway. + (init_cygheap::luid): New LUID array keeping privilege LUIDs. + * cygtls.cc (_cygtls::init_thread): Call cygheap->user.reimpersonate. + * dcrt0.cc (hProcToken): New global variable to keep process token. + (hProcImpToken): Ditto for process impersonation token. + (dll_crt0_0): Open process token here once. Duplicate to create + hProcImpToken. + (dll_crt0_1): Call set_cygwin_privileges. + * environ.cc (allow_ntea): Drop duplicate declaration. + (allow_smbntsec): Ditto. + (set_traverse): Only set allow_traverse here. + (environ_init): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop call to + enable_restore_privilege. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::facl): Ditto. + * fork.cc (fork_child): Move call to cygheap->user.reimpersonate after + syn with parent. Call set_cygwin_privileges. + * grp.cc (internal_getgroups): Use hProcImpToken instead of opening + process token. + * path.cc (fs_info::update): Bypass traverse checking when retrieving + volume information using push/pop_thread_privileges. + * registry.cc (load_registry_hive): Drop setting restore privilege + since it's already set if available. + * sec_helper.cc: Include cygtls.h. + (cygpriv): Privilege string array. + (privilege_luid): New function, evaluate LUID from cygpriv_idx. + (privilege_luid_by_name): New function, evaluate LUID from privilege + string. + (privilege_name): New function, evaluate privilege string from + cygpriv_idx. + (set_privilege): New static function called by set_process_privilege + and set_thread_privilege. Call privilege_luid to get privilege LUID. + Fix bug in return value evaluation. Improve debug output. + (set_cygwin_privileges): New function. + (set_process_privilege): Remove. + (enable_restore_privilege): Remove. + * security.cc (allow_traverse): New global variable. + (sys_privs): Change type to cygpriv_idx and store privilege indices + instead of strings. + (SYSTEM_PRIVILEGES_COUNT): Renamed from SYSTEM_PERMISSION_COUNT. + (get_system_priv_list): Don't use numerical constant in malloc call. + Use privilege_luid to get privilege LUIDs. + (get_priv_list): Call privilege_luid_by_name to get LUIDs. Improve + inner privilege LUID comparison loop. + (create_token): Enable create token privilege using + push/pop_self_privileges. Use hProcToken instead of opening process + token. Use default DACL when duplicating token. + (subauth): Enable tcb privilege using push/pop_self_privileges. + Use sec_none instead of homw made security attributes when duplicating + token. + (check_file_access): Don't duplicate access token, use active + impersonation token as is. + * security.h (enum cygpriv_idx): New enumeration type enumerating + possible privileges. + (privilege_luid): Declare new function. + (privilege_luid_by_name): Ditto. + (privilege_name): Ditto. + (allow_traverse): Declare. + (set_privilege): Declare function. + (set_process_privilege): Define as macro. + (enable_restore_privilege): Remove declaration. + (_push_thread_privilege): Define macro. + (push_thread_privilege): Ditto. + (pop_thread_privilege): Ditto. + (pop_self_privilege): Ditto. + * spawn.cc (spawn_guts): Use cygheap->user.primary_token instead of + cygheap->user.token. + * syscalls.cc (statvfs): Bypass traverse checking when retrieving + volume information using push/pop_thread_privileges. Rearrange code + to simplify push/pop bracketing. + (seteuid32): Use hProcToken instead of opening process token. Call + cygheap->user.deimpersonate instead of RevertToSelf. Create + impersonation token from primary internal or external token. Set + cygheap->user.curr_primary_token and cygheap->user.current_token + privileges once here. Drop "failed" and "failed_ptok" labels. + Drop setting DefaultDacl of process token. + (setegid32): Use hProcToken and hProcImpToken instead of opening + process token. Always reimpersonate afterwards. + * uinfo.cc (cygheap_user::init): Use hProcToken instead of opening + process token. + (internal_getlogin): Ditto. Set hProcImpToken, too. + (uinfo_init): Initialize cygheap->user.curr_primary_token. + * winsup.h (hProcToken): Declare. + (hProcImpToken): Declare. + +2005-04-03 Corinna Vinschen <corinna@vinschen.de> + + Unify usage of CYG_MAX_PATH throughout. Change buffers from + size CYG_MAX_PATH + 1 to CYG_MAX_PATH. Change length tests + accordingly. + +2005-04-02 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 15. + +2005-04-01 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork_child): Add missing __stdcall. + +2005-04-01 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (create_signal_arrive): New (temporary?) function to + create signal_arrived event. + (sigproc_init): Use create_signal_arrived. + * fork.cc (fork_child): Create signal_arrived early. + +2005-04-01 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork_child): Fixup SYSV IPC shared memory before fixing + up fdtab. + +2005-03-31 Corinna Vinschen <corinna@vinschen.de> + + * gentls_offsets: Add '-m32' flag to native compiler call to satisfy + cross platform builds. + +2005-03-31 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (NO_SYSTEM_RESOURCES): Map to EAGAIN. + (NONPAGED_SYSTEM_RESOURCES): Ditto. + (PAGED_SYSTEM_RESOURCES): Ditto. + (WORKING_SET_QUOTA): Ditto. + (PAGEFILE_QUOTA): Ditto. + (COMMITMENT_LIMIT): Ditto. + +2005-03-30 Christopher Faylor <cgf@timesys.com> + + * environ.cc (spenvs): Re-force SYSTEMROOT to always be included in + environment. + (build_env): Ditto. + +2005-03-30 Christopher Faylor <cgf@timesys.com> + + * environ.cc (spenv::retrieve): Revert most of previous change. + (build_env): Ditto. Rework to track environment variables which need + to always be in the windows environment in a separate array. + +2005-03-30 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * path.cc (symlink_info::case_check): Ignore trailing characters + in paths when comparing case. + +2005-03-30 Christopher Faylor <cgf@timesys.com> + + * environ.h (win_env::immediate): Declare new field. + (win_env::operator = ): Declare new operator. + (win_env::reset): Declare new function. + (win_env::~win_env): Declare new destructor. + (getwinenv): Add optional third argument to declaration. + * environ.cc (conv_envvars): Accommodate immediate field. + (win_env::operator =): Define new operator. + (win_env::~win_env): Define new destructor. + (win_env::add_cache): Add value to environment immediately if + "immediate" is set. + (getwinenv): Accept optional third argument which will be used to store + "cached" values to avoid overwriting real cache. + (spenv::force): Declare new field. + (spenvs): Accommodate force field. Add "PATH=" with force set to true. + (spenv::retrieve): Avoid duping anything if we're not building an + envblock. + (build_env): Ditto. Use size of potentially constructed new + environment block to determine if we need to create an environment + block. Pass getwinenv temporary storage to avoid inappropriately + overwriting the environment cache. + +2005-03-29 Eric Blake <ebb9@byu.net> + + * include/limits.h (NAME_MAX): New define. + (PATH_MAX): POSIX allows PATH_MAX to include trailing NUL. + +2005-03-29 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (is_floppy): Make externally available. + * path.h (is_floppy): Declare. + * syscalls.cc (sync): Check for floppies on A: and B: in guid case. + Don't call setmntent in non-guid case but evaluate drive bit mask + locally. + +2005-03-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc: Re-add exename. + +2005-03-28 Christopher Faylor <cgf@timesys.com> + + * include/ctype.h: Accommodate building in newlib. + +2005-03-28 Christopher Faylor <cgf@timesys.com> + + * timer.cc (getitimer): Check that ovalue is a valid pointer, not just + NULL. + +2005-03-28 Christopher Faylor <cgf@timesys.com> + + * timer.cc (timer_tracker::settime): Set times to zero when just + cancelling a timer. + +2005-03-28 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::detach): Revert to just waiting for thread + event since waiting for anything else is racy. + * timer.cc (timer_tracker::hcancel): Rename from cancel. + (timer_tracker::cancel): New method. + (timer_tracker::th): Remove. + (timer_tracker::~timer_tracker): Call cancel method. + (timer_tracker::timer_tracker): Ditto. + (timer_tracker::timer_tracker): Always, clear cancel, even though it is + probably not strictly necessary for ttstart. + (timer_thread): Accommodate cancel -> hcancel rename. + (timer_tracker::settime): Ditto. + (timer_tracker::gettime): Ditto. + (timer_delete): Ditto. + + * cygwin.din: Export _ctype_. + * include/ctype.h: Mark that _ctype_ is imported. + +2005-03-28 Christopher Faylor <cgf@timesys.com> + + * timer.cc (timer_tracker::timer_tracker): Eliminate simple + constructor. + (ttstart): Fully initialize. + + * errno.cc: Fix typo introduced in previous change. + +2005-03-28 Eric Blake <ebb9@byu.net> + + * errno.cc (FILENAME_EXCED_RANGE): Map to ENAMETOOLONG. + +2005-03-27 Christopher Faylor <cgf@timesys.com> + + * signal.cc (nanosleep): Revert tv_sec < 0 check as it is fixed + properly in the below change to hires.h. + +2005-03-27 Pierre Humblet <pierre.humblet@ieee.org> + + * times.cc (hires_ms::usecs): Compare the difference. + * hires.h: Add parentheses to HIRES_DELAY_MAX. + +2005-03-26 Christopher Faylor <cgf@timesys.com> + + * timer.cc (nanosleep): Treat tv_sec < 0 as invalid. + + * include/search.h: Make declarations consistent with newlib. + +2005-03-26 Pierre Humblet <pierre.humblet@ieee.org> + Christopher Faylor <cgf@timesys.com> + + * wininfo.h (wininfo::timer_active): Delete. + (wininfo::itv): Ditto. + (wininfo::start_time): Ditto. + (wininfo::window_started): Ditto. + (wininfo::getitimer): Ditto. + (wininfo::setitimer): Ditto. + (wininfo::wininfo): Ditto. + (wininfo::lock): New method. + (wininfo::release): Ditto. + * window.cc: Use new lock/acquire wininfo methods throughout. + (wininfo::wininfo): Delete + (wininfo::getitimer): Ditto. + (wininfo::setitimer): Ditto. + (getitimer): Ditto. + (setitimer): Ditto. + (ualarm): Ditto. + (alarm): Ditto. + (wininfo::lock): Define new function. + (wininfo::release): Ditto. + (wininfo::process): Delete WM_TIMER handling. + * timer.cc (struct timetracker): Delete it, flags. Add it_interval, + interval_us, sleepto_us, running, init_muto(), syncthread, and + gettime(). + (ttstart): Make NO_COPY. + (lock_timer_tracker): New class. + (timer_tracker::timer_tracker): Distinguish ttstart case. + (timer_tracker::~timer_tracker): New destructor. Clean out events, and + reset magic. + (timer_tracker::init_muto): New method. + (to_us): Round up as per POSIX. + (timer_thread): Reorganize to match timer_tracker::settime and + timer_tracker::gettime. Call sig_send without wait. Call + auto_release. + (timer_tracker::settime): Reorganize logic to avoid race. Call gettime + to recover old value. + (timer_tracker::gettime): New method. + (timer_create): Properly set errno on invalid timerid. Use new + lock_timer_tracker method. + (timer_delete): Ditto. Simplify code slightly. + (timer_gettime): New function. + (fixup_timers_after_fork): Reinit ttstart. + (getitimer): New implementation. + (setitimer): Ditto. + (ualarm): Ditto. + (alarm): Ditto. + * cygwin.din: Export timer_gettime. + * winsup.h: Remove has has_visible_window_station declaration. + +2005-03-26 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (DLL_OFILES): Add lsearch.o. + * cygthread.h (cygthread::notify_detached): New element. + (cygthread::cygthread): Take optional fourth argument signifying event + to signal on thread completion. + * cygthread.cc (cygthread::stub): Signal notify_detached event, if it + exists. + (cygthread::cygthread): Initialize notify_detached from fourth argument. + (cygthread::detach): Wait for notify_detached field is present. + + * lsearch.cc: New file. + * search.h: Ditto. + * include/cygwin/version.h: Bump API minor number to 126. + * cygwin.din: Export lsearch, lfind. + +2005-03-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::secret_event): Remove. + (fhandler_socket::af_local_set_secret): New function combining former + set_connect_secret and get_connect_secret into one function. + (fhandler_socket::af_local_setblocking): Rename from eid_setblocking. + (fhandler_socket::af_local_unsetblocking): Rename from + eid_unsetblocking. + (fhandler_socket::af_local_set_cred): New method. + (fhandler_socket::af_local_copy): New method. + (fhandler_socket::af_local_recv_secret): New method. + (fhandler_socket::af_local_send_secret): New method. + (fhandler_socket::af_local_recv_cred): Rename from eid_recv. + (fhandler_socket::af_local_send_cred): Rename from eid_send. + (fhandler_socket::af_local_accept): New method. + (fhandler_socket::af_local_set_sockpair_cred): Rename from + set_socketpair_eids. + (fhandler_socket::eid_accept): Remove. + (fhandler_socket::eid_connect): Remove. + (fhandler_socket::set_connect_secret): Remove. + (fhandler_socket::get_connect_secret): Remove. + (fhandler_socket::create_secret_event): Remove. + (fhandler_socket::check_peer_secret_event): Remove. + (fhandler_socket::signal_secret_event): Remove. + (fhandler_socket::close_secret_event): Remove. + (fhandler_socket::sec_event_accept): Remove. + (fhandler_socket::sec_event_connect): Remove. + * fhandler_socket.cc (secret_event_name): Remove. + (fhandler_socket::af_local_set_sockpair_cred): Rename from + set_socketpair_eids. + (fhandler_socket::af_local_setblocking): Rename from eid_setblocking. + (fhandler_socket::af_local_unsetblocking): Rename from + eid_unsetblocking. + (fhandler_socket::af_local_recv_secret): New function to receive + AF_LOCAL connect secret over socket itself. + (fhandler_socket::af_local_send_secret): New function to send AF_LOCAL + connect secret over socket itself. + (fhandler_socket::af_local_recv_cred): Rename from eid_recv. + (fhandler_socket::af_local_send_cred): Rename from eid_send. + (fhandler_socket::eid_connect): Remove. + (fhandler_socket::af_local_connect): Take over connect side handling + of AF_LOCAL secret and credential handshake. + (fhandler_socket::eid_accept): Remove. + (fhandler_socket::af_local_accept): New method, take over accept side + handling of AF_LOCAL secret and credential handshake. + (fhandler_socket::af_local_set_cred): New method, set eid credentials + to start values. + (fhandler_socket::af_local_copy): New method, copy secret and + credentials to another socket. + (fhandler_socket::af_local_set_secret): New function combining former + set_connect_secret and get_connect_secret into one function. + (fhandler_socket::create_secret_event): Remove. + (fhandler_socket::signal_secret_event): Remove. + (fhandler_socket::close_secret_event): Remove. + (fhandler_socket::check_peer_secret_event): Remove. + (fhandler_socket::sec_event_connect): Remove. + (fhandler_socket::sec_event_accept): Remove. + (fhandler_socket::fixup_after_fork): Drop secret_event handling. + (fhandler_socket::bind): Call af_local_set_secret. + (fhandler_socket::connect): Call af_local_set_cred and af_local_connect. + (fhandler_socket::listen): Call af_local_set_cred. + (fhandler_socket::accept): Call af_local_copy and af_local_accept on + accepted socket. + (fhandler_socket::close): Don't call close_secret_event. + (fhandler_socket::set_close_on_exec): Don't set secret_event + inheritance. + * net.cc (cygwin_getsockopt): Add debug output. + (socketpair): Call af_local_set_sockpair_cred instead of + set_socketpair_eids. + * select.cc (set_bits): Drop AF_LOCAL special handling in case + of except bit set. + +2005-03-23 Christopher Faylor <cgf@timesys.com> + + * include/ctype.h: Always define macros when inside cygwin. + (isblank): New macro. + +2005-03-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::eid_connect): Make private. + (fhandler_socket::set_connect_secret): Ditto. + (fhandler_socket::get_connect_secret): Ditto. + (fhandler_socket::create_secret_event): Ditto. Remove secret argument. + (fhandler_socket::check_peer_secret_event): Ditto. + (fhandler_socket::signal_secret_event): Make private. + (fhandler_socket::close_secret_event): Ditto. + (fhandler_socket::sec_event_accept): New private method. + (fhandler_socket::sec_event_connect): Ditto. + (fhandler_socket::af_local_connect): New public method. + * fhandler_socket.cc: Use 'struct sockaddr' and 'struct sockaddr_in' + rather than just 'sockaddr' and 'sockaddr_in' throughout. + (fhandler_socket::eid_connect): Drop AF_LOCAL/SOCK_STREAM test. + (fhandler_socket::create_secret_event): Remove secret argument. + Always use connect_secret instead. + (fhandler_socket::check_peer_secret_event): Ditto. + (fhandler_socket::sec_event_connect): New method, combining entire + secret event handshake on connect side. + (fhandler_socket::af_local_connect): New method, combining secret + event handshake and eid credential transaction on connect side, to + be called from select. + (fhandler_socket::sec_event_accept): New method, combining entire + secret event handshake on accept side. + (fhandler_socket::connect): Drop secret, use connect_secret instead. + Move entire secret event handshake to sec_event_connect. + (fhandler_socket::accept): Move entire secret event handshake to + sec_event_accept. + * select.cc (set_bits): Just call af_local_connect here. + +2005-03-23 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Change comment for most recent API version + bump to reflect new additions to the DLL and to remove change obsoleted + by the previous checkin. + +2005-03-23 Christopher Faylor <cgf@timesys.com> + + * include/ctype.h: New file. + * ctype.cc: Ditto. + * Makefile.in: Add ctype.o to DLL_OFILES. + * cygwin.din: Remove _ctype_ptr (for now?). + +2005-03-22 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (DLL_OFILES): Add hookapi.o. Eliminate some cruft. + * cygheap.h (cygheap_types): Add new enum: HEAP_1_HOOK. + (hook_chain): New struct. + (init_cygheap::hooks): Define new element. + * cygheap.cc (cygheap_fixup_in_child): Zero hook chain on exec. + * dcrt0.cc (dll_crt0_1): Call ld_preload just before calling main function. + * external.cc (cygwin_internal): Implement CW_HOOK. + * fork.cc (fork_child): Call fixup_hooks_after_fork. + * init.cc (cygwin_hmodule): Reinstate after a long absence. + * include/sys/cygwin.h: Define CW_HOOK. + * hookapi.cc: New file. + + * select.cc (start_thread_socket): Add debugging output. + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): gcc 4.x + accommodation. + + * fhandler_socket.cc (fhandler_socket::connect): Make sure that err is + initialized. + +2005-03-22 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (__ctype_ptr): Export. + * include/cygwin/version.h: Bump API minor version. + +2005-03-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class cygthread): Remove forward declaration. + +2005-03-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class cygthread): Forward declare. + (fhandler_socket::sec_pipe): Remove. + (fhandler_socket::eid_pipe_name): Remove. + (fhandler_socket::eid_setblocking): New private method. + (fhandler_socket::eid_unsetblocking): Ditto + (fhandler_socket::eid_recv): Ditto + (fhandler_socket::eid_send): Ditto + (fhandler_socket::eid_accept): Ditto + (fhandler_socket::eid_connect): New public method. + * fhandler_socket.cc (ASYNC_MASK): Move to beginning of file. + (fhandler_socket::eid_pipe_name): Remove. + (fhandler_socket::set_socketpair_eids): Move down to fhandler_socket + methods. + (fhandler_socket::fhandler_socket): Drop initializing sec_pipe. + (fhandler_socket::~fhandler_socket): Drop closing sec_pipe. + (fhandler_socket::eid_setblocking): New method. + (fhandler_socket::eid_unsetblocking): New method. + (fhandler_socket::eid_recv): New method. + (fhandler_socket::eid_send): New method. + (fhandler_socket::eid_connect): New method. + (fhandler_socket::eid_accept): New method. + (fhandler_socket::dup): Drop sec_pipe handling. + (fhandler_socket::connect): Fix WinSock error handling. Prepare + eid credential transaction. Call eid_connect on successful connect. + (fhandler_socket::listen): Drop creating sec_pipe. + (fhandler_socket::accept): Slightly simplify code. Call eid_accept + on accepted socket. + (fhandler_socket::getpeereid): Reshuffle code for readability. Fix + test for invalid pid. + * select.cc (set_bits): Call eid_connect on successfully connected + socket. + +2005-03-19 Christopher Faylor <cgf@timesys.com> + + * child_info.h (fork_info): Use different method to alias variable. + (spawn_info): Ditto. + * cxx.cc (__cxa_guard_acquire): New function (needed for gcc 4.x). + (__cxa_guard_release): Ditto. + * devices.in: Make sure stuff is correctly bracketed (for gcc 4.x). + * devices.cc: Regenerate. + * fhandler.h (fhandler_disk_file::fchmod): Avoid left coercion (for gcc + 4.x). + * smallprint.c (__rn): Declare as __fastcall since gcc 4.x complains + about use of regparm, for some reason. + * sync.h (sync::init_lock): Remove. + * sync.cc (sync::init_lock): Ditto. + +2005-03-18 Christopher Faylor <cgf@timesys.com> + + * net.cc (cygwin_getprotobyname): Don't try to be fancy with return + values. + (cygwin_getprotobynumber): Ditto. + +2005-03-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::utimes): Handle opening + directories under 9x gracefully. + +2005-03-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::connect): Always set sun_path + in case of a successful or pending connect. + (fhandler_socket::accept): Don't run secret event and eid credential + transactions if OS accept returned WSAEWOULDBLOCK. + +2005-03-16 Christopher Faylor <cgf@timesys.com> + + * fhandler_tape.cc (get_ll): This is a generally useful function so + move it + * winsup.h (get_ll): to here. + * security.cc (get_token_group_sidlist): Use get_ll to figure out the + long long version of the luid since QuadPart is not part of the + standard Windows API. + +2005-03-16 Christopher Faylor <cgf@timesys.com> + + * dir.cc: Rename opendir_* to dirent_* throughout. + (opendir_states): Move and rename. + * fhandler.h (dirent_states): to here. + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use raw readdir + when skipping through entries since it is keeping track of "." and + "..". + (fhandler_cygdrive::seekdir): Use fhandler_disk_file::readdir to do + everything. + * fhandler_virtual.cc (fhandler_virtual::opendir): Set flag indicating + that we provide . and .. + (fhandler_virtual::seekdir): Ditto. + (fhandler_virtual::rewinddir): Ditto. + * fhandler_registry.cc (fhandler_registry::rewinddir): Ditto. + +2005-03-16 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (free_local): New macro. + (_cygtls::remove): Use free_local to free known-malloced local + variables. + * cygtls.h: Mark some variables as "malloced". + * net.cc (enum struct_type): Rename from is_* to t_* for clarity. + (dump_protoent): Delete. + (dup_ent): New macro. + (__dup_ent): Renamed from dup_ent. Change arguments for convenience. + Replace first argument with newly alloced value. Allocate a rounded + number of bytes in an attempt to try to reuse space. Subsume + "dump_protent". + (cygwin_getprotobyname): Simplify using new dup_ent functionality. + (cygwin_getprotobynumber): Ditto. + (cygwin_getservbyname): Ditto. + (cygwin_getservbyport): Ditto. + (cygwin_gethostname): Ditto. + (cygwin_gethostbyname): Ditto. + * tlsoffsets.h: Regenerate. + + * syslog.cc (openlog): Use NULL rather than 0, for consistency with the + rest of cygwin. + (pass_handler::initialize): Use unbuffered I/O in pass one. + +2005-03-15 Christopher Faylor <cgf@timesys.com> + + * errno.cc (errmap): Correct typo in previous change. + +2005-03-15 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Free process_ident, if it exists. + + * errno.cc (errmap): ERROR_DISK_CORRUPT -> EIO. + +2005-03-11 Christopher Faylor <cgf@timesys.com> + + * path.h (pathconv_arg): Define PC_NO_ACCESS_CHECK. + (path_types): Define PATH_NO_ACCESS_CHECK == PC_NO_ACCESS_CHECK. + * path.cc (symlink_info::check_sysfile): Move to symlink_info class and + eliminate arguments that are part of class. Use set_error. + (symlink_info::check_shortcut): Ditto. + (symlink_info::set_error): New function. + (path_conv::check): Pass PC_NO_ACCESS_CHECK to symlink_info::check. + (symlink_info::check): Preserve PC_NO_ACCESS_CHECK in pflags. Use + set_error. + +2005-03-10 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (is_floppy): New function. + (setmntent): Drop floppy drives on A: and B: from logical drive DWORD. + * syscalls.cc (sync): Don't sync floppies on A: and B:. + +2005-03-10 Christopher Faylor <cgf@timesys.com> + + * autoload.cc (LoadDLLprime): Use nocopy segment or forked processes + will not initialize properly. + +2005-03-10 Christopher Faylor <cgf@timesys.com> + + * autoload.cc (LoadDLLprime): Scrap use of .linkonce and just use an + ifdef guard to load .foo_init into data segment. + + * dcrt0.cc (initial_env): Allow colon or space as CYGWIN_DEBUG + separator for consistency. + +2005-03-09 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (pinfo::pinfo): Clear more elements in the constructor. + +2005-03-09 Christopher Faylor <cgf@timesys.com> + + * net.cc (dup_ent): Revert older stupid test for null. Don't copy name + if it is NULL. + +2005-03-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::eid_pipe_name): Fix format + string. + (fhandler_socket::connect): Set sun_path before running eid credential + transaction. Run transaction only if OS connect was successful. + (fhandler_socket::accept): Run transaction only if OS accept was + successful. + +2005-03-09 Corinna Vinschen <corinna@vinschen.de> + + * signal.cc (sigprocmask): Rename first parameter to "how". + (handle_sigprocmask): Ditto. Check "how" for being a valid "how" value. + Fix call order in case of wrong "how" value. + +2005-03-09 Christopher Faylor <cgf@timesys.com> + + * net.cc (dup_ent): Revert previous stupid change. + +2005-03-09 Christopher Faylor <cgf@timesys.com> + + * net.cc (dup_ent): Avoid dereferencing a null pointer in a debug_printf. + +2005-03-09 Christopher Faylor <cgf@timesys.com> + + * path.cc (path_conv::check): Treat ENOSHARE similarly to ENOENT when + determining if there was a problem with a symlink. + +2005-03-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::listen): Don't limit the number + of pipe instances. + +2005-03-08 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::exit): Right shift exit value by eight when not + started in a cygwin environment. + +2005-03-07 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Handle MAP_AUTOGROW flag. + (fhandler_disk_file::mmap): Ditto. Clean conditional for readability. + * include/sys/mman.h: Add MAP_AUTOGROW flag. + * include/cygwin/version.h: Bump API minor version. + +2005-03-08 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Eliminate muto::init call. + * sync.h (locker): New, currently unused class. + (muto::init): Eliminate. + * sync.cc (muto::init): Ditto. + (muto::init): Eliminate critical section lock and instead use name as a + guard to prevent against multiple attempts to initialize the same muto. + + * pinfo.cc (pinfo::init): Set myself procinfo when not execing and pid + matches windows pid or cygwin pid. + +2005-03-06 Pavel Tsekov <ptsekov@gmx.net> + + * path.cc (mount_info::read_cygdrive_info_from_registry): Use the user + prefix if it exists. + +2005-03-06 Christopher Faylor <cgf@timesys.com> + + * sync.h (sync::init_lock): Declare new static member. + (sync::init()): Declare new static function. + * sync.cc (sync::init): Define. + (sync::init): Lock attempt to initialize a muto to stop multiple + threads from colliding. + * dcrt0.cc (dll_crt0_0): Initialize muto environment. + +2005-03-06 Christopher Faylor <cgf@timesys.com> + + * path.cc (special_name): Reorganize to always detect the use of + special names first, before detecting special characters. + +2005-03-04 Christopher Faylor <cgf@timesys.com> + + * fhandler_clipboard.cc: Use int for cygnativeformat rather than UINT + as that is what is returned by GetPriorityClipboardFormat. + (fhandler_dev_clipboard::read): Ditto for the format variable. + +2005-03-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open_9x): Satisfy query_open values. + +2005-03-04 Pierre Humblet <pierre.humblet@ieee.org> + + * fhandler_socket.cc (fhandler_socket::ioctl): Only cancel + WSAAsyncSelect when async mode is on. + +2005-03-03 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (utmpxname): Export. + * syscalls.cc (utmpxname): Create export alias to utmpname. + * include/utmpx.h: Define ut_name and ut_xtime if not already defined. + (utmpxname): Add prototype. + * include/sys/utmp.h: Only define ut_name if not already defined. + * include/cygwin/version.h: Bump API minor version. + +2005-03-03 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::detach): Use a slightly higher priority when + waiting for thread signalling. + +2005-03-02 Christopher Faylor <cgf@timesys.com> + + * autoload.cc (std_dll_init): Save and restore fpu control register + around LoadAddress to prevent loaded dlls (like msvcrt.dll) from + setting unwanted stuff. + +2005-03-02 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Don't attempt any removal activities if + exitsock is zero. + +2005-03-02 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::init_thread): Move exitsock setting later. It + should always be set. + (_cygtls::remove): Detect zero exitsock. Not quite sure why this is needed. + +2005-03-02 Christopher Faylor <cgf@timesys.com> + + * autoload.cc (LoadDLLprime): Mask error code to low-order 16 bits. + (noload): Preserve sign when returning error code. + +2005-03-02 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (do_cleanup): Properly restore SIGINT/SIGQUIT even if they + had previously been SIG_DFL. + +2005-03-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): Replace + GetSystemTime/SystemTimeToFileTime with GetSystemTimeAsFileTime. + * times.cc (time_as_timestruc_t): Ditto. + (time): Ditto. + +2005-03-01 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor number to 14. + +2005-03-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_clipboard.cc (fhandler_dev_clipboard::write): Never set + errno to 0. + (fhandler_dev_clipboard::read): Ditto. + * fhandler_windows.cc (fhandler_windows::read): Ditto. + * scandir.cc (scandir): Ditto. + * syscalls.cc (_fstat64_r): Ditto. + (_fstat_r): Ditto. + (_stat64_r): Ditto. + (_stat_r): Ditto. + + * mmap.cc (mmap64): Fix /dev/zero mapping. + +2005-02-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Declare new method + set_socketpair_eids. + * fhandler_socket.cc (fhandler_socket::set_socketpair_eids): New method. + (fhandler_socket::dup): Duplicate sec_pipe if necessary. + (fhandler_socket::listen): Only create sec_pipe if named pipes are + available. Initialized sec_peer_pid to 0 as on Linux. + (fhandler_socket::connect): Only run eid credential transaction if + named pipes are available. Fake otherwise. Initialized sec_peer_pid + to 0 as on Linux. + (fhandler_socket::accept): Ditto. + (fhandler_socket::close): Move closing sec_pipe handle from here... + (fhandler_socket::~fhandler_socket): ... to here. + * net.cc (socketpair): Set eid credentials by calling + fhandler_socket::set_socketpair_eids() on both socket ends. + * wincap.h (wincaps::has_named_pipes): New element. + * wincap.cc: Implement above element throughout. + +2005-02-26 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (_pinfo::set_ctty): Move function + * pinfo.cc (_pinfo::set_ctty): to here. + + * fhandler_mem.cc (fhandler_dev_mem::fstat): Don't fill out structure + if this is an on-disk device rather than an "auto" device. + * fhandler_raw.cc (fhandler_dev_raw::fstat): Ditto. + + * path.cc (normalize_posix_path): Don't treat a standalone '//' as + introducing a UNC path. + (normalize_win32_path): Ditto. + +2005-02-26 Christopher Faylor <cgf@timesys.com> + + * debug.cc (delete_handle): Report on handle value in debugging output. + + * pinfo.h (_pinfo::exists): Declare "new" function. + (_pinfo::kill): Ditto. + * fhandler_termios.cc (tty_min::kill_pgrp): Use _pinfo::exists rather + than proc_exists. + * pinfo.cc (pinfo::init): Ditto. Don't do a low_priority_sleep(0) when + looping to find exec'ed procinfo. + (pinfo::release): Be more careful about unmapping and closing. + * signal.cc (_pinfo::kill): Rename from kill_worker. Accommodate entry + into _pinfo class. + (kill0): Use _pinfo::kill rather than kill_worker. + (kill_pgrp): Ditto. Use _pinfo::exists rather than proc_exists. + * sigproc.cc (_pinfo::exists): Rename from proc_exists. + (pid_exists): Use _pinfo::exists rather than proc_exists. + (remove_proc): Ditto. + * sigproc.h (proc_exists): Delete declaration. + +2005-02-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_base): Declare fixup_mmap_after_fork + with additional flags parameter. Change offset parameter to _off64_t. + (class fhandler_disk_file): Ditto. + (class fhandler_dev_mem): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::fixup_mmap_after_fork): + Accommodate new parameters. + * mmap.cc: Include ntdll.h. + (class mmap_record): Add flags member. + (mmap_record::mmap_record): Add flags parameter. + (mmap_record::get_flags): New method. + (class map): Add next_anon_addr member to store next anonymous mapping + address suggestion. + (map::get_next_anon_addr): New method. + (map::set_next_anon_addr): New method. + (mmap64): Don't align offset and length to granularity in case of + MAP_ANONYMOUS on NT. Check for already existing mapping only on 9x. + Call mmap_record::mmap_record with additional flags argument. + (fhandler_base::fixup_mmap_after_fork): Accommodate new parameters. + (fhandler_disk_file::mmap): Use NtMapViewOfSection with + AT_ROUND_TO_PAGE flag for anonymous mappings on NT. If addr is NULL, + try to map adjacent to previous mapping. + (fhandler_disk_file::fixup_mmap_after_fork): Add flags argument. + Change offset parameter to _off64_t. Use NtMapViewOfSection to + re-create anonymous mappings on NT. + (fixup_mmaps_after_fork): Accommodate new parameters when calling + fhandler's fixup_mmaps_after_fork function. + * ntdll.h (AT_ROUND_TO_PAGE): New define. + +2005-02-25 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Handle anonymous MAP_FIXED request on + non-granulation boundary. + +2005-02-25 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (class mmap_record): Declare new map_pages method with + address parameter. + (mmap_record::map_pages): New method with address parameter. + (mmap64): Evaluate access mode before checking if already existing + mapping can be used. + Only use existing mapping if requested access mode matches the one + in the existing mapping. + Add check for existing mapping for anonymous MAP_FIXED case. + +2005-02-23 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc: Implement setting __tzrule's offset member using + newlib's __gettzinfo () interface. + (__tzrule): Remove. + (timezone): Define as long according to POSIX. + +2005-02-23 Eric Blake <ebb9@byu.net> + + * devices.in (parsedisk): Fix typo. + * devices.cc: Regenerate. + +2005-02-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (getpeereid): Export. + * fhandler.h (class fhandler_socket): Add pipe and id members to + exchange eid credentials for AF_LOCAL sockets. + (eid_pipe_name): Declare new method. + (getpeereid): Ditto. + * fhandler_socket.cc (fhandler_socket::eid_pipe_name): New method. + (fhandler_socket::fhandler_socket): Initialize sec_pipe. + (fhandler_socket::connect): Exchange eid credentials with accepting + socket process. + (fhandler_socket::listen): Prepare eid credential transaction. + (fhandler_socket::accept): Exchange eid credentials with connecting + socket process. + (fhandler_socket::close): Close eid credentials pipe if open. + (fhandler_socket::getpeereid): New method. + * net.cc (cygwin_getsockopt): Add SO_PEERCRED handling. + (getpeereid): New function. + * include/asm/socket.h (SO_PEERCRED): Define. + * include/cygwin/socket.h (struct ucred): Define new type. + * include/cygwin/version.h: Bump API minor version. + +2005-02-23 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/statvfs.h (ST_RDONLY): Define. + (ST_NOSUID): Define. + +2005-02-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (fstatvfs): Export. + (statvfs): Export. + * syscalls.cc: Include sys/statvfs.h. + (statvfs): New function. Move statfs functionality here. + (fstatvfs): New function. + (statfs): Just call statvfs and copy structure. Check validity of + incoming struct statfs pointer. + * include/cygwin/types.h (fsblkcnt_t): Define. + (fsfilcnt_t): Define. + * include/cygwin/version.h: Bump API minor version. + * include/sys/statvfs.h: New file. + +2005-02-23 Corinna Vinschen <corinna@vinschen.de> + + * devices.h: Switch FH_ZERO and FH_PORT as on Linux. Add FH_FULL. + * devices.in: Add /dev/full. + * devices.cc: Regenerate. + * dtable.cc (build_fh_pc): Add FH_FULL. + * fhandler.cc (fhandler_base::fstat): Set FH_FULL permission bits + correctly. + * fhandler_zero.cc (fhandler_dev_zero::write): Set errno to ENOSPC + and return -1 if device is FH_FULL. + +2005-02-22 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_cygdrive::closedir): Return 0 when + closing cygdrive_root. + +2005-02-22 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (basename): Export. + (dirname): Export. + * path.cc (basename): New function. + (dirname): New function. + * include/libgen.h: New file. + * include/cygwin/version.h: Bump API minor version. + +2005-02-22 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (peek_pipe): Disable new pipe code until there's + a working substitute. + +2005-02-22 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (fdatasync): Export. + * fhandler.cc (fhandler_base::fsync): Return with EINVAL if no + handle is available. + * syscalls.cc (fdatasync): Create export alias to fsync. + * include/cygwin/version.h: Bump API minor version. + +2005-02-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::fstat_helper): Declare with additional + dwVolumeSerialNumber argument. Drop default values for last three + arguments. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Pass + dwVolumeSerialNumber from GetFileInformationByHandle to fstat_helper. + (fhandler_base::fstat_by_name): Pass pc.volser () to fstat_helper. + Accommodate dropping default values for last three arguments of + fstat_helper. + (fhandler_base::fstat_helper): Add dwVolumeSerialNumber argument. + Use for st_dev member unless 0 in which case pc.volser () is used. + +2005-02-20 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (FindFirstVolumeA): Add. + (FindNextVolumeA): Add. + (FindVolumeClose): Add. + (GetVolumePathNamesForVolumeNameA): Add. + * fhandler.h (class fhandler_base): Declare new method fsync. + * fhandler.cc (fhandler_base::fsync): New method. + * syscalls.cc (fsync): Move functionality into fhandler method fsync. + Just call this method from here. + (sync_worker): New static function. + (sync): Fill with life for NT systems. + * wincap.h (wincaps::has_guid_volumes): New element. + * wincap.cc: Implement above element throughout. + +2005-02-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (enum query_state): Add query_write_attributes state. + (fhandler_base::status.query_open): Add a bit to make room for more + states. + (class fhandler_base): Declare new method utimes. + (class fhandler_socket): Ditto. + (class fhandler_disk_file): Ditto. + (fhandler_disk_file::fhandler_disk_file): Add constructor with + path_conv parameter. + * fhandler.cc (fhandler_base::open): Add query_write_attributes + handling. + (fhandler_base::utimes): New method. + * fhandler_disk_file.cc (fhandler_disk_file::link): Simplify. + Open file with query_write_attributes instead of query_write_control. + (fhandler_disk_file::utimes): New method. + (fhandler_disk_file::fhandler_disk_file): Add constructor with + path_conv parameter setting pc member immediately. + * fhandler_socket.cc (fhandler_socket::fchmod): Use new + fhandler_disk_file constructor. + (fhandler_socket::fchown): Ditto. + (fhandler_socket::facl): Ditto. + (fhandler_socket::link): Ditto. + (fhandler_socket::utimes): New method. + * times.cc: Include dtable.h. + (timeval_to_filetime): Make non-static. + (utimes): Move functionality into fhandler method utimes. Just call + this method from here. + * winsup.h: Simplify declarations of time helper functions. + (timeval_to_filetime): Add extern declaration. + +2005-02-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_base): Declare new method link. + (class fhandler_socket): Ditto. + (class fhandler_disk_file): Ditto. + * fhandler.cc (fhandler_base::open): Add FILE_WRITE_ATTRIBUTES + to query_write_control access flags. + (fhandler_base::link): New method. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't try to + open with O_WRONLY since query_write_control includes + FILE_WRITE_ATTRIBUTES. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::facl): Ditto. + (fhandler_disk_file::link): New method. Touch st_ctime on successful + link. + * fhandler_socket.cc (fhandler_socket::link): New method. + * syscalls.cc (link): Move functionality into fhandler method link. + Just call this method from here. + +2005-02-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Declare new methods fchown, + fchmod and facl. + * fhandler_socket.cc (fhandler_socket::fstat): Handle AF_LOCAL + sockets. + (fhandler_socket::fchmod): New method. + (fhandler_socket::fchown): New method. + (fhandler_socket::facl): New method. + +2005-02-19 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc: Temporary implementation of setting __tzrule's offset + member to be used by strftime. + (__tzrule): New global variable. + (tzparse): Set __tzrule's offset member appropriately. + +2005-02-17 Christopher Faylor <cgf@timesys.com> + + * path.cc (path_conv::check): Set fs flag when a unix-domain socket + is detected. + +2005-02-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Set st_ctime if + has_changed flag is set. + (fhandler_disk_file::touch_ctime): Reset has_changed flag on success. + +2005-02-17 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (utimes): Open files with FILE_WRITE_ATTRIBUTES first, + if that fails, try opeing with GENERIC_WRITE. Fix comments. + +2005-02-15 Christopher Faylor <cgf@timesys.com> + + * path.h (path_conv::issocket): Return true if device == FH_UNIX rather + than expecting path_conv to set a flag. + +2005-02-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::raw_write): Mark as changed on + successful write. + * fhandler.h (fhandler_base::status_flags): Add 'has_changed' flag. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call + fhandler_disk_file's own open and close instead of open_fs and + close_fs. Mark as changed on success. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::facl): Ditto. + (fhandler_disk_file::ftruncate): Ditto. + (fhandler_base::open_fs): Mark as changed when O_TRUNC flag on existing + file is set. + (fhandler_disk_file::close): Set st_ctime if has_changed flag is set. + +2005-02-11 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::release): Reset ev here if it exists. + (cygthread::terminate_thread): Eliminate racy code which reset ev and + thread_sync. Remove a few nonsensical inuse checks. Exit at the + bottom. + (cygthread::detach): Rewrite to again try to ensure that we don't say + we're signalled when we are not signalled. + * fhandler.cc (fhandler_base::raw_read): Revert to signalling read + success quickly. + * pipe.cc (fhandler_pipe::close): Use base method to close handle. + * sigproc.h (WAIT_SIG_PRIORITY): Just trundle along at normal priority + to allow the pipe thread to do its thing if possible. + + * pinfo.h (pinfo::zap_cwd): Declare new function. + (pinfo::zap_cwd): Move 'cd out of the way code' here. + (pinfo::exit): Use it here. + * spawn.cc (spawn_guts): And here. + +2005-02-11 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (utimes): Open files with GENERIC_WRITE on file systems + not supporting ACLs. + +2005-02-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Fix checking + lseek return code. + +2005-02-08 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (timeval_to_filetime): Define first parameter const. + (utimes): Define second parameter to const according to SUSv3. + (utime): Ditto. + * include/sys/utime.h (utime) : Change declaration accordingly. + +2005-02-08 Corinna Vinschen <corinna@vinschen.de> + + * cygthread.cc (cygthread::detach): Just test thread handle after + signal arrived, don't wait infinitely for it. + +2005-02-08 Christopher Faylor <cgf@timesys.com> + + * pipe.cc (fhandler_pipe::read): Remove hold over from old read_state + implementation. + +2005-02-06 Yitzchak Scott-Thoennes <sthoenna@efn.org> + + * net.cc (cygwin_gethostbyname): Be more picky about what's a numeric + address string, and use tls in that case too. + +2005-02-07 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc: Make windows_system_directory non-static. + * pinfo.cc (pinfo::exit): Change innocuous cd'ed location to one that + is more likely to exist. + +2005-02-06 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Leave symlink expansion loop in case + a not-ENOENT error happens. + + * cygheap.h (cygheap_fdmanip::fhandler_pipe *): New cast operator. + * pinfo.cc (_pinfo::commune_recv): Add PICOM_PIPE_FHANDLER handling. + (_pinfo::commune_send): Ditto. + (_pinfo::pipe_fhandler): New method. + * pinfo.h (enum picom): Add PICOM_PIPE_FHANDLER. + (_pinfo::pipe_fhandler): Declare. + * pipe.cc (fhandler_pipe::open): Rewrite. Allow to open foreign + pipe handles. + +2005-02-03 Christopher Faylor <cgf@timesys.com> + + * cygthread.h (cygthread::terminate_thread): Reflect return value. + * cygthread.cc (cygthread::detach): Be more careful about ensuring that + sigwait is properly waited for to avoid later missynchronization. + (cygthread::terminate_thread): Return true if thread was actually + terminated and all handles were closed. + * fhandler_base.cc (fhandler_base::raw_read): Use signal_read_state + rather than raw calls to win32 api. + (fhandler_base::read): Ditto. + * fhandler.h (fhandler_pipe::fixup_after_exec): Use method to create + read_state signalling. + (fhandler_pipe::create): Ditto. + + * Makefile.in: Make some more files -fomit-frame-pointer. + +2005-02-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::ftruncate): Define new virtual method. + (fhandler_disk_file::ftruncate): Ditto. + * fhandler.cc (fhandler_base::ftruncate): New method. + * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto. + * syscalls.cc (ftruncate64): Move functionality into fhandlers. + Call fhandler method from here. + +2005-02-02 Corinna Vinschen <corinna@vinschen.de> + + * pipe.cc (fhandler_pipe::dup): Fix conditionals in case of error. + +2005-02-02 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (utimes): Mark st_ctime for update according to SUSv3. + +2005-02-01 Christopher Faylor <cgf@timesys.com> + + * fhandler_proc.cc (format_proc_partitions): Remove PartitionType check + since it could skip over partitions that are actually interesting. + +2005-02-01 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::terminate_thread): Wait briefly for + notification event in the event that the thread was actually in the + process of exiting. + + * pipe.cc (fhandler_pipe::dup): read_state is not supposed to be + inheritable. Fix that. + + * path.cc (path_conv::check): Set symlen = 0 to avoid a compiler + warning. + + * devices.h (devices::parsedisk): Declare new function. + * devices.in (devices::parsedisk): Define new function. + * dtable.cc (dtable::init_std_file_from_handle): Use device numbers + rather than name. + * fhandler_proc.cc (format_proc_partitions): Use parsedisk to generate + disk names from numeric codes. (This was broken on two of my + systems previously and is still broken now) + +2005-02-01 Corinna Vinschen <corinna@vinschen.de> + + * pipe.cc (fhandler_pipe::open): Allow re-opening of /proc/<pid>/fd + pipes of the current process. + +2005-02-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::get_proc_fd_name): Don't generate + "device:" entry. + * fhandler.h (fhandler_socket::open): New method. + (fhandler_pipe::open): New method. + * fhandler_proc.cc (fhandler_proc::exists): Return -2 in case of + /proc/self. + * fhandler_process.cc (fhandler_process::exists): Return -2 in + case of symlinks, -3 for pipes and -4 for sockets. + (fhandler_process::fstat): Handle pipes and sockets. + (fhandler_process::open): Handle opening /proc/<pid>/fd. + (fhandler_process::fill_filebuf): Generate empty names for + non exisiting file descriptors. + * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Always + generate "socket:[number]" strings as on Linux. + (fhandler_socket::open): New method. + (fhandler_socket::fstat): Always return socket type. + * path.cc (symlink_info::set): Remove unused second parameter. + (path_conv::check): Handle pipes and sockets in /proc. + Set correct device type for AF_LOCAL sockets. + * pinfo.cc (_pinfo::commune_recv): Generate empty names for + non exisiting file descriptors. + (_pinfo::fd): Ditto. + * pipe.cc (fhandler_pipe::open): New method. + +2005-01-31 Christopher Faylor <cgf@timesys.com> + + * path.h (path_conv::set_name): Declare new function. + * path.cc (path_conv::set_name): Define new function. + * fhandler.h (fhandler_dev_null::open): Declare new function. + * fhandler.cc (fhandler_dev_null::open): Define new function. + +2005-01-31 Christopher Faylor <cgf@timesys.com> + + * smallprint.c (rnarg): Use long rather than unsigned long so that we + get proper sign extension. + +2005-01-31 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (set_traverse): New function. + (parse_thing): Add "traverse" option. Sort options alphabetically. + (environ_init): On NT, switch on traverse checking by default. + +2005-01-31 Christopher Faylor <cgf@timesys.com> + + * smallprint.c (__rn): Regparmize. + +2005-01-31 Christopher Faylor <cgf@timesys.com> + + * smallprint.c (rnarg): New macro. + (rnargLL): Ditto. + (__rn): Rename from 'rn', add a mask argument, and use the mask + argument to control how many significant digits to care about. + (__small_vsprintf): Use __rn, rnarg, rnargLL, as appropriate. + +2005-01-31 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::exit): Only return low-order 16 bits when exiting. + +2005-01-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (format_process_maps): Get destbuf argument by + reference. Allow resizing of destbuf as necessary. Fix string + handling. + +2005-01-31 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class cygheap_fdenum): New class to enumerate used + fhandlers. + * dtable.h (class dtable): Add cygheap_fdenum as friend class. + * fhandler.h (fhandler_base::get_proc_fd_name): New virtual method + to return a name for /proc/<pid>/fd. + (fhandler_socket::get_proc_fd_name): Ditto. + (fhandler_pipe::get_proc_fd_name): Ditto. + (fhandler_virtual::opendir): Make virtual method. + (fhandler_process::opendir): New method. + * fhandler.cc (fhandler_base::get_proc_fd_name): New method. + * fhandler_process.cc: Include ctype.h. + (PROCESS_FD): Define. + (process_listing): Add "fd". + (fhandler_process::exists): Fix comment. Return 1 in case of "fd" + directory. Handle files below "fd". + (fhandler_process::fstat): Drop "self" handling. Set correct link + count for directories. + (fhandler_process::opendir): New method to handle "fd" directory. + (fhandler_process::readdir): Add "fd" handling. + (fhandler_process::open): Drop "self" handling. + (fhandler_process::fill_filebuf): Ditto. Add "fd" handling. Fix + "maps" output string. + * fhandler_registry.cc (fhandler_registry::fstat): Set correct link + count for directories. + * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): New method. + * path.cc (symlink_info::set): Fix thinko. + * pinfo.cc (_pinfo::commune_recv): Rename pathbuf to path throughout. + Drop local path variable in PICOM_FIFO case. Fix debug output. + Close handles as early as possible. Add PICOM_FDS and PICOM_FD + handling. + (_pinfo::commune_send): Add PICOM_FDS and PICOM_FD handling. + (_pinfo::fd): New method. + (_pinfo::fds): New method. + * pinfo.h (enum picom): Add PICOM_FDS and PICOM_FD. + (_pinfo::fd): Declare. + (_pinfo::fds): Declare. + * pipe.cc (fhandler_pipe::get_proc_fd_name): New method. + +2005-01-29 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.c (rn): Change uval to unsigned long long to fix 64 bit + handling. + * fhandler_process.cc (format_process_maps): Print major, minor and + inode numbers correctly. + +2005-01-29 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetModuleFileNameExA): Add. + (GetModuleInformation): Add. + (QueryWorkingSet): Add. + * fhandler.h (fhandler_virtual::get_filebuf): New method. + * fhandler_proc.cc (PROC_SELF): Define. + (proc_fhandlers): Change type of self to FH_PROC. + (fhandler_proc::exists): Return -3 if self. + (fhandler_proc::fstat): Handle self as symlink. + (fhandler_proc::fill_filebuf): Handle self. + * fhandler_process.cc: Include psapi.h. + (PROCESS_EXENAME): Remove. + (PROCESS_MAPS): Define. + (PROCESS_ROOT): Define. + (PROCESS_EXE): Define. + (PROCESS_CWD): Define. + (process_listing): Remove "exename", add "maps, "root", "exe" and + "cwd" elements. + (fhandler_process::exists): Return -2 for symlinks. + (fhandler_process::fstat): Handle symlinks. + (fill_filebuf): Evaluate pid if pid is 0. Use exename handling for + exe. Handle maps, root and cwd. + (format_process_maps): New function evaluating "maps". + * path.cc (symlink_info::set): New method to fill symlink_info + with data matching virtual symlinks. + (path_conv::check): Handle virtual symlinks. + * pinfo.cc (_pinfo::commune_recv): Add PICOM_CWD and PICOM_ROOT + handling. + (_pinfo::commune_send): Ditto. + (_pinfo::root): New function. + (_pinfo::cwd): New function. + * pinfo.h (enum picom): Add PICOM_CWD and PICOM_ROOT. + (_pinfo::root): Declare. + (_pinfo::cwd): Declare. + +2005-01-29 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (new): Add a little more debugging. + * thread.cc (pthread_null::exit): Add a _my_tls.remove() for safety. + +2005-01-28 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (cygtls::call2): Move socket cleanup. + (cygtls::remove): Move socket cleanup here. Don't use _my_tls to + reference it. + +2005-01-26 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Avoid a compiler warning. + +2005-01-25 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (setpriority): Implement PRIO_PGRP, PRIO_USER and + setting priority in other Cygwin processes. + (getpriority): Implement PRIO_PGRP, PRIO_USER and getting nice value + from other processes. + +2005-01-26 Pierre Humblet <pierre.humblet@ieee.org> + + * path.cc (path_conv::check): Return ENOTDIR rather than ENOENT + when a component is not a directory. Remove unreachable code. + (digits): Delete. + +2005-01-25 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (pinfo::init): Make third parameter non-optional and + propagate change throughout. + * pinfo.cc (set_myself): Pass INVALID_HANDLE_POINTER if h is NULL. + (pinfo::init): Make third parameter non-optional. Eliminate use of + PID_EXECED as an argument. Put setting of handle back inside loop but + reorganize to try to open it only when necessary. + +2005-01-25 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export getpriority and setpriority. + * fork.cc (fork_parent): Copy parent's nice value into child. + * spawn.cc (spawn_guts): Ditto. + * miscfuncs.cc (winprio_to_nice): New function. + (nice_to_winprio): Ditto. + * pinfo.cc (pinfo_init): If parent is not a Cygwin process, set + default nice value according to current Win32 priority class. + * pinfo.h (class _pinfo): Add nice member. + * syscalls.cc (setpriority): New function, only implementing + PRIO_PROCESS for now. + (getpriority): Ditto. + (nice): Just call setpriority. + * wincap.h (wincaps::has_extended_priority_class): New element. + * wincap.cc: Implement above element throughout. + * winsup.h: Add prototypes for winprio_to_nice and nice_to_winprio. + * include/limits.h (NZERO): New define. + * include/cygwin/types.h (id_t): New datatype. + * include/cygwin/version.h: Bump API minor version. + * include/sys/resource.h: Add PRIO_XXX defines and prototypes for + getpriority and setpriority. + +2005-01-25 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (realpath): Allow to expand with .exe suffix. + +2005-01-22 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Perform same "cd" as in pinfo::exit below to + make sure that a stub process does not keep the current working + directory busy after the "execed" process has exited. + +2005-01-22 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Move everything but the MapViewOfFileEx out + of the loop since trying multiple times to call CreateFileMapping + doesn't make much sense. Try to structure the loop a little better so + that exiting with a break does the right thing. + (pinfo::release): Release shared memory area if it exists and close + handle if it exists. + +2005-01-22 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::maybe_set_exit_code_from_windows): Make sure that + process has exited before getting an error code. + (pinfo::exit): "cd" to innocuous location before exiting to make sure + that process does not keep the current working directory busy while it + is in the process of really exiting. + +2005-01-18 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CoInitialize): Remove. + (CoUninitialize): Remove. + (CoCreateInstance): Remove. + (CoTaskMemFree): Add. + (SHGetDesktopFolder): Add. + * path.cc (shortcut_header): Remove. + (shortcut_initalized): Remove. + (GUID_shortcut): New static GUID. + (struct win_shortcut_hdr): New struct describing Windows shortcut + header structure. + (symlink_worker): Rewrite creating Windows shortcuts. Create + ITEMIDLIST if target exists. Only write once. + (cmp_shortcut_header): Use win_shortcut_hdr structure for comparison. + (check_shortcut): Rewrite to read only once from file. Allow skipping + an ITIMIDLIST in the file. + +2005-01-16 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (maybe_set_exit_code_from_windows): Renamed from + set_exit_state. + * pinfo.cc (pinfo::exit): Use renamed function. + (proc_waiter): Ditto. Make a copy of input argument to avoid problems + when procs array is shuffled. Flag when copy is made so that + remove_proc knows when it is safe to reshuffle. + * sigproc.cc (proc_terminate): Don't flag process_state as PID_EXITED. + (remove_proc): Wait for waiter to finish copying pinfo element before + moving it (an actual wait should be an extremely rare event). + +2005-01-15 Christopher Faylor <cgf@timesys.com> + + * init.cc (dll_entry): Remove unused extern. + + * include/sys/cygwin.h: Remove PID_ZOMBIE. + * pinfo.h: Rename EXITCODE_* defines. + (pinfo::set_exit_state): Remove parameter. + * pinfo.cc (set_exit_state): Remove parameter. Reverse sense of test + so that exitcode is checked for having been set rather than not having + been set. Set flag when exitcode has been established. Don't set + PID_STATE here. + (pinfo::init): Remove exitcode initialization. + (pinfo::exit): Reflect change in EXITCODE_* naming. Set flag when + exitcode has been established. Reflect change in arguments to + set_process_state. + (proc_waiter): Reflect change in arguments to set_process_state. Set + process_state here and only here. + * fhandler_process.cc (fhandler_process::fill_filebuf): Reflect removal + of PID_ZOMBIE define. + (format_process_stat): Ditto. + (format_process_status): Ditto. + * sigproc.cc (pid_exists): Ditto. + (stopped_or_terminated): Ditto. Make sure that only low-order 16 bits of + exitcode are used. + * spawn.cc (spawn_guts): Reflect change in EXITCODE_* naming. + +2005-01-15 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (sig_send): Don't complain if attempt to send signal to + myself fails after I've "execed". + +2005-01-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::facl): Pretend successful + SETACL if no acls are available. + * fhandler.cc (fhandler_base::facl): Implement to return sensible + values on GETACL and GETACLCNT. Pretend successful SETACL. + * fhandler_virtual.cc (fhandler_virtual::facl): Ditto. + +2005-01-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_disk_file::touch_ctime): Declare. + * fhandler_disk_file.cc (fhandler_disk_file::touch_ctime): New method + to set file's ctime. + (fhandler_disk_file::fchmod): Try opening file for writing first. + Set file's ctime on success. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::facl): Ditto. + +2005-01-13 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo::exit): Don't access self after releasing it. + * path.h (path_conv::path_conv): Fill path with native device + name in case of device argument. + +2005-01-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc (fhandler_serial::dup): Call overlapped_setup + for child, not for parent. + +2005-01-13 Christopher Faylor <cgf@timesys.com> + + * init.cc (dll_entry): Nuke attempt to set exit code since parent will + use windows exit code if needed. + * pinfo.cc (pinfo::exit): Move release() here to minimize pid creation + race (suggested by Pierre Humblet). + +2005-01-12 Christopher Faylor <cgf@timesys.com> + + Reorganize header file inclusion throughout so that cygerrno.h comes + first. + * fhandler.h (select_record::thread_errno): Save any encountered errno + here. + (select_record::set_select_errno): New function. + (select_record::saw_error): New function. + (select_record::select_record): Initialize thread_errno to zero. + * select.cc (set_handle_or_return_if_not_open): Set thread_errno on + failure. + (select_stuff::wait): Record errno for later resurrection in calling + thread. + (peek_serial): Ditto. + +2005-01-12 Christopher Faylor <cgf@timesys.com> + + * syscalls.cc (system): Use "/bin/sh" as per linux and (sorta) SUSv3. + +2005-01-12 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::exit): Don't assume that this == myself. + +2005-01-11 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::init): Don't close input handle on temporary (?) + failure. + +2005-01-11 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (_pinfo::set_exit_state): Declare new function. + (pinfo::exit): Move here from _pinfo::exit. + * sigproc.cc (child_info::sync): Use new function to set exitcode and + process_state. + * pinfo.cc (_pinfo::exit): Ditto. + (proc_waiter): Ditto. + (_pinfo::set_exit_state): Define new function. + (_pinfo::dup_proc_pipe): Close handle when there is no parent process + around to care about the exit value. + * dcrt0.cc (dll_crt0_0): Move subproc_ready synchronization later to + make sure that myself is still mapped in parent. + (do_exit): Reflect movement to pinfo::exit. + (__api_fatal): Ditto. + * exceptions.cc (signal_exit): Ditto. + * errno.cc (errmap): Map PROC_NOT_FOUND. + * init.cc (dll_entry): Release myself before exiting. + * sigproc.cc (proc_can_be_signalled): Set errno appropriately. + (sig_send): Ditto. Also remove ill-advised test for !myself->sendsig + since this is an indication of a process which is still initializating + -- it is not an error. + (child_info::sync): Don't set exitcode here. Assume that will happen + in proc_waiter, if necessary. + * spawn.cc (spawn_guts): Delay "wait_for_myself" logic until later. + Don't wait at all if the process has already exited. Reflect movement + to pinfo::exit. + +2005-01-11 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (build_env): Disallow empty strings and strings starting + with '=' in Win32 environment. + +2005-01-08 Pierre Humblet <pierre.humblet@ieee.org> + + * syscalls.cc (seteuid32): Only change the default dacl when + seteuid succeeds. Do not close HKCU. + +2005-01-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc: Use strcasematch instead of strcasecmp + throughout. + +2005-01-06 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Fix behaviour in case of renaming directories + according to SUSv3. + +2005-01-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::open_fs): Don't allow + opening directories for writing. + +2005-01-06 Christopher Faylor <cgf@timesys.com> + + * timer.cc (timer_thread): Pass sigev pointer value as per SuSv3 rather + than pointer to sigev. + +2005-01-05 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (multiple_cygwin_problem): Reorganize error message to not + always talk about a "version" when it's not a version. + (dll_crt0_0): Change info passed to multiple_cygwin_problem to be a + little more precise. + * shared.cc (user_shared_initialize): Ditto. + (shared_info::initialize): Ditto. + +2005-01-03 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (_pinfo::dup_proc_pipe): Can't close proc pipe when execing + or we will suffer an exit code race. + +2005-01-03 Corinna Vinschen <corinna@vinschen.de> + + * signal.cc (abort): Call _GLOBAL_REENT's __cleanup. + +2005-01-03 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (setmode): Call _fwalk with _GLOBAL_REENT. + +2005-01-01 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::stub): Set inuse to false when exiting. + (cygthread::cygthread): Actually pass name as argument to debugging + output to avoid SEGV when strace'ing. + (cygthread::release): Don't set stack_ptr to NULL, since it is only set + once on first entry to a stub not on each stub iteration. + (cygthead::exit_thread): Remove obsolete function. + * cygthread.h (cygthread::exit_thread): Ditto. + +2005-01-01 Christopher Faylor <cgf@timesys.com> + + * shared.cc (open_shared): Don't attempt VirtualAlloc magic if first + attempt to map memory fails. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2006 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2006 new file mode 100644 index 000000000..bab33364a --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2006 @@ -0,0 +1,3571 @@ +2006-12-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Improve debug + output. + +2006-12-20 Corinna Vinschen <corinna@vinschen.de> + + Partially revert change from 2006-10-22. GetSecurityInfo messes up + user information on NT4. + * sec_helper.cc (security_descriptor::malloc): Drop LocalAlloc + considerations. + (security_descriptor::realloc): Ditto. + (security_descriptor::free): Ditto. + * security.cc (get_reg_security): Reinstantiate. + (get_nt_object_security): Revert to using NtQuerySecurityObject. + * security.h (class security_descriptor): Drop type member. + Accommodate throughout. + (security_descriptor::size): Constify. + (security_descriptor::copy): Ditto. + +2006-12-18 Christopher Faylor <me@cgf.cx> + + * pinfo.cc (set_myself): Use a more foolproof method for determining if + the current process was started from another cygwin process. + +2006-12-15 Pierre A. Humblet <Pierre.Humblet@ieee.org> + + * libc/minires-os-if.c (cygwin_query): Remove ERROR_PROC_NOT_FOUND case. + (get_dns_info): Verify DnsQuery exists. Use autoloaded GetNetworkParams. + +2006-12-13 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (clear_procimptoken): Close hProcImpToken in a safer way. + +2006-12-13 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (lsaauth): Initialize lsa to INVALID_HANDLE_VALUE to + avoid potential access violation. + +2006-12-12 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (subauth_id_init): Remove. + (parse_thing): Drop "subauth_id" option. + * security.cc (get_token_group_sidlist): Drop comments concerning + subauthentication. + (create_token): Back out subauthentication related changes. + (subauth): Remove. + * security.h (create_token): Remove declaration. + (subauth): Ditto. + * syscalls.cc (seteuid32): Drop subauthentication handling entirely. + +2006-12-12 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (set_traverse): Remove. + (parse_thing): Drop "traverse" option. + * path.cc (fs_info::update): Don't request SE_CHANGE_NOTIFY_PRIV + privilege. + * sec_helper.cc (set_cygwin_privileges): Ditto. + * security.cc (allow_traverse): Remove. + (alloc_sd): Drop special allow_traverse code. + * security.h (allow_traverse): Drop declaration. + * syscalls.cc (statvfs): Don't request SE_CHANGE_NOTIFY_PRIV privilege. + +2006-12-12 Corinna Vinschen <corinna@vinschen.de> + + Partially revert change from 2005-04-03, always running under an + impersonation token, which collides with Vista UAC. + * cygheap.h (deimpersonate): revert to self instead of impersonating + hProcImpToken. + (reimpersonate): Only impersonate if setuid. + * dcrt0.cc (dll_crt0_0): Don't initialize hProcImpToken here. + (dll_crt0_1): Set privileges on hProcToken. + * fork.cc (frok::child): Set privileges on hProcToken. Close handle to + hProcImpToken. + * grp.cc (internal_getgroups): Use hProcToken instead of hProcImpToken. + * security.cc (check_access): Create hProcImpToken on demand here. + * security.h (set_process_privilege): Set privileges on hProcToken. + (_push_thread_privilege): Use hProcToken instead of hProcImpToken. + (pop_thread_privilege): If not setuid'ed, revert to self. + * syscalls.cc (setegid32): Drop setting primary group on hProcImpToken. + Close handle to hProcImpToken. + * uinfo.cc (internal_getlogin): Ditto. + * winsup.h (clear_procimptoken): New inline function. + +2006-12-12 Christopher Faylor <me@cgf.cx> + + * syscalls.cc (popen): Allow '[rw][bt]'. + +2006-12-12 Corinna Vinschen <corinna@vinschen.de> + + * libc/minires.c (res_ninit): Drop handling for LOCALDOMAIN environment + variable. + +2006-12-11 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add minires-os-if.o and minires.o. + (SUBLIBS): Add libresolv.a. + Add rule for libresolv.a. + * autoload.cc: Fix return code handling for IP Helper API in case + of being unable to load iphlpapi.dll. + (DnsQuery_A): Define. + (DnsRecordListFree): Define. + * cygwin.din: Export resolver functions. + * include/resolv.h: New header. + * include/arpa/nameser.h: New header. + * include/arpa/nameser_compat.h: New header. + * include/cygwin/version.h: Bump API minor number. + * libc/minires-os-if.c: New file. + * libc/minires.c: New file. + * libc/minires.h: New file. + +2006-12-11 Christopher Faylor <me@cgf.cx> + + * sigproc.cc (child_info::child_info): Move old comment about msv_count + here. Edit it slightly to reflect new sensibilities. + +2006-12-11 Christopher Faylor <me+cygwin@cgf.cx> + + * child_info.h (child_info_spawn::__stdin): New element. + (child_info_spawn::__stdin): Ditto. + (CURR_CHILD_INFO_MAGIC): Regenerate. + * dcrt0.cc (check_sanity_and_sync): Minor cleanup. + (child_info_spawn::handle_spawn): Handle new __std* elements by calling + move_fd. + * dtable.cc (dtable::move_fd): Define new function. + * dtable.h (dtable::move_fd): Declare new function. + * fhandler.h (fhandler_pipe::popen_pid): Declare new element. + * fhandler.h (fhandler_pipe::get_popen_pid): Define new function. + * fhandler.h (fhandler_pipe::set_popen_pid): Ditto. + * pipe.cc (fhandler_pipe::fhandler_pipe): Zero popen_pid. + (fhandler_pipe::dup): Ditto. + * spawn.cc (handle): Change second argument to bool. + (spawn_guts): Accept __stdin/__stdout arguments and set them + appropriately in child_info structure and in STARTUPINFO structure. + * syscalls.cc (popen): New cygwin-specific implementation using spawn. + (pclose): Ditto. + * winsup.h (spawn_guts): Accommodate new arguments for spawn_guts. + + * fhandler.cc (fhandler_base::set_no_inheritance): Make second arg a bool. + * fhandler.h (fhandler_base::set_no_inheritance): Ditto for declaration. + + * child_info.h (child_info::msv_count): Rename from the now-inappropriate + "zero". + (child_info_spawn::filler): Add filler to work around Vista bug. + (child_info_fork::filler): Ditto. + * dcrt0.cc (get_cygwin_startup_info): Remove "zero" check since it is + now always filled out. + * fork.cc (frok::parent): Move ch.zero manipulation to constructor. + * spawn.cc (spawn_guts): Ditto. Remove _ch wrapper. + * sigproc.cc (child_info::child_info): Initialize msv_count. + + * shared.cc (shared_info::heap_slop_size): Remove noisy system_printfs. + * shared_info.h (CURR_SHARED_MAGIC): Regenerate. + +2006-12-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (rootdir): Fix typo in comment. + * syscalls.cc (try_to_bin): Ditto. + +2006-12-10 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (SHFileOperationA): Drop definition. + * ntdll.h (struct _FILE_RENAME_INFORMATION): Define. + * path.cc (fs_info::update): Note length of rootdir prefix in + root_len. + (get_nt_native_path): New function, taking over functionality of + path_conv::get_nt_native_path. + (path_conv::get_nt_native_path): Just call get_nt_native_path. + * path.h (get_nt_native_path): Declare. + (struct fs_info): New member root_len. + (fs_info::length): New inline method returning root_len. + (path_conv::rootdir): New inline method returning rootdir prefix. + * syscalls.cc (try_to_bin): Rewrite using only system calls. + (unlink_nt): Call try_to_bin with additional handle to open file + parameter. + (statvfs): Use path_conv::rootdir method. + * wincap.h: Define has_recycle_dot_bin throughout. + * wincap.cc: Ditto. + +2006-12-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (rootdir): Clarify comment. + +2006-12-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (rootdir): Don't look for volume mount points on remote + shares. + +2006-12-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (rootdir): Drop useless post-increment. Take volume + mount points into account. + (check_posix_perm): Allocate space for root directory big enough. + +2006-12-09 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Add comment that this is not possibly + the final version. + +2006-12-07 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Open native symlinks with + FILE_OPEN_REPARSE_POINT flag. + +2006-12-07 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_DELETE_PENDING): Define. + (struct _FILE_DISPOSITION_INFORMATION): Define. + * syscalls.cc (unlink_9x): new function to delete file on 9x. + * syscalls.cc (unlink_nt): new function to delete file on NT. + (unlink): Simplify. Move OS dependent stuff into aforementioned + functions. Also handle FILE_ATTRIBUTE_HIDDEN as R/O-like flag. + +2006-12-07 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (SHFileOperationA): Define. + * syscalls.cc (try_to_bin): New function trying to move a file to + the recycle bin. + (unlink): Fix arguments used in CreateFile for delete on close. + Before closing the handle, try to move the file to the recycle bin. + +2006-12-07 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct cwdstuff): Add "sync" member and accompanying + "keep_in_sync" methods. + * external.cc (cygwin_internal): Call above keep_in_sync method when + CW_SYNC_WINENV is requested. + * path.cc (cwdstuff::init): Don't change to windows_system_directory + if keep_in_sync is requested. + (cwdstuff::keep_in_sync): New method. + (cwdstuff::set): Take sync flag into account. + +2006-12-06 Corinna Vinschen <corinna@vinschen.de> + + * termios.cc: Change include order to accommodate change to sys/ioctl.h. + +2006-12-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mem.cc (fhandler_dev_mem::open): Fix comment. + * wincap.cc (has_physical_mem_access): Reflect the fact that physical + memory access has been made a protected operation beginning with + 2003 Server. + +2006-12-06 Eric Blake <ebb9@byu.net> + + * include/sys/ioctl.h: Pick up termios.h, for TIOCGWINSZ. + +2006-12-06 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (WINVER): Set to 0x0600 to cover Vista. + +2006-12-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Fix typo. + +2006-12-05 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::init): Don't change to windows_system_directory + if Cygwin DLL has been loaded dynamically. + +2006-12-05 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Don't try to open directory on systems not + supporting that. + +2006-12-05 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (get_cygwin_startup_info): Fix comment. + * wincap.cc (wincapc::init): Always reset needs_count_in_si_lpres2 to + false on non 64-bit systems. + +2006-12-05 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (get_cygwin_startup_info): Change zeros to DWORD array. + Expect first DWORD in child_info struct being set to non-zero if + wincap.needs_count_in_si_lpres2 is set. Add comment to explain why. + * fork.cc (frok::parent): Set ch.zero[0] to a sensible count value + if wincap.needs_count_in_si_lpres2 is set. + * spawn.cc (spawn_guts): Ditto. Add filler bytes after ch on stack + to accommodate needs_count_in_si_lpres2. + * wincap.h: Define needs_count_in_si_lpres2 throughout. + * wincap.cc: Ditto. + +2006-11-29 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (mkdir): Check last path component for "..". + (rmdir): Don't check last path component for "..". + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop kludge + which tries to allow deleting the current working directory. + * path.cc (has_dot_last_component): Add parameter to indicate testing + for "..". Take trailing slash into account. + (symlink_info::posixify): Rely on cygheap->cwd.win32 having a + useful value. + (cwdstuff::init): Initialize cygheap->cwd with current working + directory. Change to windows_system_directory afterwards. + (cwdstuff::set): Never call SetCurrentDirectory here. Just check + if changing into target directory would be allowed. Add comment to + explain why. + * path.h (has_dot_last_component): Declare with second parameter. + * pinfo.cc (pinfo::zap_cwd): Remove. + (pinfo::exit): Drop call to zap_cwd. + * pinfo.h (class pinfo): Remove declaration of zap_cwd. + * spawn.cc (spawn_guts): Set current working directory for non-Cygwin + child applications. Drop call to zap_cwd. + +2006-11-28 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (create_token): Revert erroneous change to test + subauth_token for INVAILD_HANDLE_VALUE. + * syscalls.cc (seteuid32): Set create_token's subauth_token parameter + back to NULL. + +2006-11-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Fix previous patch to handle the + SYSTEM attribute as well. + +2006-11-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Fix handling of files with + HIDDEN attribute set. + +2006-11-27 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/signal.h: Add __extension__ to various anonymous + unions and structs. (thanks to V.Haisman) + +2006-11-27 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa.h: New header file. + * environ.cc: Disable subauth settings. + * grp.cc: Accommodate cygsidlist's count now being a method. + * sec_helper.cc (SECURITY_MANDATORY_INTEGRITY_AUTHORITY): Remove. + (mandatory_medium_integrity_sid): Remove. + (mandatory_high_integrity_sid): Remove. + (mandatory_system_integrity_sid): Remove. + (fake_logon_sid): Add. + (cygsid::get_sid): Add well_known parameter. Set well_known_sid + accordingly. + (cygsid::getfromstr): Ditto. + (cygsidlist::alloc_sids): Move here from security.cc. + (cygsidlist::free_sids): Ditto. + (cygsidlist::add): Move here from security.h. Add well_known parameter. + Set well_known_sid accordingly. Don't allow duplicate SIDs. + * security.cc: Include cyglsa.h and cygwin/version.h. Throughout + accommodate cygsidlist's count now being a method. Throughout drop + redundant "contains" tests. + (get_user_local_groups): Add local groups as well known SIDs. + (get_token_group_sidlist): Add well known groups as well known SIDs. + (get_server_groups): Ditto. Only call get_unix_group_sidlist after + get_user_local_groups to maintain "well_known_sid" attribute. + (get_initgroups_sidlist): Add well known groups as well known SIDs. + (get_setgroups_sidlist): Add usersid and struct passwd parameter to + allow calling get_server_groups from here. + (get_system_priv_list): Make static. Return size of TOKEN_PRIVILEGES + structure. + (get_priv_list): Ditto. + (create_token): Accommodate above changes. Drop misguided attempt to + add MIC SIDs to created user token. Print returned token as hex value. + (subauth): Disable. + (lsaauth): New function implementing client side of LSA authentication. + * security.h (class cygsid): Add well_known_sid attribute. Accommodate + throughout. Add *= operator to create a well known SID. + (class cygsidlist): Rename count to cnt. Make count a method. + (cygsidlist::add): Move to sec_helper.cc. + (cygsidlist::operator *=): New method to add well known SID. + (cygsidlist::non_well_known_count): New method returning number of + non well known SIDs in list. + (cygsidlist::next_non_well_known_sid): New method returning next non + well known SID by index. + (mandatory_medium_integrity_sid): Drop declaration. + (mandatory_high_integrity_sid): Drop declaration. + (mandatory_system_integrity_sid): Drop declaration. + (fake_logon_sid): Add declaration. + (subauth): Disable declaration. + (lsaauth): Add declaration. + * syscalls.cc (seteuid32): Disable subauthentication. Add LSA + authentication. + * wincap.h: Define needs_logon_sid_in_sid_list throughout. + * wincap.cc: Ditto. + +2006-11-23 Corinna Vinschen <corinna@vinschen.de> + + * security.h (DBGSID): Define for debugging purposes. + (MKSID): Rename from SID so as to not hide SID definition from winnt.h. + * sec_helper.cc: Change SID to MKSID throughout. + +2006-11-23 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_ipv6_funcs): Fix formatting. + +2006-11-23 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fs_info::update): Define GETVOLINFO_VALID_MASK and TEST_GVI. + Change FS_IS_SAMBA and FS_IS_SAMBA_WITH_QUOTA and their usage + accordingly. Define FS_IS_NETAPP_DATAONTAP. Recognize NetApp device + and store in is_netapp flag. Mark NetApp device as having no good + inodes. + * path.h (struct fs_info): Add is_netapp flag. Add matching accessors. + +2006-11-23 Thomas Wolff <towo@computer.org> + + * fhandler_console.cc (set_color): Avoid (again) inappropriate + intensity interchanging that used to render reverse output unreadable + when (non-reversed) text is bright. + See http://sourceware.org/bugzilla/show_bug.cgi?id=514 + +2006-11-23 Joe Loh <joel@pivot3.com> + + * devices.h: Add additional SCSI disk block device numbers per + http://www.kernel.org/pub/linux/docs/device-list/devices.txt + up to 128 devices. + * devices.in: Ditto. + (device::parsedisk): Add additonal else-if cases for decoding base + and drive indices. + * devices.cc: Regenerate. + * dtable.cc (build_fh_pc): Add additional DEV_SD{2..7}_MAJOR cases. + +2006-11-09 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (EqualPrefixSid): Define. + * security.cc (create_token): Drop grps_buf. Use alloca instead. + Only add the MIC SID to the TOKEN_GROUPS list for the NtCreateToken + call. If the subauthentication token exists, use its MIC SID. + Set SID Attributes for the MIC SID to 0. + +2006-11-08 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (sid_auth): Remove. + (well_known_this_org_sid): New well known sid. + (SECURITY_MANDATORY_INTEGRITY_AUTHORITY): Define. + (mandatory_medium_integrity_sid): New well known sid. + (mandatory_high_integrity_sid): Ditto. + (mandatory_system_integrity_sid): Ditto. + (cygsid::get_sid): Use local SID_IDENTIFIER_AUTHORITY. Allow all + authorities fitting in a UCHAR. + * security.cc (get_token_group_sidlist): Always add the local + group to the token. Add comment. Add "This Organization" group + if available in incoming group list. + (get_server_groups): Only add world and authenticated users groups + if not already in list. + (create_token): Add matching mandatory integrity SID to group list + on systems supporting Mandatory Integrity Control. + * security.h (well_known_this_org_sid): Define. + (mandatory_medium_integrity_sid): Define. + (mandatory_high_integrity_sid): Define. + (mandatory_system_integrity_sid): Define. + * wincap.h: Define has_mandatory_integrity_control throughout. + * wincap.cc: Ditto. + +2006-11-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (check_posix_perm): Moved here from syscalls.cc. + (fhandler_base::fpathconf): New method implementing (f)pathconf. + * fhandler.h (class fhandler_base): Declare fpathconf method. + * path.cc (path_conv::check): Replace MAX_LINK_DEPTH with SYMLOOP_MAX. + * path.h (MAX_LINK_DEPTH): Delete. + * syscalls.cc (check_posix_perm): Move to fhandler.cc. + (fpathconf): Call fhandler's fpathconf method. + (pathconf): Build fhandler and call fhandler's fpathconf method. + * sysconf.cc (sysconf): Reorder switch according to order of flags + in sys/unistd.h. Add handling for some missing flags. + * include/limits.h: Reorder according to SUSv3 description. Add some + missing definitions. Add comments. + * include/sys/syslimits.h: New file overriding newlib's syslimits.h + file. + +2006-11-06 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (build_fh_pc): Add missing DEV_SD1_MAJOR case (Thanks to + Joe Loh for noticing). + +2006-11-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::posixify): Fix comment. + +2006-11-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Eliminate PATH_REP bit from pflags. + +2006-11-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::posixify): New method converting NT and DOS + paths in symlinks to POSIX. + (symlink_info::check_shortcut): Allocate buf allowing for a trailing 0. + Call posixify on the result. + (symlink_info::check_sysfile): Read from file into local buffer. + Eliminate old b16 considerations. Call posixify on the result. + (symlink_info::check_reparse_point): Don't use PrintName but + SubstituteName which is relevant for Windows' path handling. + Call posixify on the result. + +2006-11-01 Corinna Vinschen <corinna@vinschen.de> + + * security.h (cygpriv_idx): Add privileges new in Vista. + * security.cc (sys_privs): Ditto. + * sec_helper.cc (cygpriv): Ditto. Fix comment. + +2006-10-31 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct user_heap_info): Add slop member. + * heap.cc (heap_init): Add slop factor to heap allocation. Add + comment. + * mmap.cc (MapViewNT): Allocate memory maps top down. + (fhandler_dev_zero::mmap): Ditto. + * shared.cc (shared_info::heap_slop_size): New method. + (shared_info::heap_chunk_size): Don't use debug_printf at early stage. + * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. + (CURR_SHARED_MAGIC): Ditto. + (class shared_info): Add heap_slop member. Declare heap_slop_size. + * wincap.h: Define heapslop throughout. + * wincap.cc: Ditto. + +2006-10-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop + directory attribute for reparse points to avoid mistreating. + (fhandler_base::fstat_by_name): Ditto. + * path.cc (symlink_info::check_reparse_point): New method testing + reparse points for symbolic links. + (symlink_info::check_shortcut): Move file attribute tesat to calling + function. + (symlink_info::check): Add handling for reparse points. + * path.h (enum path_types): Add PATH_REP to denote reparse point based + symlinks. + (path_conv::is_rep_symlink): New method. + * syscalls.cc (unlink): Handle reparse points. + +2006-10-27 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (open_shared): Drop useless attempt from 2006-08-11. + +2006-10-27 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (__api_fatal): Drop spare argument to __small_sprintf. + * smallprint.c (__small_vsprintf): Preserve GetLastError value. + * winsup.h (api_fatal): Simplify. Drop duplicate filename arg. + +2006-10-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Fix comment. + +2006-10-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Accommodate + buggy RestartScan behaviour of Windows 2000. + * wincap.h: Define has_buggy_restart_scan throughout. + * wincap.cc: Ditto. + +2006-10-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::facl): Fix whitespace. + * external.cc: Update copyright. + * fhandler.cc: Ditto. + * sec_helper.cc: Ditto. + * security.h: Ditto. + * security.cc: Ditto. + (check_registry_access): Return -1 if W_OK is requested. + +2006-10-22 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Use security_descriptor::copy method. + * sec_helper.cc (security_descriptor::malloc): Use own free method. + Set type. + (security_descriptor::realloc): Handle the case that psd has been + allocated using LocalAlloc. Set type. + (security_descriptor::free): Ditto. + * security.cc (get_nt_attribute): Remove. + (get_reg_security): Remove. + (get_nt_object_security): Use GetSecurityInfo which handles all + securable objects. + (get_nt_object_attribute): Remove. + (get_object_attribute): Call get_nt_object_security instead of + get_nt_object_attribute. + (get_file_attribute): Ditto. + (check_registry_access): Call get_nt_object_security instead of + get_reg_security. + * security.h (cygpsid::operator PSID): Make method const, not the + result. + (class security_descriptor): Add type member. Accommodate throughout. + (security_descriptor::copy): New method. + (security_descriptor::operator PSECURITY_DESCRIPTOR *): New operator. + +2006-10-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fhaccess): Check if opening registry + actually created a handle. This handles the registry root dir. + * fhandler_registry.cc (fhandler_registry::open): Set io_handle in + case of opening one of the predefined registry keys. + +2006-10-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fhaccess): Call check_registry_access + for registry keys/values if ntsec is on. + * security.cc (check_access): New static function derived from + check_file_access, but object type agnostic. + (check_file_access): Only do file specific stuff. Call check_access. + (check_registry_access): New access check function for registry keys/ + values. + * security.h (check_registry_access): Declare. + +2006-10-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (fhandler_registry::fstat): Set restrictive + permission and ownership if key can't be opened for reading security. + (open_key): If opening key fails, retry opening with backup intent. + +2006-10-20 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getnameinfo): Fix typo in comment. + +2006-10-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::set_name): Make virtual. + (class fhandler_registry): Add wow64 and prefix_len members. + Declare set_name method. + * fhandler_proc.cc (PROC_REGISTRY32): Define. + (PROC_REGISTRY64): Define. + (proc_listing): Add "registry32" and "registry64" elements. + (proc_fhandlers): Add corresponding FH_REGISTRY values. + * fhandler_registry.cc (registry_len): Drop static value in favor of + class member prefix_len. Use preifx_len instead of registry_len + throughout. + (fhandler_registry::set_name): Define. Set wow64 and prefix_len + according to directory prefix. + (fhandler_registry::fhandler_registry): Set wow64 and prefix_len to + default values. + (open_key): Add wow64 argument. Handle wow64 in call to RegOpenKeyEx. + Use fhandler_registry member wow64 in this place throughout. + +2006-10-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc: Drop superfluous definition of _WIN32_WINNT. + * miscfuncs.cc: Ditto. + * sched.cc: Ditto. + +2006-10-17 Corinna Vinschen <corinna@vinschen.de> + + * glob.c: Remove. + * glob.cc: New file. Latest glob version from FreeBSD plus Cygwin + specific changes (__stat64/__stat32, ignore_case_with_glob, + drop collate functions). + (glob3): Return GLOB_ABORTED in case directory is unreadable and + GLOB_ERR is set, as demanded by SUSv3. + * glob.h: Import latest version from FreeBSD. + +2006-10-17 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (WINVER): Define instead of _WIN32_WINNT. Set to 0x0502. + (_NO_W32_PSEUDO_MODIFIERS): Define. + +2006-10-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop redundant + access check. + +2006-10-16 Corinna Vinschen <corinna@vinschen.de> + + * include/asm/byteorder.h: Fix copyright dates. + +2006-10-16 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (PrivilegeCheck): Define. + * fhandler.cc (fhandler_base::open): Always try opening with backup + resp. restore intent. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Always try + opening with backup intent. + (fhandler_disk_file::readdir): Ditto when trying to retrieve file id + explicitely. + * security.cc (check_file_access): Replace pbuf with correctly + PPRIVILEGE_SET typed pset. Check explicitely for backup and/or restore + privileges when AccessCheck fails, to circumvent AccessCheck + shortcoming. Add comment to explain. + +2006-10-13 Christopher Faylor <cgf@timesys.com> + + * winsup.h: Turn off DEBUGGING. + +2006-10-13 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (Wow64DisableWow64FsRedirection): Define. + (Wow64RevertWow64FsRedirection): Define. + * security.cc (cygsuba_installed): New shared variable to store result + of cygsuba.dll installation test. + (subauth): Check if cygsuba.dll has been installed and registered + before issuing the (sub)authentication. + +2006-10-12 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (create_token): Fix condition for source identifier. + +2006-10-11 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (struct socketinf): Convert ser_num and w4 to dynamically + allocated arrays. Add max_w4 member to keep track. + (thread_socket): Make timeout depending on number of sockets to wait + for. Loop WFMO over all sockets. + (start_thread_socket): Handle any number of sockets. Fix typo. Don't + close socket event in out of memory condition. + (socket_cleanup): Free ser_num and w4. + +2006-10-06 David Jade <d3@mutable.net> + + * path.cc (path_conv::get_nt_native_path): Properly detect \\?\ paths. + (mount_info::conv_to_win32_path): Update comment. + * fhandler_disk_file.cc (path_conv::ndisk_links): Use backslashes + to make NT kernel functions work for \\?\GLOBALROOT paths. + +2006-10-09 Corinna Vinschen <corinna@vinschen.de> + + * devices.in: Raise number of handled serial ports to 64. + * devices.cc: Regenerate. + +2006-09-17 Danny Smith <dannysmith@clear.net.nz> + + * include/asm/byteorder.h: Correct typo. + +2006-09-17 Danny Smith <dannysmith@clear.net.nz> + + * include/asm/byteorder.h: Don't #define n* macros if -fnoinline is + specified. + +2006-09-07 Christopher Faylor <cgf@timesys.com> + + * environ.cc (build_env): Don't put an empty environment variable into + the environment. Optimize use of "len". + * errno.cc (ERROR_MORE_DATA): Translate to EMSGSIZE rather than EAGAIN. + +2006-08-31 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (initgroups32): Run get_server_groups under original token. + * syscalls.cc (seteuid32): Slightly reorganize code creating a token. + +2006-08-27 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info_spawn::~child_info_spawn): Don't close + myself_pinfo handle when spawning. + +2006-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Fix formatting. + +2006-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (DIR_NUM_ENTRIES): Set to 100 to maximize + performance on remote shares. + (fhandler_disk_file::opendir): Move comment about Samba weirdness into + fhandler_disk_file::readdir. Don't disallow + FileIdBothDirectoryInformation on Samba. + (fhandler_disk_file::readdir): Workaround Samba problem with + FileIdBothDirectoryInformation by rereading already read entries + using FileBothDirectoryInformation. Change comment about Samba + weirdness explaining this change. + +2006-08-20 Hideki Iwamoto <h-iwamoto@kit.hi-ho.ne.jp> + + * fhandler_disk_file.cc (fhandler_disk_file::pread): Properly check for + non-error return from lseek. + +2006-08-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc (raw_read): Evaluate minchars taking the + vmin_ > ulen case into account. Simplify evaluating the bytes to read. + Don't use bytes in Queue value from ClearCommError call in case vtime_ + is > 0. Reformat GetOverlappedResult call. Simplify call to ReadFile. + +2006-08-14 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (subauth): Initialize user_token to NULL. Add comment. + +2006-08-11 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (open_shared): Desperately try to get shared memory, only + when DEBUGGING enabled for now. + +2006-08-10 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (_onreturn::~onreturn): Don't attempt to close a NULL + handle. + +2006-08-10 Christopher Faylor <cgf@timesys.com> + + * winsup.h: Turn on DEBUGGING by default for now. + +2006-08-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::lock): Handle + ERROR_NOT_LOCKED returned from UnlockFileEx. + +2006-08-09 Corinna Vinschen <corinna@vinschen.de> + + * path.h (SYMLINK_EA_NAME): Remove. + (SHORTCUT_HDR_SIZE): Ditto. + +2006-08-09 Christopher Faylor <cgf@timesys.com> + + * autoload.cc (GetHandleInformation): Declare new function. + (SetHandleInformation): Ditto. + * debug.cc (add_handle): Use SetHandleInformation to protect handle. + (close_handle): Use SetHandleInformation to unprotect handle. + + * spawn.cc (spawn_guts): Move detached test outside of P_OVERLAY block. + +2006-08-07 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtSetInformationFile): Define. + * cygwin.din: Export posix_fadvise and posix_fallocate. + * fhandler.cc (fhandler_base::fadvise): New method. + (fhandler_base::ftruncate): Add allow_truncate parameter. + * fhandler.h (class fhandler_base): Add fadvise method. Accommodate + new parameter to ftruncate. + (class fhandler_pipe): Add fadvise and ftruncate methods. + (class fhandler_disk_file): Add fadvise method. Accommodate new + parameter to ftruncate. + * fhandler_disk_file.cc (fhandler_disk_file::fadvise): New method. + (fhandler_disk_file::ftruncate): Accommodate new allow_truncate + parameter. Set EOF using NtSetInformationFile on NT. + * ntdll.h (struct _FILE_END_OF_FILE_INFORMATION): Define. + (NtSetInformationFile): Declare. + * pipe.cc (fhandler_pipe::fadvise): New method. + (fhandler_pipe::ftruncate): Ditto. + * syscalls.cc (posix_fadvise): New function. + (posix_fallocate): Ditto. + (ftruncate64): Accommodate second parameter to fhandler's ftruncate + method. + * include/fcntl.h: Add POSIX_FADV_* flags. Add declarations of + posix_fadvise and posix_fallocate. + * include/cygwin/version.h: Bump API minor number. + +2006-08-02 Christopher Faylor <cgf@timesys.com> + + * environ.cc (env_win32_to_posix_path_list): Declare. + (conv_envvars): Use env_win32_to_posix_path_list rather than + cygwin_win32_to_posix_path_list. + (posify): Translate back to win32 path if errno is EIDRM. + * environ.h: Update copyright. Define ENV_CVT. + * path.cc (conv_path_list): If converting for the environment and + removed an element set errno to ENV_CVT. + (env_win32_to_posix_path_list): New function. + +2006-08-01 Christopher Faylor <cgf@timesys.com> + + * environ.cc (dos_file_warning): Declare. + (parse_thing): Add "dosfilewarning". Alphabetize. + * path.cc (normalize_posix_path): Return -1 when MS-DOS path detected. + (warn_msdos): New function. + (path_conv::check): Call if !PC_NOWARN and MS-DOS path detected. + (cygwin_conv_to_win32_path): Set PC_NOWARN when calling path_conv. + (cygwin_conv_to_full_win32_path): Ditto. + * path.h (pathconv_arg::PC_NOWARN): Define. + * shared_info.h (user_info::warned_msdos): New field. + (CURR_USER_MAGIC): Reset. + +2006-07-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recv_internal): Fix a problem + with poll(2) after shutdown(SHUT_RD) has been called on the local side. + * poll.cc (poll): Use POSIX type nfds_t for second parameter. Drop + special socket handling for POLLIN. Add comment to explain why. + * include/sys/poll.h: Declare nfds_t. Use as type for second parameter + in poll(2) declaration. + +2006-07-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::evaluate_events): Circumvent + potential race condition. + (fhandler_socket::recv_internal): Fix MSG_PEEK bug on blocking sockets + and simplify recv loop. + (fhandler_socket::send_internal): Only lock when changing wsock_events. + +2006-07-31 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Drop LoadDLLprime for wsock32 since no wsock32 function + is used anymore. Drop all unused ws2_32.dll functions. + +2006-07-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (struct wsa_event): Define here. + (class fhandler_socket): Make wsock_evt private again. + (fhandler_socket::wsock_event): New read accessor for wsock_evt. + (fhandler_socket::serial_number): New read accessor to get the + socket's serial number. + (fhandler_socket::ready_for_read): Just return true. + * fhandler_socket.cc (struct wsa_event): Move definition to fhandler.h. + * select.cc (struct socketinf): Add serial number vector. + (start_thread_socket): Identify duplicate sockets by their serial + number, not (wrongly) by their wsock_evt. + +2006-07-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: Revert misguided attempt to handle FD_CLOSE error + conditions in evaluate_events. + (search_wsa_event_slot): Move wrongly placed memset in + fhandler_socket::init_events here. + (fhandler_socket::init_events): Initially set FD_WRITE event for + connectionless sockets. + * poll.cc (poll): Don't add sockets always to except_fds since select + is now supposed to do it right. + * select.cc (set_bits): Set connection state correctly for failed + af_local_connect on local sockets. Remove socket special handling + for except_selected descriptors. + (peek_socket): Try to set the read/write/exception bits actually + correctly. + +2006-07-27 Brian Ford <Brian.Ford@FlightSafety.com> + + * fhandler_socket.cc (fhandler_socket::recvmsg): Remove unused tot + argument. All callers changed. + (fhandler_socket::sendmsg): Likewise. + * net.cc (cygwin_recvmsg): Likewise. + (cygwin_sendmsg): Likewise, and prevent calling sendmsg whith an + invalid iovec. + * fhandler.h (fhandler_socket::recvmsg): Adjust prototype. + (fhandler_socket::sendmsg): Likewise. + +2006-07-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Remove prot_info_ptr. + (fhandler_socket::fixup_before_fork_exec): Remove. + (fhandler_socket::fixup_after_exec): Remove. + (fhandler_socket::need_fixup_before): Remove. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop + initializing prot_info_ptr. Remove unused code. + (fhandler_socket::~fhandler_socket): Drop free'ing prot_info_ptr. + (struct wsa_event): Rename connect_errorcode to errorcode. + (fhandler_socket::evaluate_events): Handle FD_CLOSE error condition + as FD_CONNECT error condition, except, never reset an FD_CLOSE error + condition. Always set FD_WRITE after successfully recorded FD_CONNECT. + (fhandler_socket::fixup_before_fork_exec): Remove. + (fhandler_socket::fixup_after_fork): Revert to using handle duplication. + (fhandler_socket::fixup_after_exec): Remove. + (fhandler_socket::dup): Revert to using handle duplication. + (fhandler_socket::send_internal): Only call wait_for_events in case + of WSAEWOULDBLOCK condition. + (fhandler_socket::set_close_on_exec): Call + fhandler_base::set_close_on_exec. + * net.cc (fdsock): Just set socket to inheritable on non-NT. Don't + call inc_need_fixup_before. + * select.cc (peek_socket): Don't set except_ready on every FD_CLOSE, + just on error. + +2006-07-26 Brian ford <Brian.Ford@FlightSafety.com> + + * fhandler.cc (fhandler_base::read): Call get_readahead_into_buffer + instead of duplicating it. + +2006-07-26 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (offsets): Define as offsets relative to cygwin_hmodule + instead of addresses. + (off_addr): New macro. + (open_shared): Use offsets array accordingly. Remove unused code. + * shared_info.h (cygwin_shared_address): Remove. + +2006-07-26 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct init_cygheap): Remove shared_h and mt_h members. + * fhandler_tape.cc (mt): Define as DLL shared area in + .cygwin_dll_common instead of as dynamically allocated area. + Change referencing throughout. + * mtinfo.h (mt_h): Remove entirely. + (mt): Remove extern declaration. + * shared.cc (cygwin_shared_area): New global cygwin_shared + variable located in .cygwin_dll_common. + (offsets): Define shared region addresses descending from + cygwin_shared_address. + (open_shared): Replace usage of SH_CYGWIN_SHARED by SH_USER_SHARED. + (memory_init): Set cygwin_shared just by pointing to cygwin_shared_area. + * shared_info.h (shared_locations): Remove SH_CYGWIN_SHARED and + SH_MTINFO. + (cygwin_shared_address): Define as DLL start address. + * tty.h (tty_min::tty_min): Remove constructor. + +2006-07-25 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in6.h: Guard in_port_t typedef more restrictive to + avoid compiler warning. + +2006-07-25 Christopher Faylor <cgf@timesys.com> + + * security.cc (get_logon_server): Remove nret and use dret for + everything to avoid a g++ warning. + +2006-07-25 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL version to 1.7.0. + +2006-07-25 Corinna Vinschen <corinna@vinschen.de> + + * select.h: Remove. + * fhandler_socket.cc: Don't include select.h. + * select.cc: Ditto. + +2006-07-25 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h: Drop socket related includes. + (struct _local_storage): Remove exitsock and exitsock_sin. Add + select_sockevt. + * cygtls.cc: Accommodate above change throughout. + * fhandler.h (class fhandler_socket): Make wsock_evt public. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accommodate + reordering members. + (fhandler_socket::evaluate_events): Drop FD_CONNECT event as soon as + it gets read once. Never remove FD_WRITE event here. + (fhandler_socket::wait_for_events): Wait 50 ms instead of INFINITE for + socket events. + (fhandler_socket::accept): Fix conditional. Set wsock_events members + of accepted socket to useful start values. + (fhandler_socket::recv_internal): Always drop FD_READ/FD_OOB events from + wsock_events after the call to WSARecvFrom. + (fhandler_socket::send_internal): Drop FD_WRITE event from wsock_events + if the call to WSASendTo fails with WSAEWOULDBLOCK. Fix return value + condition. + * select.cc (struct socketinf): Change to accommodate using socket event + handling. + (peek_socket): Use event handling for peeking socket. + (thread_socket): Ditto. + (start_thread_socket): Ditto. + (socket_cleanup): Same here. + * tlsoffsets.h: Regenerate. + +2006-07-23 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor version number to 22. + +2006-07-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Rearrange slightly to keep + event handling methods and members together. Drop owner status flag. + Split wait method. Rename event handling methods for readability. + * fhandler_socket.cc (struct wsa_event): Add owner field. + (LOCK_EVENTS): New macro. + (UNLOCK_EVENTS): Ditto. + (fhandler_socket::init_events): rename from prepare. + (fhandler_socket::evaluate_events): First half of former wait method. + Do everything but wait. Allow specifiying whether or not events from + event_mask should be erased from wsock_events->events. Simplify + OOB handling. Allow sending SIGURG to any process (group). + (fhandler_socket::wait_for_events): Second half of former wait method. + Call evaluate_events and wait in a loop if socket is blocking. + (fhandler_socket::release_events): Rename from release. + (fhandler_socket::connect): Accommodate above name changes. + (fhandler_socket::accept): Ditto. + (fhandler_socket::recv_internal): Ditto. + (fhandler_socket::send_internal): Ditto. + (fhandler_socket::close): Ditto. + (fhandler_socket::fcntl): Always set owner to given input value on + F_SETOWN. Handle F_GETOWN. + * net.cc (fdsock): Accommodate above name changes. + +2006-07-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::wait): Set Winsock errno to + WSAEWOULDBLOCK instead of WSAEINPROGRESS. + +2006-07-19 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (commune_process): Don't add extra \0 to cmdline. + (_pinfo::cmdline): Ditto process internal. + +2006-07-19 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (msync): Disable rounding up len. Fix bug in access check + loop. + +2006-07-19 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_worker): Return EEXIST if newpath exists. + +2006-07-18 Christopher Faylor <cgf@timesys.com> + + * tty.cc (tty_list::terminate): Don't enter the busy loop if we don't + own the master. + +2006-07-18 Silvio Laguzzi <slaguzzi@data-al.de> + + * sec_acl.cc (acltotext32): Add missing handling of default ACL entry + types. + +2006-07-18 Brian Ford <Brian.Ford@FlightSafety.com> + Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (mmap_region_status): New enum. + (mmap_is_attached_or_noreserve_page): Adjust prototype and rename + as below. + * mmap.cc (mmap_is_attached_or_noreserve_page): Rename + mmap_is_attached_or_noreserve. Add region length parameter. + Return enum above. + * exceptions.cc (_cygtls::handle_exceptions): Accommodate above. + * fhandler.cc (fhandler_base::raw_read): Call above for NOACCESS + errors and retry on success to allow reads into untouched + MAP_NORESERVE buffers. + +2006-07-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Fix typo in lint + directive. + +2006-07-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (posix_openpt): Export. + * tty.cc (posix_openpt): New function. + * include/cygwin/stdlib.h (posix_openpt): Declare. + * include/cygwin/version.h: Bump API minor number. + +2006-07-17 Christopher Faylor <cgf@timesys.com> + + GCC 4.1 fixes. + * cygheap.h (cygheap_user): Remove unneeded class names from function + declaration. + * fhandler.h (fhandler_base): Ditto. + (fhandler_dev_floppy): Ditto. + (fhandler_console): Ditto. + * wininfo.h (wininfo): Ditto. + * exceptions.cc (sigpacket::process): Avoid compiler errors about gotos + and initialization. + * fhandler_fifo.cc (fhandler_fifo::open): Ditto. + * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::ioctl): Ditto. + * mmap.cc (mmap64): Ditto. + * pipe.cc (fhandler_pipe::open): Ditto. + * spawn.cc (spawn_guts): Ditto. + + * sec_helper.cc: Fix some comments. + (get_null_sd): Move file-scope static to only function where it is + used. + +2006-07-14 Christopher Faylor <cgf@timesys.com> + + * fork.cc (fork): Lock the process before forking to prevent things + like new fds from being opened, etc. + * sync.h (lock_process::dont_bother): New function. + +2006-07-14 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/types.h: Update copyright. + +2006-07-14 Christopher Faylor <cgf@timesys.com> + + * cygwin.sc: Make sure there's something in the cygheap. + * dllfixdbg: Accommodate newer binutils which put the gnu_debuglink at + the end rather than at the beginning. + +2006-07-14 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_token_group_sidlist): Always add the interactive + group to the token. Add comment. Create logon_id group SID by + copying it from incoming group list. + (create_token): Add subauth_token parameter. Use information in + subauth_token if present. Tweak SourceIdentifier if subauth_token + is present for debugging purposes. + * security.h (create_token): Add subauth_token parameter in declaration. + * syscalls.cc (seteuid32): Call subauth first. Call create_token + regardless. Use subauth token in call to create_token if subauth + succeeded. + +2006-07-13 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (waitq_head): Don't initialize to zero. + * sigproc.h: Update copyright, fix whitespace. + +2006-07-13 Christopher Faylor <cgf@timesys.com> + + * fhandler.cc (fhandler_base::raw_read): Only return EISDIR when we're + really trying to read a directory. + + * sigproc.cc: Use "Static" where appropriate. + +2006-07-13 Corinna Vinschen <corinna@vinschen.de> + + * include/netinet/in.h: Update copyright. + +2006-07-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: Update copyright. + * include/pthread.h: Ditto. + +2006-07-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::wait): Rework function so that + WaitForMultipleObjects is really only called when necessary. + +2006-07-13 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Drop MAP_NORESERVE flag for non-anonymous, + non-private mappings. + (mmap_record::unmap_pages): Only check noreserve flag which now implies + anonymous and private. + (mprotect): Ditto. + (fixup_mmaps_after_fork): Ditto. + +2006-07-13 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Drop MAP_RESERVED flag for all non-anonymous, + non-private mappings. + +2006-07-13 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::handle_exceptions): Call new + mmap_is_attached_or_noreserve_page function in case of access violation + and allow application to retry access on noreserve pages. + * mmap.cc (mmap_is_attached_or_noreserve_page): Changed from + mmap_is_attached_page. Handle also noreserve pages now. Change + comment accordingly. + * winsup.h (mmap_is_attached_or_noreserve_page): Declare instead of + mmap_is_attached_page. + +2006-07-12 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::alloc_page_map): Don't call VirtualProtect + on maps created with MAP_NORESERVE. + +2006-07-12 Corinna Vinschen <corinna@vinschen.de> + + * include/netdb.h: Declare rcmd, rcmd_af, rexec, rresvport, + rresvport_af, iruserok, iruserok_sa, ruserok. + +2006-07-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Drop iruserok.o. Add rcmd.o. + * autoload.cc (rcmd): Drop definition. + * cygwin.din: Export bindresvport, bindresvport_sa, iruserok_sa, + rcmd_af, rresvport_af. + * net.cc (cygwin_rcmd): Remove. + (last_used_bindresvport): Rename from last_used_rrecvport. + (cygwin_bindresvport_sa): New function implementing bindresvport_sa. + (cygwin_bindresvport): New function implementing bindresvport. + (cygwin_rresvport): Remove. + * include/cygwin/version.h: Bump API minor number. + * include/netinet/in.h: Declare bindresvport and bindresvport_sa. + * libc/iruserok.c: Remove file. + * libc/rcmd.cc: New file implementing rcmd, rcmd_af, rresvport, + rresvport_af, iruserok_sa, iruserok and ruserok. + +2006-07-12 Corinna Vinschen <corinna@vinschen.de> + + * include/pthread.h: Define PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT and + PTHREAD_PRIO_PROTECT only if _POSIX_THREAD_PRIO_INHERIT is defined. + +2006-07-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::getsockname): Return valid + result for unbound sockets. + +2006-07-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Handle + wsock_mtx and wsock_evt on fork, thus handling close_on_exec correctly. + (fhandler_socket::fixup_after_exec): Drop misguided attempt to handle + close_on_exec here. + (fhandler_socket::dup): Call fixup_after_fork with NULL parent. + Add comment. + (fhandler_socket::set_close_on_exec): Handle wsock_mtx and wsock_evt. + +2006-07-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add wsock_mtx, wsock_evt + and wsock_events members. Remove closed status flag, add listener + status flag. Accommodate new implementation of socket event handling + methods. Declare recv* and send* functions ssize_t as the POSIX + equivalents. + (fhandler_socket::recv_internal): Declare. + (fhandler_socket::send_internal): Ditto. + * fhandler_socket.cc (EVENT_MASK): Define mask of selected events. + (fhandler_socket::fhandler_socket): Initialize new members. + (fhandler_socket::af_local_setblocking): Don't actually set the + socket to blocking mode. Keep sane event selection. + (fhandler_socket::af_local_unsetblocking): Don't actually set the + socket to previous blocking setting, just remember it. + (struct wsa_event): New structure to keep event data per shared + socket. + (NUM_SOCKS): Define number of shared sockets concurrently handled by + all active Cygwin processes. + (wsa_events): New shared datastructure keeping all wsa_event records. + (socket_serial_number): New shared variable to identify shared sockets. + (wsa_slot_mtx): Global mutex to serialize wsa_events access. + (search_wsa_event_slot): New static function to select a new wsa_event + slot for a new socket. + (fhandler_socket::prepare): Rewrite. Prepare event selection + per new socket. + (fhandler_socket::wait): Rewrite. Wait for socket events in thread + safe and multiple process safe. + (fhandler_socket::release): Rewrite. Close per-socket descriptor + mutex handle and event handle. + (fhandler_socket::dup): Duplicate wsock_mtx and wsock_evt. Fix + copy-paste error in debug output. + (fhandler_socket::connect): Accommodate new event handling. + (fhandler_socket::listen): Set listener flag on successful listen. + (fhandler_socket::accept): Accommodate new event handling. + (fhandler_socket::recv_internal): New inline method centralizing + common recv code. + (fhandler_socket::recvfrom): Call recv_internal now. + (fhandler_socket::recvmsg): Ditto. Streamline copying from iovec + to WSABUF. + (fhandler_socket::send_internal): New inline method centralizing + common send code. + (fhandler_socket::sendto): Call send_internal now. + (fhandler_socket::sendmsg): Ditto. Streamline copying from iovec + to WSABUF. + (fhandler_socket::close): Call release now. + (fhandler_socket::ioctl): Never actually switch to blocking mode. + Just keep track of the setting. + * net.cc (fdsock): Call prepare now. + (cygwin_connect): Revert again to event driven technique. + (cygwin_accept): Ditto. + * poll.cc (poll): Don't call recvfrom on a listening socket. + Remove special case for failing recvfrom. + * include/sys/socket.h: Declare recv* and send* functions ssize_t as + requested by POSIX. + +2006-07-10 Corinna Vinschen <corinna@vinschen.de> + + * libc/inet_addr.c: Define __INSIDE_CYGWIN_NET__. + * libc/inet_network.c: Ditto. + +2006-07-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::wait): Disable SA_RESTART + handling for now. + +2006-07-07 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_inet_ntop): Fix data type of forth parameter. + +2006-07-07 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add inet_addr.o and inet_network.o. + * autoload.cc (inet_addr): Drop definition. + (inet_ntoa): Ditto. + * net.cc: Forward declare cygwin_inet_aton and cygwin_inet_ntop. + (cygwin_inet_ntoa): Call cygwin_inet_ntop instead of Winsock inet_ntoa. + (cygwin_inet_addr): Remove here. + (cygwin_inet_aton): Ditto. + (cygwin_inet_network): Ditto. + * libc/inet_addr.c: New file implementing cygwin_inet_aton and + cygwin_inet_addr. + * libc/inet_network.c: New file implementing cygwin_inet_network. + +2006-07-06 Christopher Faylor <cgf@timesys.com> + + * hookapi.cc: Add comment header + (putmem): Make static. + (get_export): Ditto. + (rvadelta): Ditto. Don't assume that a section which ends where the + import_rva begins is the import list. + + * child_info.h: Update copyright. + * fork.cc: Ditto. + +2006-07-06 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in6.h (struct in6_addr): Fix typo. + +2006-07-06 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export in6addr_any, in6addr_loopback, freeaddrinfo, + gai_strerror, getaddrinfo, getnameinfo. + * fhandler_socket.cc: Include cygwin/in6.h. + (get_inet_addr): Accommodate AF_INET6 usage. + (fhandler_socket::connect): Ditto. + (fhandler_socket::listen): Ditto. + (fhandler_socket::sendto): Ditto. + * net.cc: Include cygwin/in6.h. + (in6addr_any): Define. + (in6addr_loopback): Define. + (cygwin_socket): Accommodate AF_INET6 usage. + (socketpair): Bind socketpairs only to loopback for security. + (inet_pton4): New static function. + (inet_pton6): Ditto. + (cygwin_inet_pton): New AF_INET6 aware inet_pton implementation. + (inet_ntop4): New static function. + (inet_ntop6): Ditto. + (cygwin_inet_ntop): New AF_INET6 aware inet_ntop implementation. + (ga_aistruct): New static function. + (ga_clone): Ditto. + (ga_echeck): Ditto. + (ga_nsearch): Ditto. + (ga_port): Ditto. + (ga_serv): Ditto. + (ga_unix): Ditto. + (gn_ipv46): Ditto. + (ipv4_freeaddrinfo): Ditto. + (ipv4_getaddrinfo): Ditto. + (ipv4_getnameinfo): Ditto. + (gai_errmap_t): New structure holding error code - error string mapping. + (cygwin_gai_strerror): New function implementing gai_strerror. + (w32_to_gai_err): New static function. + (get_ipv6_funcs): Ditto. + (load_ipv6_funcs): Ditto. + (cygwin_freeaddrinfo): New function implementing freeaddrinfo. + (cygwin_getaddrinfo): New function implementing getaddrinfo. + (cygwin_getnameinfo): New function implementing getnameinfo. + * include/netdb.h: Include stdint.h and cygwin/socket.h. Define + data types and macros used by getaddrinfo and friends. Declare + freeaddrinfo, gai_strerror, getaddrinfo and getnameinfo. + * include/cygwin/in.h: Add IPv6 related IPPROTOs. Remove definition + of struct sockaddr_in6. Include cygwin/in6.h instead. + * include/cygwin/in6.h: New header file defining IPv6 releated + data types and macros. + * include/cygwin/socket.h: Enable AF_INET6 and PF_INET6. Add + IPv6 related socket options. + * include/cygwin/version.h: Bump API minor number. + +2006-07-06 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (DsGetDcNameA): Define. + (NetGetAnyDCName): Define. + * security.cc: Include dsgetdc.h. + (DsGetDcNameA): Declare. + (DS_FORCE_REDISCOVERY): Define. + (get_logon_server): Add bool parameter to control rediscovery of DC. + Use DsGetDcNameA function if supported, NetGetDCName/NetGetAnyDCName + otherwise. + (get_server_groups): Rediscover DC if get_user_groups fails and + try again. + (get_reg_security): Use correct error code macro when testing + RegGetKeySecurity return value. + * security.h (get_logon_server): Remove default vaue from wserver + parameter. Add rediscovery parameter. + * uinfo.cc (cygheap_user::env_logsrv): Accommodate rediscovery parameter + in call to get_logon_server. + +2006-07-05 Christopher Faylor <cgf@timesys.com> + + * sortdin: Ignore all leading underscores when deriving a sort key. + * cygwin.din: Resort. + +2006-07-05 Christopher Faylor <cgf@timesys.com> + + * sortdin: New program. + * cygwin.din: Sort. + +2006-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::wait): Reset default timeout to 10ms. + +2006-07-05 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Ignore has_ea setting, it's always unset + at this point anyway. + (get_symlink_ea): Remove. + (set_symlink_ea): Remove. + (symlink_worker): Drop writing symlink into NTFS extended attributes. + (symlink_info::check): Drop reading symlinks from NTFS extended + attributes. + +2006-07-04 Christopher Faylor <cgf@timesys.com> + + * libc/rexec.cc (cygwin_rexec): Obvious (?) fix to correct a gcc + warning - set port to zero first thing in the function. + +2006-07-04 Corinna Vinschen <corinna@vinschen.de> + + * signal.cc (signal): Set sa_mask to sig. + +2006-07-04 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add rexec.o. + * autoload.cc (inet_network): Drop definition. + (rexec): Ditto. + * net.cc (rexec): Drop extern declaration. + (inet_network): Ditto. + (cygwin_inet_network): Implement using inet_addr. + (cygwin_rexec): Remove. + * libc/rexec.cc: New file. + +2006-07-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::listen): Allow listening on + unbound INET socket. + +2006-07-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::wait): Set default timeout to INFINITE. + +2006-07-03 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtQueryEaFile): Define. + (NtSetEaFile): Define. + * fhandler.cc (fhandler_base::open): Use appropriate open flags + in query case when allow_ntea is set. + * ntdll.h (struct _FILE_GET_EA_INFORMATION): Define. + (struct _FILE_FULL_EA_INFORMATION): Define. + (NtQueryEaFile): Declare. + (NtSetEaFile): Declare. + * ntea.cc (read_ea): Rename from NTReadEA and rewrite using + NtQueryEaFile. + (write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile. + * path.cc (get_symlink_ea): Make static. Add handle parameter to + accommodate new read_ea call. + (set_symlink_ea): Make static. Add handle parameter to accommodate new + write_ea call. + (symlink_worker): Call set_symlink_ea while file is still open. + (symlink_info::check): Call get_symlink_ea after file has been opened. + * security.cc (get_file_attribute): Accommodate new read_ea call. + (set_file_attribute): Accommodate new write_ea call. + * security.h (read_ea): Change declaration accordingly. + (write_ea): Ditto. + +2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * fhandler.h (class dev_console): Add `metabit' indicating the + current meta key mode. + * fhandler_console.cc (fhandler_console::read): Set the top bit of + the character if metabit is true. + * fhandler_console.cc (fhandler_console::ioctl): Implement + KDGKBMETA and KDSKBMETA commands. + * fhandler_tty.cc (process_ioctl): Support KDSKBMETA. + (fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the + master. + * include/cygwin/kd.h: New file for the meta key mode. + * include/sys/kd.h: New file. + +2006-07-03 Eric Blake <ebb9@byu.net> + + * include/stdint.h (UINT8_C, UINT16_C): Unsigned types smaller + than int promote to signed int. + +2006-07-03 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_sendto): Define appropriate parameters using + socklen_t type according to SUSv3. + (cygwin_recvfrom): Ditto. + (cygwin_setsockopt): Ditto. + (cygwin_getsockopt): Ditto. + (cygwin_connect): Ditto. + (cygwin_accept): Ditto. + (cygwin_bind): Ditto. + (cygwin_getsockname): Ditto. + (cygwin_getpeername): Ditto. + (cygwin_recv): Ditto. + (cygwin_send): Ditto. + * include/cygwin/socket.h (socklen_t): Typedef and define. + * include/sys/socket.h: Declare socket functions using socklen_t type. + +2006-07-02 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor version number to 21. + +2006-06-30 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_sendto): Allow zero-sized packets. + (cygwin_sendmsg): Ditto. + +2006-06-26 Corinna Vinschen <corinna@vinschen.de> + + Revert patches from 2005-10-22 and 2006-06-14 to use event driven + accept and connect back to using select: + * fhandler.h (class fhandler_socket): Remove accept_mtx. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop + initializing accept_mtx. + (fhandler_socket::accept): Drop event handling. + (fhandler_socket.cc (fhandler_socket::connect): Ditto. + (fhandler_socket::dup): Drop accept_mtx handling. + (fhandler_socket::listen): Ditto. + (fhandler_socket::prepare): Ditto. + (fhandler_socket::release): Ditto. + (fhandler_socket::close): Ditto. + * net.cc (cygwin_accept): Revert to calling cygwin_select to + implement interuptible accept. + (cygwin_connect): Ditto for connect. + +2006-06-22 Christopher Faylor <cgf@timesys.com> + + * fhandler_fifo.cc (fhandler_fifo::open): Release process lock and grab + a system-wide mutex to prevent a deadlock and a race. + * sync.h (lock_process): Make fhandler_fifo a friend. + + * smallprint.c (__small_vsprintf): Cosmetic change. + +2006-06-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export __srget_r, __swbuf_r. + * include/cygwin/version.h: Bump API minor number to 156. + +2006-06-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add private mutex handle + accept_mtx. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize + accept_mtx to NULL. + (fhandler_socket::dup): Duplicate accept_mtx, if available. + (fhandler_socket::listen): Create accept_mtx before trying to listen. + (fhandler_socket::prepare): Wait for accept_mtx if available to + serialize accepts on the same socket. + (fhandler_socket::release): Release accept_mtx. + (fhandler_socket::close): Close accept_mtx on successful closesocket. + +2006-06-12 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_pty_master::close): Always close + from_master/to_master since we always have copies of these handles. + +2006-06-12 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/wait.h: Move definition of wait constants from here... + * include/cygwin/wait.h: ...to here. New file. + * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3. + +2006-06-12 Pierre Humblet Pierre.Humblet@ieee.org + + * heap.cc (heap_init): Only commit if allocsize is not zero. + +2006-06-12 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (fdsock): Disable raising buffer sizes. Add comment to + explain why. + +2006-06-04 Christopher Faylor <cgf@timesys.com> + + * ioctl.cc (ioctl): Accommodate change in reported pty master device + number. + * select.cc (peek_pipe): Ditto. + +2006-06-04 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (CYGTLS_PADSIZE): Reset to a size that XP SP1 seems to like. + * tlsoffsets.h: Regenerate. + +2006-06-03 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::terminate_thread): In debugging output, use + name of thread being terminated rather than thread doing the + terminating. + + * fhandler.h (fhandler_pty_master::slave): Delete. + (fhandler_pty_master::get_unit): Ditto. + (fhandler_pty_master::setup): Change argument declaration to + accommodate new usage. + * fhandler_tty.cc (fhandler_tty_master::init): Remove obsolete slave + assignment. Pass argument to setup indicating that this is a tty. + (fhandler_tty_slave::open): Use dev() method rather than referencing + pc.dev directly. + (fhandler_pty_master::open): Don't create archetype based on ptym + device number. Set device number to use DEV_TTYM_MAJOR and tty number. + Pass argument to setup indicating that this is a pty. + (fhandler_pty_master::setup): Change single argument to a flag + indicating whether we're creating a pty and use appropriately. + Calculate 't' variable here rather than in caller. + + * fhandler_dsp.cc (fhandler_dev_dsp::open): Use dev() method rather + than referencing pc.dev directly. + +2006-06-03 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Call tty_list::init_session here. + (dll_crt0_1): Reflect renaming from tty_init to tty::init_session. + (do_exit): Reflect moving of tty_terminate into tty_list. + * exceptions.cc (events_init): Move tty_mutex stuff elsewhere. + * fhandler_console.cc (set_console_title): Use lock_ttys class. + * fhandler_termios.cc (fhandler_termios::bg_check): Make debug output + more accurate. + * fhandler_tty.cc (fhandler_tty_slave::open): Reflect move of + attach_tty into tty_list class. Don't attempt to grab master end of + pty if master doesn't exist. + (fhandler_pty_master::open): Reflect move of allocate_tty into tty_list + class. Use lock_ttys::release to release mutex. Improve debugging + output. + (fhandler_pty_master::setup): Remove if 0'ed block. Fix argument to + SetNamedPipeHandleState. + * pinfo.cc (_pinfo::set_ctty): Lock ttys before setting sid/pgid. + Improve debugging. Add temporary debugging. + * tty.cc (tty_list::init_session): New function. + (tty::init_session): Rename from tty_init. Reflect move of attach_tty + to tty_list class. + (tty::create_master): Rename from create_tty_master. + (tty_list::attach): Rename from attach_tty. Reflect renaming of + connect_tty to connect. Ditto for allocate_tty. + (tty_terminate): Delete. + (tty_list::terminate): Subsume tty_terminate. Use lock_ttys rather + than manipulating mutex directly. + (tty_list::allocate): Rename from allocate_tty. Use lock_ttys rather + than manipulating mutex directly. Don't set sid here since linux + apparently doesn't do this. Reflect move of create_tty_master into + tty. + (lock_ttys::lock_ttys): Define new constructor. + (lock_ttys::release): New function. + * tty.h (tty::exists): Return false immediately if !master_pid. + (tty::set_master_closed): Define new function. + (tty::create_master): Ditto. + (tty::init_session): Ditto. + (tty_list::mutex): New field. + (tty_list::allocate): Define new function. + (tty_list::connect): Ditto. + (tty_list::attach): Ditto. + (tty_list::init_session): Ditto. + (lock_ttys): New class. + (tty_init): Delete declaration. + (tty_terminate): Ditto. + (attach_tty): Ditto. + (create_tty_master): Ditto. + +2006-06-03 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (libdl.a): New library. + +2006-06-03 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_pty_master::close): Don't close handles if + we don't own them. + (fhandler_pty_master::setup): Make sure that original handle is closed + when changing inheritance. + (fhandler_pty_master::fixup_after_fork): Set from_master/to_master to + arch value always. + (fhandler_pty_master::fixup_after_exec): Clear from_master/to_master + when close_on_exec. + +2006-06-03 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (init_cygheap::close_ctty): Remove obsolete code. + * dcrt0.cc (child_info_spawn::handle_spawn): Signal ready after we've + run fixup_after_exec. + * dtable.cc (dtable::fixup_after_exec): Add debugging output. + * fhandler_tty.cc (fhandler_pty_master::doecho): Use class version of + to_master. + (fhandler_tty_common::close): Remove obsolete code. + (fhandler_tty_slave::fixup_after_exec): Don't close, since this is done + in dtable's fixup_after_exec. (revisit later?) + (fhandler_pty_master::fixup_after_exec): Ditto. + +2006-06-02 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (CYGTLS_PADSIZE): Bump up or suffer a regrettable collision + with the call chain. + * tlsoffsets.h: Regenerate. + + * dcrt0.cc (break_here): Define unconditionally for use elsewhere. + Call DebugBreak, if appropriate. + (initial_env): Rely on break_here() to call DebugBreak. + * exceptions.cc (try_to_debug): Ditto. + +2006-06-02 Christopher Faylor <cgf@timesys.com> + + * fhandler.cc (fhandler_base::fixup_after_exec): Declare here. + * fhandler.h (fhandler_base::fixup_after_exec): Make non-inline. + (fhandler_termios::fixup_after_fork): Delete declaration. + (fhandler_termios::fixup_after_exec): Ditto. + (fhandler_tty_common::inuse): Remove. + (fhandler_tty_common::dup): Delete declaration. + (fhandler_tty_common::fixup_after_fork): Ditto. + (fhandler_tty_slave::fixup_after_exec): Declare new function. + (fhandler_pty_master::dwProcessId): New variable. + (fhandler_pty_master::from_master): Ditto. + (fhandler_pty_master::to_master): Ditto. + (fhandler_pty_master::setup): New function. + (fhandler_pty_master::fixup_after_fork): Ditto. + (fhandler_pty_master::fixup_after_exec): Ditto. + * fhandler_termios.cc (fhandler_termios::fixup_after_exec): Delete + definition. + (fhandler_termios::fixup_after_fork): Ditto. + * fhandler_tty.cc (fhandler_tty_master::init): Use fhandler_pty_master + setup function rather than obsolete tty::common_init. Delete obsolete + inuse setting. + (fhandler_tty_slave::fhandler_tty_slave): Set inuse to NULL here. + (fhandler_tty_slave::open): Change debugging output for clarity. Check + for different things when doing a sanity check on the tty. Reflect the + fact that master_pid now is the cygwin pid rather than the windows pid. + Use "arch" rather than "archetype" for consistency. + (fhandler_tty_slave::close): Close inuse here. + (fhandler_tty_slave::dup): Remove old if 0'ed code. + (fhandler_pty_master::dup): New function. Handles pty master + archetype. + (fhandler_pty_master::fhandler_pty_master): Zero pty_master specific + fields. + (fhandler_pty_master::open): Implement using archetypes, similar to + slave. Use fhandler_pty_master setup function rather than obsolete + tty::common_init. Don't set inuse. + (fhandler_tty_common::close): Don't deal with inuse. Delete old if + 0'ed code. + (fhandler_pty_master::close): Implement using archetypes. Close + from_master and to_master. + (fhandler_tty_common::set_close_on_exec): Just set close_on_exec flag + here since everything uses archetypes now. + (fhandler_tty_common::fixup_after_fork): Delete definition. + (fhandler_tty_slave::fixup_after_exec): Define new function. + (fhandler_pty_master::setup): New function, derived from + tty::common_init. + (fhandler_pty_master::fixup_after_fork): New function. + (shared_info.h): Reset SHARED_INFO_CB to reflect new tty size. + * tty.cc (tty_list::terminate): Close individual handles from + tty_master. + (tty::master_alive): Delete. + (tty::make_pipes): Ditto. + (tty::common_init): Ditto. + * tty.h (tty::from_slave): Delete. + (tty::to_slave): Ditto. + (tty::common_init): Delete declaration. + (tty::make_pipes): Ditto. + (tty::master_pid): Define as pid_t since it is now a cygwin pid. + +2006-06-01 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (cygheap_fixup_in_child): Don't close parent handle here. + Let the caller do that. + * dcrt0.cc (child_info_spawn::handle_spawn): Close parent handle here + to allow fixup_after_exec functions to use it. + + * cygtls.cc (_cygtls::call2): Avoid calling exit thread if called with + *crt0_1 functions. + * cygtls.h (_cygtls::isinitialized): Check that we actually have a tls + before seeing if it is initialized. + * gendef (_sigfe_maybe): Ditto. + * dcrt0.cc (dll_crt0_1): Remove static, use just one argument. + * dll_init.cc (dllcrt0_info): New structure. + (dll_dllcrt0): Change into a front-end to renamed dll_dllcrt0_1 so that + we'll always be assured of having something like a tls. + (dll_dllcrt0_1): New function, basically renamed from from dll_dllcrt0. + Unconditionally call _my_tls.init_exception_handler now that we are + assured of having a tls. Change variable name from "linking" to "linked". + * winsup.h (dll_crt0_1): Declare. + (dll_dllcrt0_1): Ditto. + +2006-05-30 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread. + +2006-05-29 Christopher Faylor <cgf@timesys.com> + + * winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork + errors. + +2006-05-28 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (child_info::proc_retry): Mask all of the bits we're + interested in, which includes bits above and below 0xc0000000. + +2006-05-27 Christopher Faylor <cgf@timesys.com> + + * dll_init.cc (dll_dllcrt0): Previous change didn't work very well with + fork. Semi-revert it but change name of variable to something that + makes better sense. + +2006-05-27 Christopher Faylor <cgf@timesys.com> + + * thread.cc (verifyable_object_isvalid): Check for NULL specifically. + +2006-05-27 Christopher Faylor <cgf@timesys.com> + + * dll_init.cc (dll_dllcrt0): Call _my_tls.init_exception_handler if + we've finished initializing (Thanks to Gary Zablackis for noticing this + problem). Just use cygwin_finished_initializing rather than defining a + separate variable. + +2006-05-25 Christopher Faylor <cgf@timesys.com> + + * debug.h (ModifyHandle): Define new macro. + (modify_handle): Declare new function. + * debug.cc (modify_handle): Define new function. + * fhandler.h (fhandler_base::fork_fixup): Change return value from void + to bool. + * fhandler.cc (fhandler_base::fork_fixup): Return true if fork fixup has + been done. + * pipe.cc (fhandler_pipe::set_close_on_exec): Set inheritance of + protected handle via ModifyHandle if DEBUGGING. + (fhandler_pipe::fixup_after_fork): Protect guard handle if fork fixup + has been done. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::call): Call call2 using _my_tls. + (_cygtls::init_exception_handler): Always replace existing exception + handler with cygwin exception handler. + * cygtls.h (_cygtls::call2): Remove static designation. + * dcrto.cc (dll_crt0_1): Define in a way that allows calling via + _cygtls::call. + (_initialize_main_tls): Delete. + (_dll_crt0): Call dll_crt0_1 via cygtls::call. Set _main_tls here. + * external.cc (cygwin_internal): Implement CW_CYGTLS_PADSIZE. + * include/sys/cygwin.h (CW_CYGTLS_PADSIZE): Define. + * tlsoffsets.h: Regenerate. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * configure.in: Update to newer autoconf. + (thanks to Steve Ellcey) + * configure: Regenerate. + * aclocal.m4: New file. + +2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com> + + * fhandler.cc (readv): Remove nonsensical assert. + +2006-05-23 Christopher Faylor <cgf@timesys.com> + + * select.cc (start_thread_socket): Delay setting thread local exitsock + until we know it's correct. Return correct value on error. + +2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com> + Christopher Faylor <cgf@timesys.com> + + * select.cc (start_thread_socket): Clean up exitsock in case of error. + Use si->exitcode consistently. + +2006-05-21 Christopher Faylor <cgf@timesys.com> + + * child_info.h (_CI_SAW_CTRL_C): New enum. + (CURR_CHILD_INFO_MAGIC): Reset. + (saw_ctrl_c): New function. + (set_saw_ctrl_c): Ditto. + * sigproc.cc (child_info::proc_retry): Return EXITCODE_OK if we get + STATUS_CONTROL_C_EXIT and we actually saw a CTRL-C. + * spawn.cc (dwExeced): Delete. + (chExeced): New variable. + (spawn_guts): Set chExeced; + * exceptions.cc (dwExeced): Delete declaration. + (chExeced): Declare. + (ctrl_c_handler): Detect if we're an exec stub process and set a flag, + if so. + + * fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Add + extra DEBUGGING test. + + * pinfo.cc: Fix comment. + +2006-05-21 Christopher Faylor <cgf@timesys.com> + + * fhandle.h (fhandler_pipe::create_guard): Revert change which + eliminated SECURITY_ATTRIBUTES argument. + * pipe.cc (fhandler_pipe::open): Duplicate guard from other process and + protect it appropriately. Eliminate unneeded writepipe_exists + temporary variable. Set inheritance appropriately. + (fhandler_pipe::set_close_on_exec): Revert change which eliminated + handling guard inheritance. + (fhandler_pipe::fixup_after_fork): Ditto. Use correct name of entity + being checked by fork_fixup. + (fhandler_pipe::fixup_after_exec): Don't bother with guard here. + (fhandler_pipe::dup): Cosmetic changes and revert creation of + writepipe_exists as noninheritable. + (fhandler_pipe::create): Revert change which eliminated + SECURITY_ATTRIBUTES argument. Revert change which always made + writepipe_exists noninheritable. + +2006-05-21 Christopher Faylor <cgf@timesys.com> + + * debug.cc (add_handle): Print handle value when collision detected. + * dtable.cc (dtable::stdio_init): Cosmetic change. + * fhandler.h (fhandler_base::create_read_state): Protect handle. + (fhandler_pipe::create_guard): Ditto. Always mark the handle as + inheritable. + (fhandler_pipe::is_slow): Return boolean value rather than numeric 1. + * pipe.cc (fhandler_pipe::fhandler_pipe): Always flag that we need fork + fixup. + (fhandler_pipe::open): Don't pass security attributes to create_guard. + (fhandler_pipe::set_close_on_exec): Don't handle guard here. + (fhandler_pipe::close): Accommodate now-protected guard handle. + (fhandler_pipe::fixup_in_child): Don't protect read_state here. + (fhandler_pipe::fixup_after_exec): Close guard handle if close_on_exec. + (fhandler_pipe::fixup_after_fork): Don't bother with guard here. + (fhandler_pipe::dup): Don't set res to non-error prematurely. Use + boolean values where appropriate. Protect guard and read_state. + (fhandler_pipe::create): Don't call need_fork_fixup since it is now the + default. Don't protect read_state or guard. + + * pipe.cc (fhandler_base::ready_for_read): Use bool values for "avail". + + * spawn.cc (spawn_guts): Set cygheap->pid_handle as inheritable when + protecting. + +2006-05-15 Lev Bishop <lev.bishop+cygwin@gmail.com> + Christopher Faylor <cgf@timesys.com> + + * select.cc (fhandler_pipe::ready_for_read): Actually get the guard + mutex for blocking reads. + +2006-05-20 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty::close): Remove problematic hExeced guard. + +2006-05-20 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty_slave::open): Reinstate call to + need_invisible on first pty open. + +2006-05-18 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::need_invisible): Allocate an + invisible window station when ctty != TTY_CONSOLE. + +2006-05-16 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Don't test for initialization since + this function will always be called when _my_tls is initialized. + * init.cc (dll_entry): Don't attempt to remove tls info if _my_tls is + obviously not even available. + +2006-05-15 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (no_signals_available): Detect hwait_sig == + INVALID_HANDLE_VALUE. + (wait_sig): Set hwait_sig to INVALID_HANDLE_VALUE on __SIGEXIT. + +2006-05-15 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::init_thread): Zero entire _my_tls structure and + no more. + * cygtls.h (_my_tls::padding): Delete. + (CYGTLS_PADSIZE): Redefine concept of padding to mean padding at the + end of the stack. + * dcrt0.cc (initialize_main_tls): Change return to void. + * gentls_offsets: Treat const specially, too. Keep going after a '}' + is found. Change negative offset calculation to use CYGTLS_PADSIZE. + * init.cc (_my_oldfunc): New variable. + (threadfunc_fe): Use stored tls value for oldfunc rather than blindly + writing to the stack. + (munge_threadfunc): Set oldfunc in tls. + (dll_entry): Initialize tls allocation. + * tlsoffsets.h: Regenerate. + +2006-05-13 Christopher Faylor <cgf@timesys.com> + + * ntdll.h (STATUS_INVALID_INFO_CLASS): Conditionalize. + +2006-05-10 Brian Dessent <brian@dessent.net> + + * Makefile.in (clean): Also delete *.dbg. + +2006-05-08 Christian Franke <Christian.Franke@t-online.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix typo which + caused test for ".." to be skipped. + +2006-05-02 Christopher Faylor <cgf@timesys.com> + + * external.cc (cygwin_internal): Set errno on failure. + +2006-04-27 Corinna Vinschen <corinna@vinschen.de> + + * pipe.cc (DEFAULT_PIPEBUFSIZE): Raise to 64K. + +2006-04-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base): Change fstat_helper prototype + to take file size and inode number as 64 bit values. + * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc + (FS_IS_SAMBA_WITH_QUOTA): Ditto. + (path_conv::hasgood_inode): Delete. + (path_conv::is_samba): Delete. + (path_conv::isgood_inode): Centralized function to recognize + a good inode number. + (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size. + Accommodate argument change in fstat_helper. + (fhandler_base::fstat_by_name): Ditto. + (fhandler_base::fstat_helper): Accommodate argument change. Call + path_conv::isgood_inode to recognize good inodes. + (fhandler_disk_file::opendir): Explain Samba weirdness here. + Call path_conv::fs_is_samba instead of path_conv::is_samba. + (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS + as valid return code from NtQueryDirectoryFile to indicate that + FileIdBothDirectoryInformation is not supported. + Call path_conv::isgood_inode to recognize good inodes. + * ntdll.h (STATUS_INVALID_INFO_CLASS): Define. + * path.cc (fs_info::update): Rework file system recognition + and set appropriate flags. + * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags. + Constify pure read accessors. + +2006-04-24 Christopher Faylor <cgf@timesys.com> + + * environ.cc (getearly): Force correct dereference order when + inspecting environ table. + +2006-04-24 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (thread_pipe): Raise sleep time only every 8th iteration. + (thread_mailslot): Ditto. + +2006-04-23 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <cgf@timesys.com> + + * select.cc (thread_pipe): Raise sleep time dynamically to speed up + select on pipes when copying lots of data. + (thread_mailslot): Ditto for mailslots. + +2006-04-22 Christopher Faylor <cgf@timesys.com> + + * signal.cc (abort): On second thought, just set incyg once. + +2006-04-22 Christopher Faylor <cgf@timesys.com> + + * signal.cc (abort): Set incyg manually to help get a reliable gdb + stack trace. + * cygwin.din (abort): Make NOSIGFE. + +2006-04-21 Pierre Humblet Pierre.Humblet@ieee.org + Christopher Faylor <cgf@timesys.com> + + * environ.cc (getearly): Use GetEnvironmentVariable and cmalloc instead + of GetEnvironmentStrings. + (environ_init): Revert rawenv stuff. + +2006-04-21 Christopher Faylor <cgf@timesys.com> + + * environ.cc (rawenv): Make this variable a file-scope static. + (getearly): Rename 's' variable to 'len' since 's' is used fairly + consistently throughout cygwin as a string variable. Remove rawenv + declaration. Perform other minor cleanups. + (environ_init): Remove rawenv declaration. Only set rawenv to + GetEnvironmentStrings() if it has not already been set. Properly free + rawenv in all cases. + +2006-04-21 Christopher Faylor <cgf@timesys.com> + + * tty.h (tty::hwnd): Move to tty_min. + (tty::gethwnd): Ditto. + (tty::sethwnd): Ditto. + (tty_min::hwnd): Receive variable from tty class. + (tty_min::gethwnd): Receive function from tty classs. + (tty_min::sethwnd): Ditto. + * dtable.cc (dtable::stdio_init): Only call init_console_handler when + we actually own the console. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Set tty's hwnd + to non-zero value. + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Semi-reinstate + handling of console when pgrp is set. + +2006-04-21 Pierre Humblet <Pierre.Humblet@ieee.org> + Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (getearly): New function. + (findenv_func): New function pointer, predefined to getearly. + (getenv): Call findenv function over the findenv_func pointer. + (environ_init): Change findenv_func pointer to my_findenv after Cygwin + environment is initialized. + +2006-04-21 Lars Munch <lars@segv.dk> + + * include/asm/byteorder.h (__ntohl): Fix the missing uint32_t. + +2006-04-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::wait): Reorder setting + WSAError to avoid spurious errors with WSAError set to 0. + +2006-04-21 Corinna Vinschen <corinna@vinschen.de> + + * include/asm/byteorder.h: Include stdint.h. Per standard, change + datatypes in ntohX and htonX functions to uintXX_t types. + +2006-04-18 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (ctrl_c_handler): Only exit TRUE on CTRL_LOGOFF_EVENT + when we have actually handled the event. + +2006-04-17 Eric Blake <ebb9@byu.net> + + * mktemp.cc (_gettemp): Open temp files in binary mode. + +2006-04-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use UINT32_MAX + instead of UINT_MAX. + +2006-04-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (path_conv::hasgood_inode): Make inline. + Drop remote fs handling entirely since unreliable inode numbers + are now recognized differently. + (path_conv::is_samba): Make inline. + (fhandler_disk_file::opendir): Reformat comment. + (fhandler_base::fstat_helper): Special case remote file systems + returning (unreliable) 32 bit inode numbers. + (fhandler_disk_file::readdir): Ditto. + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto. + +2006-04-13 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Move ch.set() call back to where it was + supposed to be. + +2006-04-13 Corinna Vinschen <corinna@vinschen.de> + + * sysconf.cc (sysconf): Add _SC_THREADS, _SC_THREAD_ATTR_STACKSIZE, + _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PROCESS_SHARED, + _SC_THREAD_SAFE_FUNCTIONS, _SC_TIMERS handling. + +2006-04-12 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Revert patch which treated derived cygwin + programs differently from those which are mounted with -X. Pass extra + argument to linebuf::fromargv. + * winf.h (MAXCYGWINCMDLEN): New define. + (linebuf::finish): Add a new argument denoting when command line + overflow is ok. + (linebuf::fromargv): Ditto. + * winf.cc (linebuf::finish): Implement above change. + (linebuf::fromargv): Ditto. + +2006-04-11 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (DLL_OFILES): Add winf.o. + * spawn.cc: Move command line handling stuff into winf.cc. + * winf.h: New file. + * winf.cc: New file. + +2006-04-05 Christopher Faylor <cgf@timesys.com> + + * fhandler_socket.cc: Move iptypes.h include after winsock2 since it + now relies on it. + * net.cc: Ditto. + +2006-04-05 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Move user_data->{resourcelocks,threadinterface} + initialization here from dll_crt0_1. + (dll_crt0_1): See above. + +2006-04-04 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (fdsock): Raise default SO_RCVBUF/SO_SNDBUF buffer sizes to + the same values as on Linux. + +2006-04-03 Christopher Faylor <cgf@timesys.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + (child_info_fork::alloc_stack): Move into this class. + (child_info_fork::alloc_stack_hard_way): Ditto. + * dcrt0.cc (child_info_fork::alloc_stack): Ditto. + (child_info_fork::alloc_stack_hard_way): Ditto. + (_dll_crt0): Reference alloc_stack via fork_info. + +2006-04-03 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (linebuf::finish): Drop argument. Don't check command line + length. + (spawn_guts): Remove wascygexec. Check real_path.iscygexec instead. + Accommodate change to linebuf::finish. + +2006-04-03 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (sm): Delete. + (alloc_stack_hard_way): Figure out where the stack lives here rather + than relying on previously filled out information which has been + invalid since 1.5.19. + +2006-03-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (FS_IS_SAMBA_WITH_QUOTA): New define. + (path_conv::hasgood_inode): Recognize Samba with quota support + compiled in. + (path_conv::is_samba): Ditto. Fix comment to include Samba version + numbers for later reference. + +2006-03-30 Corinna Vinschen <corinna@vinschen.de> + + * security.h (sec_user_nih): Make sid1 argument mandatory. + (sec_user): Ditto. + +2006-03-29 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (wait_for_sigthread): Use the current user sid when + setting up the signal pipe rather than relying on (eventually) the + effective sid. + +2006-03-29 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so + that it can be used by subsequent startup functions. + (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING. + (dll_crt0_1): Move user_data->{resourcelocks,threadinterface} + initialization here from dll_crt0_0. + * fork.cc (frok::child): Tell wait_for_sigthread that this is fork. + (frok::parent): Only initialize start_time once. Tighten time when + we're "deimpersonated". + * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff. + Add debugging output. + (wait_for_sigthread): Accept an argument which illustrates whether we + are forked or not. + (wait_sig): Avoid using myself pointer. + * winsup.h ((wait_for_sigthread): Reflect change to argument. + +2006-03-26 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Close handles if we know that we will not be + seeing a sync event from the child. + +2006-03-26 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (wait_sig): Move myself manipulation... + (wait_for_sigthread): ...to here. + +2006-03-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc: Include ntdef.h and ntdll.h. + (fhandler_dev_floppy::get_drive_info): Rearrange so that now + NtQueryVolumeInformationFile is called on drives which don't support + IOCTL_DISK_GET_DRIVE_GEOMETRY. + * ntdll.h (struct _FILE_FS_SIZE_INFORMATION): Add. + (enum _FSINFOCLASS): Add missing values. + +2006-03-23 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Make + error message more explicit. + * pinfo.cc (_pinfo::commune_request): Don't lock process unless we're + looking for fifos. + +2006-03-23 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (child_info_spawn::handle_spawn): Don't initialize the + console handler here. + * dtable.cc (dtable::stdio_init): Initialize console handler here. + +2006-03-23 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (sigalloc): Don't set SA_RESTART here. + * signal.cc (_SA_NORESTART): New flag. + (sigaction_worker): New function, derived from sigaction. Don't set + internal flags unless called internally. + (sigaction): Use sigaction_worker. + (signal): Honor new _SA_NORESTART flag. + (siginterrupt): Set _SA_NORESTART flag appropriately. Use + sigaction_worker to set flags. + * include/cygwin/signal.h: Define _SA_INTERNAL_MASK here. + +2006-03-22 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread_mutex::is_good_initializer_or_bad_object): Delete. + (pthread_cond::is_good_initializer_or_bad_object): Delete. + (pthread_rwlock::is_good_initializer_or_bad_object): Delete. + (pthread_cond::init): Remove disabled code. Guard assignment to + object to initialize against access violation. + (pthread_rwlock::init): Ditto. + (pthread_mutex::init): Ditto. + +2006-03-22 Eric Blake <ebb9@byu.net> + + * fhandler.cc (fcntl): Print flags in hex. + +2006-03-22 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Semi-revert 2006-03-14 change which moved + pinfo_init and uinfo_init here. + (dll_crt0_1): Ditto. + (__dll_crt0): Ditto. Don't call update_envptrs here. + (dll_crt0_1): Ditto. Move wait_for_sigthread call here from dll_crt0_0. + * environ.cc (environ_init): Call it here instead. + * sigproc.cc (my_readsig): New static variable. + (wait_for_sigthread): Set up read pipe here since we are assured that + we have the proper privileges when this is called. + (talktome): Eliminate second argument since it is available as a global + now. + (wait_sig): Reflect use of my_readsig. + +2006-03-22 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread_cond::init): Disable validity test of object + to initialize since test of uninitialized content is unreliable. + (pthread_rwlock::init): Ditto. + (pthread_mutex::init): Ditto. + +2006-03-21 Christopher Faylor <cgf@timesys.com> + + * signal.cc (signal): Don't set SA_RESTART here. + (siginterrupt): White space. + * sigproc.cc (sigalloc): Set SA_RESTART here, on initialization. + +2006-03-21 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_status): Fix typo which made it impossible to set + iscygwin. + (child_info::isstraced): Booleanize. + (child_info::iscygwin): Ditto. + * sigproc.cc (child_info::child_info): Minor cleanup of flag setting. + * spawn.cc (spawn_guts): Only close_all_files when we know the process + has started successfully. + + * exceptions.cc (init_console_handler): Fix indentation. + +2006-03-20 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Call SetErrorMode earlier. + * pinfo.cc (_pinfo::dup_proc_pipe): Reset wr_proc_pipe on failure. + Return previous pipe handle. + * pinfo.h (_pinfo::dup_proc_pipe): Reflect change to return value. + * spawn.cc (spawn_guts): Restore previous proc pipe on retry or if + process exits before synchronization. + +2006-03-20 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_status): New enum. + (child_info::flag): Rename from 'straced'. + (child_info::isstraced): New function. + (child_info::iscygwin): Ditto. + (child_info_fork::handle_fork): Reparmize. + (child_info_fork::handle_failure): Ditto. + (child_info_spawn::handle_spawn): New function. + * dcrt0.cc (get_cygwin_startup_info): Use isstraced method. + (child_info_spawn::handle_spawn): Define new function from code + previously in dll_crt0_0. + (dll_crt0_0): Move spawn stuff into handle_spawn. Only call + init_console_handler for fork case. + * sigproc.cc (child_info::child_info): Set flag appropriately. + (child_info::proc_retry): Treat exit code as "funny" if it's a cygwin + process. + * spawn.cc (spawn_guts): Remove commented out flag setting. + +2006-03-19 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (commune_process): Fix randomly invalid pointer which caused + fifos to work incorrectly. + +2006-03-19 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Oops. We need to bother with setting + init_console_handler in the fork/exec case. + +2006-03-19 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Don't bother with setting init_console_handler + here since it will be set later when we discover if we have a ctty or + not. + * exceptions.cc (init_console_handler): Properly remove NULL handler. + +2006-03-18 Christopher Faylor <cgf@timesys.com> + + * pinfo.h (EXITCODE_OK): Define new constant. + * sigproc.cc (child_info::sync): Return EXITCODE_OK if entering with + exit_code == 0. + (sig_send): Don't complain if sending signals while blocked if the + sender isn't in the main thread. + +2006-03-18 Christopher Faylor <cgf@timesys.com> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Regenerate. + (child_info::retry): Move here from fork subclass. + (child_info::exit_code): New field. + (child_info::retry_count): Max retry count for process start. + (child_info::proc_retry): Declare new function. + (child_info_fork::retry): Move to parent. + (child_info_fork::fork_retry): Ditto. + * dcrt0.cc (child_info::fork_retry): Rename and move. + (child_info_fork::handle_failure): Move. + (dll_crt0_0): Initialize console handler based on whether we have a + controlling tty or not. Avoid nonsensical check for fork where it can + never occur. + * environ.cc (set_proc_retry): Rename from set_fork_retry. Set + retry_count in child_info. + (parse_thing): Reflect above change. + * exceptions.cc (dummy_ctrl_c_handler): Remove unused variable name. + (ctrl_c_handler): Always return TRUE for the annoying + CTRL_LOGOFF_EVENT. + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Remove call to + init_console_handler. + * fhandler_tty.cc (fhandler_tty_slave::open): Just call + mange_console_count here and let it decide what to do with initializing + console control handling. + * fork.cc (fork_retry): Remove definition. + (frok::parent): Define static errbuf and use in error messages (not + thread safe yet). Close pi.hThread as soon as possible. Protect + pi.hProcess as soon as possible. Don't set retry_count. That happens + automatically in the constructor now. Accommodate name change from + fork_retry to proc_retry. + * init.cc (dll_entry): Turn off ctrl-c handling early until we know how + it is supposed to be handled. + * pinfo.cc (_pinfo::dup_proc_pipe): Remember original proc pipe value + for failure error message. Tweak debug message slightly. + * sigproc.cc (child_info::retry_count): Define. + (child_info::child_info): Initialize retry count. + (child_info::sync): Set exit code if process dies before + synchronization. + (child_info::proc_retry): Rename from child_info_fork::fork_retry. Use + previously derived exit code. Be more defensive about what is + classified as an error exit. + (child_info_fork::handle_failure): Move here from dcrt0.cc. + * spawn.cc (spawn_guts): Maintain error mode when starting new process + to avoid annoying pop ups. Move deimpersonate call within new loop. + Move envblock freeing to end. Loop if process dies prematurely with + bad exit code. + * syscalls.cc (setpgid): Remove hopefully unneeded call to + init_console_handler. + +2006-03-15 Christopher Faylor <cgf@timesys.com> + + * cygheap.cc (init_cygheap::manage_console_count): Turn console control + handler on/off depending on whether we have allocated a console or not. + * dcrt0.cc (child_info_fork::fork_retry): Add more potential retry + statuses. + (dll_crt0_0): Turn on/off console control depending on whether we have + a controlling tty or not. + * exceptions.cc (init_console_handler): Change BOOL to bool. + * fhandler_console.cc (fhandler_console::need_invisible): Cosmetic + change. + * winsup.h (init_console_handler): Reflect argument type change. + + * wincap.h (supports_setconsolectrlhandler_null): Remove duplicate + capability throughout. + * wincap.cc: Ditto. + +2006-03-14 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info_fork::fork_retry): Declare new function. + * dcrt0.cc (child_info_fork::fork_retry): Define new function. + * fork.cc (frok::parent): Move retry decision into + child_info_fork::fork_retry and honor what it tells us to do. + * sigproc.cc (sig_send): Unhold signals on __SIGEXIT. + +2006-03-14 Christopher Faylor <cgf@timesys.com> + + * fork.cc (frok::parent): Improve error message. + +2006-03-14 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (main_environ): Initialize to &__cygwin_environment. + (dll_crt0_1): Move resourcelocks, thread interface, pinfo_init, and + uinfo_init... + (dll_crt0_0): ...to here. + (_dll_crt0): Call update_envptrs here after setting main_environ. + * environ.cc (environ_init): Eliminate initted variable. Don't call + update_envptrs here. + * sigproc.cc (wait_sig): Use my_sendsig when calling CreatePipe to + avoid a dereference. + +2006-03-13 Christopher Faylor <cgf@timesys.com> + + * child_info.h (child_info_fork::handle_failure): Declare new function. + (child_info_fork::retry): New field. + * dcrt0.cc (__api_fatal_exit_val): Define. + (child_info_fork::handle_failure): Define new function. + (__api_fatal): Exit using __api_fatal_exit_val value. + * environ.cc (set_fork_retry): Set fork_retry based on CYGWIN + environment variable. + (parse_thing): Add "fork_retry" setting. + * fork.cc (fork_retry): Define. + (frok::parent): Reorganize to allow retry of failed child creation if + child signalled that it was ok to do so. + * heap.cc (heap_init): Signal parent via handle_failure when + VirtualAlloc fails. + * pinfo.h (EXITCODE_RETRY): Declare. + * sigproc.cc (child_info::sync): Properly exit with failure condition + if called for fork and didn't see subproc_ready. + * spawn.cc (spawn_guts): Use windows pid as first argument. + * winsup.h: Remove obsolete NEW_MACRO_VARARGS define. + (__api_fatal_exit_val): Declare. + (set_api_fatal_return): Define. + (in_dllentry): Declare. + * exceptions.cc (inside_kernel): Remove unneeded in_dllentry + declaration. + +2006-03-13 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (dll_crt0_0): Reorganize so that sigproc_init is called a + little later. Add a comment. + * fork.cc (resume_child): Make void. + (frok::parent): Only zero pi when necessary. Explicitly zero si. Set + this_errno when child_copy fails. Accommodate change to resume_child. + * sigproc.cc (sigalloc): Move global_sigs initialization here. + (sigproc_init): Move global_sigs. + (sig_send): Just check for flush signals once. + + * wincap.h: Define supports_setconsolectrlhandler_null throughout. + * wincap.cc: Ditto. + +2006-03-13 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (LoadDLLfuncNt): New define to wrap NT native functions. + Use for NT native functions throughout. + * dtable.cc (handle_to_fn): Treat return value of NtQueryObject as + NTSTATUS value. + +2006-03-12 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Reset initialized flag right away if we + were previously initialized. + * cygtls.h (_cygtls::initialized): Move nearer to the end to catch + situation when Windows 98 mysteriously changes parts of _my_tls when + thread is detaching. + * gendef (__sigfe_maybe): Simplify slightly. + * tlsoffsets.h: Regenerate. + +2006-03-12 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (CYGTLS_INITIALIZED): Change to a little more unlikely value. + (CYGTLSMAGIC): Delete. + * dcrt0.cc (dll_crt0_0): Call sigproc_init during init startup. + (_dll_crt0): Don't worry about sync_startup. Just wait for sigthread here. + * dll_init.cc (cygwin_detach_dll): Only pick up tls version of retaddr + if we have a valid tls. + * fork.cc (frok::child): Remove sigproc_init initialization since it + happens much earlier now. + * gendef: Recognize SIGFE_MAYBE. + (fefunc): Generate calls to _sigfe_maybe, if appropriate. + (_sigfe_maybe): New function. + * init.cc (search_for): Always initialize search_for, even on fork. + (calibration_thread): Delete. + (calibration_id): Delete. + (prime_threads): Delete. + (munge_threadfunc): Remove calibration_thread special case. Avoid + calling thread function if we haven't yet hit the "search_for" thread. + (dll_entry): Remove prime_threads call. Only call munge_threadfunc + when hwait_sig is active. Ditto. for _my_tls.remove (); + * sigproc.cc (hwait_sig): Make global. + (sigproc_init): Don't bother with sync_startup. + (sig_send): Treat flush as a no-op when signals are held. + (wait_sig): Cause signals to be held after fork. + +2006-03-09 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Move existance check for oldpath further up + to the start of the function. Avoid another case of a name collision + if oldpath is a shortcut and a file or directory newpath already exists. + +2006-03-09 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtClose): Define. + (NtOpenDirectoryObject): Define. + (NtQueryDirectoryObject): Define. + * fhandler_proc.cc: Include ctype.h and wchar.h. + (format_proc_partitions): Revamp loop over existing harddisks by + scanning the NT native \Device object directory and looking for + Harddisk entries. + * ntdll.h: Rearrange system call declarations alphabetically. + (DIRECTORY_QUERY): Define. + (struct _DIRECTORY_BASIC_INFORMATION): Define. + (NtOpenDirectoryObject): Declare. + (NtQueryDirectoryObject): Declare. + +2006-03-08 Christopher Faylor <cgf@timesys.com> + + * cygtls.h (_cygtls::retaddr): New method. + * dll_init.cc (cygwin_detach_dll): Use new tls method to find return + address since this function is now signal guarded. + (update_envptrs): Remove unneeded braces. + * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning. + +2006-03-08 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (statvfs): Simplify path name expression. + +2006-03-08 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc: Include winioctl.h. + (statvfs): Request correct volume size using DeviceIoControl if + quotas are enforced on the file system. + +2006-03-03 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (opendir): Fix indentation. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Move storing + fhandler in file descriptor table to some point very late in function + to avoid double free'ing. Add comment to explain what happens. + Add label free_mounts and don't forget to delete __DIR_mounts structure + if NtOpenFile fails. + +2006-03-02 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (chroot): Disallow chroot into special directories. + Return EPERM instead. + +2006-03-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Check + cygdrive string length for those who have cygdrive mapped to "/". + +2006-03-01 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (set_cygwin_privileges): Request SE_BACKUP_NAME + privileges. + +2006-03-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (fhandler_proc::fstat): Always return fixed link + count of 1 for /proc directory instead of incorrect PROC_LINK_COUNT. + +2006-03-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (enum dirent_states): Remove dirent_saw_cygdrive, + dirent_saw_dev and dirent_saw_proc. + (fhandler_cygdrive::open): Declare. + (fhandler_cygdrive::close): Declare. + * fhandler_disk_file.cc (class __DIR_mounts): Move to beginning of file. + (__DIR_mounts::check_mount): New parameter to indicate if inode number + is needed in calling function or not. Add /proc and /cygdrive handling. + (__DIR_mounts::check_missing_mount): Ditto. + (path_conv::ndisk_links): Use __DIR_mounts class to create correct + hardlink count for directories with mount points in them. + (fhandler_disk_file::readdir_helper): Remove /dev, /proc and /cygdrive + handling. + (fhandler_cygdrive::open): New method. + (fhandler_cygdrive::close): New method. + (fhandler_cygdrive::fstat): Always return fixed inode number 2 and + fixed link count of 1. Drop call to set_drives. + (fhandler_cygdrive::opendir): Drop call to get_namehash. + (fhandler_cygdrive::readdir): Handle "." entry to return fixed inode + number 2. + +2006-03-01 Christopher Faylor <cgf@timesys.com> + + * cygwin.din: Fix some erroneous SIGFE/NOSIGFE settings. + +2006-03-01 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::callfunc): Revert below change. Make ev a + manual reset event again. so that it will be reset by WaitFor*Object + as appropriate. + (cygthread::stub): Ditto. + (cygthread::terminate_thread): Reset ev if it was found to have been + set. + +2006-03-01 Christopher Faylor <cgf@timesys.com> + + * analyze_sigfe: New script. + * dllfixdbg: Add copyright. + * gendef: Ditto. + * gendevices: Ditto. + * gentls_offsets: Ditto. + +2006-03-01 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event + so that it will be reset by WaitFor*Object as appropriate. + (cygthread::stub): Ditto. + (cygthread::terminate_thread): Remove forced setting of thread + termination. + +2006-03-01 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/dirent.h (struct __DIR): Rename __d_unused to + __d_internal. + * fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef". + (d_dirname): Remove useless "struct". + (d_cachepos): Ditto. + (d_cache): Ditto. + (class __DIR_mounts): New class, implementing mount point tracking + for readdir. + (d_mounts): New macro for easy access to __DIR_mounts structure. + (fhandler_disk_file::opendir): Allocate __DIR_mounts structure and + let __d_internal element of dir point to it. + (fhandler_disk_file::readdir_helper): Add mount points in the current + directory, which don't have a real directory backing them. + Don't generate an inode number for /dev. Add comment, why. + (fhandler_disk_file::readdir): Move filling fname to an earlier point. + Check if current entry is a mount point and evaluate correct inode + number for it. + (fhandler_disk_file::readdir_9x): Ditto. + (fhandler_disk_file::rewinddir): Set all mount points in this directory + to "not found" so that they are listed again after calling rewinddir(). + (fhandler_disk_file::closedir): Deallocate __DIR_mounts structure. + * path.cc (mount_info::get_mounts_here): New method to evaluate a list + of mount points in a given parent directory. + * shared_info.h (class mount_info): Declare get_mounts_here. + +2006-02-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use iscygdrive + instead of isspecial. + * path.h (path_conv::iscygdrive): New method. + +2006-02-28 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (_cygtls::interrupt_now): Remove "inside cygwin" check + since some cygwin functions are meant to be interrupted. + +2006-02-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export __isinff, __isinfd, __isnanf, __isnand. + * include/cygwin/version.h: Bump API minor number to 155. + +2006-02-28 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (readdir_worker): Use slash as path separator when evaluating + namehash for paths below /proc. + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Use expensive + inode number evaluation on share names. + +2006-02-27 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set + d_cachepos under NT or suffer memory corruption. + (fhandler_disk_file::readdir_helper): Avoid else with a return. Just + calculate extension location once when doing symlink checks. + (fhandler_disk_file::readdir): Make debug output more useful. + (fhandler_disk_file::readdir_9x): Ditto. Eliminate redundant variable. + +2006-02-27 Christopher Faylor <cgf@timesys.com> + + * include/sys/termios.h (cfsetispeed): Just define as a function rather + than resorting to a macro. + (cfsetospeed): Ditto. + +2006-02-27 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc: Fix a comment. + +2006-02-27 Christopher Faylor <cgf@timesys.com> + + * cygthread.cc (cygthread::release): Add a comment. + +2006-02-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (fhandler_netdrive::fstat): Create unambiguous + inode number. + (fhandler_netdrive::readdir): Ditto. + +2006-02-24 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (sigheld): Define new variable. + (sig_dispatch_pending): Don't check sigq since that's racy. + (sig_send): Set sigheld flag if __SIGHOLD is specified, reset it if + __SIGNOHOLD is specified. Ignore flush signals if we're holding + signals. + +2006-02-23 Christopher Faylor <cgf@timesys.com> + + * cygwin.din (_exit): Use signal front end. + (exit): Ditto. + +2006-02-23 Christopher Faylor <cgf@timesys.com> + + * winsup.h (cygwin_hmodule): Declare. + * exceptions.cc (inside_kernel): Reverse return values to reflect + function name. Return true if we're in cygwin1.dll or if we're + executing in dll_entry. + (_cygtls::interrupt_now): Reflect reversal of inside_kernel return + value. + * hookapi.cc (cygwin_hmodule): Remove declaration. + * init.cc (dll_entry): Use in_dllentry global to record that we are + executing in dllentry. + +2006-02-22 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::interrupt_now): Reorder conditional + to call inside_kernel only if this isn't locked. + +2006-02-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES to + access flags in case of query_read_control case, add FILE_READ_DATA + in case of query_stat_control. + +2006-02-20 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (av::fixup): Check for .bat and friends specifically now + since these extensions are no longer automatically detected. + +2006-02-19 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (stackdump): Avoid dumping more than once. + +2006-02-19 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Use NtOpenFile + to open the directory. + (fhandler_disk_file::readdir): Use NT_SUCCESS to determine if status + represents success. + +2006-02-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Drop generating + path_conv for root. + +2006-02-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (FS_IS_SAMBA): Move out of + path_conv::hasgood_inode. + (path_conv::is_samba): New method. + (fhandler_base::fstat_by_handle): Don't even try to use + FileIdBothDirectoryInformation on Samba. + * path.h (class path_conv): Declare is_samba method. + +2006-02-17 Christopher Faylor <cgf@timesys.com> + + * path.cc (conv_path_list): Eat empty paths when converting to POSIX. + (cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a + '/' to the end of a path ending in '.'. + +2006-02-16 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export sigignore and sigset. + * exceptions.cc (sigset): New function. + (sigignore): New function. + * include/cygwin/signal.h (SIG_HOLD): Define. + (sigignore): Declare. + (sigset): Declare. + * include/cygwin/version.h: Bump API minor number to 154. + +2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu> + + * include/mntent.h: Add missing #include. + +2006-02-13 Igor Peshansky <pechtcha@cs.nyu.edu> + + * gentls_offsets: Fix typo in error message. + +2006-02-10 Christopher Faylor <cgf@timesys.com> + + * fhandler_process.cc (format_process_stat): Use cygwin-derived start + time even on NT since it is the logical start time of the "process". + * pinfo.cc (set_myself): Don't set start time when it should have + already been set previously. + +2006-02-10 Brian Ford <Brian.Ford@FlightSafety.com> + + * times.cc (clock_getres): Use correct conversion from milliseconds to + seconds/nanoseconds. + (clock_setres): Use correct conversion to nanoseconds. + +2006-02-10 Christopher Faylor <cgf@timesys.com> + + * external.cc (sync_winenv): Rename from "setup_winenv". Use same + mechanism as spawn to determine environment variables which should be + converted back to windows form. + (cygwin_internal): Reflect setup_winenv -> sync_winenv name change. + * include/sys/cygwin.h: Ditto. + +2006-02-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Only set + the dirent_get_d_ino flag on filesystems having useful File IDs. + Add comment explaining why. + +2006-02-07 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (handle_to_fn): Accommodate new argument order in call to + sys_wcstombs. + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Call sys_wcstombs + instead of just wcstombs to accommodate OEM codepages. + * miscfuncs.cc (sys_wcstombs): Split len argument in source and target + length. Always 0-terminate result in target string. + * security.cc (lsa2wchar): Remove unused function. + (lsa2str): Ditto. + (get_lsa_srv_inf): Ditto. + (get_logon_server): Accommodate new argument order in call to + sys_wcstombs. + (get_user_groups): Ditto. + (get_user_local_groups): Ditto. + (get_priv_list): Call sys_wcstombs directly instead of lsa2str. + * uinfo.cc (cygheap_user::ontherange): Accommodate new argument order + in call to sys_wcstombs. + * winsup.h (sys_wcstombs): Change prototype to match new argument order. + +2006-02-07 Corinna Vinschen <corinna@vinschen.de> + + * init.cc (respawn_wow64_process): Exit with the exit code returned + by the respawned process. + +2006-02-06 Christopher Faylor <cgf@timesys.com> + + Always zero all elements of siginfo_t throughout. + * cygtls.h (_cygtls::thread_context): Declare new field. + (_cygtls::thread_id): Ditto. + (_cygtls::signal_exit): Move into this class. + (_cygtls::copy_context): Declare new function. + (_cygtls::signal_debugger): Ditto. + * cygtls.cc (_cygtls::init_thread): Fill out thread id field. + * exceptions.cc (exception): Change message when exception info is + unknown. Copy context to thread local storage. + (_cygtls::handle_exceptions): Avoid double test for fault_guarded. + Reflect move of signal_exit to _cygtls class. + (sigpacket::process): Copy context to thread local storage. + (_cygtls::signal_exit): Move to _cygtls class. Call signal_debugger to + notify debugger of exiting signal (WIP). Call stackdump here (WIP). + (_cygtls::copy_context): Define new function. + (_cygtls::signal_debugger): Ditto. + * tlsoffsets.h: Regenerate. + * include/cygwin.h (_fpstate): New internal structure. + (ucontext): Declare new structure (WIP). + (__COPY_CONTEXT_SIZE): New define. + + * exceptions.cc (_cygtls::interrupt_setup): Clear "threadkill" field + when there is no sigwaiting thread. + (setup_handler): Move event handling into interrupt_setup. + +2006-02-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::connect): Fix formatting. + (fhandler_socket::wait): Handle SA_RESTART when signal arrives. + +2006-02-06 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h (CMSG_FIRSTHDR): Avoid compiler warning. + +2006-02-05 Corinna Vinschen <corinna@vinschen.de> + + * include/features.h: Add comment to explain what's going to happen + here at one point. + * include/sys/stdio.h: Guard getline and getdelim prototypes with + _GNU_SOURCE to avoid collision with old-style declarations. + +2006-02-05 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (struct parse_thing): Add transparent_exe option. + * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate + transparent_exe option. Add .exe suffix for links to executable files, + if transparent_exe is set. + * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe + suffix if transparent_exe option is set. + * path.cc (symlink_worker): Accommodate transparent_exe option. + (realpath): Don't tack on .exe suffix if transparent_exe is set. + * syscalls.cc (transparent_exe): New global variable. + (unlink): Accommodate transparent_exe option. + (open): Ditto. + (link): Ditto. + (rename): Ditto. Maybe add .exe suffix when renaming executable files. + (pathconf): Accommodate transparent_exe option. + * winsup.h: Declare transparent_exe. + +2006-02-05 Christopher Faylor <cgf@timesys.com> + Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_9x): Remove + useless code. + +2006-02-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Remove label + "out". Move test for NULL __handle ... + (fhandler_disk_file::rewinddir_9x): ... here. + +2006-02-05 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (rewinddir): Keep dirent_get_d_ino and dirent_set_d_ino flags. + +2006-02-05 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Don't close dir + handle when we hit EOF since rewwindir may reactivate it. + (fhandler_disk_file::readdir_9x): Eliminate superfluous temporary + variable. + (fhandler_disk_file::closedir): Return EBADF when trying to close + unopened DIR. Reorganize slightly. Return actual derived error value + rather than always returning 0. + +2006-02-04 Christopher Faylor <cgf@timesys.com> + + * dir.cc (rmdir): Reorganize check for trailing dot to return correct + error when directory does not exist. + +2006-02-03 Christopher Faylor <cgf@timesys.com> + + * dir.cc (mkdir): Reorganize check for trailing dot to return correct + error when directory exists. + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special + test for path ending in '.'. + +2006-02-03 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (suffix_scan::lnk_match): Return true beginning with + SCAN_APPENDLNK. + (suffix_scan::next): Rearrange code to make .lnk append order slightly + more deterministic. + * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align + evaluation with stat_suffixes. + (dll_suffixes): Ditto. + +2006-02-02 Christopher Faylor <cgf@timesys.com> + + * cygwin/version.h: Mention CW_SETUP_WINENV in comment for API minor + 153. + +2006-02-02 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (updwtmpx): Export. + * syscalls.cc (updwtmpx): New function. + * include/utmpx.h (updwtmpx): Declare. + * include/cygwin/version.h: Bump API minor number to 153. + +2006-02-02 Christopher Faylor <cgf@timesys.com> + + * external.cc (setup_winenv): New function. + (cygwin_internal): Implement CW_SETUP_WINENV. + * sys/cygwin.h (cygwin_getinfo_types): Define CW_SETUP_WINENV. + +2006-02-02 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (is_group_member): Fix comment. + +2006-02-02 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (is_group_member): Use local group info type 1. Test + group for being a global group or a well-known SID before adding it + to the group list. Add comment. + +2006-02-01 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetTcpTable): Define. + * fhandler_socket.cc (address_in_use): New function to check if + sockaddr_in address is already in use. + (fhandler_socket::bind): Check if address is alreay in use in case of + SO_REUSEADDR, to circumvent WinSock non-standard behaviour. + +2006-02-01 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (dll_suffixes): Add .exe and "no suffix" to the list. + +2006-01-31 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (check_path_access): Call find_exec with FE_DLL option. + * path.h (enum fe_types): Add FE_DLL value. + * spawn.cc (std_suffixes): Remove. + (exe_suffixes): New suffix_info for executing files. + (dll_suffixes): New suffix_info for searching shared libraries. + (perhaps_suffix): Add opt argument. Use dll_suffixes if FE_DLL + option is given, exe_suffixes otherwise. + (find_exec): Propagate opt argument to perhaps_suffix. Drop suffix + check when testing execute permission. + (spawn_guts): Call perhaps_suffix with FE_NADA opt argument. + +2006-01-31 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (av::fixup): Remove unused argument. + (spawn_guts): Remove capitalization in debugging. + +2006-01-31 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (find_exec): Only return files with execute permission set + if ntsec is on. Don't check execute permission of Windows batch files. + (av::fixup): Handle empty files gracefully. Drop execute permission + test here. + * path.cc (suffix_scan::next): Don't skip any suffix on first run. + +2006-01-31 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Don't set win32 error, only POSIX errno. + +2006-01-31 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): When SetCurrentDirectory returns + ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND. Add + comment to explain why. + +2006-01-31 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (readdir_worker): Add comment about writing old 32 bit d_ino. + * include/cygwin/version.h: Bump API minor number to 152. + (CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): Remove. + +2006-01-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Simplify + conditional. + +2006-01-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (d_cachepos): Rename from d_pos to distinct + clearly from __d_position. Change throughout. + (fhandler_disk_file::rewinddir): Reset readdir cache on NT. + +2006-01-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (readdir_get_ino): Don't follow symlinks. + +2006-01-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add saw_reuseaddr status flag. + * fhandler_socket.cc (fhandler_socket::bind): Set socket to + SO_EXCLUSIVEADDRUSE if application didn't explicitely set SO_REUSEADDR + socket option, on systems supporting SO_EXCLUSIVEADDRUSE. + * net.cc (cygwin_setsockopt): Set fhandler's saw_reuseaddr status flag + if SO_REUSEADDR socket option has been successsfully set. + * wincap.h (wincaps::has_exclusiveaddruse): New element. + * wincap.cc: Implement above element throughout. + +2006-01-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): In case or error, + check for existance explicitely and set errno to EEXIST. + +2006-01-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (DIR_NUM_ENTRIES): New define determining + minimum number of dir entries which fit into the readdir cache. + (DIR_BUF_SIZE): Define globally as size of readdir cache. + (struct __DIR_cache): New structure used for readdir caching on NT. + (d_dirname): Accessor for struct __DIR_cache, use throughout. + (d_pos): Ditto. + (d_cache): Ditto. + (fhandler_disk_file::opendir): Allocate __d_dirname to contain readdir + cache on NT. + (fhandler_disk_file::readdir): Use buf as pointer into readdir cache. + Implement readdir caching. + +2006-01-28 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/dirent.h (struct dirent): Revert misguided attempt to + rename __d_unused1 to __d_fd. + +2006-01-27 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NtQueryDirectoryFile): Define. + * dir.cc (__opendir_with_d_ino): Just call opendir. + (opendir): Remove CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO handling. + (readdir_worker): Only try generating d_ino if it's 0. + Utilize namehash of directories fhandler. Call readdir_get_ino to + generate d_ino for "..". + (seekdir64): Keep dirent_set_d_ino flag. + * fhandler.h (enum dirent_states): Add dirent_get_d_ino. + (class fhandler_disk_file): Declare new private methods readdir_helper + and readdir_9x. + * fhandler_disk_file.cc (path_conv::hasgood_inode): New method to + evaluate if a filesystem has reliable inode numbers. + (fhandler_base::fstat_by_handle): Accommodate structure member name + change from IndexNumber to FileId. + (fhandler_base::fstat_helper): Call hasgood_inode here. + (fhandler_disk_file::opendir): Call fhaccess only for real files. + Don't append '*' to __d_dirname here, move to readdir_9x. On NT, + open directory handle here. Set dirent_get_d_ino and dirent_set_d_ino + flags according to wincap and filesystem. + (fhandler_disk_file::readdir_helper): New method to implement readdir + postprocessing only once. + (readdir_get_ino_by_handle): New static function. + (readdir_get_ino): New function to centralize inode number evaluation + in case inode number hasn't been returned by NtQueryDirectoryFile. + (fhandler_disk_file::readdir): Move old functionality to readdir_9x. + Call readdir_9x when on 9x/Me. Implement NT specific readdir here. + (fhandler_disk_file::readdir_9x): Move 9x specific readdir here. + (fhandler_disk_file::seekdir): Accommodate new NT readdir method. + (fhandler_disk_file::closedir): Ditto. + (fhandler_cygdrive::fstat): Set d_ino to namehash. Add comment. + (fhandler_cygdrive::opendir): Call get_namehash to prepare later + correct evaluation of d_ino. + (fhandler_cygdrive::readdir): Replace recursion with loop. Evaluate + drive's d_ino by calling readdir_get_ino. + * fhandler_proc.cc (fhandler_proc::readdir): Set dirent_saw_dot and + dirent_saw_dot_dot to avoid seeing . and .. entries twice. + * fhandler_process.cc (fhandler_process::readdir): Ditto. + * fhandler_registry.cc (fhandler_registry::readdir): Ditto. + * ntdll.h (STATUS_INVALID_PARAMETER): New define. + (STATUS_INVALID_LEVEL): New define. + (struct _FILE_INTERNAL_INFORMATION): Rename member IndexNumber to + FileId (as in Nebbitt). + * path.h (path_conv::hasgood_inode): Now implemented in + fhandler_disk_file.cc. + * wincap.h (wincaps::has_fileid_dirinfo): New element. + * wincap.cc: Implement above element throughout. + * winsup.h (readdir_get_ino): Add declaration. + * include/sys/dirent.h (struct dirent): Slightly rename structure + members to accommodate changes. + Remove __USE_EXPENSIVE_CYGWIN_D_INO handling and declaration of + __opendir_with_d_ino. + +2006-01-27 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Fix potential handle leak when failing exec. + +2006-01-27 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (inside_kernel): Fix to return true if we can't get the + name of the DLL for the given memory block since we are not in kernel + code. + +2006-01-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Fix bug in argument order to + InitializeObjectAttributes call. + +2006-01-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix test for + dirent_isroot to use the correct boolean operator. + +2006-01-25 Christopher Faylor <cgf@timesys.com> + + * ntdll.h: (temporarily?) Add more functions for querying directory. + +2006-01-24 Christopher Faylor <cgf@timesys.com> + + * dir.cc (readdir_worker): Turn off expensive inode calculation. + +2006-01-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (fhandler_process::fill_filebuf): Disable + stripping the .exe suffix from the link target in PROCESS_EXE and + PROCESS_EXENAME case. + * path.cc (realpath): Tack on .exe suffix if necessary. + +2006-01-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Try harder + to determine remote file systems with reliable inode numbers. Add + longish comment. + +2006-01-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Reset + inheritance for duplicated socket. + +2006-01-20 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump API minor number to 151. + * dir.cc (__opendir_with_d_ino): New function. + (opendir): Set flag if we should be calculating inodes. + (readdir_worker): Calculate d_ino by calling stat if the user has asked + for it. + (seekdir64): Maintain all persistent flag settings. + * fhandler.h (dirent_states): Add dirent_set_d_ino. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Reflect changes + to dirent structure. + * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto. + * include/sys/dirent.h (struct dirent): Coalesce two similar + structures. Remove all shreds of the apparently highly confusing + references to inodes. Add support for calculating a real inode if + __USE_EXPENSIVE_CYGWIN_D_INO is defined. + +2006-01-20 Christopher Faylor <cgf@timesys.com> + + * include/sys/dirent.h: Add comments for people who are REALLY confused + about whether they should be using something called __invalid_d_ino or + not. + +2006-01-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::prepare): Fix debug output. + (fhandler_socket::release): Add debug output for WSAEventSelect failure. + (fhandler_socket::ioctl): Always cancel WSAEventSelect before switching + to blocking mode. Only set nonblocking flag if ioctlsocket call + succeeded. Only print new socket state if ioctlsocket call succeeded. + +2006-01-19 Christopher Faylor <cgf@timesys.com> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check posix path + for root rather than windows path. + +2006-01-19 Christopher Faylor <cgf@timesys.com> + + * dir.cc (readdir_worker): Fill in invalid fields with -1. Accommodate + name change from __ino32 to __invalid_ino32. + * include/sys/dirent.h (__invalid_ino32): Rename from __ino32. Don't + define unused d_type macros. + +2006-01-18 Christopher Faylor <cgf@timesys.com> + + * heap.cc (heap_init): Remove Sleep. + +2006-01-18 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (rresvport): Remove extern declaration. + +2006-01-18 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (rresvport): Remove. + * net.cc (last_used_rrecvport): New global shared variable. + (cygwin_rresvport): Implement rresvport without using rresvport from + wsock32. + +2006-01-18 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h (struct sockaddr_storage): Fix typo in + ss_family member name. + +2006-01-16 Christopher Faylor <cgf@timesys.com> + + * include/cygwin/version.h: Bump DLL minor version number to 20. + +2006-01-13 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Concatenate a "-WOW64" to utsname's sysname + member to see when running under WOW64. + +2006-01-13 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on + Windows 2000 and above. Clarify the comment about IP_TOS and move + to the place where the magic happens. + (get_ifconf): Remove unused code. + * wincap.h (wincaps::has_disabled_user_tos_setting): New element. + * wincap.cc: Implement above element throughout. + +2006-01-12 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize + ttys >= 0. + +2006-01-12 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (set_console_state_for_spawn): Whackamole the argument + back to a bool. + * spawn.cc (spawn_guts): Ditto, i.e., once again call + set_console_state_for_spawn with an indication of whether we're about + to start a cygwin process. + * fhandler_console.cc (set_console_state_for_spawn): Don't set the + console state if we know we're starting a cygwin process or if we're + using a "real" tty. + +2006-01-10 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): Remove call to wincap.init. + * init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker. + Call wincap.init here before doing anything else. Use wincap.is_wow64 + to determine if we're running in a WOW64 emulator. + * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's + apparently not supported. + (mmap64): Don't create mappings beyond EOF, which would need to use + AT_ROUND_TO_PAGE, on WOW64. + * wincap.cc (wincap): Throw into the .cygwin_dll_common section. + (wincapc::init): Determine if running in WOW64 and set wow_64 flag. + * wincap.h (class wincapc): Add wow64 member. + (wincapc::is_wow64): New method. + +2006-01-10 Christopher Faylor <cgf@timesys.com> + + * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in + model name. + +2006-01-09 Christopher Faylor <cgf@timesys.com> + + * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is + done prior to check for command.com/cmd.com. Don't bother setting + CREATE_SUSPENDED flag for a MS-DOS process since it doesn't work + anyway. Avoid calling remember() when the child process has already + exited. + (av::fixup): Explicitly set cygexec flag to false on a 16 bit process. + +2006-01-09 Corinna Vinschen <corinna@vinschen.de> + + * include/getopt.h (getopt_long_only): Declare. + +2006-01-09 Eric Blake <ebb9@byu.net> + + * cygwin.din: Export getsubopt. + * include/cygwin/version.h: Bump API minor version. + +2006-01-08 Christopher Faylor <cgf@timesys.com> + + * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling + terminal to a process when duped. Linux doesn't do this, so we won't + either. + +2006-01-08 Christopher Faylor <cgf@timesys.com> + + * environ.cc (spenvs[]): windir -> WINDIR. + +2006-01-07 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::need_invisible): Remove + duplicate test. + +2006-01-07 Christopher Faylor <cgf@timesys.com> + + * fhandler.h (set_console_state_for_spawn): Eliminate argument from + declaration. + * fhandler.cc (set_console_state_for_spawn): Eliminate argument from + definition. Always check for invisible console. + (fhandler_console::need_invisible): Don't do anything if the windows + station is already not visible. + * spawn.cc (spawn_guts): Accommodate change of argument to + set_console_state_for_spawn. + +2006-01-05 Christopher Faylor <cgf@timesys.com> + + * sigproc.cc (no_signals_available): Use existence of signal thread + handle to figure out if we can actually send signals rather than + relying on my_sendsig. + (hwait_sig): Make static. + (sigproc_init): Don't set my_sendsig to anything special. Use new + global static hwait_sig. + (wait_sig): Set hwait_sig to NULL when we are exiting. + +2006-01-05 Christopher Faylor <cgf@timesys.com> + + * include/getopt.h: Accommodate recent unfortunate newlib changes. + +2006-01-05 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Don't output debugging info if this + isn't a cygwin thread. + * sigproc.cc (sigproc_init): Move clearing of sync_startup here to + lessen the likelihood of trying to deal with non-cygwin threads in + dll_entry. + + * fhandler_console: Fix set_console_state_for_spawn comment. + +2006-01-05 Igor Peshansky <pechtcha@cs.nyu.edu> + + * spawn.cc (spawn_guts): Invert the argument to + set_console_state_for_spawn. + +2006-01-04 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::need_invisible): Only try to + open "CygwinInvisible" windows station if opening of default station + fails. Use CloseWindowStation to close window station handle. + +2006-01-04 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (fhandler_console::need_invisible): Open up the + security of the newly created windows station. + +2006-01-04 Eric Blake <ebb9@byu.net> + + * path.cc (dot_special_chars): Add ", <, >, and |. + +2006-01-03 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (beep): Use MB_OK which is documented as using + the default bell rather than -1 which seems to behave differently on + different versions of Windows. + +2006-01-03 Christopher Faylor <cgf@timesys.com> + + * fhandler_process.cc (fhandler_process::readdir): Add missing argument + to syscall_printf. + + * fhandler_console.cc (fhandler_console::need_invisible): Use made-up + name for windows station rather than asking Windows to create one for + us. + + * spawn.cc (spawn_guts): Don't mess with console if we're detaching. + +2006-01-03 Christopher Faylor <cgf@timesys.com> + + * dir.cc (readdir_worker): Minor code cleanup. + + * fhandler_console.cc (beep): Use a more Windows-generic wav file if + the beep is missing. Use a more foolproof way to find out whether we + should be recreating the missing key. + + * registry.h (reg_key::_disposition): New field. + (reg_key::created): New function. + * registry.cc (reg_key::reg_key): Set _disposition to zero by default. + (reg_key::build_key): Fill in _disposition field. + +2006-01-03 Eric Blake <ebb9@byu.net> + + * dir.cc (readdir_worker): Ensure that saw_dot* flags are updated when + not handling inodes. + +2006-01-02 Christopher Faylor <cgf@timesys.com> + + * fhandler_console.cc (beep): New function. Restores missing "Default + Beep", if necessary. + (fhandler_console::write_normal): Use beep(). + +2006-01-02 Christopher Faylor <cgf@timesys.com> + + * dcrt0.cc (_dll_crt0): Remove more leftover debugging stuff. + (cygwin_dll_init): Remove unneeded initializations. Call _dll_crt0 + rather than dll_crt0_1. + +2006-01-02 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc: Include sys/un.h instead of sys/socket.h. + (syslogd_inited): Convert to enum type noting the exact result of + trying to connect to syslog daemon. Use this way throughout. + (connect_syslogd): New static function taking over the task to + connect to syslog socket. Use correct struct sockaddr_un instead of + struct sockaddr. + (try_connect_syslogd): Call connect_syslogd. If write fails on + connection oriented socket, try to reconnect to syslog socket and + try to write again. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not + started from a cygwin process - just like the good-old-days of B20. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * strace.cc (strace::write_childpid): Remove debugging output. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which + caused this function to always return prematurely. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (sigpacket::process): Pass actual reference to signal's + sigaction structure to setup_handler. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND. + * include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK. + + * dcrt0.cc (get_cygwin_startup_info): Remove commented out code. + +2006-01-01 Corinna Vinschen <corinna@vinschen.de> + + * syslog.cc (vklog): Never log kernel messages using the vsyslog + interface. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2007 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2007 new file mode 100644 index 000000000..66cb33130 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2007 @@ -0,0 +1,2769 @@ +2007-12-30 Dave Korn <dave.korn@artimi.com> + + * cygwin.din (_f_llrint, _f_llrintf, _f_llrintl, _f_lrint, _f_lrintf, + _f_lrintl, _f_rint, _f_rintf, _f_rintl): Export fast *rint* functions. + (lrint, lrintf, rint, rintf): Redirect exports to alias _f_ versions. + (llrint, llrintf, llrintl, lrintl, rintl): Add exports aliasing _f_* + versions likewise. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2007-12-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_random): Add dummy_offset member. + * fhandler_random.cc (fhandler_dev_random::lseek): Fake seeking + capability as on Linux. + +2007-12-20 Eric Blake <ebb9@byu.net> + + * libc/memmem.cc (memmem): Fix bug when searching for empty string. + +2007-12-19 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcpcpy, wcpncpy. + * include/cygwin/version.h: Bump API minor number. + +2007-12-16 Christopher Faylor <me+cygwin@cgf.cx> + + * dtable.cc (POSIX_NAMED_PIPE): New define. + (POSIX_NAMED_PIPE_LEN): Ditto. + (dtable::add_archetype): Use crealloc_abort. + (dtable::init_std_file_from_handle): Specifically detect pipe + stdin/stdout. Pass name to build_fh_dev so that proper name is + recorded. Use binmode of fh if it is set before using + get_default_mode. Set proper read/write access when calling init(). + (handle_to_fn): Handle pipes. + * fhandler.cc (fhandler_base::wait_overlapped): Add some debugging. + * fhandler.h (fhandler_base::set_name): Default to just setting the + path_conv name. + (fhandler_pipe::init): Declare. + * pipe.cc (struct pipesync): New struct. + (getov_result): New function. Blocks and retrieves the result of an + overlay I/O operation. + (pipe_handler): New function. + (pipesync::pipesync): New function. Initializer for pipesync struct. + (handler_pipe::init): Define. Detects attempts to set up a "native" + pipe fhandler and creates a thread which accepts input from or output + to the non-cygwin pipe, creating a cygwin pipe wrapper around the + non-cygwin pipe. + (fhandler_pipe::create): Add pipe-specific flags to call to init(). + + * exceptions.cc (ctrl_c_handler): Lock process while we determine what + to do. + +2007-12-14 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h: Include sys/uio.h instead of cygwin/uio.h. + * include/cygwin/uio.h: Remove. + +2007-12-14 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::set_file_pointers_for_exec): Reenable. Fix + comment. + * spawn.cc (spawn_guts): Call cygheap->fdtab.set_file_pointers_for_exec + only for non-Cygwin processes. + +2007-12-13 Craig MacGregor <cmacgreg@gmail.com> + Corinna Vinschen <corinna@vinschen.de> + + * poll.cc (poll): Return count of fds with events instead of total + event count. + +2007-12-13 Corinna Vinschen <corinna@vinschen.de> + + * string.h: Guard cygwin internal string function definitions with + __INSIDE_CYGWIN__. + +2007-12-12 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc: Include string.h. + (initial_env): Use small_printf's %P specifier. + * dll_init.cc (dll_list::alloc): Use PATH_MAX instead of CYG_MAX_PATH + for path name buffer size. + * dll_init.h (struct dll): Ditto. + * environ.cc: Include string.h. + (win_env::add_cache): Use temporary local buffer for path conversion. + (posify): Ditto. + * exceptions.cc (try_to_debug): Use CreateProcessW to allow long path + names. + * miscfuncs.cc: Drop unused implementations of strcasematch and + strncasematch. + (ch_case_eq): Drop. + (strcasestr): Drop. + (cygwin_wcscasecmp): New function. + (cygwin_wcsncasecmp): New function. + (cygwin_strcasecmp): New function. + (cygwin_strncasecmp): New function. + (cygwin_wcslwr): New function. + (cygwin_wcsupr): New function. + (cygwin_strlwr): New function. + (cygwin_strupr): New function. + * ntdll.h (RtlDowncaseUnicodeString): Declare. + (RtlUpcaseUnicodeString): Declare. + (RtlInt64ToHexUnicodeString): Fix typo in comment. + * string.h: Disable not NLS aware implementations of strcasematch + and strncasematch. + (cygwin_strcasecmp): Declare. + (strcasecmp): Define as cygwin_strcasecmp. + (cygwin_strncasecmp): Declare. + (strncasecmp): Define as cygwin_strncasecmp. + (strcasematch):Define using cygwin_strcasecmp. + (strncasematch):Define using cygwin_strncasecmp. + (cygwin_strlwr): Declare. + (strlwr): Define as cygwin_strlwr. + (cygwin_strupr): Declare. + (strupr): Define as cygwin_strupr. + * wchar.h: New file. + * wincap.cc (wincapc::init): Use "NT" as fix OS string. + * winsup.h (strcasematch): Drop declaration. + (strncasematch): Ditto. + (strcasestr): Ditto. + +2007-12-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix R/O bit + handling on filesystems without ACL support. + +2007-12-11 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzset): Guard by a muto for thread safety. + +2007-12-11 Dave Korn <dave.korn@artimi.com> + + * cygheap.cc (_csbrk): Don't request zero bytes from VirtualAlloc, + as windows treats that as an invalid parameter and returns an error. + +2007-12-11 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzset): Call tzsetwall only if it hasn't been + called before. + +2007-12-07 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h: Include limits.h. + +2007-12-06 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (initial_env): Use PATH_MAX instead of CYG_MAX_PATH for path + name buffer size. + (dll_crt0_1): Allocate new_argv0 with PATH_MAX size. + * exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20; + (error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path + name buffer size. + * external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated. + Fill out ep.progname_long. + * fhandler_process.cc (fhandler_process::fill_filebuf): Allocate + buffer for executable filename with PATH_MAX size. + * pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH. + * pinfo.h (class _pinfo): Set progname size to PATH_MAX. + * smallprint.cc: Include limits.h. Use PATH_MAX instead of CYG_MAX_PATH + for path name buffer size. + * strace.cc (strace::vsprntf): Ditto. + * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define. + (EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP. + (struct external_pinfo): Add progname_long member. + * include/sys/dirent.h: Correctly include limits.h instead of + sys/limits.h. + +2007-12-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::open): Use MAX_PATH instead of + CYG_MAX_PATH for event name buffer size. + (fhandler_pty_master::setup): Use MAX_PATH instead of CYG_MAX_PATH for + mutex name buffer size. + * netdb.cc: Drop old comment. + (open_system_file): Set path buffer size to MAX_PATH instead of + CYG_MAX_PATH. Drop conversion to posix path. Open file using win32 + path. + +2007-12-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc: Use NAME_MAX + 1 instead of CYG_MAX_PATH + throughout for subkey name buffer size. + * fhandler_socket.cc (search_wsa_event_slot): Use MAX_PATH instead of + CYG_MAX_PATH for mutex name buffer size. + (fhandler_socket::init_events): Ditto. + * fhandler_virtual.cc (fhandler_virtual::opendir): Check path length + against PATH_MAX instead of against CYG_MAX_PATH. + * registry.cc (get_registry_hive_path): Use PATH_MAX instead of + CYG_MAX_PATH for registry value path buffer size. + * shared.cc (open_shared): Use MAX_PATH instead of CYG_MAX_PATH + for shared memory name buffer size. + * thread.cc (semaphore::semaphore): Use MAX_PATH instead of CYG_MAX_PATH + for semaphore name buffer size. + * uinfo.cc (cygheap_user::env_userprofile): Use PATH_MAX instead of + CYG_MAX_PATH for temporary path name buffer size. + * winf.h (LINE_BUF_CHUNK): Define as MAX_PATH * 2. + * include/sys/dirent.h: Include sys/limits.h. Define name buffer sizes + using NAME_MAX. + +2007-12-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_fifo.cc (fhandler_fifo::open): Use MAX_NAME for pipe name + buffer size. + (fhandler_fifo::fstatvfs): Use same technique as in fhandler_socket. + * fhandler_proc.cc (format_proc_partitions): Use NAME_MAX+1 for + device name buffer size. Use MAX_PATH for device path buffer size. + +2007-12-03 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetModuleFileNameExW): Replace definition of + GetModuleFileNameExA. + * fhandler_process.cc (format_process_maps): Change modname type to + WCHAR. Set buffer sizes to PATH_MAX. Call GetModuleFileNameExW + instead of GetModuleFileNameExA. Call mount_info::conv_to_posix_path + instead of cygwin_conv_to_full_posix_path. Set posix_modname to + modname if that call fails. + (format_process_stat): Set cmd buffer size to NAME_MAX + 1. Simplify + setting cmd to process name. + (format_process_status): Ditto. + * path.cc (mount_info::conv_to_posix_path): Call sys_wcstombs + correctly. + +2007-12-03 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/time.h: Remove redundant #endif. + +2007-12-01 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/time.h (daylight): Declare as extern symbol referring + _daylight variable. + (timezone): Only define if __timezonefunc__ is undefined. + +2007-12-01 Corinna Vinschen <corinna@vinschen.de> + Brian Dessent <brian@dessent.net> + + * Makefile.in (OBSOLETE_FUNCTIONS): Add timezone. + * include/cygwin/time.h: Drop conditional timezone definitions. + (timezone): Declare as extern symbol referring _timezone variable. + +2007-11-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo::initialize): Use MAX_PATH instead of + CYG_MAX_PATH. + * fhandler_tty.cc (fhandler_pty_master::ptsname): Set buffer size to + TTY_NAME_MAX. + * syscalls.cc (ttyname): Eliminate the `+ 1' from the name buffer size + since TTY_NAME_MAX already counts the trailing NUL. + * libc/bsdlib.cc (openpty): Set pts buffer size to TTY_NAME_MAX. + +2007-11-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recv_internal): Add MSG_WAITALL + handling. Use explicit flag values instead of MSG_WINMASK. + (fhandler_socket::send_internal): Use explicit flag values instead of + MSG_WINMASK. + * include/cygwin/socket.h (MSG_WINMASK): Remove definition. + (MSG_WAITALL): Define. + +2007-11-27 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_names): Rename max_len to prefix_len. Store + the prefix len in it. + (check_path): Take length parameter. Use this length insetad of + calling strlen. Allow PATH_MAX length paths. + (ipc_mutex_init): Use MAX_PATH instead of CYG_MAX_PATH. + (ipc_cond_init): Ditto. + (shm_open): Allocate local name buffer not bigger than necessary. Call + check_path with additional length argument. + (shm_unlink): Ditto. + (mq_open): Ditto. + (mq_unlink): Ditto. + (sem_open): Ditto. + (sem_unlink): Ditto. + +2007-11-27 Corinna Vinschen <corinna@vinschen.de> + + Drop old SetResourceLock stuff in favor of mutos. + * dcrt0.cc (_reslock): Remove. + (__cygwin_user_data): Accommodate removal of resourcelocks member. + (dll_crt0_0): Don't initialize resourcelocks. + * exceptions.cc (_cygtls::signal_exit): Drop resourcelocks handling. + * mmap.cc (mmap_guard): New muto. + (LIST_LOCK): Define. + (LIST_UNLOCK): Define. + (mmap_list::search_record): Remove. + (mmap_list::try_map): Include code for anonymous case from + mmap_list::search_record. + (mmap_is_attached_or_noreserve): Access bookkeeping lists in a thread + safe way. + (mmap64): Replace SetResourceLock/ReleaseResourceLock by + LIST_LOCK/LIST_UNLOCK. Lock at the latest possible point. + (munmap): Replace SetResourceLock/ReleaseResourceLock by + LIST_LOCK/LIST_UNLOCK. + (msync): Ditto. + (mprotect): Ditto. + * thread.cc (ResourceLocks::Lock): Remove. + (SetResourceLock): Remove. + (ReleaseResourceLock): Remove. + (ResourceLocks::Init): Remove. + (ResourceLocks::Delete): Remove. + * thread.h (SetResourceLock): Drop declaration. + (ReleaseResourceLock): Ditto. + (class ResourceLocks): Drop definition. + * include/sys/cygwin.h (class ResourceLocks): Drop forward declaration. + (struct per_process): Replace resourcelocks with additional unused2 + element. + (per_process_overwrite): Accommodate above change. + +2007-11-27 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Convert usage of dynamically growing cmalloced arrays to + cmalloced linked lists throughout. + (class mmap_record): Add LIST_ENTRY element. + (mmap_record::match): New method, taking over match algorithm from + list::search_record. + (class mmap_list): Rename from class list. Add LIST_ENTRY. Convert + recs to a LIST_HEAD. Drop nrecs and maxrecs members. + (mmap_list::get_record): Drop entirely. + (mmap_list::free_recs): Drop entirely. + (mmap_list::del_record): Take mmap_record to delete as parameter. + (mmap_list::search_record): Convert to mmap_record::match. + (class mmap_areas): Rename from class map. Convert lists to LIST_HEAD. + (mmap_areas::get_list): Drop entirely. + (mmap_areas::del_list): Take mmap_list to delete as parameter. + (mprotect): Fix indentation. + +2007-11-26 Christopher Faylor <me+cygwin@cgf.cx> + + Change many cygheap allocation routines to their *_abort analogs. + * cygheap.cc (cmalloc_abort): New function. + (crealloc_abort): Ditto. + (ccalloc_abort): Ditto. + +2007-11-23 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.cc (_crealloc): Avoid memcpy when _cmalloc returns NULL. + +2007-11-08 Christopher Faylor <me+cygwin@cgf.cx> + + * dllfixdbg: Eliminate extra objcopy step. + +2007-11-07 Pedro Alves <pedro_alves@portugalmail.pt> + + * dllfixdbg: Pass --only-keep-debug to objcopy, instead of + selecting the sections manually. + +2007-11-06 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread_key_create): Drop check for incoming valid object. + +2007-11-06 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc: Include sync.h + (struct shm_shmid_list): Add ref_count member. + (struct shm_attached_list): Remove hdl and size members. Add a parent + member pointing to referenced shm_shmid_list entry. + (shm_guard): New muto. + (SLIST_LOCK): Define. + (SLIST_UNLOCK): Define. + (fixup_shms_after_fork): Use hdl and size members of parent + shm_shmid_list entry. + (shmat): Access sequential bookkeeping lists in a thread safe way. + Accommodate change in list element layout. Align comments. + (shmctl): Ditto. + (shmdt): Ditto. + (shmget): Ditto. + +2007-11-05 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (shmctl): On IPC_RMID don't unmap views and don't close handle + if the map is still referenced to emulate Linux and BSD behaviour. + +2007-11-05 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (shmctl): On IPC_RMID also unmap all views on shared mem + as well as connected shm_attached_list entry. + +2007-10-31 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (load_ipv6_funcs): Use MAX_PATH instead of CYG_MAX_PATH. + (cygwin_getaddrinfo): Simplify formatting. + (cygwin_getnameinfo): Ditto. + +2007-10-31 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (get_cygdrive_info): Make inline. + (get_cygdrive_prefixes): Remove. + (cygwin_internal): Call get_cygdrive_info with NULL flag parameters + instead of get_cygdrive_prefixes. + * path.cc (mount_info::get_cygdrive_info): Allow NULL flag parameters. + +2007-10-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't remove + write bits for directories with R/O attribute. + (fhandler_base::fhaccess): Don't shortcircuit R/O attribute with W_OK + scenarios for directories. + +2007-10-22 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct cwdstuff): Drop hash member. Drop get_hash, + get_initial, and fixup_after_exec declarations. + Convert win32 to UNICODE_STRING. + (cwdstuff::get_drive): Convert win32 path in current codepage. + (cwdstuff::set): Take native NT path. + * ntdll.h (struct _TEB): Typedef. + * path.cc (mount_info::conv_to_posix_path): Add variant taking + wide char DOS paths. + (symlink_info::posixify): Simplify concatenating cwd and relative path. + (hash_path_name): Drop special relative path handling. + (chdir): Drop special "drive only" handling. Call cwdstuff::set with + native path. + (cwdstuff::get_hash): Remove. + (windows_system_directory): Remove. + (_upp): Remove. + (get_user_proc_parms): Make inline. Get PEB pointer by calling + NtCurrentTeb. + (cwdstuff::init): Simplify. + (cwdstuff::set): Rework to handle incoming native NT path. Workaround + a Vista problem with CWD handle in the user process parameter block. + (cwdstuff::get): Simplify locking. Accommodate type change of win32. + * shared_info.h (mount_info): Add declaration for new conv_to_posix_path + method. + * strfuncs.cc (sys_wcstombs): Return correct length of created + multi-byte string. + +2007-10-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (__DIR_mounts::eval_ino): Make fname big enough + to allow multibyte chars. + +2007-10-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Open native symlinks with + FILE_OPEN_REPARSE_POINT flag. Fix typo in comment. + +2007-10-18 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/param.h (MAXPATHLEN): Define as PATH_MAX. + +2007-10-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (is_at_eof): Rewrite using NT functions. + (off_current): New static variable. + (off_append): Ditto. + (fhandler_base::raw_write): Use NtWriteFile. Accommodate O_APPEND here. + (fhandler_base::write): Drop O_APPEND hack. Use NT functions. + (fhandler_base::lseek): Rewrite using NT functions. + * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Add space in + debug output. + (fhandler_disk_file::ftruncate): Ditto. + * ntdll.h (STATUS_DISK_FULL): Define. + (FILE_USE_FILE_POINTER_POSITION): Define. + (FILE_WRITE_TO_END_OF_FILE): Define. + +2007-10-13 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_END_OF_FILE): Define. + * path.cc (symlink_info::check_shortcut): Use NT function to get file + size. Reintroduce checking file size before reading it. Eliminiate + close_it label. + (symlink_info::check_sysfile): Check for EOF condition. + +2007-10-11 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (basename): Return pointer into the path argument itself. + Shrink buf to 4 bytes. Use buf only for border cases. + (dirname): Ditto. + +2007-10-10 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (struct symlink_info): Change size of contents member to + be able to keep SYMLINK_MAX sized strings. + (symlink_worker): Rework for long path names. When writing windows + shortcuts, store pathname additionally "hidden" after the actual + shortcut data to workaround size limitations of the description field. + (symlink_info::check_shortcut): Drop file name parameter. Drop max + file size check. Use NT functions. Use appended full path if + available, description otherwise. Check symlink string length for + not exceeding SYMLINK_MAX. Don't close file here. + (symlink_info::check_sysfile): Drop file name parameter. Use NT + functions. Check symlink string length for not exceeding SYMLINK_MAX. + Don't close file here. + (symlink_info::check_reparse_point): Drop file name parameter. Drop + useless length checks. Allow SYMLINK_MAX length symlink strings. + Don't close file here. + (symlink_info::posixify): Allow SYMLINK_MAX length symlink strings. + (symlink_info::check): Turn around checking for symlink file attributes. + Use NT functions. Close symlink file here. + * include/limits.h (PATH_MAX): Define as 32760. Change comment. + (SYMLINK_MAX): Define as PATH_MAX - 1. + +2007-10-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Open file for deletion, + too. Don't write to file and especially don't close handle if file + couldn't be created. Set delete disposition if writing failed, + instead of calling unlink_nt. + +2007-09-27 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (struct _FILE_COMPRESSION_INFORMATION): Align with definition + in w32api / MSDN. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Accommodate + change to struct _FILE_COMPRESSION_INFORMATION. + +2007-09-26 Corinna Vinschen <corinna@vinschen.de> + + * termios.cc (setspeed): Support new baud rates introduced 2007-02-05. + +2007-09-20 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_OBJECT_NAME_INVALID): Define. + +2007-09-18 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (fh_disk_file): Delete as global static variable and... + (mmap64): ...define as local pointer to make mmap thread-safe. + Accommodate throughout. Only initialize fh_disk_file after file could + be opened with GENERIC_EXECUTE access. Call fstat_by_handle instead of + fstat to avoid overhead. + +2007-09-18 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_file_sd): Open file with FILE_OPEN_FOR_BACKUP_INTENT + too. + +2007-09-17 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Check for STATUS_OBJECT_NAME_INVALID. + Add comment. + +2007-09-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Partly revert change from + 2007-08-24: Call has_acls to avoid permission problems getting + a handle to a file on a remote share. Add comment. + +2007-09-08 Brian Dessent <brian@dessent.net> + + * include/cygwin/config.h: Conditionalize inline __getreent() + definition on _COMPILING_NEWLIB. + +2007-09-06 Brian Dessent <brian@dessent.net> + + * include/cygwin/config.h (__getreent): Define inline version. + +2007-09-06 Brian Dessent <brian@dessent.net> + + * include/sys/stdio.h (_flockfile): Don't try to lock a FILE + that has the __SSTR flag set. + (_ftrylockfile): Likewise. + (_funlockfile): Likewise. + +2007-08-24 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (open): Don't follow symlinks if O_EXCL is given. + +2007-08-23 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_NO_SUCH_FILE): Define. + * path.cc (get_nt_native_path): Reset upath.Length to 0 on each + invocation. + (symlink_info::check): Use NT native functions. + +2007-08-21 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::load): Use NT native functions. + +2007-08-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Rewrite checking + for executable file magic using a thread safe method and re-enable this + code. + +2007-08-21 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Drop one local FILE_BASIC_INFORMATION struct. + +2007-08-21 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (NtNotifyChangeDirectoryFile): Declare. + (NtQueryAttributesFile): Move to maintain alphabetical order of + declarations. Add comment to note that timestamp information returned + by NtQueryAttributesFile is unreliable. + * path.h (etc::changed_h): Move here. + (etc::fn): Change type to OBJECT_ATTRIBUTES. + (etc::last_modified): Change type to LARGE_INTEGER. + (etc::init): Take PUNICODE_STRING as second argument. + * path.cc: Accomodate above changes. + (etc::test_file_change): Use NT native functions. + (etc::dir_changed): Ditto. + * uinfo.cc (pwdgrp::load): Call etc::init with NT native path. + +2007-08-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc: Change debugging output througout to print + the NT status consistently. Use UNICODE path information if available. + +2007-08-20 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (ld_preload): Call LoadLibraryW. + * path.h (path_conv::get_wide_win32_path_len): Define. + +2007-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (rootdir): Delete. + * winsup.h (rootdir): Drop declaration. + +2007-08-19 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fillout_mntent): Append backslash to drive-only paths before + calling fs_info::update. + * path.h (fs_info::clear): Simplify. + (fs_info::fs_info): Add constructor. + +2007-08-17 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Fix typo in comment. + +2007-08-17 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CloseDesktop): Define. + (CreateDesktopA): Define. + (SetThreadDesktop): Define. + * spawn.cc (spawn_guts): When starting a process under another user + account, don't open up permissions on current window station and + desktop. Instead, if not in interactive session, create a new per-user + window station plus default desktop and use that for the child process. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Handle S_IFSOCK + mode bit by setting the SYSTEM attribute. + * fhandler_socket.cc (fhandler_socket::fchmod): Add S_IFSOCK mode bit + when calling fhandler_disk_file::fchmod. Don't set attributes here. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + + * path.h (path_conv::operator char *): Delete. + (path_conv::operator const char *): Delete. + * dlfcn.cc: Throughout, replace path_conv::operator char * and + path_conv::operator const char * by call to path_conv::get_win32 + for easier transition to UNICODE_PATHs. + * fhandler_socket.cc: Ditto. + * hookapi.cc: Ditto. + * path.cc: Ditto. + * spawn.cc: Ditto. + * syscalls.cc: Ditto. + * uinfo.cc: Ditto. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (readdir_worker): Convert w32name to PUNICODE_STRING. + * sec_acl.cc (getacl): Convert debug output to print native NT path. + * security.cc (set_file_attribute): Ditto. + * syscalls.cc (try_to_bin): Ditto and fix buggy debug statement. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (RtlAcquirePebLock): Declare. + (RtlReleasePebLock): Declare. + * path.cc (cwdstuff::set): Change PEB only while it's locked. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::get_namehash): Use NT native path. + * fhandler_disk_file.cc (readdir_get_ino): Ditto in call to + hash_path_name. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (RtlCreateUnicodeStringFromAsciiz): Fix declaration. + (RtlUpcaseUnicodeChar): Declare. + * path.cc (hash_path_name): Split into three functions, taking + the path as char *, PWCSTR, or PUNICODE_STRING. Move implementation + into PUNICODE_STRING-based function. Drop old drive-relative path + consideration. + * winsup.h (iswdirsep): Like isdirsep but for WCHARs. + (isabspath_u): Like isabspath, for PUNICODE_STRINGs. + (iswabspath): Like isabspath, for PWCHARs. + (hash_path_name): Add new declarations. + +2007-08-15 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (get_nt_native_path): Allow to convert special paths which + have no native NT path representation for simplified debug output. + * syscalls.cc: Convert debug output to print native NT path. + (unlink): Drop redundant debug output. + +2007-08-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Drop superfluous + test for trailing dot. + * path.h (path_conv::operator []): Remove. + +2007-08-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Use NT native functions for + accessing the file representing the local socket. + (fhandler_socket::bind): Ditto. + * ntdll.h: Declare NtReadFile. + +2007-08-14 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): In case of ERROR_SHARING_VIOLATION and + ERROR_ACCESS_DENIED, try to get file attributes by using directory + functions. + +2007-08-14 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fs_info::update): Correctly handle the volume root directory. + +2007-08-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::pc): Make public. + * fhandler_disk_file.cc (fhandler_disk_file::link): Drop extern + declaration of stat_suffixes. Use NT native path in debug output. + (fhandler_base::utimes_fs): Simplify closeit case. Use close_fs + to close newly opened file handle. + (fhandler_base::open_fs): Use NT native path in debug output. + * path.cc: Throughout drop extern declaration of stat_suffixes. + * path.h (stat_suffixes): Declare. + * sec_acl.cc (acl_worker): Drop extern declaration of stat_suffixes. + * times.cc (utimes_worker): Take path_conv as parameter instead of + single-byte pathnam, drop nofollow argument, accommodate throughout. + Compare UNICODE paths when enumerating file descriptors. Fix + formatting. Use NT native path in debug output. + +2007-08-13 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Call NtClose instead of CloseHandle throughout. + (CreateMapping): Drop unused last argument. Accommodate throughout. + (mmap64): Re-open file with execute permissions using NtOpenFile. + +2007-08-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::close_fs): Reintroduce (as inline function) + for clearness. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Revert previous + change. + (fhandler_base::open_fs): Ditto. + * fhandler_socket.cc (fhandler_socket::close): Ditto. + +2007-08-13 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Remove delqueue.o. + * delqueue.cc: Delete. + * fhandler.h (fhandler_base::close_fs): Drop declaration. + (fhandler_disk_file::close): Drop declaration. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Call close instead of + close_fs. + (fhandler_base::fstat_helper): Use open FH_UNIX handle in call to + get_file_attribute. + (fhandler_base::open_fs): Call close instead of get_file_attribute. + (fhandler_disk_file::close): Remove. + (fhandler_base::close_fs): Remove. + * fhandler_socket.cc (fhandler_socket::close): Just call + fhandler_base::close for FH_UNIX sockets. + * shared.cc (user_shared_initialize): Drop call to + user_shared->delqueue.init. + * shared_info.h (CURR_USER_MAGIC): Change according to below change. + (MAX_DELQUEUES_PENDING): Remove. + (class delqueue_list): Remove. + (class user_info): Remove delqueue. + * syscalls.cc (close_all_files): Drop call to + user_shared->delqueue.process_queue. + (unlink): Drop delqueue handling. + +2007-08-13 Corinna Vinschen <corinna@vinschen.de> + + * devices.in (dev_storage): Use native NT device name for kmsg mailslot. + * devices.cc: Regenerate. + * fhandler.cc (fhandler_base::operator =): Use path_conv assignment + operator. + (fhandler_base::set_name): Ditto. + (fhandler_base::open): Use NT native path in debug output. + * fhandler_mailslot.cc: Convert to NT native function calls. + * ntdll.h (struct _FILE_MAILSLOT_SET_INFORMATION): Define. + (NtCreateMailslotFile): Declare. + * path.cc (path_conv::set_normalized_path): Don't set wide_path to NULL. + (path_conv::set_name): Remove unused function. + * path.h (path_conv::set_name): Drop declaration. + (path_conv::operator =): Define. + +2007-08-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Remove HIDDEN_DOT_FILES code. + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto. + * path.cc (symlink_worker): Ditto. + +2007-08-12 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (getw): Remove redundant implementation. + (putw): Ditto. + (wcscmp): Ditto. + (wcslen): Ditto. + (memccpy): Ditto. + +2007-08-12 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: Add descriptive comments to special Rtl functions. + (STATUS_OBJECT_PATH_NOT_FOUND): Define. + (STATUS_BUFFER_OVERFLOW): Define. + (FILE_SUPERSEDED): Define. + (FILE_OPENED): Define. + (FILE_CREATED): Define. + (FILE_OVERWRITTEN): Define. + (FILE_EXISTS): Define. + (FILE_DOES_NOT_EXIST): Define. + (PIO_APC_ROUTINE): Typedef. + (NtFsControlFile): Fix parameter types to use PIO_APC_ROUTINE. + (NtWriteFile): Declare. + (RtlInt64ToHexUnicodeString): Declare. + * strfuncs.cc: Include ntdll.h. + (RtlInt64ToHexUnicodeString): New function. + * syscalls.cc (try_to_bin): Rewrite using native NT functions. + Only try to create recycle bin after unsuccessfully trying to move + file. Also try to create special files in recycle bin so that Windows + Explorer isn't unnecessarily stampeded. + +2007-08-10 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fillout_mntent): Fix calculation of unicode buffer size. + +2007-08-10 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Check oldpath and newpath for trailing dir + separators, require them to be existing directories if so. Check + for a request to change only the case of the filename. Check paths + for case insensitve equality only once. Handle renaming a directory + to another, existing directory by unlinking the destination directory + first. If newpath points to an existing file with R/O attribute set, + try to unset R/O attribute first. Augment hardlink test by not + checking directories. If renaming fails with STATUS_ACCESS_DENIED, + try to unlink existing destination filename and try renaming again. + Drop useless test for non-empty directory. Always close fh at the + end of the function. + +2007-08-09 Ernie Coskrey <Ernie.Coskrey@steeleye.com> + + * gendef (sigbe): Reset "incyg" while the stack lock is active to avoid + a potential race. + +2007-08-09 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Close oldpath file handle immediately after + trying to rename it. Use nfh handle when checking for non-empty + newpath directory. Only change status if check_dir_not_empty really + returns STATUS_DIRECTORY_NOT_EMPTY. + +2007-08-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (readdir_get_ino): Accommodate native symlinks. + * syscalls.cc (rename): Ditto. + +2007-08-02 Christopher Faylor <me+cygwin@cgf.cx> + + * lib/Makefile: Add missed file to accommodate below changes. + +2007-08-02 Christopher Faylor <me+cygwin@cgf.cx> + + * lib/cygwin_attach_dll.c: Fix compiler warning. + * lib/cygwin_crt0.c: Ditto. + +2007-08-02 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (codepage_type): Remove definition. + * strfuncs.cc: Move it here. New file with bits of miscfuncs.cc. + * miscfuncs.cc: Remove wide character stuff. + +2007-08-02 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Move and add text to comment about testing + oldpath and newpath referring to the same file. Test if oldpath + has more than one hardlink before opening oldpath (idea by Eric Blake). + Reorder test so that file id is tested before volume serial number. + +2007-08-02 Corinna Vinschen <corinna@vinschen.de> + + * path.h (struct fs_info): Drop root_len and name_hash members. + (fsinfo::length): Remove. + (path_conv::rootdir): Remove. + * syscalls.cc (try_to_bin): Use rootdir function instead of + path_conv::rootdir method. + +2007-08-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (path_conv::ndisk_links): Fix typo in call to + NtClose. + +2007-08-01 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Check if oldpath and newpath refer to the + same file. If so, return successfully and perform no other action, + as per SUSv3. + +2007-08-01 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_ACCESS_DENIED): Define. + * syscalls.cc (check_dir_not_empty): New static function. + (unlink_nt): Move code checking for non-empty dir to check_dir_not_empty + and call check_dir_not_empty instead. + (rename): Add fault handler. Check oldpath and newpath for trailing + . and .. path components and return EINVAL if so. Check oldpath + for being on a vrtual file system. If renaming a dir fails with + STATUS_ACCESS_DENIED, check if the target dir is non-empty and return + ENOTEMPTY if so. + +2007-08-01 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzsetwall): Don't set TZ. + +2007-08-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop + usage of path_conv::volser(). + (fhandler_base::fstat_by_name): Ditto. + * ntdll.h (STATUS_NO_MEDIA_IN_DEVICE): Define. + (STATUS_OBJECT_NAME_NOT_FOUND): Define. + (FILE_REMOVABLE_MEDIA, FILE_READ_ONLY_DEVICE, FILE_FLOPPY_DISKETTE) + (FILE_WRITE_ONCE_MEDIA, FILE_REMOTE_DEVICE, FILE_DEVICE_IS_MOUNTED) + (FILE_VIRTUAL_VOLUME, FILE_AUTOGENERATED_DEVICE_NAME) + FILE_DEVICE_SECURE_OPEN): Define Device Characteristics. + (struct _FILE_FS_DEVICE_INFORMATION): Define. + * path.cc (MAX_FS_INFO_CNT): Remove. + (fsinfo): Remove. + (fsinfo_cnt): Remove. + (fs_info::update): Rewrite using native NT functions. Drop fs_info + cashing since it's incorrect. + (path_conv::fillin): Use NtQueryInformationFile. Drop setting serial + number. + (path_conv::check): Accommodate new fs_info::update parameters. + (fillout_mntent): Ditto. + * path.h (fs_info): Drop serial, has_ea and drive_type status + flags. + (fs_info::update): Declare with new parameters. + (path_conf::drive_type): Remove. + (path_conf::fs_has_ea): Remove. + (path_conf::volser): Remove. + +2007-08-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (check_posix_perms): Remove. + (fhandler_base::fpathconf): Return value of pc.has_acls () instead + of calling check_posix_perms. + +2007-08-01 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Use unchanged path_conv in condition. + +2007-08-01 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (__small_vsprintf): Add format specifier 'W' for + PWCHAR arguments. Move wide char handling after char handling. + +2007-07-31 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (RtlFreeAnsiString): Declare. + * ntdll.h (RtlFreeOemString): Declare. + * ntdll.h (RtlUnicodeStringToAnsiString): Declare. + * ntdll.h (RtlUnicodeStringToOemString): Declare. + * smallprint.cc: Renamed from smallprint.c. Drop unnecessary + forward declarations. + (__small_vsprintf): Add format specifiers 'C' for WCHAR arguments + and 'S' for PUNICODE_STRING arguments. + +2007-07-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Revert to checking + for binary in case of .exe files. + * ntdll.h (RtlPrefixUnicodeString): Declare. + * path.cc (path_conv::is_binary): New method. + * path.h (path_conv::is_binary): Declare. + * syscalls.cc (rename_append_suffix): New static helper function for + rename. + (rename): Rewrite. New suffix tests. Use native NT functions. + +2007-07-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::facl): If file can't be + opened for reading the ACLs, fall back to faking them. + * sec_acl.cc (acl_worker): Handle non-existing files. + * security.cc (get_file_attribute): Return ILLEGAL_UID/ILLEGAL_GID + as owner/group for non-readable ACLs on file systems supporting them. + +2007-07-30 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (stat_worker): Don't call build_fh_pc with invalid pc. + +2007-07-29 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Handle read EOF better + and issue a SIGPIPE when we get ERROR_NO_DATA. + +2007-07-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't allow + FileAttributes set to 0 when calling NtSetInformationFile since it has + a special meaning. + (fhandler_disk_file::facl): Ditto. + (fhandler_disk_file::link): Only set attributes after copying files. + Use SetFileAttributesW. + * syscalls.cc (unlink_nt): Only care for actual FILE_ATTRIBUTE_READONLY. + Don't allow FileAttributes set to 0 when calling NtSetInformationFile. + After marking for deletion, restore R/O attribute on files to + accommodate hardlinks. + +2007-07-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Use FILE_ANY_ACCESS. + (fhandler_base::utimes_fs): Fix white space. + (fhandler_disk_file::lock): Remove 9x blurb from comment. + (fhandler_disk_file::mkdir): Use NtCreateFile/NtClose instead of + CreateDirectoryA. + (fhandler_disk_file::rmdir): Accommodate changes to unlink_nt. + Simplify post-delete SMB-related tests. Use NtQueryAttributesFile + instead of GetFileAttributes. + * ntdll.h (STATUS_DIRECTORY_NOT_EMPTY): Define. + (NtQueryAttributesFile): Declare. + * syscalls.cc (unlink_nt): Return NTSTATUS. Drop setattrs parameter. + Never use FILE_DELETE_ON_CLOSE, always use + NtSetInformationFile(FileDispositionInformation) instead. + Check for R/O attributes and open file with FILE_WRITE_ATTRIBUTES + access if any of them are set. Remove R/O attributes before + marking for delete if necessary. Revert them afterwards if necessary. + (unlink): Accommodate changes to unlink_nt. + +2007-07-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc: Use get_handle throughout. + (fhandler_disk_file::fchmod): Always try to open file with required + access rights. Use NtSetInformationFile instead of SetFileAttributes. + (fhandler_disk_file::facl): Use NtSetInformationFile instead of + SetFileAttributes. + (fhandler_base::utimes_fs): Change lastaccess and lastwrite to + LARGE_INTEGER. Drop 9x directory case. Use NtSetInformationFile + instead of SetFileAttributes. Drop temporarily changing R/O attribute + since NtSetInformationFile(FileBasicInformation) also works on R/O + files. + * ntdll.h (STATUS_NOT_SUPPORTED): Define. + +2007-07-29 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.h (_cygtls::inside_kernel): Move function declaration into + _cygtls class. + * exceptions.cc (_cygtls::inside_kernel): Move function definition into + _cygtls class. + + * fhandler.cc (fhandler_base::wait_overlapped): Make return tri-state + to detect when there is a EINTR situation. Add a pointer to a length + parameter. Move GetOverlappedResult into this function. + (fhandler_base::read_overlapped): Accommodate above changes and loop if + we receive a restartable signal. + (fhandler_base::write_overlapped): Ditto. + * fhandler.h (fhandler_base::wait_overlapped): Reflect above changes. + * fhandler_fifo.cc (fhandler_fifo::wait): Ditto. + +2007-07-28 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (RtlEqualUnicodePathPrefix): Rename from RtlEqualPathPrefix. + (RtlEqualUnicodePathSuffix): Rename from RtlEqualPathSuffix. + * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate above + change. + +2007-07-28 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (RtlInitCountedUnicodeString): Swap order of string and length + parameters to be the same as for RtlInitEmptyUnicodeString. + (RtlEqualPathPrefix): New inline function. + (RtlEqualPathSuffix): New inline function. + * fhandler_disk_file.cc: Accommodate parameter order change of + RtlInitEmptyUnicodeString throughout. + (fhandler_disk_file::link): Do path checking in unicode. Call + CopyFileW instead of CopyFileA. + +2007-07-27 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CreateHardLinkA): Remove. + * fhandler_disk_file.cc (fhandler_disk_file::link): Drop GetBinaryType + test. Just check exe suffix instead. Tune creating new file name. + Implement creating hard link using native NT functions which works + on all platforms. + * ntdll.h (STATUS_INVALID_DEVICE_REQUEST): Define. + (struct _FILE_LINK_INFORMATION): Define. + +2007-07-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Use + NtQueryInformationFile instead of GetFileSize, NtFsControlFile instead + of DeviceIoControl. + +2007-07-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_name): Use + RtlSplitUnicodePath. + (fhandler_disk_file::fstat): Rename oret to opened. Open file using NT + functions right here. Try to open parent dir instead of root directory + to avoid call to rootdir. Use NtFsControlFile. + * ntdll.h (RtlSplitUnicodePath): Define. + +2007-07-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (is_volume_mountpoint): New static inline + function. + (path_conv::ndisk_links): Call is_volume_mountpoint. + (fhandler_disk_file::readdir_helper): Ditto. + +2007-07-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (enum query_state): Drop redundant query_stat_control. + * fhandler.cc (fhandler_base::open): Ditto. Add READ_CONTROL to + access and FILE_OPEN_FOR_BACKUP_INTENT to create_options when opening + for writing. Always set security attributes to avoid calling + has_acls. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Don't try to + open file twice. + +2007-07-26 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (readdir_worker): Drop dir parameter from call to + readdir_get_ino. + * fhandler.h (fhandler_disk_file::readdir_helper): Switch file name + parameter to PUNICODE_STRING. + * fhandler_disk_file.cc: Drop including ntdef.h. + (class __DIR_mounts): Store mount points in UNICODE. Additionally + store cygdrive prefix in unicode here. Change methods accordingly. + (__DIR_mounts::eval_ino): Call new stat_worker instead of lstat64. + (__DIR_mounts::~__DIR_mounts): New destructor to free UNICODE buffers. + (path_conv::ndisk_links): Rewrite using native NT functions. + (fhandler_base::fstat_by_handle): Use NAME_MAX instead of CYG_MAX_PATH. + Always set pfvi->VolumeSerialNumber to non-0. Remove last resort + code. + (fhandler_base::fstat_by_name): Rewrite using native NT functions. + (fhandler_base::fstat_fs): Always call fstat_by_name if fstat_by_handle + fails. + (fhandler_base::fstat_helper): Rely on dwVolumeSerialNumber. + (fhandler_disk_file::facl): Call fstat_by_name if fstat_by_handle fails. + (DIR_BUF_SIZE): Define using NAME_MAX instead of CYG_MAX_PATH. + (__DIR_cache): Remove __name. + (d_dirname): Remove. + (fhandler_disk_file::opendir): Drop pathname length check. + Remove outdated comment. Use get_name method instead of accessing + pc.normalized_path directly. + (readdir_get_ino): Drop unused dir parameter. Accomodate throughout. + Allocate fname dynamically. Call new stat_worker instead of lstat64. + Call NtOpenFile instead of CreateFile. Call NtClose instead of + CloseHandle. + (fhandler_disk_file::readdir_helper): Use native NT functions. + Check for volume mount points and use correct inode number. + (fhandler_disk_file::readdir): Simplify slightly. + Use get_name instead of pc.normalized_path. + (fhandler_disk_file::rewinddir): Use RtlInitUnicodeString. + (fhandler_cygdrive::fstat): Ignore floppy drives. Set st_nlink + correctly. + (fhandler_cygdrive::readdir): Ignore floppy drives. + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Accommodate + change to readdir_get_ino. + * fhandler_proc.cc (PROC_DIR_COUNT): Define. + (fhandler_proc::fstat): Evaluate correct link count for /proc. + * ntdll.h (struct _FILE_DIRECTORY_INFORMATION): Define. + (NtFsControlFile): Declare. + (RtlAppendUnicodeToString): Declare. + (RtlAppendUnicodeStringToString): Declare. + (RtlCompareUnicodeString): Declare. + (RtlCopyUnicodeString): Declare. + (RtlCreateUnicodeStringFromAsciiz): Declare. + (RtlEqualUnicodeString): Declare. + (RtlFreeUnicodeString): Declare. + (RtlInitEmptyUnicodeString): Declare. + (RtlSecondsSince1970ToTime): Declare. + (RtlInitEmptyUnicodeString): Define as inline function. + (RtlInitCountedUnicodeString): Define as inline function. + * path.cc (path_conv::check): New method with PUNICODE_STRING as path, + preliminary implementation. + (mount_info::get_mounts_here): Change to create UNICODE_STRINGs. + Also copy cygpath prefix into UNICODE_STRING. + (is_floppy): Drop 9x consideration. + * path.h: Drop including ntdef.h. + (path_conv::check): Add declaration. + (path_conv::path_conv): Add constructor for UNICODE_STRING paths. + * shared_info.h (mount_info::get_mounts_here): Change declaration. + * syscalls.cc: Drop forward declaration of stat_worker. + (stat_worke): Take path_conv as parameter. Drop nofollow flag. + (stat64): Create matching path_conv and call stat_worker with it. + (lstat64): Ditto. + * winsup.h: Include ntdef.h. + (stat_worker): Declare. + (readdir_get_ino): Change declaration. + +2007-07-25 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CreateToolhelp32Snapshot): Remove. + +2007-07-25 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (Process32First): Remove. + (Process32Next): Remove. + +2007-07-25 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NetWkstaUserGetInfo): Remove. + (CharToOemBuffA): Remove. + (KillTimer): Remove. + (OemToCharBuffA): Remove. + (SetTimer): Remove. + +2007-07-20 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add sec_auth.o. + * fhandler.cc (fhandler_base::fhaccess): Accommodate interface changes + of access control functions throughout. + * fhandler_disk_file.cc: Ditto. + * fhandler_registry.cc: Ditto. + * sec_acl.cc: Drop unnecessary includes. + (setacl): Take path_conv instead of file name as parameter. + Accommodate interface changes of access control functions. + (getacl): Ditto. + * sec_auth.cc: New file, taking over all authentication related + functions from security.cc. + * sec_helper.cc: Drop unnecessary includes. + * security.cc: Ditto. Move all authentication related functions to + sec_auth.cc. + (ALL_SECURITY_INFORMATION): New define. Use throughout. + (set_file_sd): New function, replacing read_sd and the file related + part of get_nt_object_security. + (get_reg_sd): Rename from get_reg_security. Drop type parameter. + (get_reg_attribute): New function, replacing the registry related part + of get_nt_object_security. + (get_file_attribute): Take path_conv instead of file name as parameter. + Use new get_file_sd call. + (set_file_attribute): Ditto plus new set_file_sd. Drop unnecessary + implementation without uid/gid parameters. + (check_file_access): Take path_conv instead of file name as parameter. + Use new get_file_sd call. + (check_registry_access): Use new get_reg_sd call. + * security.h: Accommodate above interface changes. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_nt_attribute): Remove. + (set_file_attribute): Do it yourself instead of calling + set_nt_attribute. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_name): Use + NtQueryFullAttributesFile instead of FindFirstFile. + (fhandler_base::fstat_fs): Drop check for exec_state. Drop check for + invalid characters. + * ntdll.h (struct _FILE_NETWORK_OPEN_INFORMATION): Define. + (NtQueryFullAttributesFile): Declare. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Drop local wpath and upath + variables. Call pc.get_object_attr to create object attributes. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. + * syscalls.cc (unlink_nt): Ditto. + * path.cc (path_conv::set_normalized_path): Set wide_path to NULL. + (path_conv::get_nt_native_path): Drop parameter. Create path in + wide_path/uni_path members. + (path_conv::get_object_attr): New method to create object attributes. + (path_conv::get_wide_win32_path): New method to create Win32 wide path. + (path_conv::check): Initialize wide_path to NULL. + (path_conv::~path_conv): cfree wide_path. + * path.h (class path_conv): New members wide_path and uni_path. + Add declarations of get_object_attr and get_wide_win32_path. + (path_conv::path_conv): Initialize wide_path to NULL. + (path_conv::get_nt_native_path): Drop parameter. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc: Remove unused code. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (SetSecurityDescriptorControl): Drop. + * security.cc (alloc_sd): Set security descriptor control flag without + calling SetSecurityDescriptorControl function. + * wincap.h (wincapc::has_dacl_protect): Rename from + has_security_descriptor_control. + * wincap.cc: Ditto throughout. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (SetUserObjectSecurity): Drop. + * pinfo.cc (pinfo::set_acl): Use NtSetSecurityObject instead of + SetKernelObjectSecurity. + * spawn.cc (spawn_guts): Use NtSetSecurityObject instead of + SetUserObjectSecurity. + * uinfo.cc (cygheap_user::init): Ditto. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (init_cygheap::luid): Remove. + * mmap.cc (mlock): Accommodate parameter change in call to + push_thread_privilege. + (munlock): Ditto. + * ntdll.h (STATUS_NOT_ALL_ASSIGNED): Define. + (NtAdjustPrivilegesToken): Declare. + * sec_helper.cc (cygpriv): Reorder to match numerical privilege order. + (privilege_luid): Take job of privilege_luid_by_name, using new + cygpriv. + (privilege_luid_by_name): Remove. + (privilege_name): Accommodate new cygpriv array. + (set_privilege): Call NtAdjustPrivilegesToken to avoid using advapi32. + Accommodate changes to privilege_name. + (set_cygwin_privileges): Simplify. Don't try to set + SE_CREATE_GLOBAL_PRIVILEGE on systems not supporting it. + * security.cc (sys_privs): Reorder to match numerical privilege order. + Use real privilege values as defined in security.h. + (get_system_priv_list): Drop unused grp_list argument. Create + list of privileges according to new wincapc::max_sys_priv value. + (get_priv_list): Call privilege_luid instead of privilege_luid_by_name. + Make priv a local value instead of a pointer. + (create_token): Accommodate parameter change in call to + push_self_privilege. + (lsaauth): Ditto. + (check_access): Use privilege values directly instead of calling + privilege_luid. + * security.h: Define real privilege values. + (cygpriv_idx): Remove. + (privilege_luid): Change declaration. + (privilege_luid_by_name): Drop declaration. + (set_privilege): Change declaration. + (set_process_privilege): Drop definition. + (_push_thread_privilege): Accomodate new set_privilege parameters. + * wincap.h (wincapc::max_sys_priv): New element. + * wincap.cc: Implement above element throughout. + (wincap_2000sp4): New wincaps structure. + (wincap_xpsp1): Ditto. + (wincap_xpsp2): Ditto. + (wincapc::init): Use new wincaps. + (wincapc::max_sys_priv): New element. + +2007-07-19 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): Call set_cygwin_privileges here, after + initializing hProcToken. + * sec_helper.cc (init_global_security): Don't call set_cygwin_privileges here. + +2007-07-18 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (shared_prefix): De-const. + (shared_prefix_buf): Add static buffer for shared prefix to avoid + additional allocation. + * cygheap.cc (cygheap_init): Set cygheap->shared_prefix to + cygheap->shared_prefix_buf and strcpy. + +2007-07-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fhaccess): Add check for R/O file system. + * security.cc (check_registry_access): Set errno to EROFS when checking + for W_OK. + +2007-07-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Move setting + cfd->nohandle where it won't crash. + +2007-07-16 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_user::curr_imp_token): Rename from current_token. + Accommodate change throughout Cygwin. + (cygheap_user::imp_token): Rename from token. Accommodate change + throughout Cygwin. + (rcygheap_user::eimpersonate): Use primary token for impersonation. + * grp.cc (internal_getgroups): Use primary impersonation token when + impersonated. + * security.h (_push_thread_privilege): Use primary impersonation token + when impersonated. + +2007-07-14 Christopher Faylor <me+cygwin@cgf.cx> + + * init.cc (in_dllentry): Delete. + (dll_entry): Remove assignment to deleted variable. + * winsup.h (in_dllentry): Delete declaration. + * exceptions.cc (inside_kernel): Use another method to see if we are in + dll_entry phase. + +2007-07-13 Christopher Faylor <me+cygwin@cgf.cx> + + * init.cc (in_dllentry): Make NO_COPY to avoid spurious false + positives. + +2007-07-09 Christopher Faylor <me+cygwin@cgf.cx> + + * debug.cc (close_handle): Change debug output format slightly. + + * dlfcn.cc (dlclose): Don't close handle returned from + GetModuleHandle(NULL). + + * fhandler.h (fhandler_pipe::create): Remove obsolete argument. + (fhandler_pipe::create): Ditto. + * fhandler.cc (fhandler_pipe::create): Ditto. + (fhandler_pipe::create): Ditto. + +2007-07-09 Christopher Faylor <me+cygwin@cgf.cx> + + * strsig.cc (__signals): New macro. + (sys_sigabbrev): New array of signal strings, patterned after linux. + (siglist): Use __signals. + * include/cygwin/signal.h (sys_sigabbrev): Define. + * include/cygwin/version.h: Bump API minor version to 177. + +2007-07-09 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (closedir): Revert change from 2007-06-29. + * fhandler.h (dirent_valid_fd): Drop. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): If opening a + real dir, use the underlying fhandler to keep track of the directory + handle. In fdopendir case use original io_handle from fhandler. Use + fhandler's io_handle in subsequent directory functions throughout. + Create handle non-inheritable and set close-on-exec flag. + (readdir_get_ino): Drop dirent_isroot case. + (fhandler_disk_file::readdir): Handle dirent_isroot case here. + (fhandler_disk_file::rewinddir): Revert change from 2007-07-05. Use + NtClose instead of CloseHandle. + * fhandler_virtual.cc (fhandler_virtual::opendir): Drop adding + dirent_valid_fd flag. Set close-on-exec flag. + +2007-07-08 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (DLL_OFILES): Add newly-imported random.o. Eliminate + reliance on libiberty. + * random.cc: Import from FreeBSD. Modify for Cygwin environment. + * include/cygwin/stdlib.h (random): Reflect change in return value to + be more linux/freebsd-like. + (srandom): Ditto. + +2007-07-07 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_base::write): Remove __stdcall decoration. + (fhandler_pipe::write): Ditto. + (fhandler_fifo::write): Ditto. + +2007-07-07 Christopher Faylor <me+cygwin@cgf.cx> + + Preliminary change to make pipes interruptible and fifos reliable. + * dtable.cc (dtable::find_fifo): Eliminate definition. + * dtable.h (dtable::find_fifo): Ditto for declaration. + * fhandler.cc (fhandler_base::raw_read): Remove pipe-specific stuff. + (fhandler_base::fhandler_base): Ditto. + (fhandler_base::close): Handle overlapped I/O structure if appropriate. + (fhandler_base::dup): Ditto. + (fhandler_base::fork_fixup): Ditto. + (fhandler_base::setup_overlapped): Define new function. + (fhandler_base::destroy_overlapped): Ditto. + (fhandler_base::wait_overlapped): Ditto. + (fhandler_base::read_overlapped): Ditto. + (fhandler_base::write_overlapped): Ditto. + * fhandler.h (fhandler_base::get_overlapped): Declare new function. + (fhandler_base::setup_overlapped): Ditto. + (fhandler_base::destroy_overlapped): Ditto. + (fhandler_base::wait_overlapped): Ditto. + (fhandler_base::read_overlapped): Ditto. + (fhandler_base::write_overlapped): Ditto. + (fhandler_base::get_guard): Eliminate. + (fhandler_pipe::*): Rework to eliminate most Win9x related cruft, + removing many variables and defining a new overlapped capability. + (fhandler_fifo::*): Ditto. + (fifo_state): Declare new enum. + * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Remove old Win9x + stuff. Initialize overlapped handle to NULL. + (fhandler_fifo::set_use): Eliminate. + (fhandler_fifo::open_nonserver): Define. + (fhandler_fifo::open): Rework to use named pipes and overlapped I/O. + (fhandler_fifo::wait): Define new function to wait for named pipe + connection. + (fhandler_fifo::read): Rework to use wait() and new overlapped I/O + functionality. + (fhandler_fifo::write): Ditto. + (fhandler_fifo::dup): Eliminate. + * pinfo.cc (commune_process): Remove fifo handling. + (_pinfo::commune_request): Ditto. + * pinfo.h (picom): Ditto. + * pipe.cc (fhandler_pipe::fhandler_pipe): Remove Win9x stuff. + Initialize overlapped handle to NULL. + (fhandler_pipe::open): Eliminate Win9x stuff. + (fhandler_pipe::set_close_on_exec): Eliminate. + (read_pipe): Eliminate. + (fhandler_pipe::close): Ditto. + (fhandler_pipe::fixup_after_exec): Ditto. + (fhandler_pipe::fixup_in_child): Ditto. + (fhandler_pipe::read): Rework to use overlapped I/O. + (fhandler_pipe::write): New function using overlapped I/O. + (fhandler_pipe::dup): Rework to eliminate Win9x stuff. + (fhandler_pipe::create_selectable): Rework to eliminate Win9x and use + overlapped I/O. + * select.cc (peek_pipe): Rework to eliminate Win9x stuff and use + overlapped I/O. + (fhandler_base::ready_for_read): Ditto. + +2007-07-07 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (symlink_info::check_shortcut): Handle device "symlinks" + specially - don't posixify them. + +2007-07-07 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_disk_file.cc: White space. + * fhandler_proc.cc: Ditto. + * fhandler_virtual.cc: Ditto. + +2007-07-07 Christopher Faylor <me+cygwin@cgf.cx> + + * fork.cc: White space. + * net.cc: Ditto. + * posix_ipc.cc: Ditto. + +2007-07-06 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (gettimeofday): Align definition to POSIX. + +2007-07-06 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcstol, wcstoll, wcstoul, wcstoull, wcsxfrm. + * include/cygwin/version.h: Bump API minor number. + +2007-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Add missing + OBJ_INHERIT flag when creating OBJECT_ATTRIBUTES. + (fhandler_disk_file::rewinddir): Ditto. + +2007-07-04 Corinna Vinschen <corinna@vinschen.de> + + * times.cc: Define __timezonefunc__ before including time.h to protect + definition of timezone function. + +2007-07-04 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/time.h: Switch to timezone variable by default. Add + comment. + +2007-06-29 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export fdopendir. + * dir.cc (opendir): Call fhandler's opendir with fd set to -1. + (fdopendir): New function. + (seekdir64): Use dirent_info_mask. + (rewinddir): Ditto. + (closedir): Only release underlying file descriptor if it has been + reserved by opendir itself. + * fhandler.cc (fhandler_base::opendir): Accommodate new parameter. + * fhandler.h (dirent_states): Add dirent_valid_fd and dirent_info_mask. + (fhander_XXX::opendir): Add file descriptor parameter. Use regparms. + (fhandler_procnet::opendir): Drop declaration. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. + If called from fdopendir, use existing handle to re-open directory + with valid flags. Rename fd to cfd. Use only if no valid incoming fd. + (fhandler_cygdrive::opendir): Accommodate new parameter. + * fhandler_process.cc (fhandler_process::opendir): Ditto. + * fhandler_procnet.cc (fhandler_procnet::opendir): Drop definition. + * fhandler_virtual.cc (fhandler_virtual::opendir): Accommodate new + parameter. Only create new file descriptor entry if called from + opendir. Remove duplicated setting of dir->__flags. + * posix.sgml: Add fdopendir to list of implemented Solaris functions. + * include/cygwin/version.h: Bump API minor number. + * include/sys/dirent.h: Declare fdopendir. + +2007-06-28 Brian Dessent <brian@dessent.net> + + * include/cygwin/version.h: Fix comment typo. + +2007-06-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export stpcpy, stpncpy. + * posix.sgml: Add stpcpy and stpncpy to list of implemented + GNU extensions. + * include/cygwin/version.h: Bump API minor number. + +2007-06-27 Corinna Vinschen <corinna@vinschen.de> + + * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. + (CURR_SHARED_MAGIC): Ditto. + (class shared_info): Add heap_slop_inited member. + * shared.cc (shared_info::heap_slop_size): Use heap_slop_inited to + track initializing heap_slop since 0 is a valid value for heap_slop. + Drop useless < 0 consideration. + +2007-06-27 Eric Blake <ebb9@byu.net> + + * assert.cc (__assert_func): New function, to match newlib header + change. + * cygwin.din: Export __assert_func. + * include/cygwin/version.h: Bump API minor number. + +2007-06-21 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (WSAIoctl): Remove. + * cygwin.din: Export freeifaddrs, getifaddrs. + * fhandler_socket.cc (fhandler_socket::ioctl): Drop SOCKET parameter + from get_ifconf. + * net.cc: Include ifaddrs.h. + (in_are_prefix_equal): Match addresses in network byte order. + (ip_addr_prefix): Convert address into host byte order before + testing with IN_LOOPBACK. + (struct ifall): Define. + (get_xp_ifs): Replace get_xp_ifconf. Return struct ifall array. + (get_2k_ifs): Ditto, replace get_2k_ifconf. + (get_nt_ifs): Ditto, replace get_nt_ifconf. + (getifaddrs): New function. + (freeifaddrs): New function. + (get_ifconf): Call matching get_XX_ifs function and create + ifc content from here. Drop lo fake since it's now in get_nt_ifs. + * posix.sgml: Add freeifaddrs and getifaddrs to list of implemented + BSD functions. + * wincap.h (wincapc::has_broken_if_oper_status): New element. + * wincap.cc: Implement above element throughout. + * include/ifaddrs.h: New file. + * include/cygwin/version.h: Bump API minor number. + +2007-06-20 Eric Blake <ebb9@byu.net> + + * cygwin.din: Export exp10, exp10f, pow10, pow10f, strcasestr, + funopen, fopencookie. + * include/cygwin/version.h: Bump API minor number. + * posix.sgml: Minor improvements. + +2007-06-20 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/if.h (IFF_POINTOPOINT): Fix typo. + +2007-06-16 Christopher Faylor <me+cygwin@cgf.cx> + + * include/search.h: Reinstate node_t definition. + +2007-06-16 Christopher Faylor <me+cygwin@cgf.cx> + + * include/sys/cdefs.h: Remove in favor of newlib version. + +2007-06-14 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetIpForwardTable): Define. + * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFDSTADDR. + * net.cc (get_routedst): New static function to get destination + address of point-to-point interfaces. + (get_xp_ifconf): Handle SIOCGIFDSTADDR. + (get_2k_ifconf): Ditto. + (get_nt_ifconf): Ditto. + (get_ifconf): Ditto. + * include/asm/socket.h (SIOCGIFDSTADDR): Define. + * include/cygwin/if.h (struct ifreq): Add ifru_dstaddr member. + (ifr_dstaddr): Define. + * include/cygwin/in.h: Cast ipv4 addresses correctly to in_addr_t in + definitions. + +2007-06-12 Christopher Faylor <me+cygwin@cgf.cx> + + * signal.cc (usleep): Use useconds_t for the type as per POSIX. + +2007-06-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add xsique.o. + * cygwin.din (confstr): Make NOSIGFE. + (insque): Export. + (remque): Export. + * lsearch.cc: Remove superfluous _SEARCH_PRIVATE define. + * posix.sgml: Move insque to defined SUSv3 interfaces. Remove + comment for remque. + * include/search.h: Remove _SEARCH_PRIVATE guarded definitions. + Add struct qelem definition. Add insque and remque declarations. + * include/cygwin/version.h: Bump API minor number. + * include/sys/queue.h: Remove insque/remque definitions so as not + to collide with SUSv3 compatible declaration in search.h. + * libc/xsique.cc: New file implementing insque and remque. + +2007-06-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fstat): Set pipe permission bits more + correctly. + +2007-06-11 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (confstr): Export. + * posix.sgml (confstr): Move to list of implemented SUSv3 functions. + * sysconf.cc (confstr): Implement. + * include/cygwin/version.h: Bump API minor number. + +2007-06-05 Corinna Vinschen <corinna@vinschen.de> + + * ansi.sgml: Delete. + * misc-std.sgml: Delete. + * posix.sgml: Rework entirely. + +2007-05-29 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::set_file_pointers_for_exec): Call SetFilePointer + correctly for 64 bit file access. Comment out functionality. + * fhandler.cc (fhandler_base::open): Don't set append_mode. + (fhandler_base::write): Check for O_APPEND instead of append_mode. + Call SetFilePointer correctly for 64 bit file access. Handle + errors from SetFilePointer. + * fhandler.h (class fhandler_base): Drop append_mode status flag. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Handle + seeking correctly for 64 bit file access. + +2007-05-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Revert useless acquire check. + +2007-05-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Avoid double aquiring of cwd_lock. + Open directory with inheriting enabled. + +2007-05-21 Christian Franke <franke@computer.org> + + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Don't invalidate + devbuf if new position is within buffered range. + +2007-05-21 Eric Blake <ebb9@byu.net> + + * include/search.h (hsearch_r): Provide declaration. + +2007-05-21 Christian Franke <franke@computer.org> + Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Set buf size to + sector size. Simplify non-sector aligned case. Handle errors from + raw_read. + +2007-05-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (adjust_socket_file_mode): New inline function. + (fhandler_socket::fchmod): Squeeze mode through adjust_socket_file_mode + before using it. + (fhandler_socket::bind): Ditto. + +2007-03-19 Ryan C. Gordon <icculus@icculus.org> + + * path.cc (fs_info::update): Set and use is_cdrom. + * path.cc (fillout_mntent): Set ret.mnt_type to something more + Linux-like, based on data from fs_info. Move "system" and "user" + strings from mnt_type to mnt_opts. + * path.h (struct fs_info): Add is_cdrom field. + * path.h (fs_info::clear): Initialize is_cdrom. + * path.h (struct fs_info): Add IMPLEMENT_STATUS_FLAG(bool,is_cdrom). + * path.h (class path_conv): Add fs_is_cdrom method. Add missing + fs_is_netapp method. + +2007-05-14 Eric Blake <ebb9@byu.net> + + * cygwin.din (asnprintf, dprint, _Exit, vasnprintf, vdprintf): Export. + * include/cygwin/version.h: Bump API minor number. + +2007-04-18 Brian Dessent <brian@dessent.net> + + * cygwin.sc: Remove duplicated .debug_macinfo section. + * dllfixdbg: Also copy DWARF-2 sections into .dbg file. + +2007-04-06 Eric Blake <ebb9@byu.net> + + * include/stdint.h (WINT_MIN): Fix sign. + +2007-04-04 Eric Blake <ebb9@byu.net> + + * include/stdint.h (WINT_MIN, WINT_MAX): Fix definition. + +2007-03-30 Christopher Faylor <me@cgf.cx> + + * external.cc (cygwin_internal): Implement CW_SET_DOS_FILE_WARNING. + * include/sys/cygwin.h: Define CW_SET_DOS_FILE_WARNING. + +2007-03-29 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Fix formatting. Remove comment. Set + shared_prefix depending only on terminal service capability. + * dcrt0.cc (dll_crt0_1): Don't call set_cygwin_privileges here. + * fhandler_fifo.cc (fhandler_fifo::open): Create the mutex as global + object. + * posix_ipc.cc (ipc_mutex_init): Use cygheap->shared_prefix. + (ipc_cond_init): Ditto. + * sec_helper.cc (privilege_name): Make static. Use LookupPrivilegeName + directly to be independent of the state of cygheap. + (set_privilege): Take a LUID as parameter instead of an index value. + Only print debug output in case of failure. + (set_cygwin_privileges): Add comment. Use LookupPrivilegeValue to + get privilege LUIDs. + (init_global_security): Call set_cygwin_privileges here. + * security.h (privilege_name): Drop declaration. + (set_privilege): Declare according to above change. + (set_process_privilege): Call privilege_luid to get LUID. + (_push_thread_privilege): Ditto. + * shared.cc (open_shared): Add comment. On systems supporting the + SeCreateGlobalPrivilege, try to create/open global shared memory first. + Fall back to local shared memory if that fails. + * thread.cc (semaphore::semaphore): Use cygheap->shared_prefix. + * wincap.h (wincapc::has_create_global_privilege): New element. + * wincap.cc: Implement above element throughout. + +2007-03-28 Christopher Faylor <me@cgf.cx> + + * spawn.cc (spawn_guts): Start pure-windows processes in a suspended + state to avoid potential DuplicateHandle problems. + +2007-03-13 Eric Blake <ebb9@byu.net> + + * include/cygwin/stat.h (S_TYPEISMQ, S_TYPEISSEM, S_TYPEISSHM): + Avoid compiler warnings. + +2007-03-07 Christopher Faylor <me@cgf.cx> + + * signal.cc (handle_sigprocmask): Remove extraneous + sig_dispatch_pending. + +2007-03-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc: Fix formatting. Drop setting errno when creating + proc file content. + (format_proc_uptime): Simplify. + (format_proc_cpuinfo): Align more closely to output of Linux 2.6 kernel. + Evaluate more data, especially for AMD CPUs. + +2007-03-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::fstat_helper): Add creation time parameter. + * glob.cc (stat32_to_stat64): Set st_birthtim to st_mtim. + +2007-03-06 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/stat.h (S_TYPEISMQ): Define. + (S_TYPEISSEM): Dttio. + (S_TYPEISSHM): Ditto. + +2007-03-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mailslot.cc (fhandler_mailslot::fstat): Set new stat member + st_birthtim to useful value. + * fhandler_process.cc (fhandler_process::fstat): Ditto. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Take + additional parameter for creation time. Fill st_birthtim with it. + Accomodate additional creation time parameter throughout. + * fhandler_raw.cc (fhandler_dev_raw::fstat): Set new stat member + st_birthtim to useful value. + * fhandler.cc (fhandler_base::fstat): Ditto. + * fhandler_registry.cc (fhandler_registry::fstat): Ditto. + * include/cygwin/version.h: Bump API minor number. + * include/cygwin/stat.h (struct __stat64): Replace st_spare4 with + timestruc_t st_birthtim. + (struct stat): Ditto if __CYGWIN_USE_BIG_TYPES__ is defined. + (st_birthtime): Define if __CYGWIN_USE_BIG_TYPES__ is defined. + +2007-03-02 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (struct _FILE_NAMES_INFORMATION): Define. + * syscalls.cc (unlink_nt): Check shared directory for being empty + before trying to move and mark for deletion. + +2007-03-02 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_file_attribute): Avoid compiler warning. + +2007-03-01 Christopher Faylor <me@cgf.cx> + + * fork.cc (fork): Reset child to true after fork since it may have been + reset by fork memory copies. + +2007-03-01 Christopher Faylor <me@cgf.cx> + + * Makefile (DLL_OFILES): Remove ntea.o + * environ.cc (set_ntea): Delete. + (parse_thing): Delete "ntea" setting. + * fhandler.cc (fhandler_base::open): Remove allow_ntea considerations. + (check_posix_perm): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Ditto. + (fhandler_base::open_fs): Ditto. + (fhandler_disk_file::mkdir): Ditto. + * path.cc (symlink_worker): Ditto. + * security.cc (get_file_attribute): Ditto. + (set_file_attribute): Ditto. + * security.h: Remove allow_ntea declaration. + +2007-02-27 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (close_user_proc_parms_cwd_handle): Remove. + (cwdstuff::init): Don't call close_user_proc_parms_cwd_handle. + Call set to set cwd with all-sharing handle. + (cwdstuff::set): Fix comment. Don't close cwd handle. Set in + user parameter block instead and close old cwd handle. + * syscalls.cc (rename): Call unlink_nt instead of RemoveDirectory or + DeleteFile to allow deleting shared files/directories. + +2007-02-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc(fhandler_base::open): Open with READ_CONTROL only in + case of query_open flag set to query_read_control. Add case for + new query_read_attributes flag. + (fhandler_base::fstatvfs): New method. + * fhandler.h (enum query_state): Add query_read_attributes flag. + (class fhandler_base): Declare new virtual fstatvfs method. + (class fhandler_socket): Ditto. + (class fhandler_pipe): Ditto. + (class fhandler_fifo): Ditto. + (class fhandler_disk_file): Ditto. + (class fhandler_virtual): Ditto. + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Open with + query_read_attributes instead of query_read_control. + (fhandler_disk_file::fstatvfs): New method. + (fhandler_disk_file::facl): Open with query_read_attributes instead of + query_read_control. + * fhandler_fifo.cc (fhandler_fifo::fstatvfs): New method. + * fhandler_socket.cc (fhandler_socket::fstatvfs): New method. + (fhandler_socket::fchmod): Return with EBADF in the default case. + (fhandler_socket::fchown): Ditto. + (fhandler_socket::facl): Ditto. + * fhandler_virtual.cc (fhandler_virtual::fstatvfs): Ditto. + * ntdll.h (struct _FILE_FS_ATTRIBUTE_INFORMATION): Define. + (struct _FILE_FS_FULL_SIZE_INFORMATION): Define. + * pipe.cc (fhandler_pipe::fstatvfs): New method. + * syscalls.cc (fstatvfs): Just call the fhandler's fstatvfs. + (statvfs): Ditto. + (fstatfs): Call fstatvfs. + (statfs): Drop EFAULT handling. + +2007-02-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fstat): Set all file times to arbitrary + fixed value. + +2007-02-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (registry_listing): Drop name of HKEY_DYN_DATA. + (registry_keys): Drop HKEY_DYN_DATA. + * net.cc: Fix comment. + * syslog.cc: Ditto. + +2007-02-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Drop comment. + * mmap.cc (gen_access): Remove. + (mmap_record::gen_access): Remove. + (mmap64): Don't mention 9x any longer. + * syscalls.cc (statvfs): Drop status code consideration for 9x. + * libc/minires-os-if.c (get_registry_dns_items): Don't mention 9x any + longer. + (get_registry_dns): Drop getting registry key on 9x. Drop is9x + variable. + +2007-02-23 Corinna Vinschen <corinna@vinschen.de> + + Throughout remove all usage of wincap.has_security. + * environ.cc (environ_init): Drop setting allow_ntsec here. + * grp.cc (initgroups32): Drop usage of label "out". + * security.cc (allow_ntsec): Set to true by default. + * syscalls.cc (seteuid32): Remove label success_9x. + * wincap.cc: Remove has_security throughout. + * wincap.h: Ditto. + +2007-02-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_pipe): Remove members writepipe_exists, + orig_pid and id. Make hit_eof inline. + * fhandler_fifo.cc (fhandler_fifo::open): Drop handling of + writepipe_exists, orig_pid and id. + * pipe.cc: Ditto throughout. + (pipecount): Remove. + (pipeid_fmt): Remove. + (fhandler_pipe::hit_eof): Simplify. Move to fhandler.h. + (fhandler_pipe::dup): Drop leave label. + (fhandler_pipe::create): Drop has_unreliable_pipes case. + * wincap.cc: Remove has_unreliable_pipes throughout. + * wincap.h: Ditto. + +2007-02-23 Corinna Vinschen <corinna@vinschen.de> + + * devices.in: Change native device name to native NT device name for + /dev/null, /dev/comX and /dev/ttySx. + * devices.cc: Regenerate. + * fhandler.cc (fhandler_base::open_9x): Remove. + (fhandler_base::open): Don't test for DOS device name, don't call + open_9x. + (fhandler_dev_null::open): Remove. + * fhandler.h (class fhandler_base): Drop open_9x declaration. + (class fhandler_dev_null): Drop open declaration. + +2007-02-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::need_invisible): Drop + pty_needs_alloc_console check. + * spawn.cc (spawn_guts): Ditto. + (av::fixup): Remove setting iscui. + * syscalls.cc (rename): Drop has_move_file_ex checks. Remove 9x + specific code. + * wincap.cc: Remove has_move_file_ex and pty_needs_alloc_console + throughout. + * wincap.h: Ditto. + +2007-02-23 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (dummy_ctrl_c_handler): Remove. + (init_console_handler): Drop has_null_console_handler_routine checks. + * fhandler_raw.cc (fhandler_dev_raw::open): Drop has_raw_devices check. + * fhandler_serial.cc (fhandler_serial::open): Drop + .supports_reading_modem_output_lines check. + * miscfuncs.cc (low_priority_sleep): Drop has_switch_to_thread check. + * shared.cc (open_shared): Drop needs_memory_protection checks. + * spawn.cc (spawn_guts): Drop start_proc_suspended check. + * uname.cc (uname): Drop has_valid_processorlevel check. + * wincap.cc: Remove has_raw_devices, has_valid_processorlevel, + supports_reading_modem_output_lines, needs_memory_protection, + has_switch_to_thread, start_proc_suspended and + has_null_console_handler_routine throughout. + * wincap.h: Ditto. + +2007-02-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::lseek): Drop 9x considerations. + * fhandler_disk_file.cc (fhandler_disk_file::lock): Ditto. + * wincap.cc: Remove lock_file_highword and has_64bit_file_access + throughout. + * wincap.h: Ditto. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct cwdstuff): Remove sync member and keep_in_sync + accessors. + * external.cc (cygwin_internal): Drop call to cygheap->cwd.keep_in_sync. + * fhandler_disk_file.cc (fhandler_disk_file::link): Always presume + ability to create hard links. + * path.cc (cwdstuff::init): Drop 9x considerations. + (cwdstuff::keep_in_sync): Remove. + (cwdstuff::set): Take NT for granted. + * pinfo.h (cygwin_pid): Just return pid. + * wincap.cc: Remove has_hard_links, can_open_directories, + has_negative_pids, has_named_pipes, has_try_enter_critical_section, + cant_debug_dll_entry and detect_win16_exe throughout. + * wincap.h: Ditto. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Drop 9x specific + handling of AltGr key. + * mmap.cc: Take NT for granted throughout. + * wincap.cc: Remove map_view_of_file_ex_sucks, altgr_is_ctrl_alt, + has_working_copy_on_write, share_mmaps_only_by_name, + virtual_protect_works_on_shared_pages, has_mmap_alignment_bug and + has_working_virtual_lock throughout. + * wincap.h: Ditto. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::set_no_inheritance): Always use + SetHandleInformation. + * fhandler_disk_file.cc (fhandler_disk_file::lock): Always use + UnlockFileEx/LockFileEx functions. + * net.cc (fdsock): Don't bother to duplicate socket for inheritance. + * sysconf.cc (get_nproc_values): Take NT for granted. + (get_avphys): Ditto. + * syslog.cc (WIN95_EVENT_LOG_PATH): Remove define. + (get_win95_event_log_path): Remove. + (vsyslog): Fix formatting. Take NT for granted. + * wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait, + has_eventlog, has_set_handle_information, + has_set_handle_information_on_console_handles and supports_smp + throughout. + * wincap.h: Ditto. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (rmdir): Move existance check in front of + has_dot_last_component check. Simplify setting errno in latter case. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case. + Simplify seek beyond EOF case. + * times.cc (times): Remove wincap.has_get_process_times case. + * wincap.cc: Remove has_delete_on_close, has_page_guard, + has_get_process_times and has_lseek_bug throughout. + * wincap.h: Ditto. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + Throughout remove all usage of wincap.access_denied_on_delete. + * dir.cc (rmdir): Add existance check to be errno-compatible with Linux. + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop test for + non-existent dir on 9x share. + * syscalls.cc (unlink): Add comment. + * wincap.cc: Remove access_denied_on_delete flag throughout. + * wincap.h: Ditto. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug + introduced by switching to NtClose. + +2007-02-22 Christopher Faylor <me@cgf.cx> + + * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of + guard test. Increase size of stack reserved and increase size before + the current stack pointer. Use pointers when doing arithmetic. + (dll_crt0_1): Initialize exception handler when we notice we're the + child of a fork from non-main thread. + * fork.cc (frok::parent): Make argument volatile. + (frok::child): Ditto. + (lock_signals): New class. + (lock_pthread): Ditto. + (hold_everhthing): Ditto. + (frok::parent): Move atforkprepare and atforkparent to lock_pthread + class. + (fork): Make ischild boolean. Use hold_everything variable within + limited scope to set various mutexes in such a way as to avoid + deadlocks. + * thread.h (pthread_mutex::tid): New variable, active when debugging + for tracking thread id of owner. + (pthread_mutex::set_owner): Set tid when debugging. + * thread.cc (pthread_mutex::pthread_mutex): Clear tid. + (pthread_mutex::_unlock): Ditto when unlocking. + (pthread_mutex::fixup_after_fork): Set tid to special value after + forking since owner is unknown. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + Throughout replace all usage of wincap.shared with the constant + FILE_SHARE_VALID_FLAGS. + * fhandler.cc (fhandler_base::open_9x): Drop local variable shared. + * wincap.cc: Remove shared member throughout. + * wincap.h: Ditto. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_IMPORTS): Add libntdll.a. + * autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and + ntdll.dll available on all platforms since NT4. + + Throughout remove all usage of wincap.is_winnt. + * dcrt0.cc (dll_crt0_0): Remove call to mmap_init. + * fhandler.h (class fhandler_base): Remove has_changed flag. + (fhandler_disk_file::touch_ctime): Remove declaration. + (fhandler_disk_file::readdir_9x): Ditto. + (fhandler_disk_file::touch_ctime): Remove. + (fhandler_disk_file::readdir_9x): Remove. + (fhandler_disk_file::closedir): Call NtClose instead of CloseHandle. + * mmap.cc: Throughout call CreateMapping and MapView directly. + (VirtualProt9x): Remove. + (VirtualProtNT): Remove. + (VirtualProtEx9x): Remove. + (VirtualProtExNT): Remove. + (VirtualProtect): Remove define. + (VirtualProtectEx): Remove define. + (CreateMapping9x): Remove. + (CreateMappingNT): Rename to CreateMapping. + (MapView9x): Remove. + (MapViewNT): Rename to MapView. + (struct mmap_func_t): Remove definition. + (mmap_funcs_9x): Remove. + (mmap_funcs_nt): Remove. + (mmap_func): Remove. + (mmap_init): Remove. + * net.cc (getdomainname): Drop comment. Use NT4 registry key only. + (get_95_ifconf): Remove. + * pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes. + (winpids::enum9x): Remove. + (winpids::set): Just call enum_processes directly. + (winpids::enum_init): Ditto. + * pinfo.h (class winpids): Drop enum_processes pointer. Rename + enumNT to enum_processes. Drop enum9x declaration. Drop initialization + of enum_processes throughout. + * registry.cc (get_registry_hive_path): Just create NT key. + (load_registry_hive): Only load NT specific file. + * syscalls.cc (unlink_9x): Remove. + (unlink): Just call unlink_nt. + * wincap.cc: Remove is_winnt flag throughout. + * wincap.h: Ditto. + * winsup.h: Remove mmap_init declaration. + +2007-02-21 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincap_unknown): Change settings for unknown to reflect + the capabilities of NT4. + (wincap_95): Remove. + (wincap_95osr2): Remove. + (wincap_98): Remove. + (wincap_98se): Remove. + (wincap_me): Remove. + (wincap_nt3): Remove. + (wincapc::init): Temporarily bail out on any 9x system. + +2007-02-20 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (sem_unlink): Export. + * posix_ipc.cc: Include thread.h and semaphore.h. Remove TODO + comment. + (ipc_names): Add max_len member. Set to maximum length of the path + before tacking on the prefix path. Set prefix path for named semaphors + to /dev/shm, as on Linux. + (enum ipc_type_t): Change sem to semaphore to avoid name conflicts. + (check_path): Detect empty paths. Use ipc_names's max_len member. + Use __small_sprintf to create full object path name. Special case + semaphores. + (ipc_cond_init): Drop superfluous strcpy. + (class ipc_flock): New class to simplify file locking in subsequent + code. + (struct mq_hdr): Raise size of mqh_uname to allow adding a unique + LUID to the name. + (mq_open): Fix formatting. Create unique synchronization object names + using AllocateLocallyUniqueId. + (struct sem_finfo): New structure defining named semaphore file content. + (sem_open): Move here. Rework implementation to allow kernel + persistent implementation of POSIX named semaphores. + (_sem_close): Implement sem_close. + (sem_close): Move here. Just call _sem_close with do_close parameter + set to true. + (sem_unlink): New function. + * pthread.cc (mangle_sem_name): Remove. + (sem_open): Move to posix_ipc.cc. + (sem_close): Ditto. + * syscalls.cc (close_all_files): Call semaphore::terminate here. + * thread.cc: Fix formatting. Rearrange semaphore functions so that + they are close together. + (semaphore::semaphore): Rework to play nicely with new named semaphore + implementation. + (semaphore::_terminate): Call _sem_close if semaphore is a named + semaphore. + (semaphore::destroy): Don't destroy named semaphores. Return EINVAL + instead. + (semaphore::close): Only destroy named semaphores. Return EINVAL + otherwise. + (semaphore::open): Rework to play nicely with new named semaphore + implementation. Loop through existing semaphores to be able to + return same sem_t pointer as a former call on the same named semaphore. + (semaphore::getinternal): New function called from _sem_close. + * thread.h (class List): Make mx and head public. + (class semaphore): Fix formatting. Align method declarations with + implementation in thread.cc. Add members used for named semaphores. + (semaphore::terminate): New static method. + * include/semaphore.h: Redefine SEM_FAILED. Fix formatting. + (sem_unlink): Add declaration. + * include/cygwin/version.h: Bump API minor number. + +2007-02-20 Christopher Faylor <me@cgf.cx> + + * exceptions.cc (_cygtls::signal_exit): Only call myself.exit when when + exit_state indicates that we've visited do_exit. + * sync.h (lock_process::lock_process): Use renamed exit_state - + ES_PROCESS_LOCKED. + * winsup.h: Rename ES_MUTO_SET to ES_PROCESS_LOCKED. + +2007-02-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Remove printing wrong + errno in debug output. + +2007-02-19 Christopher Faylor <me@cgf.cx> + + Remove extraneous whitespace. + * pinfo.cc (commune_process): Use default argument to lock_process. + * sigproc.cc: Update copyright. + * select.cc: Ditto. + +2007-02-15 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (mq_open): Avoid compiler warning. Initialize mqhdr + before using it in file exists case. + * include/mqueue.h (mqd_t): Make non-pointer type. + +2007-02-15 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_mutex_init): Create global object name. + (ipc_cond_init): Ditto. + (struct mq_hdr): Add mqh_uname member to store synchronization object + name. + (mq_open): Create unique synchronization object name and store in + mq_hdr->mqh_uname. Use this name in calls to ipc_mutex_init and + ipc_cond_init. + +2007-02-14 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add posix_ipc.o. + * cygwin.din (mq_close): Export. + (mq_getattr): Export. + (mq_notify): Export. + (mq_open): Export. + (mq_receive): Export. + (mq_send): Export. + (mq_setattr): Export. + (mq_timedreceive): Export. + (mq_timedsend): Export. + (mq_unlink): Export. + * posix_ipc.cc: New file implementing the above functions. Move + shm_open and shm_unlink from syscalls.cc here. + * sysconf.cc (sca): Set value of _SC_MQ_OPEN_MAX to MQ_OPEN_MAX, + _SC_MQ_PRIO_MAX to MQ_PRIO_MAX, _SC_MESSAGE_PASSING to + _POSIX_MESSAGE_PASSING. + * include/limits.h (MQ_OPEN_MAX): Define. + (MQ_PRIO_MAX): Define. + * include/mqueue.h: New file. + * include/cygwin/version.h: Bump API minor number. + +2007-02-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/stdlib.h (valloc): Declare. + (memalign): Declare. + +2007-02-09 Pierre A. Humblet <Pierre.Humblet@ieee.org> + + * libc/minires-os-if.c (write_record): Handle DNS_TYPE_SRV and + some obsolete types. + +2007-02-08 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (check_shm): New static function to do path checking + common to shm_open and shm_unlink. Check for /dev/shm existance. + (shm_open): Call check_shm. + (shm_unlink): Ditto. + +2007-02-08 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (shm_open): Export. + (shm_unlink): Export. + * syscalls.cc (shm_open): New function. + (shm_unlink): New function. + * sysconf.cc (sca): Set value of _SC_SHARED_MEMORY_OBJECTS to + _POSIX_SHARED_MEMORY_OBJECTS. + * include/cygwin/version.h: Bump API minor number. + * include/sys/mman.h (shm_open): Add prototype. + (shm_unlink): Ditto. + +2007-02-08 Christopher Faylor <me@cgf.cx> + Corinna Vinschen <corinna@vinschen.de> + + * cygmalloc.h (__set_ENOMEM): Declare. + (MALLOC_FAILURE_ACTION): Call __set_ENOMEM. + * malloc_wrapper.cc (malloc) Remove setting errno here. + (realloc): Ditto. + (calloc): Ditto. + (memalign): Ditto. + (valloc): Ditto. + (posix_memalign): Save and restore errno. + +2007-02-07 Corinna Vinschen <corinna@vinschen.de> + + * cygmalloc.h (MALLOC_FAILURE_ACTION): Move to correct #if branch. + +2007-02-07 Corinna Vinschen <corinna@vinschen.de> + + * cygmalloc.h (MALLOC_FAILURE_ACTION): Define empty. + * cygwin.din (posix_madvise): Export. + (posix_memalign): Export. + * fhandler.cc (fhandler_base::fpathconf): Return useful values in + _PC_VDISABLE, _PC_SYNC_IO and _PC_SYMLINK_MAX cases. + * malloc_wrapper.cc (malloc): Set errno here since it's not set in + dlmalloc.c anymore. + (realloc): Ditto. + (calloc): Ditto. + (memalign): Ditto. + (valloc): Ditto. + (posix_memalign): New function. + * mmap.cc (posix_madvise): New function. + * sysconf.cc (get_open_max): New function. + (get_page_size): Ditto. + (get_nproc_values): Ditto. + (get_avphys): Ditto. + (sc_type): New type. + (sca): New array to map _SC_xxx options to sysconf return values. + (sysconf): Reimplement using sca array. + * include/limits.h: Add all missing values as defined by SUSv3. + * include/pthread.h (PTHREAD_DESTRUCTOR_ITERATIONS): Move definition + to sys/limits.h. + (PTHREAD_KEYS_MAX): Ditto. + * include/semaphore.h (SEM_VALUE_MAX): Ditto. + * include/cygwin/stdlib.h (posix_memalign): Declare. + * include/cygwin/version.h: Bump API minor number. + * include/sys/mman.h: Add posix_madvise flags. + (posix_madvise): Declare. + * include/sys/termios.h (_POSIX_VDISABLE): Move definition to + sys/limits.h. + +2007-02-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support for + baud rates up to 3000000 baud. Add missing 128K and 256K cases. + (fhandler_serial::tcgetattr): Ditto. + * include/sys/termios.h: Add baud rate definitions from B460800 up to + B3000000. + +2007-02-02 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Add missing assignment in case NtClose fails. + +2007-02-01 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (ga_dup): New function, taken from ga_clone with v4-in-v6 + mapping addition. + (ga_clone): Just call ga_dup from here. + (ga_duplist): New function to duplicate list of struct addrinfo. + (ga_echeck): Don't check ai_flags, it already happened in + cygwin_getaddrinfo. + (cygwin_freeaddrinfo): Always call ipv4_freeaddrinfo. + (cygwin_getaddrinfo): Use new wincap.supports_all_posix_ai_flags + flag rather than wincap.has_gaa_on_link_prefix. Always duplicate + WinSock's addrinfo list to a self-allocated list. Handle AI_V4MAPPED + for pre-Vista platforms supporting getaddrinfo. + * wincap.h (wincapc::supports_all_posix_ai_flags): New element. + * wincap.cc: Implement above element throughout. + * include/netdb.h: Note how AI_ADDRCONFIG is not supported pre-Vista. + Remove superfluous comment. + +2007-02-01 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h: Add IPv6 socket options. + +2007-01-31 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getaddrinfo): Fix thinko in AI_ADDRCONFIG handling. + +2007-01-31 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getaddrinfo): Check ai_flags for valid values. + Handle AI_NUMERICSERV. Handle AI_ADDRCONFIG behaviour on Vista. + * include/netdb.h (AI_NUMERICSERV): Add missing flag. + +2007-01-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::closedir): Add dir name + to debug output. + * syscalls.cc (try_to_bin): Enable code to move file to user specific + recycler dir to eliminate Vista problem. + (unlink_nt): Add comment that rename after opening for delete on close + only fails on XP. + +2007-01-30 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (child_info::child_info): Set msv_count to non-zero + value only on systems requiring it. + +2007-01-28 Corinna Vinschen <corinna@vinschen.de> + + * include/ftw.h: Include sys/cdefs.h. + +2007-01-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Implement rmdir + on NT by calling unlink_nt. Check for directory here. + * syscalls.cc (try_to_bin): Fix buggy debug_printf statement. + (unlink_nt): Make non-static. Don't use delete-on-close semantics on + directories. Explain why. + +2007-01-24 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (if_nametoindex): This time, really free IP_ADAPTER_ADDRESSES + memory. + (if_indextoname): Ditto. + +2007-01-24 Corinna Vinschen <corinna@vinschen.de> + + * security.h (pop_thread_privilege): Revert to previous state, not + to token used for impersonation. + +2007-01-24 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_user::deimpersonate): Always RevertToSelf. + +2007-01-23 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (gai_errmap): Add EAI_OVERFLOW entry. Fix formatting. + (cygwin_gai_strerror): Drop using EAI_MAX. + (w32_to_gai_err): Ditto. + * include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX. + +2007-01-23 Corinna Vinschen <corinna@vinschen.de> + + * include/netdb.h: Add AI_xxx flags available since Vista. + +2007-01-23 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (if_nametoindex): Free IP_ADAPTER_ADDRESSES memory. + (if_indextoname): Ditto. + (if_nameindex): Ditto. Remove duplicate indexed entries in result. + +2007-01-21 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (WSAIoctl): Define. + (SendARP): Define. + * cygwin.din: Export if_freenameindex, if_indextoname, if_nameindex and + if_nametoindex. + * fhandler_procnet.cc: Drop including wchar.h. Drop definitions of + GAA_FLAG_INCLUDE_ALL_INTERFACES, IP_ADAPTER_UNICAST_ADDRESS_VISTA. + (fhandler_procnet::exists): Check for has_gaa_prefixes. Call + get_adapters_addresses here. + (fhandler_procnet::readdir): Ditto. + (prefix): Move to net.cc. + (fhandler_procnet::fill_filebuf): Call get_adapters_addresses here. + Simplify allocation. Use AdapterName rather than FriendlyName as + interface name. Use IfIndex if available, Ipv6IfIndex otherwise. + (in6_are_prefix_equal): Move to net.cc. + * fhandler_socket.cc: Define old SIOCGxxx values. + (CONV_OLD_TO_NEW_SIO): Convert old SIOCGxxx value to new one. + (struct __old_ifreq): Define old struct ifreq. + (fhandler_socket::ioctl): Handle old SIOCGxxx values. Handle new + SIOCGIFFRNDLYNAM command. Simplify copying ifreq data to user space. + Call get_ifconf with additional SOCKET parameter. + * net.cc (IP_ADAPTER_UNICAST_ADDRESS_LH): Define. + (IP_ADAPTER_ADDRESSES_LH): Define. + (SIO_GET_INTERFACE_LIST): Define. + (sockaddr_in6_old): Define. + (sockaddr_gen): Define. + (INTERFACE_INFO): Define. + (IN_LOOPBACK): Define. + (in_are_prefix_equal): New static function. + (ip_addr_prefix): New function, replaces prefix function, add AF_INET + handling. + (GAA_FLAG_INCLUDE_ALL_INTERFACES): Define. + (get_adapters_addresses): New function. + (WS_IFF_xxx): Define Winsock interface flag values. + (convert_ifr_flags): New function to convert Winsock interface flag + values to Cygwin interface flag values. + (get_xp_ifconf): New get_ifconf implementation for XP SP1 and above. + (get_2k_ifconf): Fix interface index. Fix formatting. + (get_nt_ifconf): Fix formatting. + (get_95_ifconf): Ditto. + (get_ifconf): Take additional SOCKET parameter. Call get_xp_ifconf + on XP SP1 and above. + (if_nametoindex): New function. + (if_indextoname): New function. + (if_nameindex): New function. + (if_freenameindex): New function. + (in6_are_prefix_equal): Moved here from fhandler_procnet.cc. + * wincap.cc (wincap_xp): Define has_gaa_prefixes as true by default. + (wincapc::init): Assume has_osversioninfoex by default. Call + GetVersionEx with OSVERSIONINFOEX first. Call with OSVERSIONINFO only + if that fails. Simplify NT4 case and try to avoid strcmp. Check XP + Service Pack using version.wServicePackMajor to avoid strcmp. + * include/asm/socket.h (SIOCGIFFRNDLYNAM): Define. + * include/cygwin/if.h: Fix formatting. + (IFF_POINTTOPOINT): Define. + (IFF_NOARP): Define. + (IFF_LOWER_UP): Define. + (IFF_DORMANT): Define. + (struct if_nameindex): Define. + (IFRF_FRIENDLYNAMESIZ): Define. + (struct ifreq_frndlyname): Define. + (IFNAMSIZ): Redefine as 44. + (IF_NAMESIZE): Define. + (struct ifreq): Redefine ifru_flags as int. Define ifru_data. Pad size + to sizeof sockaddr_in6 for further extensions. + (ifr_data): Define. + (ifr_frndlyname): Define. + (if_nametoindex): Declare. + (if_indextoname): Declare. + (if_nameindex): Declare. + (if_freenameindex): Declare. + * include/cygwin/version.h: Bump API minor number. + (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ): Define check for old vs. new + ifreq structure. + +2007-01-18 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Don't set cwd for non-Cygwin child processes + on NT to allow starting them in virtual directories. + +2007-01-18 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (list::hash): Fix type to __ino64_t. + (list::get_hash): Ditto. + (list::set): Add struct stat parameter. Use that instead of calling + fstat. + (map::get_list_by_fd): Ditto. + (map::add_list): Ditto. + (mmap_is_attached_or_noreserve): Call get_list_by_fd appropriately. + (mmap_worker): Add pameters for map list and file stat information. + Propagate to called functions. + (mmap64): Use fstat on files early. Replace call to GetFileSize. + Call get_list_by_fd and mmap_worker appropriately. + +2007-01-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procnet.cc: Drop declaration of htonl and ntohs. Include + asm/byteorder.h instead. + +2007-01-18 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in6.h: Drop inclusion of asm/byteorder.h. + * fhandler_procnet.cc: Declare htonl and ntohs here. + +2007-01-17 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add fhandler_procnet.o. + * autoload.cc (GetAdaptersAddresses): Define. + * devices.h (FH_PROCNET): Define new device. + * devices.in (dev_procnet_storage): Add "/proc/net" entry. + * devices.cc: Regenerate. + * dir.cc (readdir_worker): Use isproc_dev macro. + * dtable.cc (build_fh_pc): Add FH_PROCNET. + * fhandler.h (class fhandler_procnet): New class. + * fhandler_proc.cc: Add "net" subdirectory handling. + * fhandler_procnet.cc: New file handling "/proc/net" directory. + * path.cc (isvirtual_dev): Move to path.h. + * path.h (isproc_dev): New macro to identify /proc files by device. + (isvirtual_dev): Moved here. Define using isproc_dev. + * syscalls.cc (unlink): Use isproc_dev macro. + * wincap.h (wincapc::has_gaa_prefixes): New element. + (wincapc::has_gaa_on_link_prefix): New element. + * wincap.cc: Implement above elements throughout. + (wincapc::init): Check XP for service pack and set has_gaa_prefixes + appropriately. + * include/cygwin/in6.h: Include asm/byteorder.h. + +2007-01-17 Corinna Vinschen <corinna@vinschen.de> + + * include/asm/socket.h (SIOGIFINDEX): Define. + +2007-01-17 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (MapView9x): Note possible uselessness of retrying. + (MapViewNT): Ditto. + (mmap64): Fix pre-reservation to work for non NULL, non MAP_FIXED. + +2007-01-16 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (RtlAnsiStringToUnicodeString): Define. + (RtlOemStringToUnicodeString): Define. + * ntdll.h (struct _RTL_USER_PROCESS_PARAMETERS): Define. + (struct _PEB): Redefine with a bit of content. + (RtlAnsiStringToUnicodeString): Declare. + (RtlOemStringToUnicodeString): Declare. + * path.cc: Include ntdll.h. + (_upp): New global variable pointing to user process parameter block. + (get_user_proc_parms): New static function to retrieve user process + parameter block. + (close_user_proc_parms_cwd_handle): New function to close handle to + current working directory in user process parameter block. + (cwdstuff::init): Drop redundant declaration of dynamically_loaded. + Set current dir only on 9x. Call close_user_proc_parms_cwd_handle + on NT instead. + (cwdstuff::keep_in_sync): Only on 9x. + (cwdstuff::set): Keep behaviour on 9x. On NT write cwd path into user + process parameter block and set cwd handle to NULL. Fix comments to + reflect new behaviour. + +2007-01-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX. + * net.cc (get_2k_ifconf): Ditto. + (get_nt_ifconf): Fake SIOCGIFINDEX. + (get_95_ifconf): Ditto. + (get_ifconf): Handle SIOCGIFINDEX. Fake it for loopback on systems + not supporting IP Helper Lib. + * include/asm/socket.h (SIOCGIFINDEX): Define. + * include/cygwin/if.h (struct ifreq): Add member for interface index. + (ifr_ifindex): Define. + +2007-01-16 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in6.h (struct ipv6_mreq): Change type of interface + member to uint32_t. + (struct in6_pktinfo): Ditto. + +2007-01-16 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in.h (struct ip_mreq_source): Define. + (struct ip_msfilter): Define. + (IP_MSFILTER_SIZE): Define. + (struct in_pktinfo): Define. + (struct group_req): Define. + (struct group_source_req): Define. + (struct group_filter): Define. + (GROUP_FILTER_SIZE): Define. + (INADDR_ALLRTRS_GROUP): Define. + * include/cygwin/socket.h: Define protocol agnostic multicast options. + +2007-01-15 Corinna Vinschen <corinna@vinschen.de> + + * CYGWIN_LICENSE: Fix web pages and contact information. + +2007-01-15 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: Adjust status definitions. + +2007-01-15 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Add TODO comment. + +2007-01-15 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_SHARING_VIOLATION): Define. + +2007-01-13 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Don't move files to recycle bin which are + not in use. + +2007-01-13 Christopher Faylor <me@cgf.cx> + + * glob.cc: Update copyright notice with latest from FreeBSD. + (glob0): Use correct type for c variable to propagate previously + detected protection. + +2007-01-12 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (_csbrk): Fix off-by-one error. + * cygwin.sc: Give .cygheap a minimum size of 512K. + +2007-01-12 Christopher Faylor <me@cgf.cx> + + * external.cc (sync_winenv): Use cur_environ () rather than + __cygwin_environ. + +2007-01-12 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (child_copy): Add missing Windows PID in debug output. + +2007-01-12 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc: Update copyright. + +2007-01-10 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Pre-Reserve space for the whole mapping to get a + useful, valid address before the actual mappings take place. + Fix typo in comment. + +2007-01-10 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (sync): Use b_drive for B: drive (Thanks to Howard Chu). + +2007-01-09 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (getpagesize): Change condition for clarity. + (getsystempagesize): Ditto. + +2007-01-09 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Do bookkeeping in 4K pages, rather than in 64K chunks. + +2007-01-07 Corinna Vinschen <corinna@vinschen.de> + + * security.h (setacl): Add parameter for writability flag. + * sec_acl.cc (setacl): Ditto. Set to true if any ACE with write + permissions is created. + * fhandler_disk_file.cc (fhandler_disk_file::facl): Reset + FILE_ATTRIBUTE_READONLY if ACL contains an ACE with write permissions. + +2007-01-05 Corinna Vinschen <corinna@vinschen.de> + + * include/strings.h: Don't include string.h. Only declare functions + according to SUSv3. + +2007-01-04 Corinna Vinschen <corinna@vinschen.de> + + (get_ifconf): Set MTU for loopback to more correct value. + +2007-01-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::ioctl): Don't fake results + for SIOCGIFFLAGS here. Call get_ifconf instead. + * net.cc (get_2k_ifconf): Clean up code to generate interface name. + Handle SIOCGIFFLAGS here. + (get_nt_ifconf): Fake SIOCGIFFLAGS here. + (get_95_ifconf): Ditto. + (get_ifconf): Don't fake loopback on systems with IP Helper Lib. + Set MTU for loopback to a more "modern" value. + +2007-01-04 Brian Ford <Brian.Ford@FlightSafety.com> + Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (PREFERRED_IO_BLKSIZE): Define as 64K. + * fhandler.cc (fhandler_base::fstat): Set st_blksize to + PREFERRED_IO_BLKSIZE. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Ditto. + * fhandler_mailslot.cc (fhandler_mailslot::fstat): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::fstat): Ditto. + +2007-01-01 Christopher Faylor <me@cgf.cx> + + * spawn.cc (spawn_guts): Don't expect synchronization from a non-cygwin + _P_NOWAIT process. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2008 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2008 new file mode 100644 index 000000000..313830261 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2008 @@ -0,0 +1,3341 @@ +2008-12-31 Christopher Faylor <me+cygwin@cgf.cx> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 191. + +2008-12-31 Christopher Faylor <me+cygwin@cgf.cx> + + * glob_pattern_p.cc: New file. + * Makefile.in (DLL_OFILES): Add glob_pattern_p.o. + * glob.h: Add declaration for glob_pattern_p. + + * pinfo.cc (pinfo::thisproc): Remove __stdcall attribute. + +2008-12-30 Christopher Faylor <me+cygwin@cgf.cx> + + * include/bits/wordsize.h: New linux-compatibility header. + +2008-12-30 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (try_to_debug): Avoid creating a huge buffer on the + stack. + +2008-12-25 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc: Change comment. + (smb_extended_info): Move here from path.cc. + (fs_info::update): Ditto. + (mount_info::create_root_entry): Delay conversion to slashes and use + passed in buffer to figure out fs type. + * path.cc (smb_extended_info): Move. + (fs_info::update): Ditto. + * mount.h: New file. Move mount information here. + * path.h: (fs_info::update): Move. + * shared_info.h (mount_item): Ditto. + +2008-12-24 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (symlink_info::check_shortcut): Ensure that symlink handle is + closed on successful return. + +2008-12-23 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_base_setup_overlapped): Add new argument. + (fhandler_base::get_overlapped_buffer): Declare new function. + (fhandler_base::set_overlapped): Ditto. + (fhandler_pipe::overlapped): New variable. + (fhandler_pipe::get_overlapped): Rework to return contents of + overlapped variable. + (fhandler_pipe::set_overlapped): Set overlapped variable based on + argument. + (fhandler_fifo::get_overlapped_buffer): Return pointer to io_status. + * fhandler.cc (handler_base::setup_overlapped): Set to overlapped + pointer to NULL if new doit parameter is false. Otherwise set up + overlapped event as usual. + (fhandler_base::wait_overlapped): Return inres if this isn't an + overlapped operation. + (fhandler_base::read_overlapped): Remove inappropriate asserts. + * pipe.cc (fhandler_pipe::fhandler_pipe): Zero overlapped element. + (struct pipesync): Delete. + (getov_result): Ditto. + (pipe_handler): Ditto. + (pipesync::pipesync): Ditto. + (fhandler_pipe::init): Don't set up pipesync thread. Just pass + opened_properly flag along to overlapped setup. + +2008-12-22 Christopher Faylor <me+cygwin@cgf.cx> + + * pipe.cc (getov_result): Minor cleanup. + +2008-12-20 Christopher Faylor <me+cygwin@cgf.cx> + + * pipe.cc (getov_result): Add parameters to facilitate better EOF + checking. + (pipe_handler): Pass extra arguments to getov_result. + +2008-12-20 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Reorganize to eliminate + gotos and to hopefully eliminate one race when a signal is detected or + there is a WFMO error. + +2008-12-20 Christopher Faylor <me+cygwin@cgf.cx> + + * pinfo.h (pinfo::thisproc): Declare. Rename from set_myself. + * pinfo.cc (pinfo::thisproc): Define. Rename from set_myself. Set + procinfo to NULL to avoid confusing subsequent init. + (pinfo_init): Accommodate set_myself -> pinfo::thisproc rename. + * dcrt0.cc (child_info_fork::handle_fork): Ditto. + (child_info_spawn::handle_spawn): Ditto. + +2008-12-20 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h (pwdgrp::refresh): Fix indentation. + * uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated + read. Drop local variable off. + +2008-12-19 Christopher Faylor <me+cygwin@cgf.cx> + + * pinfo.cc (pinfo_basic): New class. + (pinfo_basic::pinfo_basic): Define constructor for new class. + (myself): Initialize from myself_initial. + (set_myself): Set pid and progname from already myself_initial. + * strace.cc (strace::strace): Split apart strace::hello. Send + notification to strace as early as possible. + (strace::hello): Just send clause which describes the current process. + This can now be preceded by early initialization strace output. + * include/sys/strace.h (strace::strace): Declare new constructor. + +2008-12-19 Christian Franke <franke@computer.org> + + * fhandler_registry.cc (perf_data_files): New table. + (PERF_DATA_FILE_COUNT): New constant. + (fhandler_registry::exists): Add check for HKEY_PERFORMANCE_DATA + value names. + (fhandler_registry::fstat): For HKEY_PERFORMANCE_DATA, return + default values only. + (fhandler_registry::readdir): For HKEY_PERFORMANCE_DATA, list + names from perf_data_files only. + (fhandler_registry::fill_filebuf): Use larger buffer to speed up + access to HKEY_PERFORMANCE_DATA values. Remove check for possible + subkey. Add RegCloseKey (). + (open_key): Replace goto by break, remove label. Do not try to + open subkey of HKEY_PERFORMANCE_DATA. Add missing RegCloseKey () + after open subkey error. + +2008-12-19 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Handle incoming DOS paths non-POSIXy, + always case-insensitive, always ignoring ACLs. + +2008-12-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc: Set 4th parameter of NtQueryDirectoryFile to + NULL throughout. + (fhandler_disk_file::facl): Fix a condition so that fstat_by_handle + is actually used. + (fhandler_disk_file::readdir): Don't print debug message on a simple + STATUS_NO_MORE_FILES status code. + +2008-12-18 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlin_info::check): Set 4th parameter of + NtQueryDirectoryFile to NULL instead of 0 since it's a pointer. + Simplify label and break from loop handling in symlink evaluation + conditional expression. Drop a now useless break statement. Fix + behaviour when searching for `foo' and then finding a `foo.lnk' + which is no shortcut. + +2008-12-16 Christian Franke <franke@computer.org> + + * fhandler_registry.cc (DEFAULT_VALUE_NAME): Remove constant. + (encode_regname): Encode empty (default) name to "@". + Encode "@" to "%40". Change error return to -1. + (decode_regname): Decode "@" to empty name. Decode "%40" to "@". + (fhandler_registry::exists): Skip check for keys if name is empty. + Remove check for DEFAULT_VALUE_NAME, now handled by decode_regname (). + (fhandler_registry::readdir): Remove check for empty name, now + handled by encode_regname (). + (fhandler_registry::open): Remove check for DEFAULT_VALUE_NAME. + (fhandler_registry::open_key): Fail with ENOENT if key name is empty. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (gen_full_path_at): Use isabspath instead of isdirsep + to recognize absolute path. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (open_local_policy): Set lsa handle to + INVALID_HANDLE_VALUE when LsaOpenPolicy fails. Explain why. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * setlsapwd.cc (setlsapwd): Simplify code. Only try to call cygserver + if opening local policy fails. Don't treat removing non-existant + private data as error. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * setlsapwd.cc (setlsapwd): Explicitely erase password buffer content + after usage. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (fhandler_registry::exists): Handle EACCES. + (fhandler_registry::open): Ditto. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export fgetwc, fgetws, fputwc, fputws, fwide, getwc, + getwchar, putwc, putwchar, ungetwc. + * posix.sgml: Move above functions (add missing) into "implemented + SUSv3" section. + * include/cygwin/version.h: Bump api minor number. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_registry): Declare dup method. + * fhandler_registry.cc (fhandler_registry::exists): Fix missing + parenthesis. + (fhandler_registry::dup): New method. + +2008-12-14 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_disk_file.cc (readdir_get_ino): Don't complain about MS-DOS + paths since the function could be fed one by an internal call. + +2008-12-13 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.cc (cygheap_user::~cygheap_user): Remove unneeded if 0'ed + code. + + * fhandler_registry.cc (fhandler_registry::exists): Recode goto as + if/else to avoid a gcc4 compiler warning. + (fhandler_registry::open): Ditto. Use one goto rather than two. + + * gentls_offsets: Fix compiler warning in generated output. + * tlsoffsets.h: Regenerate. + + * mount.cc (fillout_mntent): slashify native paths returned via + getmntent. + +2008-12-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * resolv.h: #include <netinet/in.h> for sockaddr_in typedef. + +2008-12-07 Christian Franke <franke@computer.org> + + * fhandler_registry.cc (encode_regname): Add Parameter add_val. + Append "%val" if add_val is set. + (decode_regname): Remove trailing "%val". Change returncode accordingly. + (__DIR_hash): New class. + (d_hash): New macro. + (key_exists): New function. + (fhandler_registry::exists): Remove encode of registry name before path + compare, decode file part of path instead. Skip checks for keys if + trailing "%val" detected. + (fhandler_registry::fstat): Change check of return value of + decode_regname (). + (fhandler_registry::readdir): Allocate __DIR_hash. Record key names in + hash table. Append "%val" if key with same name exists. Fix error + handling of encode_regname (). Set dirent.d_type. + (fhandler_registry::closedir): Delete __DIR_hash. + (fhandler_registry::open): Don't open key if trailing "%val" detected + by decode_regname (). + (open_key): Ditto. + +2008-12-03 Pierre A. Humblet <Pierre.Humblet@ieee.org> + + * libc/minires.c (open_sock): Set non blocking and close on exec. + (res_ninit): Set id pseudo-randomly. + (res_nsend): Do not set close on exec. Initialize server from id. + Flush socket. Tighten rules for answer acceptance. + (res_nmkquery): Update id using current data. + +2008-12-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (must_encode): Fix condition changed for testing. + +2008-12-01 Christian Franke <franke@computer.org> + + * fhandler_registry.cc (must_encode): New function. + (encode_regname): Ditto. + (decode_regname): Ditto. + (fhandler_registry::exists): Encode name before path compare. + (fhandler_registry::fstat): Pass decoded name to win32 registry call. + (fhandler_registry::readdir): Return encoded name to user. + (fhandler_registry::open): Store decoded name into value_name. + (open_key): Pass decoded name to win32 registry call + +2008-11-28 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.c (sigpacket::process): Set tls on return since it is + assumed to be set to a valid value by the caller. + +2008-11-28 Christopher Faylor <me+cygwin@cgf.cx> + + * include/cygwin/version.h: Bump api minor number to 189 to flag the + implementation of dirent.d_type. + +2008-11-28 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (sigpacket::process): Rework previous change. tls + could still become NULL. + +2008-11-28 Christian Franke <franke@computer.org> + + * dir.cc (readdir_worker): Initialize dirent.d_type and __d_unused1. + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): + Set dirent.d_type based on FILE_ATTRIBUTE_*. + * include/sys/dirent.h: Define _DIRENT_HAVE_D_TYPE (enables DT_* + declarations). + (struct dirent): Add d_type. Adjust __d_unused1 size to preserve layout. + +2008-11-27 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (sigpacket::process): Make sure that 'tls' is never + NULL when used. + +2008-11-26 Christopher Faylor <me+cygwin@cgf.cx> + + Remove unneeded whitespace throughout. + + * fhandler_fifo.cc (fhandler_fifo::open): Rework to cause errno to be + set to ENXIO when opening a fifo write/nonblocking. + + * environ.cc (ucreqenv): Rename to ucenv. Move code from old ucenv + here and conditionalize it on create_upcaseenv. + (ucenv): Delete. + (environ_init): Fix compiler warning by moving create_upcaseenv test to + ucenv. Don't bother checking for child_proc_info when calling ucenv + since it is assumed to be NULL at the point where the function is + called. + + * path.cc (symlink_worker): Turn off MS-DOS path warnings when dealing + with devices since the device handler passes in a translated MS-DOS + path. + + * sec_auth.cc (lsaprivkeyauth): Avoid variable initialization which + causes a compiler error. + + * fhandler_netdrive.cc: Update copyright. + +2008-11-26 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add setlsapwd.o. + * cygserver.h (CYGWIN_SERVER_VERSION_API): Bump. + (request_code_t): Define CYGSERVER_REQUEST_SETPWD request type. + * cygserver_msg.h (client_request_msg::retval): Use default value of -1 + for retval if msglen is 0. + * cygserver_sem.h (client_request_sem::retval): Ditto. + * cygserver_shm.h (client_request_shm::retval): Ditto. + * cygserver_setpwd.h: New file. + * external.cc (cygwin_internal): Implement new CW_SET_PRIV_KEY type. + * sec_auth.cc (open_local_policy): Make externally available. + Get ACCESS_MASK as argument. + (create_token): Accommodate change to open_local_policy. + (lsaauth): Ditto. + (lsaprivkeyauth): New function fetching token by retrieving + password stored in Cygwin or Interix LSA private data area and + calling LogonUser with it. + * security.h (lsaprivkeyauth): Declare. + (open_local_policy): Declare. + * setlsapwd.cc: New file implementing setting LSA private data password + using LsaStorePrivateData or by calling cygserver if available. + * syscalls.cc (seteuid32): Add workaround to get the original token + when switching back to the original privileged user, even if + setgroups group list is still active. Add long comment to explain why. + Call lsaprivkeyauth first, only if that fails call lsaauth or + create_token. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_SET_PRIV_KEY. + +2008-11-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Drop + initialization of bytes_to_read. Set bytes_to_read to len in + non-buffered case. Call read_bytes correctly with bytes_to_read + instead of len. + +2008-11-21 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (MapView): Add NT status to debug output. + +2008-11-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetSystemDEPPolicy): Define. + (GetProcessDEPPolicy): Ditto. + (SetProcessDEPPolicy): Ditto. + * dcrt0.cc (disable_dep): New static function. + (dll_crt0_0): Call disable_dep on platforms requiring it. Add longish + comment to explain the circumstances. + * wincap.h (wincaps::ts_has_dep_problem): New element. + * wincap.cc: Implement above element throughout. + (wincapc::init): Set ts_has_dep_problem to true on 2008 Terminal + Servers. + * winsup.h (WINVER): Set to 0x0601. + +2008-11-11 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::cygdrive_win32_path): Always upper case + DOS drive letter to accommodate case sensitivity. + (cygdrive_getmntent): Ditto. + * path.cc (path_conv::check): Invalidate wide_path after making path + relative. + +2008-11-11 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (create_upcaseenv): New static variable. + (renv_arr): New static array to keep track of environment variables + which have to be always uppercased. + (idx_arr): Ditto. + (start_at): Ditto. + (ucreqenv): New function to uppercase only the environment variables + from renv_arr. + (parse_thing): Add "upcaseenv" setting. + (environ_init): Parse $CYGWIN before doing anything else. Call + ucreqenv instead of ucenv if CYGWIN=noupcaseenv is set. + +2008-11-10 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (normalize_win32_path): Don't add a trailing '\' if the cwd + returns a path with a trailing '\'. + +2008-11-07 Christopher Faylor <me+cygwin@cgf.cx> + + * pthread.cc (pthread_mutex::_unlock): Avoid unlocking a mutex if the + recursion_counter is already 0. + (pthread_mutex::_destroy): Don't consider a mutex busy if its + recursion_counter == 0. + (pthread_mutex::_fixup_after_fork): Set recursion_counter to 0 to flag + that we've just forked. Don't reset the owner of this mutex since the + forkee may think it still owns the mutex. Reinstate initialization of + win32_obj_id. + + * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Initialize a + variable to bypass a C++ warning. + +2008-11-05 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (environ_init): Avoid evaluating $CYGWIN twice. + +2008-10-23 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (all wincaps): Store in .cygwin_dll_common section same as + wincap. Add comment to explain why. + +2008-10-22 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetSystemWindowsDirectoryW): Define. + * kernel32.cc (GetWindowsDirectoryW): Implement to abstract from + running under Terminal Services or not. + (GetWindowsDirectoryA): Ditto. + +2008-10-21 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (pwdgrp::read_passwd): Check if we're called within + user_shared initialization and ignore myself, if so. Reformat + conditional expression. + +2008-10-20 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (NtSetAttributesFile): New inline function. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Use + NtSetAttributesFile. + * path.cc (symlink_worker): Ditto. + * syscalls.cc (unlink_nt): Ditto. + (rename): Omit FILE_SHARE_DELETE when opening files on Samba. Add + comment to explain why. + +2008-10-17 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::get_debugger_info): Call SetStdHandle + for the newly opened handle. Explain why. + (dtable::stdio_init): Don't duplicate standard error handle + when stderr has already been created under debugger control. + +2008-10-13 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Align standard owner and group permissions + with alloc_sd. Strip FILE_READ_ATTRIBUTES fromn setting + FILE_GENERIC_EXECUTE permissions same as in alloc_sd. + * security.cc (alloc_sd): Reformat expression. Strip EA permission + bits from owner_deny and group_deny computation. + +2008-10-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Check + for executable suffixes here in case we're on a file system + not supporting permission. + * path.cc (path_conv::check): Drop check for executable suffixes. + +2008-10-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of + current position in non-buffered case, too. + +2008-10-09 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (pwdgrp::read_group): Generate more speaking group name + if passwd gid exists under different gid in /etc/group. + +2008-10-09 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::is_binary): Always check for GetBinaryType. + * syscalls.cc (rename): Fix test for just changing case of name on + case insensitive filesystems. + +2008-10-09 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_shortcut): Don't check for executability + here. + (symlink_info::check_sysfile): Ditto. + +2008-10-08 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Only assume executability by suffix + on file systems not supporting permissions. + +2008-10-07 Christopher Faylor <me+cygwin@cgf.cx> + + * pthread.cc (pthread_create): Very minor formatting change. + * timer.cc (timer_thread): Ensure that any created thread defaults to + detached state. + +2008-10-06 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.h (_cygtls::initialized): Remove bogus stack check which would + crash when checking the current thread from the current thread. + * tlsoffsets.h: Regenerate. + +2008-10-05 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_0): Don't initialize signals early when + dynamically loaded. + (dll_crt0_1): Wait until this phase to initialize signals when + dynamically loaded. + +2008-09-29 Christopher Faylor <me+cygwin@cgf.cx> + + * thread.cc (pthread_mutex::_fixup_after_fork): Reinstate DEBUGGING + conditional. + +2008-09-29 Christopher Faylor <me+cygwin@cgf.cx> + + * thread.cc (pthread_mutex::_fixup_after_fork): Just reset lock to + pristine state after fork. Don't recreate a mutex since it may not + actually be needed. + +2008-09-29 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (inode_t::get_all_locks_list): Fix typo. + * posix.sgml: Add cfmakeraw to list of implemented BSD functions. + +2008-09-19 Eric Blake <ebb9@byu.net> + + * errno.cc (_sys_errlist): Add ECANCELED, ENOTRECOVERABLE, + EOWNERDEAD. + +2008-09-15 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.h (unionent): Move from net.cc. + (unionent::struct_type): Move enum here. + (_local_storage::hostent_buf): Define as unionent. + (_local_storage::protoent_buf): Ditto. + (_local_storage::servent_buf): Ditto. + * net.cc (unionent): Move to cygtls.h. + (struct_type): Ditto. + (dup_ent): Define one function per {host,proto,serv}ent type. + (cygwin_getprotobyname): Simplify dup_ent call. Removed now-unneeded + return type coercion. + (cygwin_getprotobynumber): Ditto. + (cygwin_getservbyname): Ditto. + (cygwin_getservbyport): Ditto. + (cygwin_gethostbyname): Ditto. + (cygwin_gethostbyaddr): Ditto. + tlsoffsets.h: Regenerate. + +2008-09-12 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Add -c option which is now removed from COMPILE_C*. + * cygwin.din (cfmakeraw): Export. + * termios.cc (cfmakeraw): Implement. + * include/sys/termios.h (cfmakeraw): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2008-09-11 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin.din (sys_sigabbrev): Add this here. + * dcrt0.cc (__argc,__argv,_check_for_executable): Remove dllexport + decoration since it is already handled in cygwin.din. + * errno.cc (_sys_errlist): Ditto. + * strsig.cc (sys_sigabbrev): Ditto. + * include/cygwin/signal.h: Protect use of dllimport when + __INSIDE_CYGWIN__. + * libc/getopt.c: Revert previous changes. Define __INSIDE_CYGWIN__. + +2008-09-11 Christopher Faylor <me+cygwin@cgf.cx> + + * localtime.cc (increment_overflow): Mark as non-inline to prevent + compiler from complaining about the very thing we're trying to test. + * ntea.cc (read_ea): Reorganize to avoid a new compiler warning/error. + * sched.cc (sched_rr_get_interval): Ditto. + * select.cc (peek_serial): Ditto. + * libc/rexec.cc (ruserpass): Ditto. + * posix_ipc.cc (ipc_names): Make static to avoid a compiler warning + (and it's the right thing to do anyway). + +2008-09-11 Christopher Faylor <me+cygwin@cgf.cx> + + * net.cc (in6addr_any, in6addr_loopback): Add appropriate number of + braces around initializer. + (dup_ent): Try harder to coerce the first argument to deal with more + stringent compiler. + (get_2k_ifs): Remove extraneous typedef. + (get_2k_ifs): Reorganize expression to avoid a compiler warning. + (get_xp_ifs): Ditto. + (get_nt_ifs): Ditto. + +2008-09-11 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_pipe::raw_read): Remove __stdcall decoration. + * pipe.cc (fhandler_pipe::raw_read): Ditto. + +2008-09-11 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.cc (creturn): Reorganize to avoid a new compiler + warning/error. + * dtable.cc (handle_to_fn): Ditto. + * fhandler_console.cc (fhandler_console::read): Ditto. + (fhandler_console::scroll_screen): Ditto. + (dev_console::set_color): Ditto. + * fhandler_dsp.cc (fhandler_dev_dsp::write): Ditto. + (fhandler_dev_dsp::read): Ditto. + * fhandler_tape.cc (mtinfo_drive::get_status): Ditto. + * hookapi.cc (find_first_notloaded_dll): Ditto. + * mmap.cc (msync): Ditto. + * pipe.cc (pipesync::pipesync): Ditto. + * sec_acl.cc (getace): Ditto. + * sec_auth.cc (create_token): Ditto. + (lsaauth): Ditto. + * select.cc (peek_pipe): Ditto. + * spawn.cc (av::fixup): Ditto. + * syscalls.cc (popen): Ditto. + * tty.cc (tty::init_session): Ditto. + * uinfo.cc (pwdgrp::load): Ditto. + * fhandler.cc (fhandler_base::setup_overlapped): Ditto. + (fhandler_base::wait_overlapped): Rename second use of res variable to + wres or errors are not returned correctly. + * dcrt0.cc: Remove obsolete variable. + * dll_init.cc (release_upto): Fix typo involving incorrect use of '|'. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Avoid a + compiler warning regarding coercing type-punned variables. + (fhandler_base::fstat_by_name): Ditto. + * fhandler_fifo.cc (fhandler_fifo::open_nonserver): Fix = vs. == typo. + (fhandler_fifo::wait): Add all conditions to switch statement to avoid + a compiler warning. + * fhandler_process.cc: Avoid unneeded initialization of variables to + zero. + * fhandler_socket.cc (fhandler_socket::listen): Add braces around + initializer. + * flock.cc (inode_t::get_all_locks_list): Reorganize to avoid a + compiler warning. Fix problem with EWOULDBLOCK error return. + * path.cc (GUID_shortcut): Use braces around struct initializer. + (cygwin_conv_path): Reorganize to avoid a compiler warning. + * random.cc (dummy): Mark variable as volatile to avoid a "used + uninitialized" warning. + * libc/getopt.c: Mark some variables as dllexport although gcc doesn't + seem to do the right thing with them. + * libc/minires-os-if.c (get_registry_dns_items): Coerce some function + arguments to avoid a compiler warning. + +2008-08-27 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_tty.cc (close_maybe): Check for both types of invalid handle + before attempting CloseHandle. + (fhandler_pty_master::setup): Only set inheritance on pty handles, not + tty handles. + +2008-08-26 Christopher Faylor <me+cygwin@cgf.cx> + + * shared_info.h (shared_info::create_root_entry): Remove extraneous + mount_info:: from declaration. + +2008-08-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_pipe): Rename read and write + declarations to raw_read and raw_write. + * pipe.cc (fhandler_pipe::raw_read): Rename from read. + (fhandler_pipe::raw_write): Rename from write. + +2008-08-21 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Reorganize again to + accommodate what appears to be an MSDN hint about not resetting the + overlapped event prior to calling GetOverlappedResult. + +2008-08-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_shortcut): If file can't be opened, + treat it as non-symlink rather than generating an EIO error. + (symlink_info::check_sysfile): Ditto. + +2008-08-19 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Always assume that + bytes will be non-NULL. Distinguish input result from result derived + from WFMO and GetOverlappedResult or res can never be -1. Only raise + SIGPIPE when writing. + * fhandler.h (fhandler_base::wait_overlapped): Pass first argument by + value. + * fhandler_fifo.cc (fhandler_fifo::wait): Pass in dummy byte count to + wait_overlapped. + * pipe.cc (DEFAULT_PIPEBUFSIZE): Define to 65536 explicitly. + +2008-08-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Drop fattr variable + and use FILE_ATTRIBUTE_DIRECTORY directly in call to NtCreateFile. + * posix_ipc.cc (ipc_mutex_init): Fix format string when creating IPC + object name. + (ipc_cond_init): Ditto. + * security.cc (alloc_sd): Add parentheses to fix setting initial + owner_allow value. + +2008-08-18 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Don't treat + ERROR_BROKEN_PIPE as a non-error. Do raise SIGPIPE when it is + detected. + +2008-08-15 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::get_mounts_here): Don't subtract 2 from + Length if it's 0 anyway. + +2008-08-15 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::create_root_entry): Create default cygdrive + prefix with MOUNT_NOPOSIX flag. + +2008-08-15 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Don't use eabuf when trying to open + file a second time. Call NtOpenFile instead of NtCreateFile in this + case. + +2008-08-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Fix linking + against symlinks. + +2008-08-14 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Call set_security_attribute with + additional path_conv argument. + * fhandler.cc (fhandler_base::open): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Never set DOS + R/O attribute when using ACLs. + (fhandler_disk_file::mkdir): Ditto. Set + security descriptor on remote dirs after creating the dir, same as in + fhandler_base::open. + * fhandler_socket.cc (fhandler_socket::bind): Ditto for remote AF_LOCAL + socket files. + * path.cc (symlink_worker): Ditto. for remote symlinks. + * security.cc (alloc_sd): Take additional path_conv argument. + Accommodate throughout. Drop setting FILE_WRITE_EA/FILE_READ_EA + flags unconditionally (was only necessary for "ntea"). Don't set + FILE_READ_ATTRIBUTES and FILE_WRITE_ATTRIBUTES unconditionally on + Samba. Add comment to explain. Drop useless setting of + STANDARD_RIGHTS_WRITE, it's in FILE_GENERIC_WRITE anyway. + Remove FILE_READ_ATTRIBUTES bit from FILE_GENERIC_EXECUTE so as not + to enforce read permissions on Samba. + (set_security_attribute): Take additional path_conv argument. + * security.h (set_security_attribute): Change prototype accordingly. + +2008-08-13 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fillout_mntent): Always print noumount option last. + +2008-08-13 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fillout_mntent): Print options as taken in fstab and mount. + +2008-08-13 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc: Throughout convert to use long pathnames. + * dll_init.h (struct dll): Change name to WCHAR, change operator [] to + take PWCHAR argument. + +2008-08-11 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): If newpath doesn't exist, check if .exe suffix + in oldpath has been omitted before appending .exe to newpath. + +2008-08-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Don't set + eom_detected when EOF is detected, thus returning 0 instead of + setting errno to ENOSPC. + +2008-08-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Use Samba workaround generally + for all remote filesystems supporting ACLs. Change comment and + explain why. Refer to the discussion which led to this. + +2008-08-05 Brian Dessent <brian@dessent.net> + + * config/i386/profile.h (mcount): Mark asms volatile. + +2008-08-05 Christopher Faylor <me+cygwin@cgf.cx> + + * dll_init.cc (dll_global_dtors): Add an additional test to avoid + walking the linked list if it is empty. + (dll_list::detach): Don't set dll_global_dtors_recorded if we aren't + actually going to record any dlls. + +2008-08-04 Christopher Faylor <me+cygwin@cgf.cx> + + Changes suggested by Dave Korn. + * dcrt0.cc (cygwin_exit): Remove (hopefully) extraneous call to + dll_global_dtors. + * dll_init.cc (dll_global_dtors): Run destructors in reverse + dependency/load order. + * dll_init.h (dll_list): Add dll_global_dtors as a friend. + +2008-08-01 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Add a symbol denoting return from call to + main(). + * exceptions.cc (stack_info::walk): Stop walking the stack when we + hit _cygwin_exit_return rather than just blindly stopping when PC + becomes zero. + +2008-07-31 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Handle (and explain) a special case + when accessing files matching DOS device names on SMB shares. + +2008-07-31 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Check constructed short pathname for being + a DOS device name and fall back to long path name, if so. + +2008-07-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_name): Check for + file systems incapable of handling FileIdBothDirectoryInformation + correctly. + (fhandler_disk_file::opendir): Ditto. + * path.cc (fs_info::update): Always clear at the start. + Rearrange to make certain tests only on non-Samba, non-NFS remote + drives. + Add test for file systems known to be incapable of handling + FileIdBothDirectoryInformation correctly. Right now that's just + "UNIXFS". + * path.h (struct fs_info): Add has_buggy_fileid_dirinfo flag and + accessor methods. + (class path_conv): Add has_buggy_fileid_dirinfo method. + +2008-07-30 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (extract_nt_dom_user): Return domain and user name as + WCHAR. + (cygwin_logon_user): Accommodate above change. Convert password to + WCHAR and call LogonUserW. + * external.cc (cygwin_internal): Accommodate above change. + * security.h (extract_nt_dom_user): Change prototype accordingly. + +2008-07-30 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin.din (_getutline): Remove. + * lib/bsdlib.cc (login): Make argument const as per linux. + (logout): Ditto. + * syscalls.cc (getutid): Ditto. + (getutline): Ditto. + (pututline): Ditto. + (getutxent): Add comment mentioning non-thread-safety. + (getutxid): Ditto. + (getutxline): Ditto. + (pututxline): Ditto. + * sys/utmp.h: Declare arguments to various functions as const as per + linux. Remove bogus _getutline definition. + +2008-07-29 Christopher Faylor <me+cygwin@cgf.cx> + + * include/cygwin/version.h: Add comment indicating that current API number + bump also has another consequence. + +2008-07-29 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Remove v8 regexp files. + (OBSOLETE_FUNCTIONS): Remove v8 regexp functions. + (NEW_FUNCTIONS): Remove POSIX regex functions. + * cygwin.din: Export POSIX regex functions with their correct symbol + name. Export with posix_ prefix for backward compatibility. + * syscalls.cc (regfree): Remove ancient fake function. + * regex/regex.h: Remove renaming regex functions within Cygwin. + * regexp/*: Remove. + * include/cygwin/version.h: Bump API minor number. + +2008-07-27 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_0): Remove calling malloc_init and + user_shared_initialize_1 from here. + (dll_crt0_1): Remove dynamically_loaded check. Just call malloc_init + and user_shared_initialize unconditionally. + * shared.cc (user_shared_create): Rename from user_shared_initialize. + (user_shared_initialize): Rename from user_shared_initialize_1. Move + complete user_shared content initialization code here from + user_shared_create. + * syscalls.cc (seteuid32): Remove call to user_shared_initialize_1. + That is implied by the "true" argument to user_shared_create(). + +2008-07-27 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::init): Add location where we're looking for + fstab to temporary message. + + * lib/cygwin_crt0.c (cygwin_crt0): Simplify by eliminating + accommodations for ancient cygwin DLLs. + * lib/crt0.h: Include <windows.h> directly since it is needed. + +2008-07-27 Christopher Faylor <me+cygwin@cgf.cx> + + * shared_info.h (shared_destroy): Declare. + * shared.cc (shared_destroy): Define new function to destroy shared + memory regions. + * init.cc (dll_entry): Call shared_destroy when dll detaches from the + process. + +2008-07-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::send_internal): Send never more + then 64K bytes at once. For blocking sockets, loop until entire data + has been sent or an error occurs. + (fhandler_socket::sendto): Drop code which sends on 64K bytes. + (fhandler_socket::sendmsg): Ditto. + +2008-07-26 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_master::setup): Reorganize so that all + operations for each end of the pipe are grouped together. + +2008-07-25 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Call malloc_init and user_shared_initialize_1 + only in non-dynamically loaded case. + +2008-07-25 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1 + here in case we're dynamically loaded. Explain why. + (dll_crt0_1): Call user_shared_initialize_1 from here. + * mount.cc (is_native_path): New inline function testing for native + and long Win32 path prefix. + (is_unc_share): Remove long WIn32 path prefix test. + (mount_info::create_root_entry): Use PATH_MAX buffer. + (mount_info::init): Ditto. + (mount_info::add_item): Test for is_native_path as well. + * path.cc (normalize_win32_path): Simplify native path prefix code. + * shared.cc (user_shared_initialize_1): New function taking user + shared initialization code relying on malloc and cygtls. + (user_shared_initialize): Move mountinfo initialization to + user_shared_initialize_1. + * shared_info.h (user_shared_initialize_1): Declare. + * syscalls.cc (seteuid32): Call user_shared_initialize_1 after user + changed. + +2008-07-24 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab): Change system_printf to + debug_printf on NtOpenFile failure. + +2008-07-24 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (user_shared_initialize): Fetch potentially changed Cygwin + username from /etc/passwd before loading mount table. + (shared_info::init_installation_root): New function fetching Cygwin's + installation root dir and storing as native NT path in global shared + memory. + (shared_info::initialize): Call init_installation_root exactly once at + first startup. + * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. + (CURR_SHARED_MAGIC): Ditto. + (class shared_info): Add installation_root member. + (shared_info::init_installation_root): Declare. + + * grp.cc (pwdgrp::read_group): Call pwdgrp::load with native WCHAR path. + * passwd.cc (pwdgrp::read_passwd): Ditto. Avoid recursion. + (etc::init): Take POBJECT_ATTRIBUTES instead of path_conv. + * path.h (etc::init): Change prototype accordingly. + * pwdgrp.h (class pwdgrp): Store path as UNICODE_STRING/PWCHAR instead + of as path_conv. + (pwdgrp::load): Accommodate prototype. + * uinfo.cc (pwdgrp::load): Change argument type from char to wchar_t. + Create native NT path here instead of calling path_conv. + + * mount.cc (find_root_from_cygwin_dll): Drop in favor of global + initializaion in shared_info. + (mount_info::init): Fetch native NT root dir from cygwin_shared. + (mount_info::from_fstab): Expect native NT path and use native NT + functions to access file. Convert username part in user fstab path + according to special char transformation rules. + * path.cc (tfx_chars): Convert slash to backslash. + (transform_chars): Implement for path given as PWCHAR. + (transform_chars): PUNICODE_STRING version calls PWCHAR version. + Remove useless commented code. + +2008-07-22 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Fix previous patch for UNC paths. + +2008-07-22 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Remove long path prefix from win32 path + before calling CreateProcess if path length is < MAX_PATH. + +2008-07-22 Corinna Vinschen <corinna@vinschen.de> + + * include/ctype.h: Declare __ctype_ptr__ to keep newlib build happy. + +2008-07-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (WNetGetProviderNameA): Define. + (WNetGetResourceParentA): Remove. + * fhandler_netdrive.cc (struct net_hdls): New structure to keep + WNet handles. Stored in dir->__handle throughout. + (thread_netdrive): Rewrite to enumerate all servers in all accessible + domains and workgroups. + (fhandler_netdrive::readdir): Simplify toplevel code. Lowercase all + server names in toplevel. + (fhandler_netdrive::rewinddir): Close all WNet handles and free + net_hdls structure. + +2008-07-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Rename x to fh. On Samba, always + create file with NULL security descriptor and set the permissions + afterwards. Explain why. + +2008-07-18 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (known): Remove "binmode" option. + * fhandler.cc (binmode): Remove. + (fhandler_base::set_flags): Accommodate binmode removal. + * path.h (path_conv::set_binary): Remove. + * pipe.cc (pipe): Create pipes always as binary pipes. + * winsup.h (binmode): Remove declaration. + +2008-07-17 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab_line): Default to binary mount. + +2008-07-16 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (allow_winsymlinks): Revert default to create system bit + symlinks for speed. + +2008-07-16 Corinna Vinschen <corinna@vinschen.de> + + Add case-sensitivity. + Unconditionally handle mount points case-sensitive. + Unconditionally handle virtual paths case-sensitive. + Unconditionally handle registry paths case-insensitive. + Otherwise, accommodate case-sensitivity of given path throughout. + * cygheap.cc (cygheap_root::set): Get additional caseinsensitive + parameter and store it. + * cygheap.h (struct cygheap_root_mount_info): Add member + caseinsensitive. + * dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call + to path_conv::check. + * environ.cc (pcheck_case): Remove. + (check_case_init): Remove. + (known): Drop "check_case" option. + * exceptions.cc (open_stackdumpfile): Add comment. + * fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch + instead of strcasematch. + * fhandler_disk_file.cc: Accommodate case-sensitivity of given path + throughout. + (__DIR_mounts::check_mount): Unconditionally check virtual paths + case-sensitive. + (fhandler_disk_file::link): Drop case clash handling. + (fhandler_disk_file::open): Ditto. + (fhandler_disk_file::readdir_helper): Drop managed mount code. + * mount.cc: Remove managed mount code and datastructures. + (struct opt): Remove "managed" option. Add "posix=0" and "posix=1" + options. + (fillout_mntent): Remove "managed" output. Add "posix" output. + * path.cc (struct symlink_info): Remove case_clash member and + case_check method. + (pcheck_case): Remove. + (path_prefix_p): Take additional bool parameter "caseinsensitive". + (pathnmatch): Ditto. + (pathmatch): Ditto. + (mkrelpath): Ditto. + (fs_info::update): Set caseinsensitive flag according to file system + name and FILE_CASE_SENSITIVE_SEARCH flag. Add comment. + (tfx_chars_managed): Remove. + (transform_chars): Drop "managed" parameter. Always use tfx_chars. + (get_nt_native_path): Drop "managed" parameter. Make sure drive letters + are always upper case. + (getfileattr): Change second parameter to denote caseinsensitivity. + (path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE. + Set caseinsensitive according to global obcaseinsensitive flag, file + system case sensitivity and MOUNT_NOPOSIX mount flag. + Drop case_clash and all the related code. + (symlink_worker): Drop case clash handling. + (symlink_info::set): Drop setting case_clash. + (symlink_info::case_check): Remove. + (cwdstuff::set): Add comment. + (etc::init): Take path_conv instead of PUNICODE_STRING as parameter to + allow case sensitivity. + * path.h (enum pathconv_arg): Drop PC_SYM_IGNORE. + (enum case_checking): Remove. + (enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag. + (struct fs_info): Add caseinsensitive flag and accessor methods. + (class path_conv): Add caseinsensitive member and define + objcaseinsensitive method. Drop case_clash member and isencoded method. + (pathmatch): Change prototype according to above change. + (pathnmatch): Ditto. + (path_prefix_p): Ditto. + (get_nt_native_path): Ditto. + (class etc): Ditto. + (fnunmunge): Remove prototype. + * shared.cc (shared_info::init_obcaseinsensitive): Initialize + obcaseinsensitive flag from obcaseinsensitive registry value. + (shared_info::initialize): Call init_obcaseinsensitive here by the + first process creating the shared memory. + * shared_info.h (mount_item::fnmunge): Remove. + (shared_info::obcaseinsensitive): Rename from obcaseinsensitivity. + (shared_info::init_obcaseinsensitive): Declare. + * syscalls.cc (try_to_bin): Add comment. + * include/sys/mount.h (MOUNT_ENC): Remove flag. + (MOUNT_NOPOSIX): Add flag. + +2008-07-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff. + Just initialize drive data. + * mtinfo.h (MTINFO_MAGIC): Remove. + (MTINFO_VERSION): Remove. + (class mtinfo): Remove magic and version members. + * shared.cc (shared_info::initialize): Move call to + get_session_parent_dir so that the dir creation is only called once. + Move call to mt.initialize so that it's called only by the first + process creating the shared memory. + * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. + (CURR_SHARED_MAGIC): Ditto. + (class shared_info): Add obcaseinsensitivity member. + +2008-07-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fpathconf): On _PC_POSIX_PERMISSIONS + and _PC_POSIX_SECURITY, return true for NFS, too. + +2008-07-14 Corinna Vinschen <corinna@vinschen.de> + + Throughout drop allow_ntsec and allow_smbntsec handling. + * environ.cc (set_ntsec): Remove. + (set_smbntsec): Remove. + (known): Remove ntsec and smbntsec options. + * external.cc (check_ntsec): Return true if no filename is given. + * mount.cc (oopts): Add "acl" and "noacl" options. Set MOUNT_NOACL + flag accordingly. + (fillout_mntent): Handle MOUNT_NOACL flag. + * path.h (enum path_types): Add PATH_NOACL. + * security.cc (allow_ntsec): Remove. + (allow_smbntsec): Remove. + * security.h (allow_ntsec): Drop declaration. + (allow_smbntsec): Drop declaration. + * include/sys/mount.h (MOUNT_NOACL): Define. + +2008-07-14 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (cygwin_strncasecmp): Fix bug which results in + prematurely truncated strings. Simplify target length argument to + sys_mbstowcs. + +2008-07-14 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetExtendedTcpTable): Define. + * fhandler_socket.cc (address_in_use): Take const struct sockaddr + pointer as argument. Implement additional AF_INET6 table check. + (fhandler_socket::bind): Drop AF_INET test before calling + address_in_use. + * net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if + called with unsupported af_family. + +2008-07-12 Eric Blake <ebb9@byu.net> + + Fix usage of recently fixed Interlocked* functions. + * winbase.h (ilockincr, ilockdecr, ilockexch, ilockcmpexch): Add + volatile qualifier, to match Interlocked* functions. + +2008-07-11 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (peek_pipe): Temporarily revert patch from 2008-05-30. + +2008-07-11 Corinna Vinschen <corinna@vinschen.de> + + Change length for domain buffers from INTERNET_MAX_HOST_NAME_LENGTH to + MAX_DOMAIN_NAME_LEN throughout. + * cyglsa.h (CYG_LSA_MAGIC): New value. + (cyglsa_t): Define username and domain as WCHAR arrays. + * errno.cc (errmap): Add mapping for ERROR_NONE_MAPPED. + * sec_auth.cc: Drop 'w' prefix from WCHAR string variable names where + appropriate. + (extract_nt_dom_user): Prefer resolving by SID before resolving by + domain\name pair. + (cygwin_logon_user): Don't print cleartext password in debug output. + Change comment. + (get_user_groups): Revert calls to LookupAccountNameW to use NULL + server instead of explicit server name, according to MSDN. + (get_user_local_groups): Ditto. + (get_server_groups): Fetch domain and user name from usersid per + LookupAccountSidW instead of calling extract_nt_dom_user. + (lsaauth): Fetch domain and user name from usersid per LookupAccountSidW + instead of calling extract_nt_dom_user. + * sec_helper.cc (cygpriv): Convert to wchar_t pointer array. + (privilege_luid): Convert first parameter to PWCHAR. + (privilege_name): Return wchar_t pointer. + (set_privileges): Accommodate debug output. + * security.h (privilege_luid): Change prototype accordingly. + +2008-07-10 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa.h (SECURITY_STRING): Define. + (enum _SECPKG_NAME_TYPE): Define. + (struct _SECPKG_CALL_INFO): Define. + (struct _LSA_SECPKG_FUNCS): Extend to full size. Define unused + functions lazily. + (cygprf_t): Define. + * sec_auth.cc (lsaauth): Use actual primary group if no admins group. + Add (disabled) code to fetch token from profil data. + +2008-07-09 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (verify_token): Allow builtin groups missing in a token + and it's still valid. Explain why. + +2008-07-09 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (DsGetDcNameW): Replace DsGetDcNameA. + * dcrt0.cc (child_info_spawn::handle_spawn): Drop artificial + supplementary group list from calling setgroups in parent. + * grp.cc (internal_getgroups): Drop 9x-only code. Reformat. + * sec_auth.cc (get_logon_server): Do everything in WCHAR only. + (get_user_groups): Ditto. Use wlogonserver in LookupAccountNameW + calls, too. + (is_group_member): Get logon server as first argument and use in call + to NetLocalGroupGetMembers. + (get_user_local_groups): Get logon server as first argument and use in + calls to NetLocalGroupEnum and LookupAccountNameW. Revamp to work + more correctly in domain environments. + (get_server_groups): Accommodate aforementioned changed function calls. + * security.h (get_logon_server): Change prototype accordingly. + * uinfo.cc (cygheap_user::env_logsrv): Accommodate changed + get_logon_server call. + +2008-07-09 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Also add integrity-enabled groups. + +2008-07-09 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (verify_token): Disable code which returns false if + the token contains additional groups not requested by setgroups. + Explain why. + +2008-07-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Don't run explicit + local socket test in SO_REUSEADDR case on systems supporting + enhanced socket security. Explain why. Only call address_in_use + for AF_INET sockets. + * net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR + on systems supporting enhanced socket security. Add comment. + * wincap.h (wincaps::has_enhanced_socket_security): New element. + * wincap.cc: Implement above element throughout. + +2008-07-08 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (ipv6_inited): Make NO_COPY. + +2008-07-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::is_binary): Fix test. Add comment. + +2008-06-24 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_bindresvport_sa): Fix usage of last_used_bindresvport. + +2008-06-21 Corinna Vinschen <corinna@vinschen.de> + + * include/limits.h (PATH_MAX): Add comment. + * include/cygwin/config.h (__FILENAME_MAX__): Define as 4096. Add + comment. + +2008-06-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_master::setup): Fix pipe inheritance. + +2008-06-18 Christopher Faylor <me+cygwin@cgf.cx> + + * strsig.cc (strsignal): Return non-const buffer to allow building with + recent newlib change. + +2008-06-17 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (DsGetDcNameA): Drop declaration. + (DS_FORCE_REDISCOVERY): Drop definition. + +2008-06-17 Christopher Faylor <me+cygwin@cgf.cx> + + * spawn.cc (spawn_guts): Reinstate call to + fhandler_console::need_invisible since it is required to prevent + console flashing. + +2008-06-17 Corinna Vinschen <corinna@vinschen.de> + + * include/resolv.h (_getshort): Drop declaration. + (_getlong): Ditto. + +2008-06-12 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::get_cygdrive_info): Fix usage of user and + system arguments. Strip trailing slash from path for backward + compatibility. + +2008-06-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (set_console_state_for_spawn): Drop declaration. + * fhandler_console.cc (set_console_state_for_spawn): Remove. + (fhandler_console::open): Set console state last. Don't set + ENABLE_PROCESSED_INPUT flag. + * spawn.cc (spawn_guts): Drop call to set_console_state_for_spawn. + +2008-06-11 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (get_nt_native_path): Drop considerations for DOS devices. + Keep relative paths relative. + (cygwin_conv_path): Don't try to skip native NT prefixes on relative + paths. + +2008-06-11 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_MOUNT_REGISTRY): Bump. + (CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME): Remove. + (CYGWIN_INFO_CYGDRIVE_FLAGS): Remove. + (CYGWIN_INFO_CYGDRIVE_PREFIX): Remove. + (CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX): Add comment to differ from the + registry related defines. + +2008-06-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procnet.cc (dad_to_flags): Fix comment. + +2008-06-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procnet.cc (get_scope): New static function to evaluate + scope. + (dad_to_flags): New static array to convert Windows DAD state to + Linux values. + (format_procnet_ifinet6): Drop asking for IfIndex, just use Ipv6IfIndex. + Use get_scope and dad_to_flags to generate more accurate linux-like + output. + +2008-06-10 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (if_nametoindex): Fix typo in call to get_adapters_addresses. + (if_indextoname): Prefer IPv6 loopback device name over IPv4 loopback + device name on pre-Vista systems. + (if_nameindex): Ditto. + +2008-06-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather than + __small_sprintf. + * net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for + consistency with /proc/net/if_inet6. + (if_indextoname): Ditto. + (if_nameindex): Ditto. + +2008-06-10 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab): Read sizeof (buf) - 2 bytes. + Add code to handle overly long lines. + +2008-06-10 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (lsaauth): Make returned token inheritable. + +2008-06-10 Corinna Vinschen <corinna@vinschen.de> + + * devices.cc: Regenerate. + +2008-06-09 Christopher Faylor <me+cygwin@cgf.cx> + + * devices.in: Remove "Global" from tty device. + +2008-06-09 Eric Blake <ebb9@byu.net> + + * signal.cc (abort): Only flush streams after signal handler. + +2008-06-02 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin.sc: Remove unrequired and erroneous definition. + +2008-05-30 Christopher Faylor <me+cygwin@cgf.cx> + + * select.cc (peek_pipe): Semi-reinstate pipe NT-special write + detection. + +2008-05-29 Christopher Faylor <me+cygwin@cgf.cx> + + * devices.in: Change mapping for /dev/ttyS* and /dev/com*. + * devices.cc: Regenerate. + +2008-05-25 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::from_fstab): Use proper buffer size. + +2008-05-24 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::init): Revert previous change. + (mount_info::from_fstab): Change system_printf to debug_printf. Just + use a local NT_MAX_PATH sized temporary buffer. + +2008-05-24 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::init): Recreate path when trying to read the + user fstab file. + +2008-05-24 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Reorder test for nfs symlinks. + +2008-05-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try to + use FileIdBothDirectoryInformation on NFS shares. Fix comment to + explain why. + * path.cc (symlink_info::check): Reinstantiate no_ea. Use in + erroneously changed condition. + +2008-05-23 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (find_root_from_cygwin_dll): New function factored from + from_fstab. Avoid use of tls since it isn't necessarily initialized + when cygwin1.dll is dynamically loaded. + (mount_info::create_root_entry): Ditto. + (mount_info::init): Calculate cygwin root once. Use create_root_entry + to record it. Pass fstab location to from_fstab. + (mount_info::from_fstab): Move root calculation stuff elsewhere, as per + above. + + * shared_info.h (mount_info::from_fstab_line): Make private. + (mount_info::fstab): Ditto. Accommodate new arguments. + +2008-05-23 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::from_fstab): Use cygwin_hmodule rather than + trying to find handle based on cygwin1.dll. + + * path.cc (symlink_info::check): Remove unused variable. + +2008-05-23 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (open_shared): Fix comments. Fix a condition which has + been overlooked to revert to its old state in change from 2008-04-18. + +2008-05-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Define eabuf and easize outside of + loop. Set to NULL on first STATUS_EAS_NOT_SUPPORTED. Align comments. + Fix formatting. + +2008-05-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Eliminate + compiler warning. + +2008-05-23 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (symlink_info::check): Don't pass EaBuffer to NtCreateFile if + it has indicated that it isn't appropriate. + * ntdll.h (STATUS_EAS_NOT_SUPPORTED): Define. + + * winsup.h: Remove __builtin* defines. + +2008-05-22 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Fix thinko. Only add enabled groups to + the group list. + +2008-05-22 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Don't add deny-only groups to the group + list. + +2008-05-22 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (struct san): Add two int values to store the current + tls_pathbuf counters. + (return_from_fault): Restore tls_pathbuf counters. + (setup_fault): Save tls_pathbuf counters. + * tlsoffset.h: Regenerate. + +2008-05-22 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist. + +2008-05-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cygwin_conv_path): Define tp before setting up faul handler. + * syscalls.cc: Ditto, throughout. + (gen_full_path_at): Add bool parameter to allow NULL pathname. + (futimesat): Allow NULL pathname as GLIBC. + +2008-05-21 Christopher Faylor <me+cygwin@cgf.cx> + + * string.h (strchr): Eliminate. + + * syscalls.cc (rename): Work around inexplicable C++ warning. + +2008-05-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (get_ino_by_handle): Rename pfai to fai. + (fhandler_base::fstat_by_handle): Drop fai_size and pfai in favor of + static struct fai_buf. Restructure. + (fhandler_base::fstat_by_name): Drop fvi_size and pfvi. Drop fdi_size + and pfdi in favor of static struct fdi_buf. Drop redundant test for + existance. Use FileDirectoryInformation class instead of + FileBothDirectoryInformation. Drop call to NtQueryVolumeInformationFile + in favor of using pc.fs_serial_number (). Fix FileId information given + to fstat_helper. + (fhandler_disk_file::fstatvfs): Drop fvi_size, pfvi, fai_size and pfai. + Drop getting FileFsVolumeInformation and FileFsAttributeInformation in + favor of using the related path_conv info. + (fhandler_disk_file::opendir): Fix comment. + (fhandler_disk_file::readdir): Ditto. Use FileDirectoryInformation + class instead of FileBothDirectoryInformation. + * path.cc (fs_info::update): Store MaximumComponentNameLength in new + member name_len. + * path.h (struct fs_info): Use ULONG rather than DWORD. Add member + name_len to store MaximumComponentNameLength. Add accessor methods. + (path_conv::fs_name_len): New method. + +2008-05-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (dirent_states): Add dirent_nfs_d_ino state and add it to + dirent_info_mask. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set + dirent_nfs_d_ino flag for NFS shares. Explain why. + (fhandler_disk_file::readdir): Use FileNamesInformation instead of + FileBothDirectoryInformation info class on NFS clients not supporting + the FileIdBothDirectoryInformation info class. Use local pointers to + accommodate different offsets. + * path.cc (symlink_info::check): Don't test directories for symlinks + on NFS shares. Enhance comment. + +2008-05-21 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (FILTERED_MODE): Define valid chmod mode mask. + (chmod): Call fh->fchmod with filtered mode. + (fchmod): Ditto. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for + S_IFSOCK in mode bits. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_worker): Fix EA buffer size info given to + NtCreateFile. + (symlink_info::check_nfs_symlink): Get 64K buffer for EA buffer. + Change EA buffer size info given to NtQueryEaFile accordingly. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_shortcut): Minimize requested file + access flags. + (symlink_info::check_sysfile): Ditto. Add missing `else'. + (symlink_info::check): Only retry to open file if first try failed + with access denied. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fs_info::update): Re-add opening the unsplitted path + for fillout_mntent's sake. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Create directories + on NFS shares with correct mode bits. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (cygwin_inet_addr): Fix type of declaration. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add nfs.o. + * fhandler.cc (fhandler_base::open): Open files on NFS shares with + correct access flags and EAs. + * fhandler.h (fhandler_base::fstat_by_nfs_ea): Declare. + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): New method. + (fhandler_base::fstat_by_handle): Call fstat_by_nfs_ea for files on + NFS shares. + (fhandler_disk_file::fchmod): Use NFS specific method to set mode for + files on NFS shares. Don't overrule errno from call to + set_file_attribute with errno from NtSetInformationFile call. + (fhandler_disk_file::fchown): Add comment. + * mount.cc (fillout_mntent): Accommodate change in second parameter + to fs_info::update. + * nfs.cc: New file. + * nfs.h: New file. + * path.cc (fs_info::update): Take handle instead of bool as second + parameter. Use that handle if it's not NULL. Only close handle if + it has been opened here. Use static defined buffers instead of + alloca'd buffers. + (path_conv::check): Call symlink_info::check with reference to fs. + Don't call fs.update here if file exists. + (conv_path_list): Prefer tmp_pathbuf buffer over using alloca. + (symlink_worker): Use NFS specific method to create symlinks on NFS + shares. Prefer tmp_pathbuf buffer over using alloca. + (symlink_info::check_shortcut): Reopen file from incoming handle + with necessary FILE_GENERIC_READ flag. Prefer tmp_pathbuf buffer over + using alloca. + (symlink_info::check_sysfile): Ditto. + (symlink_info::check_reparse_point): Use tmp_pathbuf buffer to + allocate REPARSE_DATA_BUFFER. + (symlink_info::check_nfs_symlink): New method. + (enum symlink_t): Remove. + (symlink_info::check): Don't use NtQueryAttributesFile. Rather, open + file with necessary access flags and call NtQueryInformationFile. Fix + error handling in case file can't be opened. For existing files, call + fs_info::update here. Restructure symlink checking to accommodate the + fact that the file is already open. Add case for NFS symlinks. + * path.h (fs_info::update): Take handle instead of bool as second + parameter. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Fix condition when to start a transaction. + +2008-05-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Free wide_path and normalized_path if + necessary. + * path.h (path_conv::path_conv): Set wide_path, normalized_path and + normalized_path_size to 0 in all constructors. + +2008-05-19 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Allocate temporary path buffers using + tmp_pathbuf. Don't try to unset R/O attribute on dstpc if a + removepc exists. dstpc is a non-existant file in that case. + +2008-05-17 Christopher Faylor <me+cygwin@cgf.cx> + + * include/stdint.h: Use int rather than long for {u,}int32_t. + +2008-05-16 Corinna Vinschen <corinna@vinschen.de> + + * CYGWIN_LICENSE: Remove duplicate file here. + +2008-05-15 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): ONly start transaction if FS supports them. + +2008-05-15 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (LoadDLLfuncNt): Re-invent. + (NtCreateTransaction): Define. + (NtCommitTransaction): Define. + (NtRollbackTransaction): Define. + (RtlGetCurrentTransaction): Define. + (RtlSetCurrentTransaction): Define. + * ntdll.h (TRANSACTION_ALL_ACCESS): Define. + (NtCreateTransaction): Declare. + (NtCommitTransaction): Declare. + (NtRollbackTransaction): Declare. + (RtlGetCurrentTransaction): Declare. + (RtlSetCurrentTransaction): Declare. + * syscalls.cc (start_transaction): New static function to start TxF + transaction. + (stop_transaction): New static function to end TxF transaction. + (rename): Call start_transaction and stop_transaction where appropriate + on systems supporting transactions. + * wincap.h (wincaps::has_transactions): New element. + * wincap.cc: Implement above element throughout. + +2008-05-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Drop + explicit transformation of special DOS chars. + * strfuncs.cc (sys_wcstombs): Always transform UNICODE private use area + back to ASCII. + +2008-05-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/stdlib.h (initstate): Declare. + (setstate): Declare. + +2008-05-13 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::set_normalized_path): Drop strip_tail argument. + Never strip trailing dots and spaces. + * (path_conv::check): Accomodate above change. + * path.h (path_conv::operator=): Ditto + * dtable.cc (build_fh_dev): Ditto. + * fhandler.h (fhandler_base::set_name): Ditto. + + * path.cc (transform_chars): Disable converting trailing dots and + spaces. + + * path.cc (path_conv::check): Remove two disabled code snippets. + +2008-05-13 Corinna Vinschen <corinna@vinschen.de> + + * random.cc (initstate): Align to POSIX definition. + (setstate): Ditto. + +2008-05-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Remove _def_time.o. + * libc/_def_time.c: Remove. Move definitions of _DefaultTimeLocale + and _CurrentTimeLocale ... + * libc/strptime.cc: ... here. + +2008-05-08 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/localedef.h: Remove. + * libc/strptime.cc: Define _TimeLocale and declare _CurrentTimeLocale + as well as _DefaultTimeLocale locally for Cygwin. + +2008-05-08 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add _def_time.o. Remove timelocal.o. + * include/sys/localedef.h: New file from NetBSD. + * libc/_def_time.c: Ditto. + * libc/getopt.c: Update to latest OpenBSD version 1.23. + * libc/strptime.cc: Replace FreeBSD version 1.35 with latest NetBSD + version 1.28. + * libc/timelocal.cc: Remove. + * libc/timelocal.h: Remove. + +2008-04-30 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::release): Drop fixup_before handling. + (dtable::fixup_before_fork): Remove. + (dtable::fixup_before_exec): Remove. + * dtable.h (class dtable): Remove cnt_need_fixup_before member. + (dtable::dtable): Accommodate above change. + (dtable::dec_need_fixup_before): Remove. + (dtable::inc_need_fixup_before): Remove. + (dtable::need_fixup_before): Remove. + (dtable::fixup_before_exec): Remove declaration. + (dtable::fixup_before_fork): Ditto. + * fhandler.h (fhandler_base::fixup_before_fork_exec): Remove. + (fhandler_base::need_fixup_before): Remove. + * fork.cc (frok::parent): Drop fixup_before handling. + * spawn.cc (spawn_guts): Ditto. + +2008-04-30 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (is_unc_share): Allow \\?\ prefix as well. Enhance comment. + (mount_info::from_fstab): Remove patch from 2008-04-29. + + * mount.cc (mount_info::conv_to_posix_path): Simplify test for native + UNC path. + * path.cc (normalize_win32_path): Ditto. + (symlink_worker): Ditto. + (symlink_info::posixify): Ditto. + (cygwin_conv_path): Ditto. + +2008-04-29 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab): Skip native path prefix in + module path. + +2008-04-29 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Use volume serial numbers stored in path_conv + rather than fetching them here for the "same file" test. Change + comment to reflect this. + +2008-04-28 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Avoid special handling for + STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile. + * strace.cc (strace::vprntf): Use bigger buffer. + +2008-04-28 Corinna Vinschen <corinna@vinschen.de> + + * kernel32.cc (CreateFileMappingW): Remove stray small_printf. + +2008-04-28 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (IsWow64Process): Remove. + (Wow64DisableWow64FsRedirection): Remove. + (Wow64RevertWow64FsRedirection): Remove. + * ntdll.h (enum _PROCESSINFOCLASS): Define ProcessWow64Information. + * init.cc (respawn_wow64_process): Use NtQueryInformationProcess to + get WOW64 state. + * wincap.cc (wincapc::init): Ditto. + * wincap.h (wincapc::wow64): Change type to ULONG. + +2008-04-27 Corinna Vinschen <corinna@vinschen.de> + + * wincap.h (wincapc::wow64): Change type to BOOL. + * wincap.cc: Remove explicit use of this pointer in wincapc methods. + (wincapc::init): Fix bug in IsWow64Process handling. + +2008-04-26 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): Set SEM_NOGPFAULTERRORBOX error mode, too, + to accommodate Vista/Longhorn. + * spawn.cc (spawn_guts): Move check for CREATE_SUSPENDED condition + after the call to ch.set() since it depends on it. + +2008-04-25 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (install): Drop install rules for postinstall script. + +2008-04-25 Corinna Vinschen <corinna@vinschen.de> + + * postinstall: Remove (Moved to base-cygwin package). + +2008-04-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Move handling FILE_ATTRIBUTE_NORMAL + back to its old place. Or it to file_attributes instead of setting it. + +2008-04-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): *Only* handle SYSTEM and HIDDEN + attributes in FILE_OVERWRITE case. + +2008-04-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Handle SYSTEM and HIDDEN attributes + in FILE_OVERWRITE case as well. + +2008-04-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Disable calling + pc.ndisk_links. Just use nNumberOfLinks instead. + +2008-04-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::utimens_fs): Fix typo in + input range check. + +2008-04-24 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (futimens): Export. + (utimensat): Export. + * fhandler.cc (fhandler_base::utimens): Replace fhandler_base::utimes. + Call utimens_fs. + * fhandler.h (class fhandler_base): Declare utimens_fs instead of + utimes_fs, utimens instead of utimes. + (class fhandler_disk_file): Declare utimens instead of utimes. + * fhandler_disk_file.cc (fhandler_disk_file::utimens): Replace + fhandler_disk_file::utimes. + (fhandler_base::utimens_fs): Replace fhandler_base::utimes_fs. + Implement tv_nsec handling according to SUSv4. + * syscalls.cc (utimensat): New function. + * times.cc (timespec_to_filetime): New function. + (timeval_to_timespec): New function. + (utimens_worker): Replace utimes_worker. + (utimes): Convert timeval to timespec and call utimens_worker. + (lutimes): Ditto. + (futimens): Take over implementation from futimes. + (futimes): Convert timeval to timespec and call futimens. + * winsup.h (timespec_to_filetime): Declare. + * include/cygwin/version.h: Bump API minor number. + * posix.sgml: Add SUSv4 section. Add futimens and utimensat to it. + +2008-04-24 Yaakov (Cygwin Ports) <yselkowitz@users.sourceforge.net> + + * include/wait.h: New file. + +2008-04-23 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Add openat, faccessat, fchmodat, fchownat, fstatat, + futimesat, linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat, + symlinkat, unlinkat to list of implemented Solaris functions. + +2008-04-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Sort. + (faccessat): Export. + (fchmodat): Export. + (fchownat): Export. + (fstatat): Export. + (futimesat): Export. + (linkat): Export. + (mkdirat): Export. + (mkfifoat): Export. + (mknodat): Export. + (openat): Export. + (readlinkat): Export. + (renameat): Export. + (symlinkat): Export. + (unlinkat): Export. + * path.cc (readlink): Align definition to POSIX. + * syscalls.cc (gen_full_path_at): New static function. + (faccessat): Implement. + (fchmodat): Implement. + (fchownat): Implement. + (fstatat): Implement. + (futimesat): Implement. + (linkat): Implement. + (mkdirat): Implement. + (mkfifoat): Implement. + (mknodat): Implement. + (openat): Implement. + (readlinkat): Implement. + (renameat): Implement. + (symlinkat): Implement. + (unlinkat): Implement. + * include/cygwin/version.h: Bump API minor number. + +2008-04-22 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): Move CWD initialization from here... + (dll_crt0_1): ...to here. + +2008-04-22 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (fmemopen): Export. + (open_memstream): Export. + * include/cygwin/version.h: Bump API minor number. + +2008-04-22 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (create_token): Add integrity level SID to token on + systems supporting that. Remove useless check for dynamically loading + NtCreateToken function. + * sec_helper.cc (mandatory_medium_integrity_sid): Define. + (mandatory_high_integrity_sid): Define. + (mandatory_system_integrity_sid): Define. + * sec_helper.h (mandatory_medium_integrity_sid): Declare. + (mandatory_high_integrity_sid): Declare. + (mandatory_system_integrity_sid): Declare. + +2008-04-21 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::init): Remove call to from_registry. Print + message that fstab is missing. + (mount_info::from_fstab): Use CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX + instead of constant string. + (mount_info::read_mounts): Remove. + (mount_info::from_registry): Remove. + (mount_info::read_cygdrive_info_from_registry): Remove. + * postinstall: Enable code to create fstab entries from old registry + entries. + * registry.cc (reg_key::reg_key): Drop CYGWIN_INFO_CYGNUS_REGISTRY_NAME + from registry key. + * shared_info.h (mount_info::read_mounts): Remove declaration. + (mount_info::from_registry): Ditto. + (mount_info::to_registry): Ditto. + (mount_info::read_cygdrive_info_from_registry): Ditto. + * winver.rc (CYGWIN_REGISTRY_KEY): Remove. + (LegalCopyright): Fix to include 2008. + (RegistryKey): Set to CYGWIN_INFO_CYGWIN_REGISTRY_NAME. + * include/cygwin/version.h (CYGWIN_INFO_CYGNUS_REGISTRY_NAME): Remove. + +2008-04-21 Corinna Vinschen <corinna@vinschen.de> + + * kernel32.cc (CreateFileMappingW): Fix bug in reserve/commit handling. + +2008-04-21 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add kernel32.o. + * autoload.cc (WSACloseEvent): Remove. + (WSACreateEvent): Remove. + * cygheap.cc (cygheap_init): Drop initializing shared_prefix. + * cygheap.h (struct init_cygheap): Drop shared_prefix and + shared_prefix_buf members. + * fhandler_socket.cc (sock_shared_name): New static function. + (search_wsa_event_slot): Convert name buffers to WCHAR. Call + NtCreateMutant/NtOpenMutant to create mutexes in session local + namespace. + (fhandler_socket::init_events): Ditto. Fix debug output. + (fhandler_socket::release_events): Close mutexes using NtClose. + (fhandler_socket::dup): Ditto. + * kernel32.cc: New file, implementing Win32 calls in a Cygwin-specific + way. + * mmap.cc (MapView): Make static. + * ntdll.h: Fix status code sorting. + (STATUS_OBJECT_NAME_EXISTS): Define. + (SEMAPHORE_QUERY_STATE): Define. + (CYG_SHARED_DIR_ACCESS): Define. + (CYG_MUTANT_ACCESS): Define. + (CYG_EVENT_ACCESS): Define. + (CYG_SEMAPHORE_ACCESS): Define. + (enum _PROCESSINFOCLASS): Define ProcessSessionInformation. + (struct _PROCESS_SESSION_INFORMATION): Define. + (NtCreateSemaphore): Declare. + (NtOpenSemaphore): Declare. + * flock.cc: Use CYG_xxx_ACCESS access masks where appropriate. + * posix_ipc.cc (ipc_mutex_init): Use native functions to create mutex. + Create in cygwin-shared subdir. + (ipc_cond_init): Ditto for event. + (ipc_mutex_close): Use NtClose. + (ipc_cond_close): Ditto. + (mq_open): Drop "cyg" prefix from mqh_uname. + * shared.cc (CYG_SHARED_DIR_ACCESS): Drop definition here. + (_cygwin_testing): Declare extern on file level. + (get_shared_parent_dir): Change name of shared directory. Add name + to api_fatal output. + (get_session_parent_dir): New function. + (shared_name): Simplify. + (shared_info::initialize): Call get_session_parent_dir. + * shared_info.h (get_session_parent_dir): Declare. + * smallprint.cc (__small_vswprintf): Fix bug in multibyte string + conversion. + * thread.cc (semaphore::semaphore): Align semaphore name to object + names in posix IPC functions. + * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump. + +2008-04-18 Corinna Vinschen <corinna@vinschen.de> + + Revert thinko in previous patch. + * fhandler.h (struct wsa_event): Move back from wsa_event.h to here. + * fhandler_socket.cc (NUM_SOCKS): Ditto. + (wsa_events): Move back from cygwin_shared to here. Accommodate + throughout. + (socket_serial_number): Ditto. + * shared_info.h: Accommodate above changes. + * wsa_event.h: Remove. + +2008-04-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (struct wsa_event): Move to wsa_event.h. Include + wsa_event.h instead. + * fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h. + (wsa_events): Move from DLL shared area to cygwin_shared shared + memory. Accommodate throughout. + (socket_serial_number): Ditto. + * fhandler_tape.cc (mt): Ditto. + (mtinfo_init): Remove. + (mt): Define as cygwin_shared->mt. + * flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove. + (FLOCK_INODE_DIR_ACCESS): Move up in file. + (FLOCK_MUTANT_ACCESS): Ditto. + (FLOCK_EVENT_ACCESS): Ditto. + (get_lock_parent_dir): Remove. + (inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle. + Add a "flock-" prefix to file's lock directory name for clarity. + * mtinfo.h (mtinfo_init): Drop declaration. + * net.cc (last_used_bindresvport): Move from DLL shared area to + cygwin_shared shared memory. + (cygwin_bindresvport_sa): Accommodate above change. + * sec_helper.cc (_everyone_sd): Move here from flock.cc. + * security.h (SD_MIN_SIZE): Ditto. + (everyone_sd): Ditto. + * shared.cc (cygwin_shared_area): Remove. + (cygwin_shared_h): New handle. + (get_shared_parent_dir): New static function. + (shared_name): Drop session_local argument. Call get_shared_parent_dir + here. Add cygwin-shared subdir to object name. + (offsets): Reinstantiate SH_CYGWIN_SHARED member. + (open_shared): Revert change from 2007-03-29 for systems supporting + SeCreateGlobalPrivilege. + (shared_info::initialize): Call mtinfo's initialize here. + (memory_init): Drop call to mtinfo_init. + * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. + (CURR_SHARED_MAGIC): Ditto. + (class shared_info): Add members for global socket and tape info + sharing. + (enum shared_locations): Reinstantiate SH_CYGWIN_SHARED. + (get_shared_parent_dir): Declare. + (shared_name): Drop session_local argument from declaration. + * wsa_event.h: New file. Move definitions of NUM_SOCKS and + struct wsa_event here. + +2008-04-18 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (noload): Make sure this and succeeding functions are + located in the text segment. + +2008-04-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::close): Disable enforced + lingering since the original problem can no longer be reproduced. + +2008-04-16 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Drop local buf. Allocate groups + directly using alloca. + +2008-04-14 Corinna Vinschen <corinna@vinschen.de> + + * postinstall: Fix copy/paste bug. + +2008-04-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Fix + thinko in UNC path handling. + * path.cc (symlink_worker): Fix typo in comment. Fix UNC path handling. + +2008-04-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Simplify + code which checks for symlinks. Fix problem with UNC paths. + + * environ.cc (struct parse_thing): Remove transparent_exe option. + * syscalls.cc (transparent_exe): Remove. + (unlink): Always add stat_suffixes, drop transparent_exe check. + (open): Ditto. + (link): Ditto. + (pathconf): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::link): Ditto. + * fhandler_process.cc (fhandler_process::fill_filebuf): Always remove + .exe suffix. + * path.cc (realpath): Never attach known_suffix. + +2008-04-10 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (wprintf): Remove. + (_wprintf): Ditto. + * syscalls.cc (wprintf): Ditto. + * include/cygwin/version.h: Add FIXME comment. + +2008-04-08 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab): Read user fstab files from + /etc/fstab.d/$USER to avoid user write access to /etc. + * postinstall: Use variables for filenames. Create /etc/fstab.d dir + with 01777 permissions. + +2008-04-08 Corinna Vinschen <corinna@vinschen.de> + + * postinstall: Disable adding registry mounts to /etc/fstab for now. + +2008-04-07 Christopher Faylor <me+cygwin@cgf.cx> + + Remove unneeded header files from source files throughout. + +2008-04-07 Corinna Vinschen <corinna@vinschen.de> + + * postinstall: Add function print_flags and call where appropriate. + Omit system and cygdrive flag when testing cygdrive flags. + +2008-04-07 Christopher Faylor <me+cygwin@cgf.cx> + + Add miscfuncs.h to files as needed throughout. + * mount.cc: New file. + * path.cc: Move mount-specific stuff into mount.cc. Move common stuff + into miscfuncs.cc. Remove unneeded includes. + * miscfuncs.cc: Move some common path functions here. + * miscfuncs.h: New file. + * winsup.h: Move miscelleneous functions to miscfuncs.h. + * dcrt0.cc: Remove unneeded includes. + * Makefile.in (DLL_OFILES): Add mount.o. + + * include/cygwin/config.h: Fix a minor typo. + +2008-04-07 Corinna Vinschen <corinna@vinschen.de> + + * postinstall: Set IFS to LF only. Change while loop in subshell to + for loop in parent shell. Add code to read system mount points and + system cygdrive prefix from registry and append them to /etc/fstab. + +2008-04-06 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (struct opt): Rename "system" to "nouser". + * postinsatll: Ditto. + +2008-04-05 Corinna Vinschen <corinna@vinschen.de> + + * postinstall: New script. + * Makefile.in (sysconfdir): Define. + (install): Create $(sysconfdir)/postinstall dir. Install postinstall + script into it. + + * path.cc: Add temorary comments to note later function removal. + (conv_fstab_spaces): New inline function to handle \040 to space + conversion. + (struct opt): Add "system" and "user" mount options. + (mount_info::from_fstab_line): Only allow # to start a comment at + the beginning of the line. Call conv_fstab_spaces on native_path and + posix_path fields. Don't enforce system mounts in /etc/fstab. + Drop last argument in call to add_item. + (mount_info::from_fstab): Create a default cygdrive entry. Load + user mount points from fstab.<username> instead of fstab.<sid>. + (mount_info::read_mounts): Drop last argument in call to add_item. + (mount_info::add_reg_mount): Remove. + (mount_info::del_reg_mount): Remove. + (mount_info::write_cygdrive_info): Rename from + mount_info::write_cygdrive_info_to_registry. Don't write to registry. + Disallow to overwrite a system cygdrive prefix. + (mount_info::remove_cygdrive_info_from_registry): Remove. + (mount_info::get_cygdrive_info): Just fetch current cygdrive prefix and + flags. + (mount_info::add_item): Drop last argument. Don't write to registry. + Disallow to overwrite a system mount point. + (mount_info::del_item): Drop last argument. Don't write to registry. + Disallow to remove a system mount point. + (mount): Enforce user mount. + (cygwin_umount): Ditto. + * shared_info.h (mount_info::add_item): Drop last argument. + (mount_info::del_item): Ditto. + (mount_info::add_reg_mount): Remove. + (mount_info::del_reg_mount): Remove. + (mount_info::write_cygdrive_info): Rename from + mount_info::write_cygdrive_info_to_registry. + (mount_info::remove_cygdrive_info_from_registry): Remove. + +2008-04-03 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (mount_info::from_fstab_line): Simplify. Recognize special + "cygdrive" entry from FS type field. + (mount_info::from_fstab): Create a default root dir. + +2008-04-03 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (insert_file): Fix potential buffer overflow. + +2008-04-03 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (mount_info::from_fstab): Get module path name of the Cygwin + DLL, not the path of the application. + +2008-04-03 Corinna Vinschen <corinna@vinschen.de> + + Cleanup. + * exceptions.cc (windows_system_directory): Make static. Convert to + WCHAR. + (_cygtls::inside_kernel): Accommodate above change. Check module + path name for leading \\?\ and skip, if so. + (try_to_debug): Call GetEnvironmentStringsW and convert evaluation to + WCHAR to avoid truncated environment problem. + (has_visible_window_station): Call GetUserObjectInformationW. + (events_init): Accommodate above conversion of windows_system_directory. + * init.cc (respawn_wow64_process): Use WCHAR functions to start new + process. + * net.cc (__dup_ent): Drop Windows 9x consideration. + (load_ipv6_funcs): Use WCHAR functions to load IPv6 libs. + * syscalls.cc (syscalls.cc): Remove call to GetDiskFreeSpace. + +2008-04-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (mount_info::init): First try to fetch mount points from + fstab files. Fallback to registry if none exists. + (skip_ws): New inline function. + (find_ws): Ditto. + (struct opt): New structure for mount options. + (read_flags): New static function to convert a mount flags string into + a flag value. + (mount_info::from_fstab_line): New method to create a mount table + entry from a fstab line. + (mount_info::from_fstab): New method to read fstab file. + * shared_info.h (mount_info::from_fstab_line): Declare. + (mount_info::from_fstab): Declare. + +2008-04-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (enum symlink_t): Rename from shortcut_t. + +2008-04-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_reparse_point): Use NtFsControlFile + to read reparse points. + (enum shortcut_t): New type. + (symlink_info::check): Convert sym_check to shortcut_t. Use shortcut_t + enum values throughout. Check reparse point before checking for + sysfile shortcut. Open reparse points with READ_CONTROL only to + accommodate special Vista reparse points. Add comments. + +2008-04-02 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (get_lock_parent_dir): Drop call to NtOpenDirectoryObject + and utilize OBJ_OPENIF flag in call to NtCreateDirectoryObject. + (inode_t::inode_t): Ditto. Same for NtOpenMutant/NtCreateMutant. + +2008-04-02 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Change lockf to being implemented. + +2008-04-02 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (insert_file): Convert filename to WCHAR and call + CreateFileW to allow UTF-8 filenames. + +2008-04-01 Corinna Vinschen <corinna@vinschen.de> + + * Fix copyright dates. + +2008-04-01 Corinna Vinschen <corinna@vinschen.de> + + Throughout, call fcntl64 instead of fcntl or fcntl_worker. + * fcntl.cc (fcntl_worker): Remove. + (fcntl64): Add fault handler. Move fcntl_worker stuff here. Add case + for locking and call fhandler's lock method directly. Make sure that + F_FLOCK flag isn't set in lock call. + (_fcntl): Add fault handler. + * fhandler.cc (fhandler_base::fcntl): Drop lock cases. + * flock.cc (flock): Add fault handler. Simplify code. Call fhandlers + lock method directly instead of fcntl_worker. Add debug output. + (lockf): Add fault handler. Call fhandlers lock method directly + instead of fcntl_worker. Add debug output. + * winsup.h (fcntl_worker): Drop declaration. + (fcntl64): Declare. + +2008-03-31 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (__small_vswprintf): Fix uninitialized usage of `w'. + + Revamp advisory file locking to avoid cross reference pointers as well + as to allow BSD flock semantics. More agressively delete unused nodes + and sync objects. + * fhandler.h (fhandler_base::ino): Rename from namehash. Fix comment. + (fhandler_base::node): Remove. + (fhandler_base::unique_id): Add. + (fhandler_base::del_my_locks): New method. + (get_ino): Rename from get_namehash. Change usage throughout Cygwin. + (get_unique_id): New method. + * fhandler.cc (fhandler_base::close): Call own del_my_locks method. + Fix comment. + (fhandler_base::fhandler_base): Accommodate new and changed members. + (fhandler_base::fixup_after_fork): Call del_my_locks. + (fhandler_base::fixup_after_exec): Ditto for files with close-on-exec + flag set. + * fhandler_disk_file.cc (get_ino_by_handle): Rename from + readdir_get_ino_by_handle. Accommodate throughout. + (fhandler_base::open_fs): Fill ino with inode number if FS has good + inodes. Allocate a LUID and store in unique_id to recognize file + descriptors referencing the same file object. + * flock.cc: Drop flock TODO comments. Use explicit types __dev32_t + and __ino64_t instead of dev_t and ino_t. + (LOCK_OBJ_NAME_LEN): Change to reflect longer lf_id length. + (get_obj_handle_count): New method. + (lockf_t::lf_id): Change type to long long. + (inode_t::get_lock_obj_handle_count): Drop in favor of static function + get_obj_handle_count. + (inode_t::del_locks): Remove. + (inode_t::get): Add create_if_missing flag argument. + (inode_t::del_my_locks): Reimplement to handle POSIX and BSD flock + locks. Return if node can be deleted or not. + (inode_t::~inode_t): Ditto. Close handles to i_dir and i_mtx. + (fixup_lockf_after_fork): Remove. + (fhandler_base::del_my_locks): New method. + (fixup_lockf_after_exec): Check if node can be deleted. + (inode_t::get): Only create node if create_if_missing is set. Lock + the returned node here before unlocking the node list. + (inode_t::get_all_locks_list): Accommodate new lf_id length. + (inode_t::create_lock_obj): Ditto. + (lockf_t::open_lock_obj): Ditto. Change return type to bool. De-const. + Set lf_obj instead of returning a handle. + (lockf_t::del_lock_obj): Call SetEvent only if new incoming parameters + allow it. Explain how it's supposed to work. + (fhandler_disk_file::lock): Only fetch file length in SEEK_END case. + Use NtQueryInformationFile(FileStandardInformation) instead of + calling fstat_by_handle. Always unlock node before returning. + Use fhandler's unique id to create lf_id for BSD flock locks. + Rely on node lock from inode_t::get. Call del_lock_obj on removed + locks here to allow explicit unlocking. Delete node if no lock exists + on the file anymore. + (lf_setlock): Get file handle as additional parameter. Handle the fact + that lf_getblock now always opens the attached event object. Reactivate + erroneously applied patch which deactivates setting thread priority. + Additionally handle blocking on BSD flock locks. + (lf_clearlock): Get file handle as additional parameter. + (lf_getlock): Close event handle opened by lf_getblock. + (lf_getblock): Open potentially blocking event object here and check + its signal state if it's a BSD flock lock. + (lf_wakelock): Get file handle as additional parameter. + * fork.cc (frok::child): Drop call to fixup_lockf_after_fork. + * ntdll.h (struct _EVENT_BASIC_INFORMATION): Define. + (enum _EVENT_INFORMATION_CLASS): Define. + (NtQueryEvent): Declare. + + * fhandler.h (fhandler_base::fs_flags): Remove. + (fhandler_base::set_fs_flags): Remove. + (fhandler_base::get_fs_flags): Remove. + * fhandler.cc (fhandler_base::write): Check for sparse file using + pc.fs_flags(). + * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto. + + The return of the volume serial number in fs_info. + * fhandler.h (get_dev): New method. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call to + NtQueryVolumeInformationFile(FileFsVolumeInformation). Just use + get_dev() method. + * fhandler_fifo.cc (fhandler_fifo::open) Use device ID and inode number + to generate fifo name. + * path.h (fs_info::sernum): New member. + (fs_info::serial_number): New method. + (path_conv::fs_serial_number): New method. + * path.cc (fs_info::update): Fetch volume serial number and store in + sernum. + +2008-03-28 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (lockf_t::operator new): Add operator taking a pointer. Call + cmalloc instead of ccalloc in the default operator. Add comments. + (inode_t::operator new): Call cmalloc instead of ccalloc. + (inode_t::get_all_locks_list): Return lockf_t pointer. + (inode_t::del_all_locks_list): Delete. Remove calls throughout. + (inode_t::get): Handle failing new gracefully. + (MAX_LOCKF_CNT): Define. + (inode_t::get_all_locks_list): Use pre-allocated buffer in i_all_lf + instead of allocating every lock. Return pointer to start of linked + list of locks. + (lockf_t::open_lock_obj): Create event object non-inheritable. + (fhandler_disk_file::lock): Handle failing new gracefully. + (lf_setlock): Allocate temporary buffer for node->i_all_lf from TLS. + Remove erroneous NtClose call. + (lf_getlock): Allocate temporary buffer for node->i_all_lf from TLS. + (lf_getblock): Set lf to return value of get_all_locks_list. + +2008-03-27 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (FLOCK_PARENT_DIR_ACCESS): Define. + (FLOCK_INODE_DIR_ACCESS): Define. + (FLOCK_MUTANT_ACCESS): Define. + (FLOCK_EVENT_ACCESS): Define. + (SD_MIN_SIZE): Define. + (everyone_sd): Define to simplify calling _everyone_sd. + (_everyone_sd): Replace everyone_sync_sd. Take SECURITY_DESCRIPTOR as + argument and allow to specify access mask. + (get_lock_parent_dir): Open/Create parent dir with + FLOCK_PARENT_DIR_ACCESS. Add text to api_fatal message. + (inode_t::inode_t): Open/Create dir with FLOCK_INODE_DIR_ACCESS. + Open/Create mutant with FLOCK_MUTANT_ACCESS. Add text to api_fatal + message. + (lockf_t::create_lock_obj): Create event with FLOCK_EVENT_ACCESS. + Add text to api_fatal message. + (lockf_t::open_lock_obj): Open event with FLOCK_EVENT_ACCESS. + On failure, just return NULL pointer instead of calling api_fatal. + (lockf_t::get_lock_obj_handle_count): Replace call to small_printf + with call to debug_printf. + (lf_setlock): Handle a failure to open the lock event object as + EDEADLK. Call system_printf if opening sync objects fail. + * ntdll.h (DIRECTORY_TRAVERSE): Define. + (DIRECTORY_CREATE_OBJECT): Define. + (DIRECTORY_CREATE_SUBDIRECTORY): Define. + (EVENT_QUERY_STATE): Define. + +2008-03-27 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Fix setting errno in case of trailing "/." + +2008-03-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: Create shared objects session local throughout. + * shared.cc (shared_name): Add argument to allow opening session + local shared memory. + * shared_info.h (shared_name): Change declaration accordingly. + +2008-03-26 Christopher Faylor <me+cygwin@cgf.cx> + + Implement method of detecting a missing dll as suggested by Brian + Dessent. + * hookapi.cc (find_first_notloaded_dll): New function. + * pinfo.cc (status_exit): New function. Issue message when dll not + found. Use find_first_notloaded_dll to find a nonexistent dll. + (pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit + code >= 0xc0000000UL. + * sigproc.cc (child_info::proc_retry): Return exit code when + STATUS_DLL_NOT_FOUND. + * spawn.cc (spawn_guts): Minor cleanup. + * syscalls.cc (close_all_files): Don't actually close stderr + filehandle. Just make it noninheritable. + * winsup.h (find_first_notloaded_dll): Declare new function. + +2008-03-26 Brian Dessent <brian@dessent.net> + + * ntdll.h: Add several missing NTSTATUS defines. + +2008-03-24 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (inode_t::get_all_locks_list): Don't allow F_WAIT flag + in lock event object name. + (lockf_t::create_lock_obj): Ditto. + (lockf_t::open_lock_obj): Ditto. + (lf_setlock): Only check POSIX locks for deadlock condition. + (lf_findoverlap): Don't let POSIX and flock locks interact. + +2008-03-24 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc: Clarify a couple of comments. + (lf_setlock): Treat not being able to sync on a process as a potential + deadlock situation. Close process handle using CloseHandle. + +2008-03-24 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc: Fix typo in comment. + +2008-03-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::dup): Drop setting flags in the parent. + + Implement advisory file locking. + * cygheap.h (struct init_cygheap): Add inode_list member. + * cygwin.din (lockf): Export. + * dcrt0.cc (child_info_spawn::handle_spawn): Call + fixup_lockf_after_exec. + * dtable.h (class dtable): Add fhandler_disk_file as friend class. + * fhandler.cc (fhandler_base::close): Call del_my_locks if node is set. + (fhandler_base::fhandler_base): Initialize node to NULL. + (fhandler_base::fixup_after_fork): Ditto. + * fhandler.h (class fhandler_base): Add member node. + * fhandler_disk_file.cc (fhandler_disk_file::lock): Delete. + * flock.cc: Implement all advisory file locking here. + (fhandler_disk_file::lock): Implement here. + (flock): Call fcntl with F_FLOCK bit set. Remove test main function. + (lockf): New function. + * fork.cc (frok::child): Call fixup_lockf_after_fork. + * ntdll.h (DIRECTORY_ALL_ACCESS): Define. + (struct _OBJECT_BASIC_INFORMATION): Define. + (enum _EVENT_TYPE): Define. + (NtCreateDirectoryObject): Declare. + (NtCreateEvent): Declare. + (NtCreateMutant): Declare. + (NtOpenEvent): Declare. + (NtOpenMutant): Declare. + * include/cygwin/version.h: Bump API minor number. + +2008-03-22 Christopher Faylor <me+cygwin@cgf.cx> + + * dtable.cc (handle_to_fn): Modify to return true if handle represents + a cygwin tty. + (dtable::init_std_file_from_handle): Detect when we've seen a cygwin + pipe and use it in overlapped mode by default. + (decode_tty): Make static. + +2008-03-22 Christopher Faylor <me+cygwin@cgf.cx> + + * dtable.cc: Define various device-related string constants as wide + character constants. + (dtable::init_std_file_from_handle): Reorganize pipe handling to try to + catch special tty case. + (build_fh_name_worker): Declare for common use. + (build_fh_name): Define char version. + (build_fh_name): Define (currently unused) UNICODE_STRING version. + (decode_tty): Detect if pipe is actually a cygwin tty, returning the + tty name in the buffer. + (handle_to_fn): Reorganize to use wide characters. + * dtable.h (build_fh_name): Declare (currently unused) UNICODE_STRING + version. + * fhandler_tty.cc (fhandler_pty_master::setup): Use + fhandler_pipe::create_selectable to create a pipe with a given name. + * pipe.cc (pipe_handler): Make returned handle inheritable. + (fhandler_pipe::create_selectable): Take an optional name. Use a + standard cygwin introducer for the name. + + * path.cc (path_conv::check): Make first argument const. + * path.h (path_conv::check): Ditto for declaration. + (path_conv::path_conv): Ditto for UNICODE_STRING version. + +2008-03-18 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h: Revert erroneous move of `#ifdef WINVER' to + another location. + +2008-03-14 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc (fcntl_worker): Protect with a 'myfault'. + + * path.cc (normalize_posix_path): Treat X:/ as Win32 path, too. + + * smallprint.cc (__wrn): New static function. + (__small_vswprintf): New function to generate WCHAR strings. + (__small_swprintf): Ditto. + * winsup.h (__small_swprintf): Declare. + (__small_vswprintf): Declare. + +2008-03-13 Corinna Vinschen <corinna@vinschen.de> + + * path.sgml: Remove documentation for old path API. Add documentation + for new path API. + * security.sgml: New file to document cygwin_set_impersonation_token + and cygwin_logon_user with only eight years of delay. + * shared.sgml: Remove file. + * include/sys/cygwin.h (cygwin32_attach_handle_to_fd): Move declaration + into fully deprecated function block. + (cygwin_logon_user): Move declaration down to declaration of + cygwin_set_impersonation_token. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Just return with 0 if filenames are identical, + per POSIX. Drop comment added in previous patch. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Handle a special case of trying to rename a + mount point. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * environ.h: Fix comment. + * winsup.h: Ditto. Reflect the fact that CYG_MAX_PATH is deprecated. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * pipe.cc (fhandler_pipe::create_selectable): Use MAX_PATH instead of + CYG_MAX_PATH. + * tty.cc (tty_list::init_session): Ditto. + (tty::alive): Ditto. + (tty::open_mutex): Ditto. + (tty::create_inuse): Ditto. + (tty::get_event): Ditto. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Disable + munging. Convert all chars in the 0xf0xx area to it's ascii equivalent. + * path.cc (normalize_posix_path): Don't treat "X:foo" as windows path, + only "X:\foo". + (tfx_chars): New transformation table for special DOS chars. + (tfx_chars_managed): Ditto, plus transformation of uppercase ASCII + chars. + (transform_chars): New function. + (get_nt_native_path): Make static. Call transform_chars for all valid + FS paths. Get additional flag if file is managed or not. Accommodate + throughout. + (getfileattr): Get additional flag if file is managed or not. + Accommodate throughout. + (path_conv::check): Disable special handling for trailing dots and + spaces. + (mount_item::build_win32): Disable code for managed paths. + (mount_info::conv_to_posix_path): Ditto. + * path.h (get_nt_native_path): Remove declaration. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't + copy filename twice in the non-managed case. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767. + Accommodate change throughout. + + * cygwin.din (cygwin_conv_path): Export. + (cygwin_conv_path_list): Export. + (cygwin_create_path): Export. + * dcrt0.cc (dll_crt0_1): Use cygwin_conv_path. + * dtable.cc (handle_to_fn): Ditto. Don't expect UNICODE_STRING being + 0-terminated. + * environ.cc (env_plist_to_posix): New helper function. + (env_plist_to_win32): Ditto. + (env_path_to_posix): Ditto. + (env_path_to_win32): Ditto. + (return_MAX_PATH): Remove. + (conv_envvars): Use new helper functions. Drop removed members. + (win_env::operator =): Accommodate removal of path length functions. + (win_env::add_cache): Accommodate new env helper function API. + (posify): Ditto. + * environ.h (struct win_env): Ditto. Remove path length function + pointers since they are unused. + * path.cc (warn_msdos): Use cygwin_conv_path. + (getfileattr): Use new tmp_pathbuf::u_get method. + (fillout_mntent): Ditto. + (symlink_info::check): Ditto. + (path_conv::check): Use sizeof (WCHAR) instead of constant 2. + (symlink_info::check_reparse_point): Ditto. + (conv_path_list): Get max size of target string as argument. Call + cygwin_conv_path as helper function. + (cygwin_conv_path): New function. + (cygwin_create_path): New function. + (cygwin_conv_to_win32_path): Just call cygwin_conv_path with size set + to MAX_PATH. + (cygwin_conv_to_full_win32_path): Ditto. + (cygwin_conv_to_posix_path): Ditto. + (cygwin_conv_to_full_posix_path): Ditto. + (conv_path_list_buf_size): Add FIXME comment. + (env_PATH_to_posix): Rename from env_win32_to_posix_path_list. + Add size argument as required for env helper functions. + (cygwin_win32_to_posix_path_list): Call conv_path_list with size set to + MAX_PATH. + (cygwin_posix_to_win32_path_list): Ditto. + (cygwin_conv_path_list): New function. + (cwdstuff::get): Fix length argument in call to sys_wcstombs. + * spawn.cc (find_exec): Use cygwin_conv_path_list. + * tls_pbuf.h (tmp_pathbuf::u_get: New method. + * uinfo.cc (cygheap_user::ontherange): Allocate temporary path buffers + using tmp_pathbuf. Use cygwin_conv_path. + * winf.cc (av::unshift): Use cygwin_conv_path. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h: Comment out old cygwin32_XXX API. + Mark old path handling API as deprecated. + (cygwin_conv_path_t): Typedef. Define values. + (cygwin_conv_path): Declare. + (cygwin_create_path): Declare. + (cygwin_conv_path_list): Declare. + +2008-03-11 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (get_full_path_of_dll): Allow paths up to PATH_MAX. + (dlopen): Call get_full_path_of_dll with path buffer allocate by + tmp_pathbuf. + +2008-03-11 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (find_exec): Use tmp_pathbuf to allocate path buffer. + +2008-03-11 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Use tmp_pathbuf to + allocate path buffer. + (handle_to_fn): Ditto. Allocate fnbuf big enough to get long path + names. + +2008-03-11 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Make sure drive_length is 0 for virtual + paths. Add comments. + * spawn.cc (spawn_guts): Don't allow to start a native Win32 application + from a long path or a virtual path. Print an error message to stderr. + +2008-03-11 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (parse_options): Use tmp_pathbuf to allocate buffer. + (regopt): Take tmp buffer as additional argument. + (environ_init): Alllcate tmpbuf earlier. Use as temporary buffer in + call to regopt. + * tls_pbuf.cc (tmp_pathbuf::c_get): Allocate one additional char. + (tmp_pathbuf::w_get): Allocate one additional WCHAR. + * winf.cc (av::unshift): Use tmp_pathbuf to allocate buffer. + +2008-03-11 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (sync): Use MAX_PATH rather than CYG_MAX_PATH. + +2008-03-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_console): Add write_buf as pointer to + temporary buffer space. + * fhandler_console.cc (CONVERT_LIMIT): Define as NT_MAX_PATH. Add + comment. + (fhandler_console::write_normal): Use write_buf throughout. + (fhandler_console::write): Use tmp_pathbuf to allocate write_buf. + +2008-03-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::write_normal): Don't print + chars marked as ERR chars. + +2008-03-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (dev_console::con_to_str): Declare returning DWORD. + * fhandler_console.cc (dev_console::con_to_str): Return number of + multibyte char bytes. + (fhandler_console::read): Set nread to number of multibyte char bytes + returned from con_to_str. + (fhandler_console::write_normal): Reorder trunc buffer preocessing. + Return after writing valid multibyte sequence out of trunc buffer. + Change comments slightly. + +2008-03-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (DIR_BUF_SIZE): Define required space for file + name in terms of sizeof(WCHAR). + (fhandler_disk_file::readdir_helper): Convert *all* of fname. + * path.cc (fillout_mntent): Use tmp_pathbuf for path buffer. + (symlink_worker): Ditto. + (SCAN_JUSTCHECKTHIS): New state for suffix_scan to define + that only the actual name gets cheked and a suffix is never attached. + (suffix_scan::has): If filename + suffix would be > NAME_MAX, start + in SCAN_JUSTCHECKTHIS state. + (suffix_scan::next): Add case for SCAN_JUSTCHECKTHIS. + (symlink_info::check): Use tmp_pathbuf for path buffer. Goto + file_not_symlink in case of invalid file name. + (realpath): Use tmp_pathbuf for path buffer. + +2008-03-07 Brian Dessent <brian@dessent.net> + + * dtable.cc (handle_to_fn): Null-terminate posix_fn in the case + of justslash = true. + +2008-03-07 Brian Dessent <brian@dessent.net> + + * fhandler.cc (fhandler_base::open): Use %S for PUNICODE_STRING. + * syscalls.cc (setmode): Ditto. + +2008-03-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::sendto): Never send more than + 64K. Add comment to explain why. + (fhandler_socket::sendmsg): Ditto. + +2008-03-07 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add tls_pbuf.o. + * autoload.cc (CreateDesktopW): Replace CreateDesktopA. + (CreateWindowStationW): Replace CreateWindowStationA. + (GetUserObjectInformationW): Replace GetUserObjectInformationA. + * cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH. + * cygtls.cc (_cygtls::remove): Free temporary TLS path buffers. + * cygtls.h (TP_NUM_C_BUFS): Define. + (TP_NUM_W_BUFS): Define. + (class tls_pathbuf): New class to store pointers to thread local + temporary path buffers. + (_local_storage::pathbufs): New member. + * environ.cc (win_env::add_cache): Use temporary TLS path buffer instead + of stack based buffer. + (posify): Get temporary outenv buffer from calling function. + (environ_init): Create temporary TLS path buffer for posify. + (build_env): Create Windows environment block as WCHAR buffer. + * environ.h (build_env): Change declaration accordingly. + * external.cc (sync_winenv): Accommodate build_env change. + * fhandler_console.cc (fhandler_console::need_invisible): Use + GetUserObjectInformationW and CreateWindowStationW. + * fhandler_process.cc (format_process_maps): Use temporary TLS path + buffer instead of stack based buffer. + * fork.cc (frok::parent): Convert to use CreateProcessW. + * path.cc: Throughout use temporary TLS path buffers instead of stack + based buffer. Replace checks for CYG_MAX_PATH by checks for + NT_MAX_PATH. + (getfileattr): New function to replace GetFileAttributesA. + (normalize_win32_path): Remove Win32 and NT long path prefixes. + (getwd): Assume PATH_MAX + 1 buffer per SUSv3. + * path.h (class path_conv): Set path buffer to size NT_MAX_PATH. + (iswdrive): Define. + * pinfo.cc (commune_process): Use temporary TLS path buffer instead of + stack based buffer. + * registry.cc (get_registry_hive_path): Ditto. + (load_registry_hive): Ditto. + * spawn.cc (spawn_guts): Convert to use CreateProcessW and + CreateProcessAsUserW. + (av::fixup): Open/close file using NtOpenFile/NtClose. + * syscalls.cc (mknod_worker): Allow PATH_MAX file name. + (mknod32): Ditto. + (getusershell): Ditto. + * tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf + methods. + * tls_pbuf.h: New header for files using tmp_pathbuf. + * tlsoffsets.h: Regenerate. + * winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow. + +2008-03-06 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. + +2008-03-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open_): Add missing test for O_CREAT. + Fix comment. + +2008-03-05 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (~child_info_spawn): Check moreinfo->myself_pinfo for + NULL before closing. + * spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely + in case of failing CloseProcess. + + * fhandler.cc (fhandler_base::open_): Return EISDIR when trying to + create a directory. + * path.cc (path_conv::check): If input path had a trailing dir + separator, tack it on to the native path if directory doesn't exist. + +2008-03-02 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc (_cygtls::init_exception_handler): Semi-revert to making + only ourselves the exception handler and nothing else. + * exceptions.cc (open_stackdumpfile): Use correct format specifiers for + unicode when printing the name of the stackdump file. + (stack_info::walk): Stop walking if ebp points into cygwin itself. + (_cygtls::handle_exceptions): Detect when signal is masked and treat as + if it was not caught. Reinitialize exception handler to known state to + avoid subsequent attempts to call Windows exception handlers if an + exception occurs in a signal handler. Revert to a 'return 0' rather + than using a goto. + + * strfuncs.cc (sys_wcstombs_alloc): Minor formatting tweak. + * winsup.h: Fix comment typo. + +2008-03-02 Christopher Faylor <me+cygwin@cgf.cx> + + * smallprint.cc (__small_vsprintf): Free allocated buffer rather than + pointer into the buffer. + +2008-03-01 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.h (_cygtls::handle_threadlist_exception): Eliminate. + (_cygtls::init_threadlist_exceptions): Ditto. + * cygtls.cc (_cygtls::handle_threadlist_exception): Eliminate. + (_cygtls::init_threadlist_exceptions): Ditto. + (_cygtls::find_tls): Use myfault handling to deal with errors caused by + nonexistent threads. + * sigproc.cc (wait_sig): Eliminate call to init_threadlist_exceptions. + +2008-03-01 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc (_cygtls::init_exception_handler): Just return. + +2008-03-01 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::handle_exceptions): Only call rtl_unwind when + exiting. Just return, don't set thread context. + * gendef (_setjmp): Store %fs:0 in jmp_buf. + (_sjfault): Ditto. + (_ljfault): Restore %fs:0 from jmp_buf. + (_longjmp): Ditto. + +2008-02-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call close_fs + instead of close to avoid calling close from wrong class when changing + a file system based device node. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::facl): Ditto. + +2008-02-28 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::handle_exceptions): When being debugged, + leave through SetThreadContext, too, to keep exception handler stack + intact. + +2008-02-28 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (open_stackdumpfile): Add comments. + +2008-02-28 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (open_stackdumpfile): Use NtCreateFile to create + stackdump file. + +2008-02-27 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (stack_info::walk): Fix typo. + +2008-02-27 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::init_exception_handler): Fix comment. + +2008-02-27 Corinna Vinschen <corinna@vinschen.de> + + * (struct __DIR_cache): Switch order of members so that the buffer + given to NtQueryDirectoryFile is 8 byte aligned. + +2008-02-27 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc (_cygtls::handle_threadlist_exception): Make it clear that + the function never actually returns. + * exceptions.cc (_cygtls::handle_exceptions): Jump out of function + rather than returning to avoid meddling by previously installed + exception handlers. + +2008-02-25 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is + enabled. Replace calls to GetEnvironmentVariable by calls to + GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA + with NULL buffer. + (cygbench): Ditto, drop local buffer. + * environ.cc (getearly): Call GetEnvironmentVariableA. + (environ_init): Retrieve unicode environment and convert to current + codepage locally. + (getwinenveq): Ditto. + * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling + convention. + * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve + required buffer length. + * fork.cc (frok::child): Call GetEnvironmentVariableA. + * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs. + * sec_auth.cc: Ditto. + * strfuncs.cc (sys_wcstombs_alloc): Fix formatting. + (sys_mbstowcs): Change arguments to allow specifying a source string + length. + (sys_mbstowcs_alloc): Ditto. + * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in + calls to sys_mbstowcs. + * winsup.h (sys_mbstowcs): Adjust declaration. + (sys_mbstowcs_alloc): Ditto. + +2008-02-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Revert error handling change in case + DuplicateHandle fails, because it breaks Vista/Longhorn workaround. + +2008-02-19 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (sig_send): Use sigmask of target thread if it is + specified otherwise default to main sigmask. + +2008-02-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fpathconf): Fix _PC_NAME_MAX and + _PC_PATH_MAX cases. + +2008-02-15 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h (__INT_MAX_PATH): Remove. + (external_pinfo): Convert program_long to pointer. + * external.cc (fillout_pinfo): Add buffer for program_long value. + +2008-02-15 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h (__INT_MAX_PATH): Define to 32K. + (external_pinfo): Set size of program_long to __INT_MAX_PATH. + +2008-02-15 Christopher Faylor <me+cygwin@cgf.cx> + + * include/sys/cygwin.h (external_pinfo): Define program_long size using + external buffer size rather than cygwin-internal buffer size. + +2008-02-15 Christopher Faylor <me+cygwin@cgf.cx> + + Perform whitespace cleanup throughout. + + * dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards + compatibility. + (check_sanity_and_sync): Ditto. + * winsup.h (SIGTOMASK): Ditto. Just use constant in signal + calculation. + * include/cygwin/version: Remove backwards signal mask compatibility + define. + + * path.cc (symlink_info::check_sysfile): Cosmetic change. + + * registry.cc (get_registry_hive_path): Remove unneeded variable. + + * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and + use either main sigmask or current thread sigmask. + (set_process_mask): Ditto. + (sighold): Ditto. + (sigrelse): Ditto. + (sigset): Ditto. + (set_process_mask_delta): Ditto. + (_cygtls::call_signal_handler): Ditto. + * fhandler_process.cc (format_process_status): Ditto. + * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. + * pinfo.h (class pinfo): Ditto. + * select.cc (pselect): Ditto. + * signal.cc (sigprocmask): Ditto. + (abort): Ditto. + (sigpause): Ditto. + (sigsend): Ditto. + (wait_sig): Ditto. + * thread.h (pthread::parent_tls): New member. + * thread.cc (pthread::pthread): Record parent_tls here. + (pthread::thread_init_wrapper): Initialize sigmask from parent thread. + +2008-02-14 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cwcsdup): New function. + (cwcsdup1): New function. + * cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR. + (cwcsdup): Declare. + (cwcsdup1): Declare. + * registry.cc (get_registry_hive_path): Use WCHAR instead of char + throughout. + (load_registry_hive): Ditto. + * registry.h (get_registry_hive_path): Change declaration accordingly. + (load_registry_hive): Ditto. + * sec_helper.cc (cygpsid::string): New method returning PWCHAR. + * security.h (cygpsid::string): Declare. + * syscalls.cc (seteuid32): Convert local name var to WCHAR. + * uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers + to WCHAR. Call sys_wcstombs_alloc to generate puserprof buffer. + + * winsup.h: Fix comment. + (NT_MAX_PATH): New definition for maximum internal path length. + Use throughout where appropriate. + * include/limits.h (PATH_MAX): Set to 4096 as on Linux. + +2008-02-13 Christopher Faylor <me+cygwin@cgf.cx> + + * configure.in: Remove non-working options. + * configure: Regenerate. + +2008-02-13 Christopher Faylor <me+cygwin@cgf.cx> + + * syscalls.cc (_isatty): Define as an alias to isatty to override + newlib version. + + * thread.cc (pthread_kill): Deal with signal 0 as per POSIX and also + avoid manipulating an invalid thread. + +2008-02-13 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Move llrint, llrintf, llrintl, lrintl, rintl, wcstol, + wcstoll, wcstoul, wcstoull, wcsxfrm from unimplemented to implemented + POSIX interfaces. + Change headline of "GNU extensions" to "GNU and Linux extensions". + Add fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, lgetxattr, + listxattr, llistxattr, lremovexattr, lsetxattr, removexattr, setxattr, + wcpcpy and wcpncpy to list of implemented GNU functions. + +2008-02-13 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::init_exception_handler): Revert patch + from 2005-12-02. + * exceptions.cc (stack_info::walk): Add workaround for NT 5.2 + 64 bit OSes. + * wincap.h (wincaps::has_restricted_stack_args): New element. + * wincap.cc: Implement above element throughout. + (wincapc::init): Reset has_restricted_stack_args if not running + under WOW64. + +2008-02-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): Remove unused + attr. + (fhandler_disk_file::fsetxattr): Ditto. + * include/attr/xattr.h: New file. + +2008-02-11 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Fix typo in call to sys_wcstombs. + * miscfuncs.cc (next_char): Initialize ret to keep gcc happy. + +2008-02-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add ntea.o. + * cygwin.din (getxattr, listxattr, removexattr, setxattr, lgetxattr, + llistxattr, lremovexattr, lsetxattr, fgetxattr, flistxattr, + fremovexattr, fsetxattr): Export Linux extended attribute functions. + Sort. + * errno.cc (errmap): Add mappings for ERROR_EAS_DIDNT_FIT, + ERROR_EAS_NOT_SUPPORTED, ERROR_EA_LIST_INCONSISTENT, + ERROR_EA_TABLE_FULL, ERROR_FILE_CORRUPT, ERROR_INVALID_EA_NAME. + * fhandler.h (class fhandler_base): Declare new fgetxattr and + fsetxattr methods. + (class fhandler_disk_file): Ditto. + * fhandler.cc (fhandler_base::fgetxattr): New method. + (fhandler_base::fsetxattr): New method. + * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): New method. + (fhandler_disk_file::fsetxattr): New method. + * ntdll.h (STATUS_EA_TOO_LARGE): Define. + (STATUS_NONEXISTENT_EA_ENTRY): Define. + (STATUS_NO_EAS_ON_FILE): Define. + * ntea.cc (read_ea): Rewrite for long pathnames and for using with + Linux extended attribute functions. + (write_ea): Ditto. + (getxattr_worker): New static function. + (getxattr): New function. + (lgetxattr): New function. + (fgetxattr): New function. + (listxattr): New function. + (llistxattr): New function. + (flistxattr): New function. + (setxattr_worker): New static function. + (setxattr): New function. + (lsetxattr): New function. + (fsetxattr): New function. + (removexattr): New function. + (lsetxattr): New function. + (fsetxattr): New function. + * security.h (read_ea): Change declaration according to above changes. + (write_ea): Ditto. + * include/cygwin/version.h: Bump API minor version. + +2008-02-10 Corinna Vinschen <corinna@vinschen.de> + + * libc/ftw.cc (ftw): Allow nfds <= 0 for glibc compatibility. + * libc/nftw.c (nftw): Ditto. + +2008-02-07 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Set access to + read/write if handle is connected to a tty or console. + * fhandler_dsp.cc (fhandler_dev_dsp::dup): Set open flags correctly + after duplicating from archetype. + * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto. + (fhandler_pty_master::dup): Ditto. + +2008-02-06 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (next_char): Fix typos in comment. + * strfuncs.cc: Remove cygserver guards. + +2008-02-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_console::trunc_buf): Add to use as cache for + truncated multibyte characters on input. + (fhandler_console::write_replacement_char): Declare new method. + * fhandler_console.cc (CONVERT_LIMIT): Raise to 64K. + (fhandler_console::fhandler_console): Initialize trunc_buf. + (ERR): Define as independent value again. + (fhandler_console::write_replacement_char): New method to print + replacement chars. + (fhandler_console::write_normal): Add handling for truncated multibyte + sequences. Call next_char instead of pathetic CharNextExA function. + Don't change src, rather just work with found later on. + * miscfuncs.cc (is_cp_multibyte): Move here from strfuncs.cc. + Don't call Windows function, restrict to well-known ANSI/OEM codepages + and UTF-8. + (next_char): Call CharNextExA only for doublebyte codepages. + Implement for UTF-8 here. + * strfuncs.cc (is_cp_multibyte): Move to miscfuncs.cc. + * winsup.h (next_char): Declare. + * include/limits.h (MB_LEN_MAX): Set to maximum value of MB_CUR_MAX + as defined by newlib for now. + +2008-02-05 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CharToOemA): Remove. + (CharNextExA): Define. + * environ.cc (codepage_init): Un-static. Set active_codepage to + active codepage. Default to ansi regardless of buf pointer. + * fhandler.h (dev_console::get_console_cp): New method. + (dev_console::con_to_str): Change declaration according to new + implementation. + (dev_console::str_to_con): Ditto. + * fhandler_console.cc (cp_convert): Remove. + (dev_console::con_to_str): Redefine to take WCHAR as incoming console + char. + (dev_console::get_console_cp): Return correct codepage according to + alternate_charset_active setting. + (dev_console::str_to_con): Redefine to create WCHAR buffer for console + output. + (fhandler_console::read): Read console input as WCHARs. + (base_chars): Fix typo in comment. + (fhandler_console::char_command): Save and restore console output + buffer using UNICODE functions. + (fhandler_console::write_normal): Convert to write output in UNICODE. + Use CharNextExA to recognize multibyte characters in input. Workaround + problem with UTF-8 and MultiByteToWideChar. Simplify the loop for + printing "normal" characters. + * strfuncs.cc (active_codepage): New variable to store active codepage. + (get_cp): Call codepage_init() if active_codepage is uninitialized. + Just return active_codepage. + (is_cp_multibyte): New function. + * winsup.h (active_codepage): Declare. + (codepage_init): Declare. + (is_cp_multibyte): Declare. + +2008-02-03 Brian Dessent <brian@dessent.net> + + * smallprint.cc (__small_vsprintf): Use HEAP_NOTHEAP for type. + * strfuncs.cc (sys_wcstombs_alloc): Guard use of ccalloc + to !__OUTSIDE_CYGWIN__ for use in cygserver. + (sys_mbstowcs_alloc): Ditto. + +2008-02-01 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (cygwin_wcsncasecmp): Never access more than n + characters. + (cygwin_strncasecmp): Ditto. Fix for strings longer than n. + +2008-02-01 Corinna Vinschen <corinna@vinschen.de> + + * string.h: Re-enable inline strcasematch and strncasematch + implementations and rename to ascii_strcasematch/ascii_strncasematch. + * dcrt0.cc: Replace str[n]casematch with ascii_str[n]casematch where + applicable. + * environ.cc: Ditto. + * fhandler_process.cc: Ditto. + * hookapi.cc: Ditto. + * path.cc: Ditto. + * spawn.cc: Ditto. + * strace.cc: Ditto. + * syscalls.cc: Ditto. + * uinfo.cc: Ditto. + * winf.cc: Ditto. + +2008-01-31 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to current + codepage. + * environ.cc (set_file_api_mode): Always set file api to ANSI if not + using the OEM codepage. + (codepage_init): Allow "utf8" codepage. + * fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and + cast as needed. Always convert input to wide char and write + CF_UNICODETEXT to clipboard. + (fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and + convert to current codepage if CYGWIN_NATIVE format is not available. + * fhandler_console.cc: Drop redundant undef. + * smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING + to current codepage for printing. + * strfuncs.cc: Use PWCHAR throughout. + (get_cp): Return CP_UTF8 for utf8_cp codepage setting. + (sys_wcstombs): Allow NULL target buffer. + (sys_wcstombs_alloc): New function. + (sys_mbstowcs_alloc): Ditto. + * winsup.h (codepage_type): Add utf8_cp. + (HEAP_NOTHEAP): Define. + (sys_wcstombs_alloc): Declare. + (sys_mbstowcs_alloc): Declare. + +2008-01-31 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct cwdstuff): Add dir member to store cwd handle. + (cwdstuff::get_handle): New method. + * path.cc (cwdstuff::set): When doit is true, always try to get + directory handle. Fail if duplicating handle fails. Store handle + in dir. Fix potential SEGV when setting drive_length. + +2008-01-28 Corinna Vinschen <corinna@vinschen.de> + + * path.cc: Fix Samba version in comment. + +2008-01-24 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (fs_info::update): Fix old-style Samba test to support + recent as well as upcoming Samba releases. + +2008-01-22 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (struct _FILE_FS_OBJECTID_INFORMATION): Define. + * path.cc (struct smb_extended_info): Define. + (fs_info::update): Request object id info to get Samba information. + Set flags according to new implementation. + * path.h (struct fs_info): Add samba_version to status_flags. + Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG. + +2008-01-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Open file with + READ_CONTROL for Vista/Longhorn's sake. + +2008-01-15 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (install-libs): Overwrite newlib's libg.a with symlink + to libcygwin.a. + +2008-01-15 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Remove memmem.o. + * memmem.cc: Remove in favor of newlib implementation. + +2008-01-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h: Update copyright. + * include/limits.h: Ditto. + +2008-01-06 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_base::is_tty): Make bool. + (fhandler_serial::is_tty): Ditto. + (fhandler_termios::is_tty): Ditto. + (fhandler_base::is_slow): Return bool value. + (fhandler_socket::is_slow): Ditto. + (fhandler_serial::is_slow): Ditto. + (fhandler_console::is_slow): Ditto. + (fhandler_tty_common::is_slow): Ditto. + (fhandler_tty_master::is_slow): Ditto. + (fhandler_dev_null::is_slow): Ditto. + +2008-01-06 Christopher Faylor <me+cygwin@cgf.cx> + + * include/limits.h (TTY_NAME_MAX): Increase size to same as linux to + allow for (at least) null terminating byte for "/dev/console". + +2008-01-01 Christopher Faylor <me+cygwin@cgf.cx> + + * tty.cc: Update copyright. + * pipe.cc: Ditto. + +2008-01-01 Christopher Faylor <me+cygwin@cgf.cx> + + * newsym: First stab at understanding data as well as functions. + + * pipe.cc (fhandler_pipe::init): Move more intelligence here. + (fhandler_pipe::create): Simplify based on above change. + + * tty.cc (tty_list::allocate): Remove non-NT code. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2009 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2009 new file mode 100644 index 000000000..5638e460c --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2009 @@ -0,0 +1,3483 @@ +2009-12-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::wait_for_events): Drop parameter default + value. + * fhandler_socket.cc (fhandler_socket::connect): Add false as second + parameter to wait_for_events call. + (fhandler_socket::accept): Ditto. + (fhandler_socket::send_internal): Fix typo in call to wait_for_events. + +2009-12-26 Eric Blake <ebb9@byu.net> + + * include/pty.h (openpty, forkpty): Mark last two arguments const, + to match glibc 2.8. + * libc/bsdlib.cc (openpty, forkpty): Likewise. + +2009-12-25 Andy Koppe <andy.koppe@gmail.com> + + * fhandler_console.cc (handler_console::read): Use the tty's VERASE + character as the backspace keycode. + +2009-12-24 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Set fileattr to + FILE_ATTRIBUTE_DIRECTORY in a certain error condition. Explain why. + +2009-12-22 Christopher Faylor <me+cygwin@cgf.cx> + + * select.cc (fhandler_fifo::select_read): Fill in device specific + record. + (fhandler_fifo::select_write): Ditto. + (fhandler_fifo::select_except): Ditto. + +2009-12-21 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cygwin_conv_path): Add band-aid including comment to avoid + conversion from POSIX "." to Win32 ".\\". + +2009-12-21 Corinna Vinschen <corinna@vinschen.de> + + * exec.cc (execvp): Call find_exec with FE_NNF flag to enforce + a NULL return when executable isn't found in $PATH. Convert NULL + to "". + (execvpe): Ditto. + * spawn.cc (spawn_guts): Return with EFAULT if prog_arg is NULL. + Return with ENOENT if prog_arg is empty string. Add a comment. + +2009-12-21 Thomas Wolff <towo@towo.net> + + * fhandler_console.cc (get_nonascii_key): Generate ESC prefix + for Alt modifier generically for function keys and keypad keys. + Distinguish Normal, Ctrl, Shift, Ctrl-Shift rather + than Normal, Ctrl, Shift, Alt, so that in combination with generic + Alt handling all 8 combinations of these modifiers are distinguished. + (keytable): Add escape sequences for remaining modified + function keys as a compatible extension using rxvt escape codes. + Also distinguish keypad keys modified with Ctrl, Shift, Ctrl-Shift + using xterm-style modifier coding. + +2009-12-21 Corinna Vinschen <corinna@vinschen.de> + + Throughout, revert ill-conceived replacement of hMainThread with + GetCurrentThread/NtCurrentThread. + * dcrt0.cc (dll_crt0_0): Duplicate main thread handle to hMainThread + again. + +2009-12-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (__vt100_conv): Minor formatting change. + +2009-12-19 Thomas Wolff <towo@towo.net> + + * fhandler_console.cc (write_console): Check for VT100 + graphics mode and transform wide characters in ASCII small + letter range to corresponding graphics. + (__vt100_conv): Table to transform small ASCII letters to line + drawing graphics for use in VT100 graphics mode. + (write_normal): Check for SO/SI control characters to + enable/disable VT100 graphics mode. + (base_chars): Enable SO/SI control characters for detection. + (write): Check for ESC ( 0 / ESC ( B escape sequences to + enable/disable VT100 graphics mode. Also detect ">" while + parsing ESC [ sequences to distinguish specific requests. + (char_command): Distinguish Secondary from Primary Device Attribute + request to report more details about cygwin console terminal version. + * fhandler.h (vt100_graphics_mode_active): New flag to indicate mode. + (saw_greater_than_sign): New parse flag for ESC [ > sequences. + (gotparen, gotrparen): New state values to parse ESC ( / ) sequences. + + * fhandler_console.cc (read): Allow combined Alt-AltGr modifiers + to also produce an ESC prefix like a plain Alt modifier, e.g. to make + Alt-@ work on a keyboard where @ is AltGr-q. + +2009-12-18 Eric Blake <ebb9@byu.net> + + * signal.cc (nanosleep): Fix bug in previous patch. + +2009-12-18 Corinna Vinschen <corinna@vinschen.de> + + Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcess + according to context. Throughout, replace hMainThread with + GetCurrentThread/NtCurrentThread according to context. + * dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to + hMainProc. Drop duplication of GetCurrentThread to hMainThread. + * dtable.cc (dtable::stdio_init): Remove useless comment. + * globals.cc (hMainProc): Remove. + (hMainThread): Remove. + * ntdll.h (NtCurrentProcess): Define. + (NtCurrentThread: Define. + +2009-12-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_registry::value_name): Convert to wchar_t*. + * fhandler_registry.cc: Call UNICODE registry functions throughout + and convert to multibyte using current locale's charset. Accommodate + throughout. + (must_encode): Take wchar_t. + (encode_regname): Convert from wchar_t *. + (decode_regname): Convert to wchar_t *. + +2009-12-18 Corinna Vinschen <corinna@vinschen.de> + + * path.sgml (func-cygwin-conv-path): Clarify meaning of size parameter. + (func-cygwin-conv-path-list): Fix typo. + (func-cygwin-posix-path-list-p): Ditto. + +2009-12-17 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Handle remote shares as well. Just rename + files in this case, instead of moving them to the recycler. Create + even more unique filename. Add comment to explain filename. + (unlink_nt): Remove code returning with EBUSY on remote shares. + Set bin_stat to move_to_bin except on NFS. Add comment to explain. + +2009-12-17 Eric Blake <ebb9@byu.net> + + * signal.cc (nanosleep): Support 'infinite' sleep times. + (sleep): Avoid uninitialized memory. + +2009-12-16 Thomas Wolff <towo@towo.net> + + * fhandler_console.cc (read): Detect and handle mouse wheel scrolling + events (for completion of mouse reporting mode 1000) and mouse + movement events (for additional mouse reporting modes 1002 and 1003). + Use mouse_aware() as a guard and only condition for mouse + reporting in order to enforce consistence of read() and select(). + Add focus reports (for additional focus reporting mode 1004). + (mouse_aware): Enable detection of additional mouse events for select(). + Tune function to precisely match actual reporting criteria. + Move adjustment of mouse position (by window scroll offset) + here to avoid duplicate code. + (char_command): Initialization of enhanced mouse reporting modes. + Initialization of focus reporting mode. + * fhandler.h (use_mouse): Change flag (bool->int) to indicate + additional mouse modes. Add flag to indicate focus reporting. + (mouse_aware): Move enhanced function into fhandler_console.cc. + * select.cc (peek_console): Use modified mouse_aware() for more + general detection of mouse events. Also check for focus reports. + +2009-12-16 Corinna Vinschen <corinna@vinschen.de> + + * registry.cc (cygnus_class): Remove. + (reg_key::build_reg): Don't set class when creating key. + +2009-12-15 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_setsockopt): Only skip calling setsockopt(SO_REUSEADDR) + on stream sockets under systems supporting enhanced socket security. + +2009-12-15 Thomas Wolff <towo@towo.net> + + * fhandler_console.cc (char_command): Fix code to select dim mode + to 2 rather than 9. Add entries for mode 22 (normal, not bold) + 28 (visible, not invisible), 25 (not blinking). + +2009-12-14 Corinna Vinschen <corinna@vinschen.de> + + * libc/getopt.c (getopt_internal): Set optreset according to optind + setting earlier. Reevaluate POSIXLY_CORRECT if optreset is set to !0. + Handle a leading '-' in options independently of posixly_correct. + +2009-12-09 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_fifo.cc (fhandler_fifo::open): Avoid resetting errno after + it has been explicitly set. + + * include/cygwin/version.h: Bump DLL minor version number to 2. + +2009-12-06 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL minor version number to 1. + +2009-12-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (send_internal): Don't split datagram messages + into pieces. + + * syslog.cc (vsyslog): Set default facility to LOG_USER if it hasn't + been set yet. + +2009-12-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (fhandler_registry::open): Mark /proc/registry + directory and siblings as nohandle fhandler. + +2009-11-30 Christopher Faylor <me+cygwin@cgf.cx> + + * speclib: Use last dll found since that's the real name of the cygwin + DLL. + +2009-11-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix typos in + comments. Always open file synchronized when reading header bytes, + otherwise suffer stack corruption. + +2009-11-26 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::stdio_init): Use GetCurrentProcess() rather than + hMainProc as process handle when duplicating the stdout handle. + Explain why. Add Win32 error code to debug output. + +2009-11-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add + socket handle value to debug output. + (fhandler_socket::fixup_after_fork): Ditto. Make new socket handle + OVERLAPPED, just as if it has been created with socket(). + * net.cc (fdsock): Close duplicated socket and explain why. Disable + the entire WSADuplicateSocket test for now and explain why. + +2009-11-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::set_close_on_exec): Only call + fhandler_base::set_close_on_exec for inheritable sockets. + +2009-11-21 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (ro_u_dll): New R/O unicode string. + * syscalls.cc (nt_path_has_executable_suffix): Add ro_u_dll to + blessed_executable_suffixes array. Explain why. + +2009-11-18 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (fhandler_disk_file::lock): Disable a shortcut from the + original BSD code, but keep it in and documented why we can't use it. + +2009-11-18 Corinna Vinschen <corinna@vinschen.de> + + * ntea.cc (read_ea): Always add length of "user." prefix, not only + on Samba. Change comment. + +2009-11-18 Corinna Vinschen <corinna@vinschen.de> + + * ntea.cc (read_ea): Try to open file first to have more sensible + error codes. Always refuse non "user." EAs for Linux compatibility + and return EOPNOTSUPP. Fix handling of empty (== non-existant) EAs. + Always prepend "user." prefix to EA names. + (write_ea): Try to open file first to have more sensible error codes. + Always refuse non "user." EAs for Linux compatibility and return + EOPNOTSUPP. Delay skipping "user." prefix until after potential call + to read_ea. + +2009-11-17 Corinna Vinschen <corinna@vinschen.de> + + Reintegrate socket duplication via WSADuplicateSocket/WSASocket. + * autoload.cc (WSADuplicateSocketW): Define. + (WSASocketW): Define. + * dtable.cc (dtable::release): Call dec_need_fixup_before if necessary. + (dtable::fixup_before_fork): New function. + (dtable::fixup_before_exec): New function. + * dtable.h (class dtable): Add member cnt_need_fixup_before. Add + declarations for above new functions. + (dtable::dec_need_fixup_before): New inline method. + (dtable::inc_need_fixup_before): New inline method. + (dtable::need_fixup_before): New inline method. + * fhandler.h (fhandler_base::fixup_before_fork_exec): New virtual + method. + (fhandler_base::need_fixup_before): New virtual method. + (class fhandler_socket): Add member prot_info_ptr. + (fhandler_socket::init_fixup_before): Declare. + (fhandler_socket::need_fixup_before): New inline method. + (fhandler_socket::fixup_before_fork_exec): Declare. + (fhandler_socket::fixup_after_exec): Declare. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize + prot_info_ptr to NULL. + (fhandler_socket::~fhandler_socket): Free prot_info_ptr conditionally. + (fhandler_socket::init_fixup_before): New method. + (fhandler_socket::fixup_before_fork_exec): Ditto. + (fhandler_socket::fixup_after_fork): Use WSASocketW to duplicate + socket if necessary. + (fhandler_socket::fixup_after_exec): New method. + (fhandler_socket::dup): Use fixup_before_fork_exec/fixup_after_fork + to duplicate socket if necessary. + * fork.cc (frok::parent): Start child suspended if some fhandler + needs fixup before fork. If so, call dtable::fixup_before_fork after + CreateProcess and resume child. + * net.cc (fdsock): Try to find out if socket needs fixup before and + initialize socket accordingly. Add HUGE comment to explain what happens + and why. + * spawn.cc (spawn_guts): Start child suspended if some fhandler needs + fixup before exec. If so, call dtable::fixup_before_exec after + CreateProcess. + +2009-11-16 Eric Blake <ebb9@byu.net> + + * environ.cc (setenv): Detect invalid argument. + (unsetenv): Distinguish EFAULT from EINVAL. + +2009-11-13 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (fdsock): Fill _rmem and _wmem with valid values returned + from getsockopt if setsockopt with desired values failed. + +2009-11-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + Corinna Vinschen <corinna@vinschen.de> + + * sysconf.cc (get_nprocs): New function. + (get_nprocs_conf): Ditto. + (get_avphys_pages): Ditto. + (get_phys_pages): Ditto. + * cygwin.din: Export them. + * include/sys/sysinfo.h: New header, decalre above new functions. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * posix.sgml: Mention them as GNU extensions. + +2009-11-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_mailslot): Declare new private method + get_object_attr. + * fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Implement. + (fhandler_mailslot::open): Replace calls to path_conv::get_object_attr + with calls to fhandler_mailslot::get_object_attr. + +2009-11-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Revert change from + 2009-11-09. + +2009-11-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (is_volume_mountpoint): Align check with + symlink_info::check_reparse_point(). + * path.cc (symlink_info::check_reparse_point): Rearrange slightly. + Add code path for unrecognized repare point types. Add comment. + +2009-11-09 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_reparse_point): Always check + SubstituteName for volume string to recognize volume mount points. + Reuse subst when calling sys_wcstombs. + * syscalls.cc (rename): Set errno to EBUSY when trying to rename + volume mount points. Explain why. + +2009-11-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Restrict generating + META key sequences to singlebyte input chars. + +2009-11-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Drop all "other" + permissions from st_mode, if the reading the file's security descriptor + failed. Explain why. + +2009-11-06 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (ro_u_scr): New R/O unicode string. + (ro_u_sys): Ditto. + * syscalls.cc (nt_path_has_suffix): Replace with ... + (nt_path_has_executable_suffix): New function checking for explicit + executable suffixes. + (rename): Call nt_path_has_executable_suffix instead of + nt_path_has_suffix. Check oldpath for nt_path_has_executable_suffix + as well to set old_explicit_suffix. + +2009-11-06 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (inst_root_inited): New static bool variable. + (init_installation_root): Set inst_root_inited to true. + (memory_init): Print installation root debug output only if + inst_root_inited is true. + +2009-11-05 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (nt_path_has_suffix): New function. + (rename): Don't append .exe suffix if binary target name has any suffix + at all. + +2009-11-05 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (dll_suffixes): Disable. Explain why. + (perhaps_suffix): Use stat_suffixes instead of dll_suffixes. + +2009-11-03 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Re-introduce setting the SE_DACL_PROTECTED + flag. Remove INHERITED_ACE flag from all inherited ACEs. Add comment. + Fix ace_off counter in unrelated ACE loop. + * wincap.cc: Re-add has_dacl_protect throughout. + * wincap.h: Ditto. + +2009-11-02 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Re-enable generating default permission + entries for directories. + +2009-11-02 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (get_full_path_of_dll): Drop enforcing a .dll suffix. + (dlopen): If last path component has no dot, append one to override + automatic .dll suffix in LoadLibrary. + +2009-11-02 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.h (transform_chars): Declare. Define inline variation here. + * mount.cc (mount_info::from_fstab): Remove extern declaration of + transform_chars. + * path.cc (tfx_chars): Move to strfuncs.cc. + (transform_chars): Ditto. + * strfunc.cc (tfx_chars): Moved here from path.cc. + (transform_chars): Ditto. + (sys_cp_wcstombs): Make UNICODE private use area conversion roundtrip + save for all characters. + (sys_cp_mbstowcs): Ditto, by removing special case for UTF-8 sequences + representing U+F0xx UNICODE chars. Fix typo in comment. + +2009-11-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (tfx_chars): Constify. + +2009-10-31 Corinna Vinschen <corinna@vinschen.de> + + * cygprops.h: New file. + * dtable.cc (handle_to_fn): Add check for correct installation_key + string in object name for pipes and ttys. + * external.cc (cygwin_internal): Add CW_GET_INSTKEY to allow fetching + the installation_key from cygserver. + * fhandler_fifo.cc (fhandler_fifo::fifo_name): Add installation_key + to fifo name. + * globals.cc: Include cygprops.h. + (_RDATA): Move slightly and add comment. + (cygwin_props): Define. + * mount.cc (mount_info::init): Accommodate the fact that + installation_root is now a global variable in DLL common shared memory, + rather than a member of cygwin_shared. + * pipe.cc (fhandler_pipe::create_selectable): Add installation_key to + pipe name. + * shared.cc (installation_root): Define here for storage in DLL + common shared memory. + (installation_key): Ditto. + (installation_key_buf): Ditto. + (init_installation_root): Convert from shared_info method to ordinary + function. Add initializing installation_key. Invalidate + installation_key depending of value of disable_key property. Add + comment to explain. + (get_shared_parent_dir): Add installation_key to directory name. + (get_session_parent_dir): Ditto. + (shared_info::initialize): Move call to init_installation_root from + here... + (memory_init): ...to here. Add debug output to print installation root + and installation key. Add comment to explain why. + * shared_info.h (SHARED_INFO_CB): Recalculate. + (CURR_SHARED_MAGIC): Ditto. + (class shared_info): Remove definition of installation_root and + declaration of init_installation_root. + (init_installation_root): Declare. + (installation_root): Declare. + (installation_key): Declare. + * uinfo.cc (pwdgrp::load): Accommodate the fact that installation_root + is now a global variable in DLL common shared memory. + * include/cygwin/version.h: Bump API minor number. + (CYGWIN_INFO_INSTALLATIONS_NAME): Add. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_INSTKEY. + +2009-10-31 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (security_descriptor::realloc): Call free first if + current security desriptor has been allocated by GetSecurityInfo. + +2009-10-30 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (security_descriptor::free): If sd_size is 0, call + LocalFree instead of ::free. + + * sec_acl.cc: Throughout replace old ACE flag definitions with current + definitions as used in MSDN man pages. + * security.cc: Ditto. + + * fhandler.cc (fhandler_base::open): Make sure file has really been + just created before fixing file permissions. Add S_JUSTCREATED + attribute to set_file_attribute call. + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Always create dir + with default security descriptor and fix descriptor afterwards. + Add S_JUSTCREATED flag to set_file_attribute call. + * fhandler_socket.cc (fhandler_socket::bind): Ditto for AF_LOCAL + socket files. + * path.cc (symlink_worker): Ditto for symlinks. + * security.cc (get_file_sd): Call GetSecurityInfo rather than + NtQuerySecurityObject. Explain why. Change error handling accordingly. + (alloc_sd): Skip non-inherited, non-standard entries in ACL if + S_JUSTCREATED attribute is set. Explain why. Minor format fixes. + * security.h (S_JUSTCREATED): New define. + (security_descriptor::operator=): New operator. + +2009-10-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_random.cc (fhandler_dev_random::lseek): Revert change from + 2009-10-23. + +2009-10-30 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (hex_str): New const string. + (__rn): Drop str and use hex_str instead. + (__small_vsprintf): If 'l' modifier has been found, print subsequent + multibyte or wide char string using the s, S, or W options in extended + hex value layout. + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Print WCHAR + and resulting multibyte filename in extended hex value layout in + debug output. + +2009-10-26 Charles Wilson <cygwin@cwilson.fastmail.fm> + + * lib/pseudo-reloc.c (__report_error) [CYGWIN]: Correct size bug + regarding error messages. + +2009-10-25 Charles Wilson <cygwin@cwilson.fastmail.fm> + + Sync pseudo-reloc.c with mingw64 + * lib/psuedo-reloc.c: Remove unnecessary includes. + Forward declare _pei386_runtime_relocator. + Decorate _image_base__ symbol with macro for + mingw64 compatibility. Whitespace changes. + (__print_reloc_error): Renamed to... + (__report_error): This. "Returns" void, and + always aborts. Now used on all platforms. + (__write_memory): Remove special case error handling + for different platforms - always call __report_error. + (do_pseudo_reloc): Remove special case error handling + for different platforms - always call __report_error. + (_pei386_runtime_relocator): Decorate _image_base__ + symbol with mingw64 compatibility macro. + +2009-10-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Remove unused variables sa and sd. + +2009-10-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Always create file with default + security descriptor and fix descriptor afterwards. Change comment to + explain why. + * security.cc (alloc_sd): Drop setting the SE_DACL_PROTECTED flag. + * wincap.cc: Remove has_dacl_protect throughout. + * wincap.h: Ditto. + +2009-10-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_random.cc (fhandler_dev_random::lseek): Allow negative + dummy file positions as on Linux. + +2009-10-20 Corinna Vinschen <corinna@vinschen.de> + + * registry.cc (reg_key::get_int): Add alternative implementation + taking WCHAR strings. + (reg_key::set_int): Ditto. + (reg_key::get_string): Ditto. + (reg_key::set_string): Ditto. + * registry.h (struct reg_key): Add prototypes for added methods. + +2009-10-20 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (__small_vsprintf): Simplify UNICODE string handling + and allow empty strings. + +2009-10-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhander_disk_file::readdir): Handle a status + code STATUS_NOT_SUPPORTED. Add matching comment. + +2009-10-19 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (internal_setlocale): Only convert $PATH if there is a + $PATH. + +2009-10-19 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (av::fixup): Treat non-readable, but executable files as + Cygwin executables. + +2009-10-18 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (uinfo_init): Deimpersonate, don't reimpersonate, if + not in a setuid condition. + +2009-10-13 Eric Blake <ebb9@byu.net> + + * external.cc (cygwin_internal): Use va_end. + * fork.cc (child_copy): Likewise. + * libc/bsdlib.cc (warn, warnx, err, errx): Likewise. + * pinfo.cc (commune_request): Likewise. + * strace.cc (strace::prntf, strace_printf): Likewise. + +2009-10-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2009-10-13 Christian Franke <franke@computer.org> + Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h: Add new cygwin_getinfo_type + CW_SET_EXTERNAL_TOKEN. + Add new enum CW_TOKEN_IMPERSONATION, CW_TOKEN_RESTRICTED. + * cygheap.h (cyguser): New flags ext_token_is_restricted, + curr_token_is_restricted and setuid_to_restricted. + * external.cc (cygwin_internal): Add CW_SET_EXTERNAL_TOKEN. + * sec_auth.cc (set_imp_token): New function. + (cygwin_set_impersonation_token): Call set_imp_token (). + * security.h (set_imp_token): New prototype. + * spawn.cc (spawn_guts): Use CreateProcessAsUserW if restricted token + was enabled by setuid(). Do not create new window station in this case. + * syscalls.cc (seteuid32): Add handling of restricted external tokens. + Set HANDLE_FLAG_INHERIT for primary token. + (setuid32): Set setuid_to_restricted flag. + * uinfo.cc (uinfo_init): Do not reimpersonate if restricted token was + enabled by setuid (). Initialize user.*_restricted flags. + +2009-10-13 Eric Blake <ebb9@byu.net> + + * hires.h (hires_ms): Change initime_us to initime_ns, with 10x + more resolution. + (hires_ms::nsecs): New prototype. + (hires_ms::usecs, hires_ms::msecs, hires_ms::uptime): Adjust. + * times.cc (systime_ns): New helper function. + (hires_ms::prime): Use it for more resolution. + (hires_ms::usecs): Change to... + (hires_ms::nsecs): ...with more resolution. + (clock_gettime): Use more resolution. + (systime): Rewrite in terms of systime_ns. + (timespec_to_filetime): Rewrite math to reflect true operation. + * fhandler_disk_file.cc (utimens_fs): Use higher resolution. + +2009-10-12 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Return 0 in CW_SET_DOS_FILE_WARNING + and CW_SETERRNO cases. + +2009-10-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Only append .lnk + if the original device had one, too. Add comment. + + * fhandler_socket.cc (fhandler_socket::fstat): Always return a size of + 0 on sockets. + +2009-10-09 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (tfx_chars): Convert all ASCII control characters except + ASCII NUL as well. Change layout to make the conversions more clear. + Add comment. + +2009-10-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h (DEFAULT_LOCALE): Define as "C.UTF-8". + +2009-10-08 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (_cygtls::signal_exit): There's no need to set + signal_arrived if we're exiting. + +2009-10-08 Eric Blake <ebb9@byu.net> + + * fhandler_disk_file.cc (utimens_fs): Plug fd leak on EINVAL. + +2009-10-07 Charles Wilson <cygwin@cwilson.fastmail.fm> + + Additional pseudo-reloc-v2 support + * ntdll.h: Add custom NTSTATUS value for pseudo-reloc + errors STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION. + * pinfo.cc (status_exit): Map custom pseudo-reloc + error value STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION to 127. + * sigproc.cc (child_info::proc_retry): Return exit code when + STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION. + + Cygwin modifications to pseudo-reloc.c + * lib/pseudo-reloc.c: Added comments throughout and various + whitespace fixes. Exploit cygwin_internal(CW_EXIT_PROCESS,...) + for fatal error handling that is consistent with cygwin process + life-cycle. Ensure state variable (in _pei386_runtime_relocator) + is unique to each address space, across fork(). + (__print_reloc_error): New function for reporting errors in a + manner supported by cygwin at this early stage of the process + life-cycle. + (_pei386_runtime_relocator): Ensure relocations performed + only once for each address space, but are repeated after fork() + in the new address space. + only once for each address space (e.g. across fork()). + (__write_memory) [MINGW]: Ensure that b is always initialized + by call to VirtualQuery, even if -DNDEBUG. + + * lib/pseudo-reloc.c: Import new implementation to support + v2 pseudo-relocs implemented by Kai Tietz from mingw. + +2009-10-07 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (seteuid32): Call set_cygwin_privileges on primary token + as well. + +2009-10-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_pty_master::tcgetpgrp): Declare. + * fhandler_termios.cc (fhandler_termios::tcgetpgrp): Only return + valid pgid if tty is controlling tty. Set errno to ENOTTY and + return -1 otherwise. + (fhandler_pty_master::tcgetpgrp): New function. Return 0 for + master side of pty if it's not the controlling tty of the process. + +2009-10-05 Charles Wilson <cygwin@cwilson.fastmail.fm> + + Add cygwin wrapper for ExitProcess and TerminateProcess. + * include/sys/cygwin.h: Declare new cygwin_getinfo_type + CW_EXIT_PROCESS. + * external.cc (exit_process): New function. + (cygwin_internal): Handle CW_EXIT_PROCESS. + * pinfo.h (pinfo::set_exit_code): New method. + * pinfo.cc (pinfo::set_exit_code): New, refactored from... + (pinfo::maybe_set_exit_code_from_windows): here. Call it. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR + to 215 to reflect the above change. + +2009-10-05 Charles Wilson <cygwin@cwilson.fastmail.fm> + + * exceptions.cc: Move global variable sigExeced... + * globals.cc: here. + * pinfo.cc (pinfo::maybe_set_exit_code_from_windows): Remove now + unneeded declaration. + +2009-10-04 Dave Korn <dave.korn.cygwin@gmail.com> + + * Makefile.in (CFLAGS): Add -mno-use-libstdc-wrappers. + +2009-10-04 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (internal_setlocale): Add comment. + +2009-10-02 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Drop calls to setlocale/_setlocale_r. Just + call initial_setlocale from here. + * syscalls.cc (initial_setlocale): Set internal charset and revert + application locale to "C". + (setlocale): Don't set Cygwin's internal charset here. + +2009-10-02 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Move cxx_malloc reset kluge from here. + (check_sanity_and_sync): to here. + +2009-09-30 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (has_dot_last_component): Rewrite to detect some corner cases + that were previously uncaught. + +2009-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (beep): Move up to avoid forward declaration. + (fhandler_console::read): Just beep on characters invalid in current + charset. Add comment. + +2009-09-29 Eric Blake <ebb9@byu.net> + + * syscalls.cc (rename): Fix regression in rename("dir","d/"). + +2009-09-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recv_internal): Always call + WSARecv on SOCK_STREAM sockets. + +2009-09-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class dev_console): Constify charset parameter of + str_to_con. + * fhandler_console.cc (dev_console::con_to_str): Simplify. Always + default to the current internal locale. + (dev_console::get_console_cp): Always use codepage 437 for alternate + charset. + (dev_console::str_to_con): Constify charset parameter. + (fhandler_console::write_normal): Always use codepage 437 for alternate + charset. Otherwise always default to the current internal locale. + Replace ASCII SO with ASCII CAN. + * strfuncs.cc: Tweak comments according to below changes. + (sys_cp_wcstombs): Constify charset parameter. Convert all wchar_t + values in the Unicode private use area U+F0xx to the singlebyte + counterpart. Drop special handling creating ASCII SO sequence from + U+DCxx value. Rearrange for performance. Replace ASCII SO with + ASCII CAN. + (sys_cp_mbstowcs): Constify charset parameter. Replace ASCII SO with + ASCII CAN. Drop special case for U+DCxx ASCII SO sequences. Always + create a replacement from the Unicode private use area U+F0xx for + invalid byte values in a multibyte sequence. Do the same for wchar_t + values from the U+F0xx range to make them roundtrip safe. + * wchar.h (sys_cp_wcstombs): Constify charset parameter. + (sys_cp_mbstowcs): Ditto. + +2009-09-28 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Default locale.charset to "UTF-8". + * dcrt0.cc (dll_crt0_1): Call setlocale (LC_CTYPE, "") here, just + before resetting application locale to "C". + * environ.cc (environ_init): Drop code setting locale here. + * syscalls.cc (check_codepage): Break out check for required codepage + from internal_setlocale. + (internal_setlocale): Just convert CWD and $PATH from old charset to + new charset and set internal charset. + (setlocale): Change accordingly. Don't require LC_ALL or LC_CTYPE to + store old locale value. Always call internal_setlocale if charset + changed due to locale environment changes. + +2009-09-26 Eric Blake <ebb9@byu.net> + + * exec.cc (fexecve): New function. + * cygwin.din (execvpe, fexecve): Export new fexecve and existing + execvpe. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * posix.sgml: Mention them. + +2009-09-26 Eric Blake <ebb9@byu.net> + + * syscalls.cc (link): Delete obsolete comment. Reject directories + and missing source up front. + (rename): Use correct errno for trailing '.'. Detect empty + strings. Allow trailing slash to newpath iff oldpath is + directory. + * dir.cc (mkdir): Reject dangling symlink with trailing slash. + * fhandler_disk_file.cc (fhandler_disk_file::link): Reject + trailing slash. + * fhandler.cc (fhandler_base::link): Match Linux errno. + +2009-09-25 Eric Blake <ebb9@byu.net> + + * syscalls.cc (fchmodat): lchmod is not yet implemented. + (euidaccess): New function. + * path.cc (realpath): Update comment. + (canonicalize_file_name): New function. + * include/cygwin/stdlib.h (canonicalize_file_name): Declare it. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * cygwin.din: Export canonicalize_file_name, eaccess, euidaccess. + * posix.sgml: Mention them. + +2009-09-25 Eric Blake <ebb9@byu.net> + + * fhandler.h (fhandler_base::fhaccess): Add parameter. + * security.h (check_file_access, check_registry_access): Likewise. + * security.cc (check_file_access, check_registry_access) + (check_access): Implement new parameter. + * fhandler.cc (fhandler_base::fhaccess): Likewise. + (device_access_denied): Update caller. + * syscalls.cc (access, faccessat): Update callers. + * spawn.cc (find_exec, fixup): Likewise. + +2009-09-24 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (mq_open): Avoid closing the same descriptor twice in + case of errors. + (sem_open): Ditto. + +2009-09-24 Corinna Vinschen <corinna@vinschen.de> + + * kernel32.cc (CreateMutexW): Use correct access mask. + (CreateSemaphoreW): Ditto. + +2009-09-23 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (__set_charset_from_codepage): Fetch current ANSI + codepage if cp is 0. + +2009-09-23 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_cp_wcstombs): Convert lone surrogate pair + second halves to unambiguous ASCII SO sequence. When converting + chars invalid in current codepage to ASCII SO sequence, make + sure to check for surrogate pair second half only if at least + one wide characters is left. Decrement nwc if valid second half has + been converted. + (sys_cp_mbstowcs): Improve ASCII SO handling. Never break from loop + if invalid character has been found. Recognize ASCII SO sequence + representing originally invalid mulitbyte char converted into a + lone surrogate pair second half. Convert accordingly. + +2009-09-22 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (WSARecv): Define. + * fhandler_socket.cc (fhandler_socket::recv_internal): Call WSARecv + instead of WSARecvFrom if no name parameter is given. Explain why. + +2009-09-22 Eric Blake <ebb9@byu.net> + + * syscalls.cc (faccessat): Fix typo, reject bad flags. + (fchmodat, fchownat, fstatat, utimensat, linkat, unlinkat): Reject + bad flags. + +2009-09-22 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_cp_mbstowcs): Reset shift state after handling + invalid multibyte sequence. + +2009-09-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_worker): Rework error handling to generate Linux + compatible errno in case of trailing slash in newpath. + +2009-09-22 Eric Blake <ebb9@byu.net> + + * dtable.h (OPEN_MAX_MAX): New macro. + * resource.cc (getrlimit) [RLIMIT_NOFILE]: Use it. + * dtable.cc (dtable::extend): Likewise. + * fcntl.cc (fcntl64): Obey POSIX rule with too-large F_DUPFD. + * syscalls.cc (dup2): Likewise. + +2009-09-21 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cwdstuff::get_posix): Convert to const inline method just + returning pointer to posix path. + (cwdstuff::reset_posix): Convert to non-inline method taking a wchar_t + pointer. + * path.cc (cwdstuff::set): Revert change from 2009-05-13. Set posix + to valid incoming path again. + (cwdstuff::reset_posix): New implementation setting posix path from + incoming wchar_t path. Explain usage. + (cwdstuff::get_posix): Drop implementation. + (cwdstuff::get): Drop special case to handle empty posix path. + * syscalls.cc (internal_setlocale): Store old posix cwd as wide char + path. Restore posix cwd using new charset. Explain why. + +2009-09-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Drop faking hardlink + creation on filesystems not supporting hardlinks. + +2009-09-20 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Add another hack to REALLY make sure that + cxx_malloc is always set to the cygwin version. + +2009-09-20 Christopher Faylor <me+cygwin@cgf.cx> + + * external.cc (cygwin_internal): Add hack to always reset cxx_malloc to + proper value. + + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Relocate wayward + comment. + +2009-09-19 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (sigpacket::process): Explicitly set thread-specific + handler function to zero to avoid transferring to incorrect location. + (_cygtls::call_signal_handler): Don't transfer to handler if there is + no handler to transfer to. + +2009-09-18 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (sigpacket::process): Give sigwait() processing + precedence even when a handler is present. + + * syscalls.cc (getpagesize): Change return to 'int'. + +2009-09-16 Christopher Faylor <me+cygwin@cgf.cx> + + * ntea.c (write_ea): Don't abort if not-samba. + +2009-09-01 Christopher Faylor <me+cygwin@cgf.cx> + + * select.cc (peek_console): Always check window size when there is ANY + keyboard activity. + +2009-08-26 Corinna Vinschen <corinna@vinschen.de> + + * path.h (INTERIX_SYMLINK_COOKIE): Define. + * path.cc (symlink_info::check_sysfile): Read Interix symlinks as well. + +2009-08-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Only set R/O attribute if ACLs + are not used. + +2009-08-24 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Add comment. + * path.cc (symlink_info::check_reparse_point): Return -1 for volume + mount points. Explain why. + (symlink_info::check): Call fs.update again for volume mount points. + Explain why. + +2009-08-24 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (ro_u_volume): New R/O unicode string. + * path.cc (symlink_info::check_reparse_point): Fix check for volume + mount points to work on Vista and later as well. + +2009-08-22 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (__set_charset_from_codepage): Add codepages 20866 + (KOI8-R) and 21866 (KOI8-U). + +2009-08-21 Christopher Faylor <me+cygwin@cgf.cx> + + * dll_init.h (has_dtors): New flag. + (run_dtors): New wrapper function which avoids calling dtors more than + once. + * dll_init.cc (dll_global_dtors): Use dll.run_dtors wrapper. + (dll_list::detach): Ditto. + (dll_list::alloc): Set has_dtors flag. + +2009-08-21 Christopher Faylor <me+cygwin@cgf.cx> + + * fcntl.cc (fcntl64): Detect negative fd as error. + +2009-08-21 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Allocate fh_disk_file on cygheap. Delete + explicitely before returning. + +2009-08-20 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (build_fh_dev): Take additional bool parameter indicating + whether set_name should be called or not. + (dtable::dup_worker): Call build_fh_pc with new second parameter set + to false. Explain why. If fhandler's dup failed, delete rather than + cfree newfh and set newfh to NULL to indicate failure correctly. + * dtable.h (build_fh_pc): Change declaration according to above change. + Default set_name parameter to true. + * mmap.cc (mmap_record::free_fh): Delete rather than cfree fh. + +2009-08-18 Christopher Faylor <me+cygwin@cgf.cx> + + * dtable.cc (dtable::fixup_after_exec): Close any popen'ed file handles here. + * fhandler.h (fhandler_*::ispipe): New function. + (fhandler_base::get_popen_pid): Define virtual function. + (fhandler_*::isdevice): Make const. + (fhandler_*::isfifo): Ditto. + +2009-08-17 Christopher Faylor <me+cygwin@cgf.cx> + + * syscalls.cc (popen): Reorganize slightly for clarity. Fix a comment. + +2009-08-17 Christopher Faylor <me+cygwin@cgf.cx> + + * syscalls.cc (popen): Rewrite to accommodate situations where stdin, + stdout, or stderr are closed. + +2009-08-17 Christopher Faylor <me+cygwin@cgf.cx> + + * pipe.cc (fhandler_pipe::create_selectable): Add -pipe to default pipe names. + + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Use bool/true/false + for what is actually a boolean variable. + +2009-08-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix length + check for ".." dir. + +2009-08-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Change comment + to be fair. + +2009-08-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Remove + ill-advised attempt to optimize "." and ".." handling by checking for + specific position in directory listing. Explain why. + (fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto. + Special-case opening file on NFS to fetch inode number and add longish + comment to explain why. + +2009-08-14 Corinna Vinschen <corinna@vinschen.de> + + * (fhandler_socket::getsockname): Fix length returned for unbound + AF_LOCAL sockets. + (fhandler_socket::getpeername): Ditto. + * net.cc (socketpair): Don't set sun_path and peer_sun_path to + make sure getsockname and getpeername return the correct values + for AF_LOCAL sockets. + +2009-08-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::accept): Use sizeof rather + then constant size. Truncate returned data, but return full address + length as per POSIX. + (fhandler_socket::getsockname): Truncate returned data, but return full + address length as per POSIX. + (fhandler_socket::getpeername): Ditto. + +2009-08-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add peer_sun_path member. + (fhandler_socket::set_peer_sun_path): New method. + (fhandler_socket::get_peer_sun_path): New method. + * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize + peer_sun_path to NULL. + (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary. + (fhandler_socket::dup): Duplicate peer_sun_path. + (fhandler_socket::accept): Ditto. Return fake unbound peer content + and len in case of AF_LOCAL sockets. + (fhandler_socket::getsockname): Always use local sockaddr_storage to + store socket address and copy over to incoming address. Handle every + namelen correctly per POSIX. + (fhandler_socket::getpeername): Ditto. Add code path to return + correct value for AF_LOCAL sockets. + (fhandler_socket::set_peer_sun_path): New method. + * net.cc (socketpair): Set peer_sun_path to empty string, just like + sun_path. + +2009-08-13 Corinna Vinschen <corinna@vinschen.de> + Dave Korn <dave.korn.cygwin@googlemail.com> + + * cxx.cc (default_cygwin_cxx_malloc): Enhance commenting. + * dll_init.cc (dll_dllcrt0_1): Likewise. + * dlfcn.cc (dlopen): Prevent dlopen()'d DLL from installing any + cxx malloc overrides. + * include/cygwin/cygwin_dll.h (__dynamically_loaded): New variable. + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Check it and only + install cxx malloc overrides when statically loaded. Extend comments. + +2009-08-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::accept): Always use local + sockaddr_storage to store peer address and copy over to incoming + peer address if available. Truncate data as necessary according + to POSIX. + +2009-08-11 Corinna Vinschen <corinna@vinschen.de> + + * include/limits.h (NGROUPS_MAX): Set to a more sane value. + * include/sys/param.h (NGROUPS): Ditto. + +2009-08-10 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (av::fixup): Check shell scripts for executability only on + filesystems/mounts supporting real permissions. + +2009-08-10 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (DEV_SOCKET): New static WCHAR string. Name of + the native NT socket device. + (dtable::init_std_file_from_handle): Remove unused tmp_pathbuf + variable. Move check for sockets into FILE_TYPE_PIPE clause. + Rely on handle_to_fn having recognized socket, or check if + getsockopt works to accommodate NT4 shortcoming. + (handle_to_fn): Use tmp_pathbuf for OBJECT_NAME_INFORMATION + buffer and simplify code due to that. Check name returned by + NtQueryObject for socket device. + +2009-08-10 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_console.cc (create_invisible_console_workaround): Fix size + of cmd in the way originally intended. + +2009-08-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (create_invisible_console_workaround): Fix + size of cmd to take spaces into account. + +2009-08-08 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Fix comment to + document change in the Windows 7 workaround. + * wincap.cc (wincapc::init): Don't set has_console_handle_problem + to false on 32 bit systems. + +2009-08-06 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getnameinfo): Force setting NI_NUMERICSERV only + on Windows 2003 and earlier, only if the port number doesn't + resolve to a well-known service. Change comment accordingly. + +2009-08-05 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.h (cygheap_debug::endh): Delete. + * debug.cc (lock_debug::acquired): Delete. + (lock_debug::lock_debug): Simplify. + (lock_debug::unlock): Ditto. + (find_handle): Don't set endh here. + (add_handle): Add new handle to beginning of the list rather than + trying to maintain an end list pointer. + (delete_handle): Minor optimization. + (mark_closed): Make logic clearer. + (verify_handle): Lock handle list before scanning. + (setclexec): Ditto. + (modify_handle): Ditto. + (newh): Don't lock handle list here. Assume caller did this. + (mark_closed): Ditto. + (close_handle): Remove unneeded #if. + * dtable.cc (dtable::dup2): Tweak debug output. + +2009-08-04 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (patch_conv::check): Zero path before setting it. + +2009-08-04 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem + size if the length exceeds it. + * net.cc (fdsock): Use 65535 as window size, just like the comment + says or we run into problems with DuplicateHandle. + + * path.cc (patch_conv::check): Use set_path to set invalid filename. + * path.h (path_conv::path_conv): Ditto. + +2009-08-04 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (pdrive_buf): Defensively allocate one extra byte. + +2009-08-04 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_cygdrive:DRVSZ): New enum. + (pdrive_buf): New place to hold information about cygdrive. + * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Store drive + info in pdrive_buf since get_win32_name() could now be too small to + hold everything. + (fhandler_cygdrive::rewinddir): Reset pdrive to pdrive_buf. + (fhandler_cygdrive::closedir): Ditto. + * pipe.cc (fhandler_pipe::init): Be more defensive when referencing + get_win32_name(). Rework logic which made a copy of the POSIX path and + then never used it. + +2009-08-02 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (stopped_or_terminated): Don't return a match when stopsig + == SIGCONT and not WCONTINUED. + * termios.cc (tcsetpgrp): Improve debugging output. + +2009-08-01 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap_malloc.h: New file. + * cygheap.h: Remove stuff now included in cygheap_malloc.h and include + that file. Make cygheap_init a standard c++ function. Remove unneeded + child_info declaration. + * path.h: Include cygheap_malloc.h. Remove extra cstrdup declaration. + (path_conv): Reorganize to group variables together. + (path_conv::path): Make const char *. + (path_conv::known_suffix): Ditto. + (path_conv::normalized_path): Ditto. + (path_conv::path_conv): Reorganize initializers to reflect new element + ordering. + (path_conv::get_win32): Change return value to const char *. + (path_conv::set_path): Move back here from spawn.cc. + (parh_conv::modifiable_path): New function. + * path.cc (path_conv::add_ext_from_sym): Accommodate const'ness of + known_suffixes. + (path_conv::set_normalized_path): Ditto for normalized_path. + (path_conv::check): Use modifiable_path whereever we need to modify the + path element. Use set_path to set the path. + (path_conv::~path_conv): Accommodate new const'ness. + * spawn.cc (perhaps_suffix): Declare ext as const since that's what is + being returned. + (path_conv::set_path): Move back to path.h. + * winf.f (linebuf): Perform minor cleanup. + (linebuf::fromargv): Change second parameter to const. + * winf.cc (linebuf::fromargv): Ditto. + +2009-08-01 Christopher Faylor <me+cygwin@cgf.cx> + + * path.h (path_conv::set_path): Change return value. + * spawn.cc (path_conv::set_path): Return newly set value. + (find_exec): Set retval to newly set value when calling set_path. + +2009-07-31 Christopher Faylor <me+cygwin@cgf.cx> + + * spawn.cc (find_exec): Fix one more path where retval was not set. + +2009-07-31 Christopher Faylor <me+cygwin@cgf.cx> + + * spawn.cc (find_exec): Stop relying on the ability to set retval to a + fixed path_conv buffer and set it on the fly instead. + +2009-07-30 Corinna Vinschen <corinna@vinschen.de> + + * path.h (cstrdup): Fix declaration. + +2009-07-29 Dave Korn <dave.korn.cygwin@googlemail.com> + + * globals.cc (enum exit_states::ES_GLOBAL_DTORS): Delete. + * dcrt0.cc (__main): Schedule dll_global_dtors to run + atexit before global dtors. + (do_exit): Delete test for ES_GLOBAL_DTORS and call to + dll_global_dtors. + +2009-07-29 Corinna Vinschen <corinna@vinschen.de> + + * path.h (class path_conv): Convert path from char array to char *. + Initialize to NULL in constructors. Drop normalized_path_size member. + (path_conv::size): Remove. + (path_conv::operator =): Always copy with sizeof path_conv. Always + duplicate path on cygheap. + (path_conv::set_path): Move implementation to spawn.cc. + * path.cc (path_conv::set_normalized_path): Always allocate + normalized_path on cygheap. + (path_conv::check): Don't work on path, rather allocate THIS_path in + TLS and use it throughout. When finished, allocate path on cygheap + and copy over. Defer tacking on extension after having copied path. + * spawn.cc (path_conv::set_path): Implement here. + +2009-07-27 Corinna Vinschen <corinna@vinschen.de> + + * mount.h (enum fs_info_type): New type. + (IMPLEMENT_FS_FLAG): New define. + (class fs_info): Convert filesystem type status flags into an enum + fs_info_type. Add cifs FS. Revert change to has_buggy_open and + has_buggy_fileid_dirinfo. Make them normal; status flags again. + Implement is_FS functions using IMPLEMENT_FS_FLAG. + * mount.cc (fs_info::update): Define MINIMAL_WIN_NTFS_FLAGS and + FS_IS_WINDOWS_NTFS. Add comment. Only test remote filesystems + for "NTFS" once. Add is_cifs check using FS_IS_WINDOWS_NTFS. + Set has_buggy_open flag for SUNWNFS. Set has_buggy_fileid_dirinfo + flag for UNIXFS and all cifs type filesystems. Only check for + caseinsensitivity once. + (fillout_mntent): Create locale fs_names array. Use for setting + _my_tls.locals.mnt_type. + +2009-07-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * posix.sgml (std-notes): Remove obsolete reference to CYGWIN=server. + +2009-07-25 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (std-notes): Add flock restriction. + +2009-07-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (set_console_title): Set buffer size to + TITLESIZE + 1. Call sys_mbstowcs with correct destination length. + +2009-07-24 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.h (wait_for_sigthread): Eliminate parameter. + * sigproc.cc (wait_for_sigthread): Ditto. Don't synchronize with + wait_sig after receiving an event that it is ready to go. + (init_sig_pipe): New function. + (wait_sig): Call init_sig_pipe to create pipes for communicating + signals to this process. Don't send sigCONT signal when initializing. + * fork.cc (frok::child): Accommodate wait_for_sigpipe parameter change. + +2009-07-24 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_*::write): Make ssize_t/__stdcall. + (fhandler_*::write_overlapped): Ditto. + (fhandler_*::raw_write): Ditto. + (fhandler_*::readv): Ditto. + (fhandler_*::writev): Ditto. + (fhandler_*::raw_read): Make __stdcall. + * fhandler: Accommodate changes to read/write functions throughout. + * fhandler_clipboard.cc: Ditto. + * fhandler_console.cc: Ditto. + * fhandler_dsp.cc: Ditto. + * fhandler_fifo.cc: Ditto. + * fhandler_mailslot.cc: Ditto. + * fhandler_mem.cc: Ditto. + * fhandler_mem.cc: Ditto. + * fhandler_random.cc: Ditto. + * fhandler_tape.cc: Ditto. + * fhandler_tty.cc: Ditto. + * fhandler_virtual.cc: Ditto. + * fhandler_windows.cc: Ditto. + * fhandler_zero.cc: Ditto. + * syscalls.cc (readv): Use ssize_t as temp variable. + + * fhandler.cc (fhandler_base::read): Coerce returned len to signed or + it will never be treated as < 0. + (fhandler_base::wait_overlapped): Minimize calls to GetLastError. + Remove duplicate debugging test. Fix error return. + + * fhandler.h (fhandler_fifo::fifo_name): Declare new function. + (fhandler_fifo::close): Ditto. + (fhandler_fifo::dup): Ditto. + (fhandler_fifo::close_on_exec): Ditto. + * fhandler.cc (fhandler_fifo::fifo_name): Define new function. + (FIFO_BUF_SIZE): New define. + (cnp): Ditto. + (fhandler_fifo::open): Rework. Use cnp to open named pipe. Always + open write side as a client. Open dummy client when writing and can't + connect. + (wait): Rework. Implement fifo_wait_for_next_client. Handle signals + during connect better. Add new fifo_wait_for_server code which polls + (sigh) waiting for server. + (fhandler_fifo::raw_read): Handle transition states when one client + closes and another is available. + (fhandler_fifo::close): Define. + (fhandler_fifo::dup): Ditto. + (fhandler_fifo::close_on_exec): Ditto. + +2009-07-24 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (internal_setlocale): Fix typo in GBK codepage. + +2009-07-24 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Ignore sharing violation on NFS. Align + comments. + +2009-07-23 Corinna Vinschen <corinna@vinschen.de> + + * mount.h (fs_info::fsn): New member. + (fs_info::clear): Clear fsn. + (fs_info::fsname): New read accessor for fsn. + * mount.cc (fs_info::update): Fill in fsn member with lowercased + filesystem name if filesystem is not well-known. Fall back to + "unknown" if filesystem name is missing. + (fillout_mntent): Print filesystem name retrieved in fs_info::update + rather than static string "unknown". + +2009-07-23 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Revert to open filesystem with access set + to READ_CONTROL. If that fails, try additionally with FILE_READ_DATA. + +2009-07-22 Eric Blake <ebb9@byu.net> + + * exceptions.cc (handle_exceptions): Set si_addr according to + POSIX for SIGSEGV. + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Open filesystem with access set to 0. + Explain why. + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc: Revert accidental checkin. + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Handle STATUS_NOT_SUPPORTED from + NtCreateFile just like STATUS_EAS_NOT_SUPPORTED. + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fillout_mntent): Fix typo (noexec -> notexec). + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Fix typo in comment. + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (enum del_lock_called_from): New enumeration. + (fhandler_base::del_my_locks): Declare taking a del_lock_called_from + as argument. + * fhandler.cc (fhandler_base::close): Call del_my_locks with "on_close". + (fhandler_base::fixup_after_fork): Call del_my_locks with "after_fork". + (fhandler_base::fixup_after_exec): Call del_my_locks with "after_exec". + * flock.cc (fhandler_base::del_my_locks): Take del_lock_called_from + as argument. Call node->del_my_locks with NULL handle in after_exec + case. Explain why. + +2009-07-21 Eric Blake <ebb9@byu.net> + + * dtable.cc (dup2): Correct return value for no-op. + +2009-07-21 Corinna Vinschen <corinna@vinschen.de> + Eric Blake <ebb9@byu.net> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Add special case + for MVFS. Explain why. + (fhandler_disk_file::utimens): Drop local variables lastaccess and + lastwrite. Copy timestamps right into FILE_BASIC_INFORMATION structure + to avoid copying them twice. + +2009-07-20 Corinna Vinschen <corinna@vinschen.de> + + * wincap.h (wincaps::has_always_all_codepages): New element. + * wincap.cc: Implement above element throughout. + * wchar.h (__sjis_mbtowc): Declare. + (__eucjp_mbtowc): Ditto. + (__gbk_mbtowc): Ditto. + (__kr_mbtowc): Ditto. + (__big5_mbtowc): Ditto. + * syscalls.cc (internal_setlocale): Convert to char * function. + Return parameter by default. Return NULL if request to use a + charset can't be satisfied due to missing codepage support in the + underlying OS. Fix comment. + (setlocale): Store original locale. Restore to original locale if + internal_setlocale returns NULL. + +2009-07-20 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (fork): Create local tmp_pathbuf. Explain why. + +2009-07-18 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (sig_handle_tty_stop): Set stopsig to SIGCONT when + continuing. + (stopped_or_terminated): Honor WCONTINUED. + * wait.cc (wait4): Ditto. + * include/cygwin/wait.h (WCONTINUED): Define. + (__W_CONTINUED): Ditto. + (WIFCONTINUED): Ditto. + +2009-07-18 Dave Korn <dave.korn.cygwin@gmail.com> + + * libstdcxx_wrapper.cc (operator delete): Remove stray space in + asm name. + +2009-07-17 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc (_cygtls::init_exception_handler): Test for e, not e->prev + or we could still end up adding our handler twice. Add comment + explaining what we're doing. + * dll_init.cc (dll_dllcrt0_1): Clarify comment. + +2009-07-17 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc (_cygtls::init_exception_handler): Avoid adding our + exception handler twice. + +2009-07-17 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Just return when a sharing violation + occurs on remote filesystems. + +2009-07-17 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc: Improve comment on R/O UNICODE_STRINGs. + * mount.h (class fs_info): Add is_mvfs bit. + * mount.cc (fs_info::update): Recognize MVFS remote filesystem. + (fillout_mntent): Reorder filesystem checks for speed. Add + mvfs, unixfs, and sunwnfs filesystem types. + * path.h (class path_conv): Add fs_is_mvfs method. + * path.cc (symlink_worker): On MVFS, always create symlinks as + Windows shortcuts. Explain why. + +2009-07-16 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): First remove the R/O DOS attribute with + FILE_WRITE_ATTRIBUTES access only, then re-open the file for DELETE. + Explain why. + +2009-07-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Remove file + attribute check already done in NtSetAttributesFile. + +2009-07-15 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc: Reorder constant UNICODE_STRINGs for clarity. + * mount.h (fs_info::sttaus): Move filesystem type flags into + substructure. Add union to allow simple test for having set any + one filesystem type flag. Replace has_buggy_open flag with is_sunwnfs + flag. Replace has_buggy_fileid_dirinfo with is_unixfs flag. + (fs_info::got_fs): New private method. + (fs_info::has_buggy_open): New explicit implementation. + (fs_info::has_buggy_fileid_dirinfo): Ditto. + * mount.cc (fs_info::update): Optimize filesystem checks for speed. + * winsup.h (IMPLEMENT_STATUS_FLAG): Change write accessor to return + value just set. + +2009-07-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (GET_RESOURCE_INFO): Remove. + (thread_netdrive): Drop GET_RESOURCE_INFO case. + (fhandler_netdrive::exists): Use GET_RESOURCE_OPENENUM info class + to check for existance. + +2009-07-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Remove useless + alloca. + +2009-07-15 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Only fix up UNC path in win32 so as not + to overwrite incoming path. + +2009-07-14 Corinna Vinschen <corinna@vinschen.de> + + Throughout avoid having to initialize constant UNICODE_STRINGs. + * globals.cc: Define constant UNICODE_STRINGs and store in .rdata + section. + * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs + rather then initializing local UNICODE_STRING variable where + applicable. + * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. + * flock.cc (inode_t::inode_t): Ditto. + * mmap.cc: Ditto. + * syscalls.cc: Ditto. + * mount.cc (fs_info::update): Ditto. + * path.cc: Ditto. + + * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as + UNICODE_STRING. + (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING. + * fhandler_disk_file.cc: Accommodate throughout. + * mount.cc (fs_info::update): Ditto. + * path.cc (cwdstuff::set): Ditto. + * syscalls.cc: Ditto. + +2009-07-14 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (active_codepage): Remove. + +2009-07-12 Christopher Faylor <me+cygwin@cgf.cx> + + * how-spawn-works.txt: Add "out of date" note. + * how-vfork-works.txt: Ditto. + +2009-07-12 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Don't do anything special with any RCS directories. + + * ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma. + + * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment. + + * sigproc.cc (sig_send): Don't send signal to myself if this is an exec + stub. + +2009-07-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Don't use + FileAllInformation info class since it needs a big buffer. Add a + comment. + +2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com> + + * winbase.h (ilockexch): Avoid making 'ret' volatile. + (ilockcmpexch): Likewise. + +2009-07-07 Dave Korn <dave.korn.cygwin@gmail.com> + + * Makefile.in (DLL_OFILES): Add libstdcxx_wrapper.o + (libstdcxx_wrapper_CFLAGS): Add flags for new module. + (_cygwin_crt0_common_STDINCFLAGS): Define per-file override. + (libstdcxx_wrapper_STDINCFLAGS, cxx_STDINCFLAGS): Likewise. + * cxx.cc: Include "cygwin-cxx.h". + (operator new): Tweak prototype for full standards compliance. + (operator new[]): Likewise. + (operator new (nothrow)): New fallback function. + (operator new[] (nothrow), operator delete (nothrow), + operator delete[] (nothrow)): Likewise. + (default_cygwin_cxx_malloc): New struct of pointers to the above, + for final last-resort fallback default. + * cygwin-cxx.h: New file. + (struct per_process_cxx_malloc): Define. + (default_cygwin_cxx_malloc): Declare extern. + * cygwin.din (__wrap__ZdaPv): Export new wrapper. + (__wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv, + __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj, + __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj, + __wrap__ZnwjRKSt9nothrow_t): Likewise. + * globals.cc (__cygwin_user_data): Init newly-repurposed 'forkee' + field (now 'cxx_malloc') to point to default_cygwin_cxx_malloc. + * libstdcxx_wrapper.cc: New file. + (__wrap__ZdaPv, __wrap__ZdaPvRKSt9nothrow_t, __wrap__ZdlPv, + __wrap__ZdlPvRKSt9nothrow_t, __wrap__Znaj, + __wrap__ZnajRKSt9nothrow_t, __wrap__Znwj, + __wrap__ZnwjRKSt9nothrow_t): Define wrapper functions for libstdc++ + malloc operators and their overrides. + * winsup.h (default_cygwin_cxx_malloc): Declare extern. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * include/sys/cygwin.h (struct per_process_cxx_malloc): Forward + declare here. + (struct per_process::forkee): Rename and repurpose from this ... + (struct per_process::cxx_malloc): ... to this. + * lib/_cygwin_crt0_common.cc: Include cygwin-cxx.h. + (WEAK): Define shorthand helper macro. + (__cygwin_cxx_malloc): Define and populate with weak references + to whatever libstdc++ malloc operators will be visible at final + link time for Cygwin apps and dlls. + (_cygwin_crt0_common): Always look up cygwin DLL's internal + per_process data, and don't test for (impossible) failure. Inherit + any members of __cygwin_cxx_malloc that we don't have overrides + for from the DLL's default and store the resulting overall set of + overrides back into the DLL's global per_process data. + +2009-07-07 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::remove): Fix typo. + +2009-07-06 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (clean): Clean generated files in srcdir. + * tlsoffsets.h: Regenerate. + +2009-07-06 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc (_cygtls::remove): Avoid closing a NULL handle. + +2009-07-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabuf + and wsacnt to references. Fix handling of WSAEMSGSIZE. + +2009-07-06 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (struct _local_storage): Add thread storage pointers for + memory used by socket select functions. Combine them into a single + struct select. + * cygtls.cc: Accommodate above change throughout. + (_cygtls::init_thread): Drop initalizing of sockevt to + INVALID_HANDLE_VALUE. + (_cygtls::fixup_after_fork): Reset sockevt to NULL. + (_cygtls::remove): Don't use sockevt value to bail out prematurely. + Set sockevt to NULL. Free malloced select members. + * select.h (struct select_socket_info): Drop max_w4 member. + * select.cc (thread_socket): Use INFINITE timeout value if number of + objects to wait for is <= MAXIMUM_WAIT_OBJECTS. Use num_w4 member + of select_socket_info struct rather than dropped max_w4. + (init_tls_select_info): New inline function to initialize TLS select + members. + (start_thread_socket): Just call init_tls_select_info to initialize TLS + select members and use them later on. + (socket_cleanup): Don't free select_socket_info pointer members since + they are thread local now. + +2009-07-06 Christopher Faylor <me+cygwin@cgf.cx> + + * dtable.cc (handle_to_fn): Detect failing NtQueryObject. + +2009-07-06 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Delete stray CR. + +2009-07-05 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_console.cc: Change workstation -> windows station + throughout. + +2009-07-04 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (SetParent): Add new import. + * fhandler.h (fhandler_console::create_invisible_console): Declare new + function. + (create_invisible_console_workaround): Ditto. + * fhandler_console.cc (fhandler_console::create_invisible_console): + Define new function. + (create_invisible_console_workaround): Ditto. Add too much code to + deal with broken Windows 7. Use a helper app to start an invisible + console window. + (fhandler_console::need_invisible): Reorganize to use helper functions + to create invisible console. + + * spawn.cc (spawn_guts): Avoid zeroing already zeroed fields in si. + +2009-07-04 Dave Korn <dave.korn.cygwin@gmail.com> + + * autoload.cc (AttachConsole): Correct size of args. + +2009-07-03 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (jit_debug): New global. + (initial_env): Set jit_debug when we are automatically starting a gdb + process. + * dtable.cc (dtable::get_debugger_info): Don't tty tricks when we are + being debugged by our own captive gdb, as determined by jit_debug == + true. + (dtable::init_std_file_from_handle): Detect errors when initializing a + tty early rather than at random points later. + * fhandler.h (fhandler_*::init): Return int to indicate + success/failure. + * fhandler.cc (fhandler_base::init): Reflect change in return value. + * pipe.cc (fhandler_pipe::init): Ditto. + (fhandler_pipe::create_selectable): Don't say we're retrying when we + aren't. + * fhandler_console.cc (fhandler_console::init): Ditto. Return + success/failure. + * fhandler_serial.cc (fhandler_serial::init): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::init): Ditto. + (fhandler_tty_slave::open): Make debugging output more detailed. + * tty.cc (tty_list::terminate): Don't close I/O handles before all + slaves have checked in. + (tty::slave_alive): Make a non-inlined function. Check if tty pipe + handles can be created as an additional exists check. + * tty.h (tty::slave_alive): Just define here. + +2009-07-03 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Add fpurge and mkstemps to BSD list. + +2009-07-03 Eric Blake <ebb9@byu.net> + + * cygwin.din (fpurge, mkstemps): New exports. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * mktemp.cc (_gettemp): Add parameter. + (mkstemps): New function. + (mkstemp, mkdtemp, mktemp): Adjust clients. + +2009-07-03 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Fix typo in comment. + (ShowWindowAsync): Define. + (AttachConsole): Define. + * fhandler_console.cc (fhandler_console::need_invisible): Add band-aid + for Windows 7 AllocConsole bug. + +2009-07-01 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_xp_ifs): Fix typo in comment. + +2009-07-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_socket): Add class members and methods + to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes. + * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members. + (fhandler_socket::send_internal): Check for SO_SNDBUF size and + restrict send to 1 byte less per KB 823764. Leave loop immediately + if WSASendMsg has been used. + * net.cc (fdsock): Change comment again. Set buffer sizes to 65536. + Store values in fhandler_socket. + (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in + fhandler_socket. + (cygwin_sendto): Drop call to sig_dispatch_pending. + (cygwin_recvfrom): Ditto. + (cygwin_recvmsg): Ditto. + (cygwin_sendmsg): Ditto. + +2009-06-30 Christopher Faylor <me+cygwin@cgf.cx> + + * select.h: New file split from fhandler.h. + (select_record::select_record): Define do-nothing constructor for "new" + to avoid gratuitous zeroing. + (select_info): New base class. + (select_pipe_info): New class with methods for dealing with pipes. + (select_socket_info): New class with methods for dealing with sockets. + (select_serial_info): Dummy class for serial. + (select_mailslot_info): Dummy class for mailslots. + (select_stuff): Define device_specific_* as actual classes rather than + void *. + * dtable.h (dtable::select_read): Accommodate return value change to + 'bool' and argument change to "select_stuff". + (dtable::select_write): Ditto. + (dtable::select_except): Ditto. + * dtable.cc (dtable::select_read): Accommodate return value change to + 'bool' and argument change to "select_stuff". + (dtable::select_write): Ditto. + (dtable::select_except): Ditto. + * fhandler.h: Excise select-related classes. + (fhandler_*::select_read): Change argument to select_stuff. + (fhandler_*::select_write): Ditto. + (fhandler_*::select_except): Ditto. + * select.cc (UNIX_FD_ZERO): Use memset rather than bzero. + (select_stuff::test_and_set): Change return type to bool. Allocate + select_record on entry and let fhandler_*::select_* operate on the + start.next field of select_stuff. + (pipeinf): Delete. + (select_pipe_info::select_pipe_info): New constructor. Allocates event + for controlling pipe waits. + (select_pipe_info::~select_pipe_info): New destructor. Destroy event. + Stop thread. + (select_pipe_info::add_watch_handle): New function. + (thread_pipe): Wait for the hEvent part of any overlapped pipes before + peeking. + (start_thread_pipe): Don't allocate device_specific_pipe stuff here. + Assume that it has been allocated earlier. + (pipe_cleanup): Rely on select_pipe_info destructor to clean up pipe + paraphenalia. + (fhandler_*::select_*): Derive select_record from new select_stuff + argument. + (fhandler_pipe::select_*): Ditto. Allocate pipe-specific field if not + already allocated. + (serialinf): Delete. + (thread_serial): serialinf -> select_serial_info. + (fhandler_base::ready_for_read): Rewrite to accommodate change in + argument to fhandler_*::select_*. + (socketinf): Delete. + (thread_socket): socketinf -> select_socket_info. + (mailslotinf): Delete. + (thread_mailslot): mailslotinf -> select_mailslot_info. + +2009-06-30 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::has_ongoing_io): Accept an argument + indicating whether the overlapped event should be tested. + (fhandler_base::read_overlapped): Pass is_overlapped state to + has_ongoing_io. + (fhandler_base::write_overlapped): Ditto. + * fhandler.h (fhandler_base::has_ongoing_io): Accommodate argument + change. + * select.cc (peek_pipe): Ditto. + +2009-06-30 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (fdsock): Set default socket buffer sizes to 65520. Change + comment accordingly. + * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum + send size to 65520 as well. + +2009-06-29 Christopher Faylor <me+cygwin@cgf.cx> + + * select.cc (peek_pipe): Turn on (temporarily?) the experimental code + which tries to determine when a pipe is writable. + +2009-06-28 Christopher Faylor <me+cygwin@cgf.cx> + + * select.cc (peek_pipe): Use has_ongoing_io() to determine if the pipe + is ready for writing rather than performing brute-force checks. + +2009-06-28 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_base::has_ongoing_io): Declare new function. + * fhandler.cc (fhandler_base::has_ongoing_io): Define new function. + (fhandler_base::read_overlapped): Use has_ongoing_io to avoid writing + when handle has not completed last I/O. + (fhandler_base::write_overlapped): Ditto. + * select.cc (peek_pipe): Be more careful about accessing hEvent field + from get_overlapped(). + +2009-06-28 Christopher Faylor <me+cygwin@cgf.cx> + + * gendef (cleanup): Rename from 'nocr'. Remove comments and trailing + spaces. + * cygwin.din: Add long-needed comment describing what + dll_crt0__FP11per_process demangles to. + + * select.cc (peek_pipe): Flag handle as not ready for write if event is + not signalled. + * fhandler.cc (fhandler_base::setup_overlapped): Establish event as + already signalled. + (fhandler_base::wait_overlapped): Don't reset event after we've + successfully waited. MSDN documentation says that this happens + automatically after a WriteFileEx/ReadFileEx. + +2009-06-26 Corinna Vinschen <corinna@vinschen.de> + + * wincap.h (wincaps::has_broken_alloc_console): New element. + * wincap.cc: Implement above element throughout. + +2009-06-25 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (lsaauth): Close unused handle. + (lsaprivkeyauth): Ditto. + +2009-06-23 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_server_groups): Ignore errors from + get_user_local_groups. + +2009-06-22 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Don't run additional check for Win32 + incompatible CWD if newargv.fixup bailed out already. + (av::fixup): Check shell scripts for executability. + +2009-06-18 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (chdir): Check error conditions first. + +2009-06-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsg + as NO_COPY. + +2009-06-16 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::read_overlapped): Use a better variable + name. + +2009-06-16 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::read_overlapped): Preserve len when + looping due to received signal. + +2009-06-15 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_flags): New static function to generate interface flags + value. + (get_ipv4fromreg_ipcnt): New static function to fetch number of + configured IPv4 addresses for a given NIC from registry. + (get_ipv4fromreg): New static function to fetch configured IPv4 + addresses for a given NIC from registry. + (get_friendlyname): New static function to generate friendly name. + (get_hwaddr): New static function to copy hardware address. + (get_xp_ifs): Restructure slightly. Add code to generate IPv4 entries + entries for interfaces which are disconnected. + +2009-06-14 Christopher Faylor <me+cygwin@cgf.cx> + + * errno.cc (errmap): Add mapping for ERROR_IO_INCOMPLETE. + * fhandler.cc (fhandler_base::fcntl): Fix comment. + (fhandler_base::wait_overlapped): Accept an optional len parameter. + Use the len parameter when WriteFile fails with ERROR_IO_PENDING. Make + debug output less alarming. + (fhandler_base::write_overlapped): Pass len to wait_overlapped. + * fhandler.h (fhandler_base::wait_overlapped): Add an optional argument + denoting the number of characters intended to be written. + + * fhandler_tty.cc (fhandler_pty_master::close): Don't close archetype + handles when cygwin is still initializing since the handles aren't + actually opened at that point. + +2009-06-14 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (time2): Take another stab at fixing a compiler warning. + +2009-06-14 Christopher Faylor <me+cygwin@cgf.cx> + + * localtime.cc (time2): Take a stab at fixing a compiler warning. + +2009-06-14 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Honor nonblocking flag + for writes. Don't reset event handle when we see a ERROR_IO_PENDING. + + * sigproc.cc (stopped_or_terminated): Use bool constants for + consistency. + + * wait.cc (wait4): Remove nonsensical comment. + +2009-06-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelen + pointer to NULL if name pointer is NULL. Explain why. + +2009-06-12 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (time2): Change "spring gap" to "spring forward gap" + in comment. + +2009-06-12 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (time2): Add workaround for spring forward gap problem. + Add explaining comment. + +2009-06-12 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (SUBLIBS): Add librt.a. + (librt.a): New rule to build librt.a. + +2009-06-12 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (check_path): Fix typo in comment. Align naming + convention rules to Linux. Handle backslash same as slash. Add + comment. + +2009-06-09 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetSystemTimes): Remove. + * fhandler_proc.cc (format_proc_uptime): Use global system_info rather + than retrieving a local copy of the SYSTEM_INFO. Drop call to + GetSystemTimes and retrieve SystemPerformanceInformation on all systems + again with buffer size big enough for 64 bit systems. + (format_proc_stat): Use global system_info rather than retrieving a + local copy of the SYSTEM_INFO. Retrieve SystemPerformanceInformation + with buffer size big enough for 64 bit systems. + +2009-06-08 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetSystemTimes): Define. + * fhandler_proc.cc (format_proc_uptime): Use GetSystemInfo to retrieve + processor count. Use GetSystemTimes when available to retrieve system + idle time. Improve debug output. + (format_proc_stat): Use GetSystemInfo to retrieve processor + count. Improve debug output. Ignore if SystemPerformanceInformation + returns error. Explain why. + +2009-06-08 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (frok::parent): Remove ancient code erroneously flushing + stdout. + +2009-06-08 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (save_errno::~save_errno): Set errno directly to avoid + flooding debug output. + +2009-06-08 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Return with error set to ENOENT if + STATUS_NO_MEDIA_IN_DEVICE is returned. + +2009-06-07 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.h (mini_cygheap): New struct. + (init_cygheap): Inherit locale field via mini_cygheap. + * cygheap.cc (cygheap_at_start): Define new variable. + (cygheap): Initialize as cygheap_at_start so that locale information is + always available. + (cygheap_init): Initialize cygheap iff it is set to cygheap_at_start. + * shared_info.h (memory_init): Accommodate argument change. + * memory.cc (memory_init): Accept an argument indicating whether + cygheap should be initialized or not. + * dcrt0.cc (child_info_fork::handle_fork): Pass false to memory_init(). + (child_info_spawn::handle_spawn): Ditto. + (dll_crt0_0): Pass true to memory_init when not forking or execing. + + * cygheap.h (cygheap_types::HEAP_2_DLL): New enum. + * dll_init.h (dll): Remove unused namelen field. + (dll_list::load_after_fork): Accommodate change in arguments. + * dll_init.cc (dll_list::alloc): Allocate dll information in the cygwin + heap. + (dll_list::detach): Free dll information from the cygwin heap. + (dll_list::load_after_fork): Use dll information in the cygwin heap + directly rather than querying parent. + * fork.cc (frok::first_dll): Delete. + (frok::child): Don't report on first_dll. Don't pass it to + load_on_fork. + (frok::parent): Don't set first_dll. + (fork): Ditto. + +2009-06-06 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (dll_list::alloc): Allocate memory using a section + object. Explain why. Drop call to GetSystemInfo, rather call + getpagesize to get allocation granularity. Only align to allocation + granularity under WOW64. Use roundup2 to align. + (dll_list::detach): Call NtUnmapViewOfSection instead of VirtualFree. + +2009-06-06 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Use NtUnmapViewOfSection instead of UnmapViewOfFile + throughout for symmetry. + (fhandler_dev_mem::munmap): Use correct process handle in call to + NtUnmapViewOfSection. + +2009-06-06 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.h (struct dll): Set size of name element to ANYSIZE_ARRAY. + * dll_init.cc: Fix formatting. + (dll_list::alloc): Only allocate as much memory for struct dll as + necessary for given DLL name. + (dll_list::load_after_fork): Only read a single page of parent memory. + Only read more if namelen indicates that it's necessary. + +2009-06-05 Dave Korn <dave.korn.cygwin@gmail.com> + + * winbase.h (ilockexch): Fix asm constraints. + (ilockcmpexch): Likewise. + +2009-06-05 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (heap_init): Fix typo in comment. + +2009-06-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_clipboard.cc: Avoid calling system_printf. + (set_clipboard): Add basic error checking. Set errno here. Per MSDN, + don't call GlobalFree on data block transferred to clipboard. + (fhandler_dev_clipboard::write): Drop setting errno after call to + set_clipboard. + (fhandler_dev_clipboard::read): Add basic error checking. Simplify code. + +2009-06-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (set_console_title): Convert title string to + wchar_t and call SetConsoleTitleW. + +2009-06-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Allow Ctrl-Space to + emit a NUL byte. + +2009-06-04 Dave Korn <dave.korn.cygwin@gmail.com> + + * thread.cc (__cygwin_lock_lock): Delete racy optimisation. + (__cygwin_lock_unlock): Likewise. + +2009-06-03 IWAMURO Motnori <deenheart@gmail.com> + + * strfuncs.cc (sys_cp_mbstowcs): Fix condition. + +2009-06-03 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_cp_wcstombs): Implement reverse functionality + of the change to sys_cp_mbstowcs from 2009-05-30. + (sys_cp_mbstowcs): Slightly reformat. Fix comment to accommodate + change to sys_cp_wcstombs. Don't write to *ptr if dst is NULL. + +2009-06-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Convert Alt-Backspace + to \033\177 or to \377 dependent on the setting of dev_state->metabit. + +2009-06-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Don't call set_exec for files on "noacl" + mount points. + +2009-05-30 Christopher Faylor <me+cygwin@cgf.cx> + + * strfuncs.cc (sys_cp_mbstowcs): Treat src as unsigned char *. Convert + failure of f_mbtowc into a single malformed utf-16 value. + +2009-05-30 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin/include/sys/termios.h: Make default erase character "^?". + +2009-05-30 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_console.cc (fhandler_console::read): Convert backspace key + to DEL. + +2009-05-29 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (cwdstuff::set): Rewrite previous change to properly test the + end of the buffer. + +2009-05-28 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (cwdstuff::set): Avoid removing a nonexistent trailing slash. + +2009-05-20 Eric Blake <ebb9@byu.net> + + * net.cc (gethostby_helper): Use correct signedness. + +2009-05-18 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::add_item): Avoid using any-old '/' as + indicating root. + +2009-05-18 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::got_usr_bin): Mark as NO_COPY. + (mount_info::got_usr_lib): Ditto. + (mount_info::root_idx): Ditto. + +2009-05-14 Corinna Vinschen <corinna@vinschen.de> + + * wchar.h (sys_mbstowcs): Add missing __stdcall attribute. + +2009-05-14 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Set Cygwin default locale values. + * cygheap.h (struct cygheap_locale): New structure. + (struct user_heap_info): Add cygheap_locale member locale. + * dcrt0.cc (dll_crt0_1): Revert to calling _setlocale_r so that only + the applications locale is reverted to "C". + * environ.cc (environ_init): Remove unused got_lc variable. + * fhandler.h (class dev_console): Remove now unsed locale variables. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove + setting dev_console's locale members. + (dev_console::con_to_str): Use internal locale settings. Default to + __ascii_wctomb if charset is "ASCII". + (fhandler_console::write_normal): Ditto. + * strfuncs.cc (__ascii_wctomb): Drop declaration. + (__db_wctomb): Use fixed value 2 instead of not + necessarily matching MB_CUR_MAX. + (__eucjp_wctomb): Use 3 instead of MB_CUR_MAX. + (sys_cp_wcstombs): Remove special case for "C" locale. + (sys_wcstombs): Implement here. Use internal locale data stored on + cygheap. + (sys_cp_mbstowcs): Remove special case for "C" locale. + (sys_mbstowcs): Implement here. Use internal locale data stored on + cygheap. + * syscalls.cc (internal_setlocale): New function to set cygheap locale + data and to reset CWD posix path. + (setlocale): Just call internal_setlocale from here if necessary. + * wchar.h (__ascii_wctomb): Declare. + (sys_wcstombs): Don't define inline, just declare. + (sys_mbstowcs): Ditto. + +2009-05-14 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::init): Remove MOUNT_CYGWIN_EXEC setting when + auto-mounting /usr/bin. + +2009-05-14 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (oopts): Add a no-op "auto" option. + (mount_info::create_root_entry): Set root dir to MOUNT_IMMUTABLE rather + than to MOUNT_OVERRIDE. + +2009-05-13 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (mount_info::got_usr_bin): Define. + (mount_info::got_usr_lib): Ditto. + (mount_info::root_idx): Ditto. + (mount_info::create_root_entry): Create root entry as immutable and + flag as automatic. + (mount_info::init): Remove "Huh? No /etc/fstab..." warning. + Unconditionally call from_fstab for user and system tables. Fill in + /usr/bin and /usr/lib if they have not been specified in /etc/fstab. + (oopts): Alphabetize. Add "override" option to allow overriding + immutable mount points. + (mount_info::add_item): Accommodate new MOUNT_IMMUTABLE flag intended + for root mount. + (mount_info::add_item): Detect "/usr/bin", "/usr/lib", and "/" and set + appropriate global state. + (fillout_mntent): Add ,auto to mount points added by Cygwin DLL. + (mount): Remove masking of MOUNT_SYSTEM. Allow user to shoot + themselves. Add comment. + * mount.h (mount_info::got_usr_bin): Declare. + (mount_info::got_usr_lib): Ditto. + (mount_info::root_idx): Ditto. + * include/sys/mount.h: Reformat enum. + Add MOUNT_{OVERRIDE,IMMUTABLE,AUTOMATIC}. + +2009-05-13 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cwdstuff): Convert to class. Make posix and dir private. + (cwdstuff::get_posix): New method. + (cwdstuff::reset_posix): New method. + * dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r. + * environ.cc (environ_init): Ditto. Prefer "C" locale over current + codepage default locale. + * path.cc (chdir): Use cwdstuff::get_posix method instead of accessing + cwdstuff::posix directly. + (cwdstuff::set): Defer creating posix path to first usage. + (cwdstuff::get_posix): Create posix path if it's empty, and return it. + (cwdstuff::get): Create posix path if it's empty. + * strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C" + locale. + (sys_cp_mbstowcs): Ditto. + * syscalls.cc (gen_full_path_at): Fetch CWD posix path locked. + (setlocale): Implement here. Reset CWD posix path. + +2009-05-09 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin/version.h (CYGWIN_VERSION_CYGWIN_CONV): New define. + +2009-05-09 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Add workaround for + Windows 7 64 bit issue. Add lengthy comment to explain what happens. + * wincap.h (wincaps::has_console_handle_problem): New element. + * wincap.cc: Implement above element throughout. + (wincap_7): New wincaps structure for NT 6.1 kernels. + (wincapc::init): Set has_console_handle_problem to false for 32 bit + systems. + +2009-05-09 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (str2uni_cat): Move from here... + * path.cc (str2uni_cat): ...to here. Simplify. Make static inline. + (get_nt_native_path): Use RtlAppendUnicodeToString rather than + str2uni_cat for constant strings for speed. + * security.h (str2uni_cat): Drop declaration. + +2009-05-08 Corinna Vinschen <corinna@vinschen.de> + IWAMURO Motonori <deenheart@gmail.com> + + * strfuncs.cc (sys_cp_wcstombs): save and restore previous errno value. + (sys_cp_mbstowcs): Ditto. + +2009-05-08 IWAMURO Motonori <deenheart@gmail.com> + + * strfuncs.cc (sys_cp_wcstombs): Set errno to 0 before converting + wide char to SO/UTF-8 sequence. + +2009-05-08 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/select.h: Guard definitions with __USE_W32_SOCKETS as + the accompanying fd_set definitions in newlib's sys/types.h. + +2009-05-06 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_console.cc (fhandler_console::ioctl): Properly treat + TIOCLINUX argument as a char. + * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use coercion to properly + set char value. + +2009-05-06 Corinna Vinschen <corinna@vinschen.de> + + * libc/minires.c (scanline): Fix type in calls to ctype functions + to stay in unsigned char range for char values >= 0x80. + * regex/regcomp.c: Ditto, throughout. + * regex/regex2.h (ISWORD): Ditto. + +2009-05-06 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_init): Set umask to a sane default. + * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH + to set HOME. Default to /home/USERNAME. + +2009-05-03 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (set_file_sd): Drop using FILE_OPEN_FOR_RECOVERY flag in + call to NtOpenFile. + * exceptions.cc (open_stackdumpfile): Ditto in call to NtCreateFile. + * fhandler.cc (fhandler_base::open): Ditto. Simplify setting + create_options. + + * mount.cc (fs_info::update): Recognize offline storage. + (fillout_mntent): Report UDF and offline storage. + * mount.h (class fs_info): Add is_csc_cache status flag. + +2009-05-04 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_console.cc (fhandler_console::write_console): Eliminate + unneeded debugging output. + (fhandler_console::write_normal): Eliminate unneeded __seterrno. + +2009-05-04 Christopher Faylor <me+cygwin@cgf.cx> + + * libc/minires.c (scanline): Accommodate ctype changes which disallow + use of an unadorned char argument to is* macros. + * regex/regcomp.c: Ditto, throughout. + * regex/regex2.h (ISWORD): Ditto. + +2009-05-03 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare. + (fhandler_console::write_replacement_char): Declare as inline. + (fhandler_console::write_console): Declare new function. + * fhandler_console.cc (fhandler_console::MAX_WRITE_CHARS): Define. + (handler_console::write_console): Define. + (fhandler_console::write_replacement_char): Define as inline. + (fhandler_console::write_normal): Use write_console when writing + buffers of unknown length. + +2009-04-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/cygwin/socket.h: Define SOL_IPV6. + +2009-04-21 Corinna Vinschen <corinna@vinschen.de> + + * ctype.cc (__set_ctype): Copy exact part of the current active + character class array. + +2009-04-20 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (lf_setlock): Handle border case which results in WFMO loop + exiting with ret == WAIT_TIMEOUT gracefully. Add a system_printf to + uncover other potential problems with WFMO loop. + +2009-04-18 Christopher Faylor <me+cygwin@cgf.cx> + + * mkimport: Specify .text for stub explicitly. + * speclib: Add a dummy '.idata$7' section referring to the dll + associated with the real import library. + +2009-04-18 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (globify): Only call mbtowc for non-ascii chars. + +2009-04-17 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (globify): Make multibyte-aware. + +2009-04-17 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (class inode_t): Add i_wait member and matching methods + wait(), unwait(), and waiting(). + (inode_t::inode_t): Initialize i_wait to 0. + (fhandler_disk_file::lock): Only remove node if no other thread is + waiting for a blocking lock. + (lf_setlock): Manipulate node->i_wait to signal that a thread is + waiting for a blocking lock in this node. + (lf_findoverlap): Reinstantiate SELF test as in original code. + +2009-04-16 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (get_full_path_of_dll): Just return a bool value. Drop + local path_conv in favor of getting it as parameter. Add local string + buffer instead of getting it as parameter. + (dlopen): Accommodate get_full_path_of_dll change. Fetch WCHAR Windows + path from path_conv variable and call LoadLibraryW. + +2009-04-16 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_LOCK_NOT_GRANTED): Define. + * syscalls.cc (unlink_nt): Handle STATUS_LOCK_NOT_GRANTED same as + STATUS_SHARING_VIOLATION. Add lengthy comment to explain why. + +2009-04-15 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::get_wide_win32_path): Allow relative paths. + (cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative + paths to absolute paths if the relative pathname length exceeds + MAX_PATH. + +2009-04-15 Corinna Vinschen <corinna@vinschen.de> + + * libc/bsdlib.cc: Align copyright with upstream. + * libc/fnmatch.c: Ditto. + * libc/fts.c: Ditto. + * libc/inet_addr.c: Ditto. + * libc/inet_network.c: Ditto. + * libc/rcmd.cc: Ditto. + * libc/rexec.cc: Ditto. + +2009-04-14 Christopher Faylor <me+cygwin@cgf.cx> + + * speclib: Really revert to using tempdir. + +2009-04-14 Christopher Faylor <me+cygwin@cgf.cx> + + * speclib: Revert to using tempdir. + +2009-04-14 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzload): Implement setting __tzrule's offset member + using newlib's __gettzinfo () interface also when tzload returns + successfully. + +2009-04-13 Dave Korn <dave.korn.cygwin@gmail.com> + + * include/stdint.h (intptr_t): Remove long from type. + (uintptr_t): Likewise. + (INTPTR_MIN): Remove 'L' suffix. + (INTPTR_MAX, UINTPTR_MAX): Likewise. + +2009-04-12 Christopher Faylor <me+cygwin@cgf.cx> + + * speclib: Initial stab at cleaning up temp files. More work needed. + * mkimport: Ditto. + +2009-04-12 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (clean): Clean globals.h. + (LIBCOS): Depend on globals.h. + +2009-04-11 Christopher Faylor <me+cygwin@cgf.cx> + + * mkimport: New script to perform all operations necessary to create + libcygwin.a. + * rmsym: Delete. + * newsym: Delete. + * Makefile.in (toolopts): New variable which holds options relating to + binutils/gcc tools. + (speclib): Use toolopts. Add symbols to avoid copying to special + libraries. + (OBSOLETE_FUNCTIONS): Delete. + (NEW_FUNCTIONS): Change to represent an argument to new mkimport + script. + (libcygwin.a): Use only new mkimport script to create libcygwin.a. + Only rely on ${LIBCOS}. + (*/lib*.a): Simplify speclib dependencies. + (speclib): Accept toolchain options. Convert every argument to + absolute path. Simplify parsing of nm output. Accommodate new + exclude option. + +2009-04-11 Dave Korn <dave.korn.cygwin@googlemail.com> + + * include/stdint.h (INTPTR_MIN, INTPTR_MAX): Add 'L' suffix. + (WINT_MAX): Add 'U' suffix. + +2009-04-10 Christopher Faylor <me+cygwin@cgf.cx> + + * speclib: Use a more robust method to derive full file path. + +2009-04-09 Christopher Faylor <me+cygwin@cgf.cx> + + * speclib: Semi-revert to previous version but don't try to generate + well-formed import library. Instead, just extract appropriate symbols + and let later libcygwin.a on link line fill in the rest of the import + stuff. + * gendef: Hopefully no-op modification to allow easier post-processing + on symbol values. + +2009-04-09 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Use tmp_pathbuf buffer to allocate infobuf + rather than using the stack. + +2009-04-09 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Fix alignment of infobuf. + +2009-04-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchown): Catch an + error when changing the user account on a standalone Samba server. + Explain why. + * sec_acl.cc (setacl): Accommodate additional parameter to set_file_sd. + * sec_helper.cc (SECURITY_SAMBA_UNIX_AUTHORITY): Define. + (well_known_samba_unix_user_fake_sid): Define. + * security.cc (set_file_sd): Take additional parameter if ownership + should be changed. Restrict requested permissions accordingly. + (set_file_attribute): Accommodate additional parameter to set_file_sd. + * security.h (well_known_samba_unix_user_fake_sid): Declare. + (set_file_sd): Align declaration to above change. + +2009-04-07 Corinna Vinschen <corinna@vinschen.de> + + * include/stdint.h (int_least32_t): Define as int. + (uint_least32_t): Ditto, unsigned. + (int_fast16_t): Define as int. + (int_fast32_t): Ditto. + (uint_fast16_t): Ditto, unsigned. + (uint_fast32_t): Ditto. + (UINT32_MAX): Remove `L' long marker. + (UINT_LEAST32_MAX): Ditto. + (UINT_FAST16_MAX): Ditto. + (UINT_FAST32_MAX): Ditto. + (INT32_C): Ditto. + (UINT32_C): Ditto. + +2009-04-07 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc: Change WCHAR to wchar_t in multibyte<->widechar + conversion functions throughout. + * wchar.h: Ditto in declarations. Guard them __INSIDE_CYGWIN__. + +2009-04-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class dev_console): Add members con_mbtowc, con_wctomb, + and con_charset. + (dev_console::str_to_con): Take mbtowc function pointer and charset + as additional parameters. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize + aforementioned new members. Explain why. + (dev_console::con_to_str): Remove useless comment. Call new + sys_cp_wcstombs function rather than sys_wcstombs. + (dev_console::str_to_con): Take mbtowc function pointer and charset + as additional parameters. Call sys_cp_mbstowcs accordingly. + (fhandler_console::write_normal): Only initialize f_mbtowc and charset + once. Accommodate changed str_to_con. + * strfuncs.cc (sys_cp_wcstombs): Renamed from sys_wcstombs. Take + wctomb function pointer and charset as parameters. Use throughout. + (sys_cp_mbstowcs): Take wctomb function pointer and charset as + parameters instead of codepage. Remove matching local variables and + their initialization. + * wchar.h (ENCODING_LEN): Define as in newlib. + (__mbtowc): Use mbtowc_p typedef for declaration. + (wctomb_f): New type. + (wctomb_p): New type. + (__wctomb): Declare. + (__utf8_wctomb): Use wctomb_f typedef for declaration. + (sys_cp_wcstombs): Move declaration from winsup.h here. + (sys_wcstombs): Ditto. + (sys_wcstombs_alloc): Ditto. + (sys_cp_mbstowcs): Ditto. + (sys_mbstowcs): Ditto. + (sys_mbstowcs_alloc): Ditto. + * winsup.h: Move declaration of sys_FOO functions to wchar.h. Include + wchar.h instead. + +2009-04-06 Earl Chew <earl_chew@agilent.com> + + * libc/rexec.cc (ruserpass): Use fstat64 instead of fstat. + +2009-04-06 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc: Add comment to explain why we can't support JIS + for now. + (__db_wctomb): Alwaus use WC_NO_BEST_FIT_CHARS. + (__jis_wctomb): Just call __ascii_wctomb from here. + (__eucjp_wctomb): Convert to standalone implementation to fix up the + difference between eucJP and CP 20932 affecting JIS-X-0212 characters. + Explain. + (__kr_wctomb): Use codepage 949. + (__db_mbtowc): Reorder code slightly. Always use MB_ERR_INVALID_CHARS + in call to MultiByteToWideChar. Fix a problem with singlebyte + sequences. Fix a bug in '\0' handling. Reset state->__count on + successful return from non-zero state. + (__jis_mbtowc): Just call __ascii_mbtowc from here. + (__eucjp_mbtowc): Convert to standalone implementation to fix up the + difference between eucJP and CP 20932 affecting JIS-X-0212 characters. + (__kr_mbtowc): Use codepage 949. + (__set_charset_from_codepage): Handle codepage 20932 as eucJP. + +2009-04-05 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Use all compile options when calculating magic values. + * shared_info.h (CURR_SHARED_MAGIC): Revert erroneous value. + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + + * fhandler.h (acquire_output_mutex): Remove unneeded ';'. + (release_output_mutex): Ditto. + +2009-04-05 Christopher Faylor <me+cygwin@cgf.cx> + + * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings. + * shared_info.h (CURR_SHARED_MAGIC): Update. + * spawn.cc (spawn_guts): Avoid copying one line command line argument + if it hasn't been filled out. + +2009-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + Corinna Vinschen <corinna@vinschen.de> + + * include/asm/byteorder.h (__ntohl): Prototype before define to avoid + a warning with -Wmissing-prototypes. Use _ELIDABLE_INLINE macro from + _ansi.h. + (__ntohs): Ditto. + +2009-04-02 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (build_env): Fix length calculation of resulting + wide char environment string. + +2009-04-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/netdb.h: #include <inttypes.h>, <netinet/in.h>, + and <sys/socket.h> per SUSv3. + +2009-04-01 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_cp_mbstowcs): Check if ASCII SO is followed by at + least two chars and the next byte is a valid UTF-8 start byte before + trying to convert the followup bytes as UTF-8 sequence. + +2009-03-31 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (struct shm_attached_list): Convert access type to ULONG. + (fixup_shms_after_fork): Fix comment. Use NtMapViewOfSection rather + than MapViewOfFileEx to recreate shared memory regions. Add function + name to api_fatal output. + (shmat): Use NtMapViewOfSection to create shared memory region + top-down. + +2009-03-31 Corinna Vinschen <corinna@vinschen.de> + + * ctype.cc: Remove implementation of ctype functions in favor of + pointer-based newlib implementation. + (_ctype_b): Declare. + (__ctype_cp): Move to newlib. Declare. + (__ctype_iso): Ditto. + (__set_ctype): Implement changing __ctype_ptr__. Only copy character + class data in applications built under older Cygwin. + * cygwin.din (__ctype_ptr__): Export. + * include/ctype.h: Remove in favor of newlib implementation. + * include/cygwin/config.h (__EXPORT): Define alongside __IMPORT. + * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE): + Define check for old vs. new ctype implementation. + Bump API minor number. + +2009-03-28 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Perform some minor cleanup. Revamp speclib handling. + * speclib: Rewrite to create libraries with dlltool rather than + attempting surgery on libcygwin.a. + +2009-03-27 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (inet_ntop6): Convert to lowercase hex digits on the fly. + +2009-03-27 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getaddrinfo): Check hints for non-NULL before + checking its content. + +2009-03-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_fifo): Rename read/write methods to + raw_read/raw_write. + * fhandler_fifo.cc: Ditto. + +2009-03-27 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (pathconf): Fix memory leak. + +2009-03-26 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_worker): Write target filename as UTF-16 string + with leading BOM marker. + (symlink_info::check_shortcut): If check for leading BOM marker + succeeds, read filename as UTF-16 string. + (symlink_info::check_sysfile): Ditto. + +2009-03-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/asm/byteorder.h (__ntohl): Align definition to ISO C99. + (__ntohs): Ditto. + +2009-03-26 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (__set_charset_from_codepage): Revert to translating + codepage 936 to "GBK". + +2009-03-25 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_wcstombs): Don't convert ASCII SO into two + ASCII SO's. + +2009-03-25 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (environ_init): Break from locale loop after first hit. + * fhandler_console.cc (fhandler_console::write_normal): Print a SO + sequence using always valid Unicode chars. + +2009-03-25 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (__kr_wctomb): Use codepage 51949 rather than 50949. + (__kr_mbtowc): Ditto. + (__set_charset_from_codepage): Ditto. Translate codepage 936 to + "GB2312" and drop the charset name "GBK". + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (__kr_wctomb): Use codepage 50949 rather than 949. + (__kr_mbtowc): Ditto. + (__set_charset_from_codepage): Translate codepages 949 and 50949 to + "EUCKR" and drop the charset name "CP949". + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_cp_mbstowcs): Don't read beyond src + nms. + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * shared_info.h (CURR_SHARED_MAGIC): Update. + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * wchar.h: Replace UINT with unsigned int. + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * wchar.h: Remove erroneous "C" specifier from extern declaration. + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * ctype.cc (_CTYPE_DATA_0_127): Add _B class to TAB character. + (__ctype_default): New character class array for default ASCII + character set. + (__ctype_iso): New array of character class array for ISO charsets. + (__ctype_cp): Ditto for singlebyte Windows codepages. + (tolower): Implement as distinct function to support any singlebyte + charset. + (toupper): Ditto. + (__set_ctype): New function to copy singlebyte character classes + corresponding to current charset to ctype_b array. + Align copyright text to upstream. + * dcrt0.cc (dll_crt0_1): Reset current locale to "C" per POSIX. + * environ.cc (set_file_api_mode): Remove. + (codepage_init): Remove. + (parse_thing): Remove "codepage" setting. + (environ_init): Set locale according to environment settings, or + to current codepage, before converting environment to multibyte. + * fhandler.h (fhandler_console::write_replacement_char): Drop argument. + * fhandler_console.cc (dev_console::str_to_con): Call sys_cp_mbstowcs + rather than MultiByteToWideChar. + (fhandler_console::write_replacement_char): Always print a funny + half filled square if a character isn't in the current charset. + (fhandler_console::write_normal): Convert to using __mbtowc + rather than next_char. + * fork.cc (frok::child): Drop call to set_file_api_mode. + * globals.cc (enum codepage_type) Remove. + (current_codepage): Remove. + * miscfuncs.cc (cygwin_wcslwr): Unused, dangerous. Remove. + (cygwin_wcsupr): Ditto. + (is_cp_multibyte): Remove. + (next_char): Remove. + * miscfuncs.h (is_cp_multibyte): Drop declaration. + (next_char): Ditto. + * strfuncs.cc (get_cp): Remove. + (__db_wctomb): New function to implement _wctomb_r functionality for + doublebyte charsets using WideCharToMultiByte. + (__sjis_wctomb): New function to replace unusable newlib function. + (__jis_wctomb): Ditto. + (__eucjp_wctomb): Ditto. + (__gbk_wctomb): New function. + (__kr_wctomb): Ditto. + (__big5_wctomb): Ditto. + (__db_mbtowc): New function to implement _mbtowc_r functionality for + doublebyte charsets using MultiByteToWideChar. + (__sjis_mbtowc): New function to replace unusable newlib function. + (__jis_mbtowc): Ditto. + (__eucjp_mbtowc): Ditto. + (__gbk_mbtowc): New function. + (__kr_mbtowc): New function + (__big5_mbtowc): New function + (__set_charset_from_codepage): New function. + (sys_wcstombs): Reimplement, basically using same wide char to multibyte + conversion as newlib's application level functions. Plus extras. + Add lengthy comment to explain. Change return type to size_t. + (sys_wcstombs_alloc): Just use sys_wcstombs. Change return type to + size_t. + (sys_cp_mbstowcs): Replace sys_mbstowcs, take additional codepage + argument. Explain why. Change return type to size_t. + (sys_mbstowcs_alloc): Just use sys_mbstowcs. Change return type to + size_t. + * wchar.h: Declare internal functions implemented in strfuncs.cc. + (wcscasecmp): Remove. + (wcsncasecmp): Remove. + (wcslwr): Remove. + (wcsupr): Remove. + * winsup.h (codepage_init): Remove declaration. + (get_cp): Ditto. + (sys_wcstombs): Align declaration to new implementation. + (sys_wcstombs_alloc): Ditto. + (sys_cp_mbstowcs): Add declaration. + (sys_mbstowcs): Define as inline function. + (sys_mbstowcs_alloc): Align declaration to new implementation. + (set_file_api_mode): Remove declaration. + * include/ctype.h (isblank): Redefine to use _B character class. + (toupper): Remove ASCII-only definition. + (tolower): Ditto. + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (str2buf2uni): Remove. + * security.h (str2buf2uni): Remove declaration. + +2009-03-24 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * include/mntent.h: Remove declarations of nonexistant addmntent + and hasmntopt. Update and clarify the /etc/mtab comment. + +2009-03-23 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (__small_vsprintf): Handle NULL PWCHAR and + PUNICODE_STRING arguments. + (__small_vswprintf): Ditto. + +2009-03-23 Corinna Vinschen <corinna@vinschen.de> + + * include/asm/byteorder.h (__constant_ntohs): Remove declaration. + (__constant_ntohl): Ditto. + +2009-03-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wordexp, wordfree. + * posix.sgml: Move them to SUSv4 list. + * include/cygwin/version.h: Bump API minor number. + +2009-03-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/sys/un.h: #include <string.h> for strlen. + +2009-03-19 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (get_full_path_of_dll): Revert patch from 2008-07-16. + +2009-03-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din: Export log2, log2f as functions. + * posix.sgml: Add them to SUSv4 list. + * include/cygwin/version.h: Bump API minor number. + +2009-03-18 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (lsaauth): Remove local definitions of struct + _TOKEN_LINKED_TOKEN and TokenLinkedToken in favor of definitions + from winnt.h. + (lsaprivkeyauth): As in lsaauth, fetch linked token if available and + return that in favor of default token. + +2009-03-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * errno.cc (_sys_errlist): Add ESTRPIPE. + +2009-03-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcsdup. + * posix.sgml: Add wcsdup to SUSv4 list. + * include/cygwin/version.h: Bump API minor number. + +2009-03-15 Corinna Vinschen <corinna@vinschen.de> + + * include/inttypes.h: Remove "l" size specifier from all 16 and 32 bit + definitions. + +2009-03-14 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered + during initialization. + +2009-03-14 Corinna Vinschen <corinna@vinschen.de> + + * gendef: Remove STABS directives. + +2009-03-13 Corinna Vinschen <corinna@vinschen.de> + + * mktemp.cc: Remove STABS specific link-time warning. Align copyright + text to upstream. + +2009-03-13 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc: Fix lockf copyright to latest version. + +2009-03-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be defined + earlier. + (get_ino_by_handle): Take additional path_conv argument, accommodate + throughout. Only use FileId if isgood_inode check is true. + (fhandler_base::open_fs): Simplify setting ino due to above change. + (readdir_get_ino): Make sure to return always a non-zero inode number. + (fhandler_disk_file::readdir): Always open file in dir with + FILE_OPEN_REPARSE_POINT so as not to open wrong file. + Drop call to isgood_inode here. + * path.cc (symlink_info::check): Call fs.update in case we're fetching + file information from call to NtQueryDirectoryFile. + +2009-03-12 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (fhandler_disk_file::lock): Don't test file open mode in + case of flock-type locks. Explain why. + +2009-03-12 Brian Ford <Brian.Ford@FlightSafety.com> + + * gethostby_helper: Fix typos in DEBUGGING case. + +2009-03-11 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcscasecmp, wcsncasecmp. + * posix.sgml: Move wcscasecmp, wcsncasecmp to SUSv4 list. + * include/cygwin/version.h: Bump API minor number. + +2009-03-11 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf, + vswscanf. + * posix.sgml: Move fwscanf, swscanf, vwscanf, vfwscanf, vswscanf + to SUSv4 list. + * include/cygwin/version.h: Bump API minor number. + +2009-03-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::wait_for_events): Take additional + parameter "dontwait". + * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the + socket is non-blocking if dontwait is true. + (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to + set the wait_for_events dontwait parameter. + (fhandler_socket::send_internal): Ditto. Optimize code slightly. + * include/cygwin/socket.h (MSG_DONTWAIT): Define. + * include/cygwin/version.h: Bump API minor number. + +2009-03-09 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcsftime. + * posix.sgml: Move wcsftime to SUSv4 list. + * include/cygwin/version.h: Bump API minor number. + +2009-03-06 Pierre A. Humblet <pierre@phumblet.no-ip.org> + + * cygwin.din: Export gethostbyname2. + * net.cc: define _CYGWIN_IN_H and include resolv.h. + (realloc_ent): New function. + (dup_ent): Call realloc_ent. + (memcpy4to6): New function. + (dn_length1): New function. + (gethostby_helper): New function. + (gethostbyname2): New function. + * posix.sgml: Add gethostbyname2. + * include/cygwin/version.h: Bump API minor number. + * libc/minires.c (get_options): Look for "inet6" and apply bounds + to "retry" and "retrans". + (res_ninit): Set the default options at the beginning. + (dn_expand): Fix "off by one". + +2009-03-06 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf, + vswprintf. Sort. + * posix.sgml: Move fwprintf, swprintf, vwprintf, vfwprintf, vswprintf + to SUSv4 list. Sort SUSv4 list. + * include/cygwin/version.h: Bump API minor number. + +2009-03-04 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (disable_dep): Disable. Explain why. + (dll_crt0_0): Disable calling disable_dep. Explain why. + +2009-03-03 Corinna Vinschen <corinna@vinschen.de> + + * net.cc: Include asm/byteorder.h. + (htonl): Move to end of file. Add comment to explain why. Align + definition to POSIX. Use related macro from asm/byteorder.h. + (ntohl): Ditto. + (htons): Ditto. + (ntohs): Ditto. + * include/asm/byteorder.h: Revert previous patch. + +2009-03-03 Corinna Vinschen <corinna@vinschen.de> + + * include/asm/byteorder.h: Disable optimization when building + Cygwin network code. + +2009-02-26 Christopher Faylor <me+cygwin@cgf.cx> + + * dtable.cc (dtable::select_read): Add ability to override fh. + * fhandler.h (fhandler_fifo::select_read): Declare new function. + (fhandler_fifo::select_write): Ditto. + (fhandler_fifo::select_except): Ditto. + * select.cc (peek_pipe): Treat certain classes of pipe errors as "no + data". + (fhandler_fifo::select_read): Define new function. + (fhandler_fifo::select_write): Ditto. + (fhandler_fifo::select_except): Ditto. + + * shared_info.h (CURR_SHARED_MAGIC): Update. + +2009-02-23 Sjors Gielen <mailinglist@dazjorz.com> + + * Makefile.in: Add DESTDIR functionality. + +2009-02-23 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_user_local_groups): Simplify LookupAccountName code. + +2009-02-20 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NetLocalGroupEnum): Remove. + (NetLocalGroupGetMembers): Remove. + (NetUserGetLocalGroups): Add. + * sec_auth.cc (is_group_member): Remove function. + (get_user_local_groups): Get user as string instead of as SID. + Call NetUserGetLocalGroups instead of NetLocalGroupEnum. Drop call + to is_group_member. + (get_server_groups): Call get_user_local_groups with user name instead + of user SID. + +2009-02-19 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc: Fix Copyright date. + +2009-02-19 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export mbsnrtowcs and wcsnrtombs. + * posix.sgml: Move mbsnrtowcs and wcsnrtombs to SUSv4 section. + * include/cygwin/version.h: Bump API minor number. + +2009-02-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export open_wmemstream. + * posix.sgml: Move open_wmemstream to SUSv4 section. + * include/cygwin/version.h: Bump API minor number. + +2009-02-16 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export reallocf. + * malloc_wrapper.cc( reallocf): New function. + * posix.sgml: Add reallocf to BSD section. + * include/cygwin/version.h: Bump API minor number. + * libc/fts.c: Remove erroneous reallocf definition. + +2009-02-16 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcstoimax, wcstoumax. + * posix.sgml: Move wcstoimax and wcstoumax to SUSv4 section. + * include/inttypes.h: Declare wcstoimax and wcstoumax. + * include/cygwin/version.h: Bump API minor number. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcsnlen. + * posix.sgml: Move wcsnlen to SUSv4 section. + * include/cygwin/version.h: Bump API minor number. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (_getenv_r): New function. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Move dirfd to SUSv4 section. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Move interfaces deprecated in SUSv4 to deprecated + interfaces section. Move interfaces added in SUSv4 to SUSv4 + section or, if unimplemented, add them to the unimplemented interfaces + section. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Merge SUSv3 and SUSv4 section into a single SUSv4 section. + Move Solaris calls now in SUSv4 to SUSv4 section. Rename unimplemented + section to refer to SUSv4. Add note about missing interfaces. + Move wcstod and wcstof from unimplemented to SUSv4 section. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab_line): Make cygdrive posix=0 by + default as documented. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcstod and wcstof. + * include/cygwin/version.h: Bump API minor number. + +2009-02-11 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (open): Handle O_DIRECTORY flag. + * include/fcntl.h: Add SUSv4 flags O_DIRECTORY, O_EXEC and O_SEARCH. + * include/cygwin/version.h: Bump API minor number. + +2009-02-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix format. Add + code to allow to read disk and CD/DVD devices in full length. Explain + why. + (fhandler_dev_floppy::raw_read): Add current position to debug output. + + * include/sys/sched.h: New stub file to override newlib file with + clashing definitions. + +2009-02-05 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export wcstok. + * posix.sgml: Move wcstok from unimplemented to susv3. + * include/cygwin/version.h: Bump API minor number. + +2009-02-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (proc_tab): Add entry for mounts symlink. + (format_proc_mounts): New function to implement mounts symlink. + * fhandler_process.cc (process_tab): Add entry for mounts file. + (format_process_mounts): New function to implement mounts file. + +2009-02-04 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Disable generating default permission entries + for directories. + +2009-01-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number + evaluation for faked "." entry. + + * mount.cc (fs_info::update): Move setting of is_cdrom after checking + for caseinsensitivity. Recognize UDF in is_cdrom case and set + caseinsensitive flag according to UDF brokenness determined by OS. + Add comment to explain why. + * mount.h (class fs_info): Add is_udf status flag. + * path.cc (symlink_info::check): Add workaround for UDF bug in + terms of casesensitivity on certain OSes. + * wincap.h (wincaps::has_broken_udf): New element. + * wincap.cc: Implement above element throughout. + +2009-01-27 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::wait_overlapped): Set bytes to -1 on + EINTR or real error. + (fhandler_base::write_overlapped): Assume that bytes_written will + contain proper error value. + * pipe.cc (fhandler_pipe::fhandler_pipe): Set uninterruptible_io since + signals are handled by pipe functions now. + +2009-01-26 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (shared_name): New function for WCHAR names. + (open_shared): Take name parameter as WCHAR. Accommodate throughout. + * shared_info.h ((CURR_SHARED_MAGIC): Redefine. + (shared_name): Add declaration for function taking a WCHAR name. + (open_shared): Change declaration according to above change. + * pinfo.cc (pinfo::init) : Accommodate above change. + +2009-01-26 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgrgid_r): Simplify code by using stpcpy. + (getgrnam_r): Ditto. + * passwd.cc (getpwuid_r32): Simplify code by using stpcpy. + (getpwnam_r): Ditto. + +2009-01-26 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::load): Open file with FILE_OPEN_FOR_BACKUP_INTENT + flag. + +2009-01-24 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab): Open fstab file with + FILE_OPEN_FOR_BACKUP_INTENT flag. + +2009-01-23 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (__small_vsprintf): Use already available buffer tmp + in wfillin case. + +2009-01-22 Christopher Faylor <me+cygwin@cgf.cx> + + * select.cc (peek_serial): Add hack to allow proper operation with + com0com driver. + +2009-01-21 Corinna Vinschen <corinna@vinschen.de> + + Remove USE_SERVER define. Accommodate throughout. + * configure.in: Remove --enable-server option. + * configure: Regenerate. + * environ.cc: Remove CYGWIN=server setting. + +2009-01-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procnet.cc: Reorganize global procnet content data into a + new struct virt_tab_t. Accommodate throughout. + + * fhandler.h: Fix copyright dates. + * fhandler_process.cc: Ditto. + * fhandler_registry.cc: Ditto. + +2009-01-20 Corinna Vinschen <corinna@vinschen.de> + + * devices.h (FH_PROCESSFD): New device type. + * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD. + * fhandler.h (class fhandler_virtual): Drop bufalloc member. + * fhandler_virtual.h: New header. + * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor + of types virt_type_t and virt_tab_t from fhandler_virtual.h. + Change prototypes of format_XXX functions accordingly. + (proc_tab): Drop size member info. + (fhandler_proc::fill_filebuf): Don't allocate filebuf here. Allocate + it in the format_XXX functions. + * fhandler_process.cc: Reorganize global process content data into a + new struct virt_tab_t. Accommodate throughout. + (format_process_winexename): New function. + (format_process_winpid): New function. + (format_process_exename): New function. + (format_process_root): New function. + (format_process_cwd): New function. + (format_process_cmdline): New function. + (format_process_ppid): New function. + (format_process_uid): New function. + (format_process_pgid): New function. + (format_process_sid): New function. + (format_process_gid): New function. + (format_process_ctty): New function. + (format_process_fd): New function. + * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use + bufalloc. + * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define + bufalloc locally. + * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop + initialization of bufalloc. + (fhandler_virtual::dup): Drop copying bufalloc. + +2009-01-20 Corinna Vinschen <corinna@vinschen.de> + + * thread.h (struct pthread_rwlock::RWLOCK_READER): Add counter n. + * thread.cc (pthread_rwlock::rdlock): If a thread already owns a + read lock, just count the number of locks for it, per SUSv4. + (pthread_rwlock::tryrdlock): Ditto. + (pthread_rwlock::unlock): If a thread has more than one concurrent + read locks, just count down. + +2009-01-20 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (WSAIoctl): Reintroduce. + (WSASendMsg): Define. + * fhandler.h (class fhandler_socket): Change definition of recv_internal + and send_internal to take WSAMSG pointer as parameter. + * fhandler_socket.cc (WSAID_WSARECVMSG): Define. + (LPFN_WSARECVMSG): Define. + (WSASendMsg): Declare. + (get_ext_funcptr): New function to fetch address of WSARecvMsg. + (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter. + Change code accordingly. If control information is requested, + fetch address of WSARecvMsg and use that instead of WSARecvFrom. + (fhandler_socket::recvfrom): Change return type to ssize_t as + declared in fhandler.h. Accommodate changes to recv_internal. + (fhandler_socket::recvmsg): Ditto. Make sure that control information + is only requested if system, address family, and socket type support it. + (fhandler_socket::send_internal): Take just a LPWSAMSG parameter + and the flags. Change code accordingly. If control information is + provided, use WSASendMsg instead of WSASendTo. + (fhandler_socket::sendto): Drop useless comment. Accommodate changes + to send_internal. + (fhandler_socket::sendmsg): Ditto. Make sure that control information + is only provided if system, address family, and socket type support it. + * wincap.h (wincaps::has_recvmsg): New element. + (wincaps::has_sendmsg): New element + * wincap.cc: Implement above elements throughout. + * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment + of type struct cmsghdr. + +2009-01-17 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond + EOF is required. + +2009-01-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc: Reorganize global proc content data into a new + struct proc_tab_t. Accommodate throughout. + (format_proc_version): New function. + (format_proc_loadavg): New function. + (format_proc_self): New function. + + * resource.cc (getrlimit): Return correct rlim_max value for + RLIMIT_NOFILE. + +2009-01-16 Corinna Vinschen <corinna@vinschen.de> + + * Fix copyright dates. + +2009-01-13 Corinna Vinschen <corinna@vinschen.de> + + * libc/getopt.c (parse_long_options): Use fix from NetBSD's getopt + to avoid false ambiguities. + +2009-01-12 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (enum bin_status): New type. + (try_to_bin): Return bin_status. Rename win32_path to pc. Rename h + to fh. Rename fh to tmp_fh. Add code to set delete dispostion and + more code to replace file moved to bin by another, temporary file. + Add comments to explain why. + (unlink_nt): Replace move_to_bin with bin_stat. Only set bin_stat + to move_to_bin for non-remote files. As a last resort, call try_to_bin + if setting delete-on-close failed. Only re-set R/O DOS attribute + and only close handle if it's still valid. + +2009-01-11 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout. + * path.cc (path_conv::check): Set to and check for ENOENT instead of + ENOSHARE. + + * path.cc (symlink_info::check): Fix Samba 3.2.x comment. + +2009-01-09 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab_line): Always convert drive + letter in native path to uppercase. + * path.cc (normalize_win32_path): Ditto. + (path_prefix_p): Revert previous patch. + + * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER + return code to circumvent weird behaviour of Samba 3.2.x shares. + +2009-01-09 Christopher Faylor <me+cygwin@cgf.cx> + + * include/sys/cygwin.h (CW_SETERRNO): Define. + * external.cc (CW_SETERRNO): Implement. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to + reflect the above change. + + * path.cc (path_prefix_p): Treat X: as equivalent to x:. + + * mkglobals_h: Remove unneeded #define. + + * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero. + +2009-01-08 Corinna Vinschen <corinna@vinschen.de> + + * libc/fts.c (fts_build): Use DT_DIR case on Cygwin. + (fts_ufslinks): Fix using wrong structure member in Cygwin-specific + code. + +2009-01-07 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: Reorder NT status flags. Fix a case difference. Add + STATUS_CANNOT_DELETE flag. + * syscalls.cc (unlink_nt): Change initial NtOpenFile to request + FILE_SHARE_DELETE sharing mode. Change comment accordingly. + If setting delete disposition failed with STATUS_CANNOT_DELETE, try + to delete using delete-on-close. Explain why. + Rearrange setting R/O DOS attribute after trying to delete. Simplify + comment. + +2009-01-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe if + original file has .exe as well. + * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit + apps as binaries. + +2009-01-02 Christopher Faylor <me+cygwin@cgf.cx> + + Remove unneeded header files from source files throughout. + Update copyrights where appropriate. + + * globals.cc: New file for generic global variables. + * mkglobals_h: New script to generate globals.h. + * mkstatic: New script used to build a (currently non-working) static + libcygwin_s.a. + * Makefile.in: Add unused rule to build a non-working libcygwin_s.a. + (DLL_OFILES): Add globals.o. Make all objects rely on globals.h. + (globals.h): New target. Generate globals.h. + * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE + operator is allowed in _cygtls. + * dcrt0.cc: Move most globals to globals.cc. + * init.cc: Ditto. + * environ.cc (strip_title_path): Remove now-unneeded extern. + * fhandler_serial.cc (fhandler_serial::open): Ditto. + * pinfo.cc: Ditto. + (commune_process): Ditto. + * shared.cc: Ditto. + * glob.cc: Ditto. + * strace.cc: Ditto. + * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h. + * path.cc (stat_suffixes): Move here. + * security.h: Add forward class path_conv declaration. + * smallprint.cc (__small_vsprintf): Make a true c++ function. + (__small_sprintf): Ditto. + (small_printf): Ditto. + (console_printf): Ditto. + (__small_vswprintf): Ditto. + (__small_swprintf): Ditto. + * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of + regparm. + (hExeced): Move to globals.cc + * strfuncs.cc (current_codepage): Ditto. + (active_codepage): Ditto. + * sync.cc (lock_process::locker): Move here from dcrt0.cc. + * syscalls.cc (stat_suffixes): Move to path.cc. + * tty.cc (tty::create_master): Uncapitalize fatal warning for + consistency. + * winsup.h: Include globals.h to declare most of the grab bag list of + globals which were previously defined here. + + * mount.h: Move USER_* defines back to shared_info.h. + + * speclib: Force temporary directory cleanup. + +2009-01-02 Christopher Faylor <me+cygwin@cgf.cx> + + * speclib: Rewrite completely in perl. Avoid multiple nm calls. + diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2010 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2010 new file mode 100644 index 000000000..cd103f7e9 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2010 @@ -0,0 +1,3103 @@ +2010-12-29 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc: Include stdlib.h. + (_cygtls::init_thread): Seed random number generator on a per-thread + basis. + +2010-12-27 Christopher Faylor <me+cygwin@cgf.cx> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 234. + +2010-12-26 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin.din: Export program_invocation_name and program_invocation_short_name. + * dcrt0.cc: Set program_invocation*name to correct values, based on + argv[0]. + * globals.cc (program_invocation_name): Define. + (program_invocation_short_name): Ditto. + +2010-12-16 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Really fix erroneous inheritence entry + duplication now. Add more comments for clarity. + +2010-12-15 Christian Franke <franke@computer.org> + + * sec_acl.cc (getacl): Ensure that the default acl contains at least + DEF_(USER|GROUP|OTHER)_OBJ entries. + +2010-12-15 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Fix erroneous inheritence entry duplication. + +2010-12-12 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (check_dir_not_empty): Never count more than 3 directory + entries. + +2010-12-12 Christopher Faylor <me+cygwin@cgf.cx> + + * init.cc (search_for): Put this in shared section or suffer subtle + problems with the tls. + * pinfo.cc (status_exit): Add debug output to report on unexpected exit. + * tls_pbuf.cc (tmp_pathbuf::c_get): Add more details to internal error. + +2010-12-09 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (RETRY_COUNT): New define. + (std_dll_init): Restructure loop to retry loading a DLL only if + specific errors occur. If these errors persist, try to load DLL + with name only. + +2010-12-08 Corinna Vinschen <corinna@vinschen.de> + + * include/strings.h: Remove in favor of equivalent newlib file. + +2010-12-08 Christian Franke <franke@computer.org> + + * sec_acl.cc (getacl): Set DEF_CLASS_OBJ permissions to 07 instead + of 0777. + +2010-12-06 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Don't generate ENOENT for non-existant + CYGDRIVE and NETDRIVE paths. Add comment. + +2010-12-02 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_xp_ifs): Fix counting of idx to return stable interface + alias names for interfaces with multiple IPv4 addresses. + +2010-11-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::dup): Free path_conv strings + to avoid memory leak. Add comment. + (fhandler_pty_master::dup): Ditto. + * path.h (path_conv::free_strings): New method. + +2010-11-23 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (SendARP): Remove. + * net.cc (get_flags): Set IFF_NOARP flag for PPP and SLIP devices. + (get_xp_ifs): Unify IFF_BROADCAST setting. Drop calling SendARP to + set IFF_NOARP flag. + +2010-11-23 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Don't use FileNetworkOpenInformation + on Netapps. Relax condition for workaround. Always request size + information via FileStandardInformation info class in workaround. + +2010-11-22 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (NETAPP_IGNORE): Add FILE_PERSISTENT_ACLS. + (FS_IS_NETAPP_DATAONTAP): Drop test for FILE_PERSISTENT_ACLS. + (fs_info::update): Set filetype to ntfs in remote case, too. Fix a + couple of comments. Add test for Netapps faking to be FAT. + + * mount.h (IMPLEMENT_FS_FLAG): Simplify definition and usage. + +2010-11-22 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_ipv4fromreg_ipcnt): Fix debug output. Only create debug + output if error is not ERROR_FILE_NOT_FOUND. + (get_ipv4fromreg): Ditto. + +2010-11-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::fchown): Initialize mode to 0. + +2010-11-15 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Move llround and llroundf to implemented SUSv4 functions. + * include/cygwin/version.h: Add llround and llroundf to the comment for + the 233 CYGWIN_VERSION_API_MINOR bump. + +2010-11-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/paths.h (_PATH_VARTMP): Define. + +2010-10-30 Christopher Faylor <me+cygwin@cgf.cx> + + * localtime.cc (is_upper): Rename to isupper and include ctype.h to + pull in standard macro. + (lcl_is_set): Define as an enum. + (tzsetwall): Assign lcl_is_set to correct enum values. + (tzset): Ditto. Copy as much of TZ as will fit to TZ buffer. + +2010-10-27 Christopher Faylor <me+cygwin@cgf.cx> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 233. + +2010-10-24 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (do_exit): Don't set thread termination until all fds have + been closed since an fd may rely on a thread. + * fhandler_tty.cc: Reformat comment. + (fhandler_pty_master::pty_master_thread): Don't treat + ERROR_PIPE_CONNECTED state as an error. + * globals.cc (exit_states): Reorder ES_THREADTERM. + + * path.cc (find_fast_cwd_pointers): Remove excessively wordy DEBUGGING output. + +2010-10-24 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (try_to_debug): Improve comment. + * fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Add a + comment. + +2010-10-23 Christopher Faylor <me+cygwin@cgf.cx> + + * pinfo.cc (pinfo::exit): Grab a tty lock before setting pgid. + +2010-10-23 Christopher Faylor <me+cygwin@cgf.cx> + + * pinfo.cc (pinfo::exit): Reset tty pgrp to zero if no more handles open. + (_pinfo::set_ctty): Remove debugging stuff. + +2010-10-23 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_master::open): Remove debugging printf. + +2010-10-23 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_termios::tcinit): Make second argument + non-optional. + * fhandler_console.cc (fhandler_console::open): Specify second argument + to tcinit. + * fhandler_termios.cc (fhandler_termios::tcinit): Rename second + argument. Set pgid to 0 if this is a pty master. + (fhandler_termios::tcgetpgrp): Just return value of pgid. It will be + zero if not initialized. + * fhandler_tty.cc (fhandler_tty_slave::open): Specify second argument + to tcinit. + (fhandler_tty_slave::ioctl): Implement TIOCGPRP/TIOCSPGRP. Fix switch + indentation. + (fhandler_tty_master::ioctl): Implement TIOCGPRP/TIOCSPGRP. + * include/sys/termios.h (TIOCGPGRP): Define similarly to Linux. + (TIOCSPGRP): Ditto. + +2010-10-18 Marco Atzeri <marco_atzeri@yahoo.it> + + * winsup/cygwin/cygwin.din: Add llround and llroundf. + +2010-10-09 John Carey <aeolus@electric-cloud.com> + Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cwdstuff::override_win32_cwd): Declare. + * ntdll.h (struct _PEB): Add members accessed by the fast cwd method + starting with Vista. + (struct _KUSER_SHARED_DATA): Define with only the DismountCount. + (RtlAllocateHeap): Declare. + (RtlEnterCriticalSection): Declare. + (RtlFreeHeap): Declare. + (RtlLeaveCriticalSection): Declare. + * path.cc (get_user_proc_parms): Remove. + (struct _FAST_CWD): New structure. + (fast_cwd_ptr): Define. + (SharedUserData): Define. + (peek32): Define. + (find_fast_cwd_pointers): New function to find the global pointer + to the current FAST_CWD structure. + (copy_cwd_str): New helper function. + (cwdstuff::override_win32_cwd): New method to set the Win32 CWD. + (cwdstuff::init): Just call override_win32_cwd from here when + started from native Win32 parent. + (cwdstuff::set): Access Win32 CWD via PEB reference instead of using + get_user_proc_parms function. Memorize old DismountCount before + opening directory handle. Call override_win32_cwd to set up Win32 CWD. + Be more verbose in comments. + * wincap.h (wincaps::has_fast_cwd): New element. + * wincap.cc: Implement has_fast_cwd element throughout. + +2010-10-08 Marco Atzeri <marco_atzeri@yahoo.it> + Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Export new complex math functions from newlib. + * posix.sgml: Move newly exported complex functions to implemented + SUSv4 functions. + * include/cygwin/version.h: Bump API minor version. + +2010-10-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::get_stat_access): Delete. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Always check + executable suffix to get x-bits for .exe files also in notexec case. + Always reopen file when checking for file header. + * ntdll.h (wait_pending): Delete. + * path.cc (symlink_info::check_shortcut): Drop call to wait_pending + since file is always opened for sync IO. + (symlink_info::check_sysfile): Ditto. + (MIN_STAT_ACCESS): Remove. + (FULL_STAT_ACCESS): Remove. + (symlink_info::check): Drop access flag. Revert to open file with + just read attributes access. Reorder symlink check to check for + reparse points first. Don't check reparse points for anything else, + even on remote drives. Open file for GENERIC_READ when trying to + read shortcuts or system-bit symlinks. Accommodate dropped access + flag in call to path_conv_handle::set. + * path.h (class path_conv_handle): Drop access flag and accommodate + all related methods. + +2010-10-06 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_mutex_init): Call NtCreateMutant to make sure the + access mask is correct. + (ipc_cond_init): Take additional parameter to differ between send and + receive event. Call NtCreateEvent to make sure the access mask is + correct. + (ipc_cond_timedwait): Reset Event prior to calling WFMO. + (struct mq_info): Split mqi_wait into two events, mqi_waitsend and + mqi_waitrecv. + (mq_open): Calloc mqinfo. Create mqi_waitsend and mqi_waitrecv events. + Make sure all synchronization objects are closed in case of an error. + (_mq_send): Wait for mqi_waitsend event. Signal mqi_waitrecv event. + (_mq_receive): Wait for mqi_waitrecv event. Signal mqi_waitsend event. + (mq_close): Close mqi_waitsend and mqi_waitrecv events. + +2010-10-05 Corinna Vinschen <corinna@vinschen.de> + + * path.h (enum pathconv_arg): Remove PC_CHECK_EA. + +2010-10-02 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_0): Move _main_tls initialization here. + (__dll_crt0): Only initialize _main_tls if it changes. + * fhandler_console.cc (fhandler_console::write): Fix debugging output. + +2010-10-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Simplify. + Just call nfs_fetch_fattr3 if called via fstat. + * nfs.cc (nfs_fetch_fattr3): New function to fetch NFS fattr3 info from + file handle. + * nfs.h (nfs_fetch_fattr3): Declare. + * path.cc (symlink_info::check): Simplify NFS case. Just call + nfs_fetch_fattr3. + +2010-10-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::exists): Return virt_none + if path is invalid. + +2010-10-01 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (std_dll_init): Add a retry loop. + +2010-09-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc: Drop including nfs.h. + * fhandler_disk_file.cc: Ditto. + (fhandler_base::fstat_by_nfs_ea): Use fattr3 from path_conv member, + unless called from fstat. + * path.cc: Drop including nfs.h. + (symlink_info::check): Rearrange definition of file info buffers. + Fetch fattr3 info for files on NFS and store in conv_hdl for later + use in fhandler_base::fstat_by_nfs_ea. Use fattr3 file type to + recognize symlink on NFS and try to fetch symlink target only for + actual symlinks. + * path.h: Include nfs.h. + (class path_conv_handle): Change file info storage to union of + FILE_NETWORK_OPEN_INFORMATION and fattr3 structures. + (path_conv_handle::fnoi): Align to aforementioned change. + (path_conv_handle::nfsattr): New method. + (path_conv::nfsattr): New method. + +2010-09-30 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Remove erroneous assumption about + required permissions when reading NFS symlinks. + +2010-09-29 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_tty.cc (fhandler_tty_slave::init): Revert to using + tc->setpgid since previous change broke some use cases. + +2010-09-28 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_tty.cc (fhandler_tty_slave::init): Add debugging. Use + tcsetpgrp to potentially set pgid since it is smarter about deciding if + a process is in the background. + * include/sys/cygwin.h (PID_ORPHANED): Actually delete as planned. + (PID_NOTCYGWIN): Correctly define. + +2010-09-28 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (getdomainname): Drop special case for NT4. + +2010-09-28 Corinna Vinschen <corinna@vinschen.de> + + Revert accidental previous login. + +2010-09-28 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_IMPORTS): Remove libadvapi32.a. + * autoload.cc: Add all advapi32 entry points. + * mount.cc (mount_info::init): Read user fstab only if we have a + username. + * passwd.cc (pwdgrp::read_passwd): Only use username if we have one. + * shared.cc (user_info::initialize): Set cb last so as not to override + planned behaviour in pwdgrp::read_passwd. + * uinfo.cc (cygheap_user::init): Fetch Windows username from environment + variable $USERNAME. Don't set name in cygheap if variable is empty. + (internal_getlogin): If we still have no username, try GetUserNameW. + +2010-09-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_master::setup): Always create master + thread. + +2010-09-28 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (gethostid): Use correct path to ProductId registry value. + +2010-09-27 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Remove erroneous NtClose on random handle + value. + +2010-09-26 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::init): Call GetUserNameW and convert to + multibyte here so as not to rely on the current ANSI page. + +2010-09-26 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (__main): Force signal synchronization. + +2010-09-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Drop has_exclusiveaddruse + condition. Fix comment about availability. Move remaining comment to + the right spot. Drop has_ip_helper_lib condition. + * net.cc (cygwin_setsockopt): Drop has_disabled_user_tos_setting + condition. Fix comment. + (get_2k_ifs): Fix comment. + (get_nt_ifs): Remove. + (getifaddrs): Drop call to get_nt_ifs. + (get_ifconf): Ditto. + * wincap.cc: Throughout, drop has_ip_helper_lib, + has_disabled_user_tos_setting, and has_exclusiveaddruse settings from + wincaps. + (wincap_unknown): Remove. + (wincap_nt4): Remove. + (wincap_minimal): New macro, set to wincap_nt4sp4 for now. + (wincapc::init): Drop test for pre-SP4 NT4. Just imply at least NT SP4. + Replace references to wincap_unknown with references to wincap_minimal. + * wincap.h (struct wincaps): Drop has_ip_helper_lib, + has_disabled_user_tos_setting, and has_exclusiveaddruse flags and + methods. + +2010-09-25 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Throughout, order entry points alphabetically by DLL + and function name. Make functions which are available on all supported + systems non-optional. Fix return value on entry points imported from + secur32.dll. Add comment. + (std_dll_init): Call fesetenv unconditionally. + +2010-09-24 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (std_dll_init): Move dll_path closer to its use. Use + dll_path in fatal error. Set ret values under lock control. + * lib/minires.c (res_nsend): Fix compilation errors owing to pointer + signedness. + +2010-09-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Handle query_write_dac flag. + * fhandler.h (enum query_state): Add query_write_dac flag. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Open file + with query_write_dac instead of query_write_control. + +2010-09-24 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_BAD_NET_RESP to ENOSYS. + * fhandler_disk_file.cc (fhandler_disk_file::facl): Handle ENOSYS and + point to the explanation. + * ntdll.h (STATUS_NOT_IMPLEMENTED): Define. + * path.cc (symlink_info::check): Handle the inability of NT4 to use + FileNetworkOpenInformation on share root dirs in either direction. + * path.h (slash_unc_prefix_p): Remove unused declaration. + * security.cc (get_info_from_sd): Handle ENOSYS from get_file_sd. + Explain when this happens. + +2010-09-23 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (std_dll_init): Use correct format type when displaying + dll name in error output. + +2010-09-21 Pierre Humblet <Pierre.Humblet@ieee.org> + + * libc/minires.c (res_nsend): Use the Windows resolver if appropriate. + (dn_expand): Only set errno in case of error. Delete old comments. + (dn_skipname): Fix typo in comment. + +2010-09-21 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cwdstuff::set): Replace constant 2 with sizeof(WCHAR) where + appropriate. + +2010-09-21 Corinna Vinschen <corinna@vinschen.de> + + * mount.h (class fs_info): Add has_buggy_reopen flag and accessor + methods. + * mount.cc (fs_info::update): Set has_buggy_reopen flag for NWFS. + Add comment. + * path.h (path_conv::get_object_attr) Make inline method. + (path_conv::init_reopen_attr): New inline method. + * path.cc (path_conv::get_object_attr): Remove. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Use + path_conv::init_reopen_attr method to initialize OBJECT_ATTRIBUTE for + reopening file. + (fhandler_disk_file::fchmod): Ditto. + (fhandler_base::utimens_fs): Ditto. + (fhandler_disk_file::rewinddir): Ditto. + * syscalls.cc (unlink_nt): Ditto. + +2010-09-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Always open NFS files with + FILE_READ_EA, even when opening with O_WRONLY to allow fstat. + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Call + FlushFileBuffers if file has been opened for writing. Explain why. + (fhandler_base::fstat_by_handle): Renew content of pc.fnoi if called + via fstat. Explain why. Fix formatting. + * path.cc (symlink_info::check): Try to open file the second time with + FILE_READ_EA permissions since it's needed in later calls to + fhandler_base::fstat_by_nfs_ea. + +2010-09-20 Christopher Faylor <me+cygwin@cgf.cx> + + * include/sys/cygwin.h (PID_NOTCYGWIN): New enum. + * spawn.cc (spawn_guts): Set a flag when a process is not a cygwin + process. + * fhandler_tty.cc (fhandler_tty_slave::init): Remove previous change. + Try a different method to determine when we should become the process + group owner. + * signal.cc (kill0): Remove archaic code which dealt with never-set + flag. + +2010-09-20 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_tty.cc (fhandler_tty_slave::init): Add additional checks to + determine when a process should grab control of a tty's pgid. Use + being_debugged() for consistency. + * debug.h (being_debugged): Remove vestige of win9x accommodation. + +2010-09-19 Christopher Faylor <me+cygwin@cgf.cx> + + * wincap.h (wincaps::has_buggy_thread_startup): Declare. + (wincapc::has_buggy_thread_startup): Ditto. + * wincap.cc::wincap_*): Accommodate has_buggy_thread_startup. + (wincapc::init): Explicitly turn off has_buggy_thread_startup if not + WOW64. + * cygthread.h (cygthread::thread_handle): Declare/define new method. + * dcrt0.cc (_dll_crt0): Don't call __sinit here. + (dll_crt0_0): Don't call sigproc_init during initialization + if wincap.has_buggy_thread_startup(). + (dll_crt0_1): Defer sigproc_init to here when + wincap.has_buggy_thread_startup(). Call __sinit after we've determined + that we're not forking. + (__main): Rework comments. Add potential future reminder. + +2010-09-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fetch number + of links and inode number only if path has good inodes. + (fhandler_base::fstat_by_name): Fetch inode number only if path has + good inodes. + +2010-09-14 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Make sure AllocationSize and EndOfFile + are stored in the right order when fetching the info from the + NtQueryDirectoryFile result. + +2010-09-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (get_mem_values): Simplify code. Fix + NtQueryVirtualMemory loop so it handles memory allocation gracefully. + Always set errno to a useful value. + +2010-09-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_base): Change inheritance of fstat_helper + and fstat_by_... methods to private. + (fhandler_base::fstat_helper): Drop all redundant arguments. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call + to fstat_by_nfs_ea here. Drop fetching basic file information. + Drop setting file attributes. Accommodate change in fstat_helper call. + (fhandler_base::fstat_by_name): Simplify. Only fetch directory + information to get the inode number. Drop setting file attributes. + Accommodate change in fstat_helper call. + (fhandler_base::fstat_fs): Call fstat_by_nfs_ea if on NFS. + (fhandler_base::fstat_helper): Drop all redundant arguments. Use + information already collected in the fhandler. Move heading comment + into code and drop dwFileAttributes comment. + * mmap.cc (mmap64): Call fstat_fs rather than fstat_by_handle. + * mount.cc (fs_info::update): Note that has_buggy_basic_info is unused. + * path.cc (symlink_info::check_reparse_point): Add comment. + (symlink_info::check): Fetch FileNetworkOpenInformation rather than + FileBasicInformation throughout, except on NFS. Explain why. Store + FILE_NETWORK_OPEN_INFORMATION in conv_hdl. Remove + FILE_ATTRIBUTE_DIRECTORY attribute in conv_hdl for reparse point + symlinks. + * path.h (class path_conv_handle): Add FILE_NETWORK_OPEN_INFORMATION + member _fnoi. + (path_conv_handle::fnoi): New accessor method for _fnoi. + (path_conv::fnoi): New accessor method for cubv_hdl._fnoi. + + * fhandler_tty.cc (fhandler_tty_slave::init): Use tty::setpgid method. + +2010-09-12 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (acl_worker): Remove. + (acl32): Implement acl_worker functionality here. + (lacl32): Just return -1 with errno set to ENOSYS. + (lacl): Ditto. + * include/cygwin/acl.h (lacl): Remove this call. + +2010-09-12 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (sig_dispatch_pending): Remove debugging statement. + (sigproc_init): Wrap a long line. + +2010-09-12 Christopher Faylor <me+cygwin@cgf.cx> + + * cygthread.h (cygthread::cygthread): Reorganize slightly. + * dcrt0.cc (dll_crt0_0): Move sigproc initialization later to ensure + everything we need has been set up. + (dll_crt0_1): Streamline some logic slightly. + * sigproc.cc (no_signals_available): Add back dropped test for macro + parameter. + * fhandler_console.cc (fhandler_console::write): Show a little bit of + what's being written to the console in debugging output. + +2010-09-12 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (start_transaction): Make inline function. Move up to be + more generally available. + (stop_transaction): Ditto. + (unlink_nt): Potentially start transaction when trying to delete file + with DOS R/O attribute set. If file is .lnk symlink, check for number + of hardlinks. Add "out" label and only return via "out". Rearrange + reversion of DOS R/O attribute and, on success, only revert R/O + attribute if file is .lnk symlink with more than one hardlink. Add + length comment to explain why. + +2010-09-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): More thoroughly + check the existence condition on remote drives. Enhance comment. + +2010-09-11 Dave Korn <dave.korn.cygwin@gmail.com> + + * Makefile.in (DLL_OFILES): Add new fenv.o module. + (fenv_CFLAGS): New flags definition for fenv.o compile. + * autoload.cc (std_dll_init): Use fenv.h functions instead of direct + manipulation of x87 FPU registers. + * crt0.c (mainCRTStartup): Likewise. + * cygwin.din (feclearexcept, fegetexceptflag, feraiseexcept, + fesetexceptflag, fetestexcept, fegetround, fesetround, fegetenv, + feholdexcept, fesetenv, feupdateenv, fegetprec, fesetprec, + feenableexcept, fedisableexcept, fegetexcept, _feinitialise, + _fe_dfl_env, _fe_nomask_env): Export new functions and data items. + * fenv.cc: New file. + * posix.sgml: Update status of newly-implemented APIs. + * include/fenv.h: Likewise related header. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2010-09-10 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Limit retry loop in case of sharing violation + to about a second. + +2010-09-10 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (fstatat): Call stat_worker directly from here. + +2010-09-10 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (allow_others_to_sync): Define MAX_PROCESS_SD_SIZE. Use + instead of ACL_DEFAULT_SIZE. + * sec_acl.cc (setacl): Use TLS buffer to allow maximum ACL size. + * security.h (ACL_DEFAULT_SIZE): Drop definition. + (ACL_MAXIMUM_SIZE): Define. + (SD_MAXIMUM_SIZE): Define. + * security.cc (get_file_sd): Allocate security_decscriptor with size + SD_MAXIMUM_SIZE. + (alloc_sd): Use TLS buffer to allow maximum ACL size. + +2010-09-10 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (class fs_info_cache): New class to cache filesystem + information. + (fs_info::update): Check FileFsVolumeInformation against filesystem + cache and use it, if filesystem is already available. Add filesystem + to cache, if not. Only request FileFsObjectIdInformation if + FILE_SUPPORTS_OBJECT_IDS is set in filesystem flags. + * ntdll.h (struct _FILE_FS_VOLUME_INFORMATION): Add pragma pack so the + structure size is matching the OS expectations. Add __dummy member + used in filesystem cache. + +2010-09-10 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_file_sd): Add bool parameter justcreated. Use + GetSecurityInfo only if justcreated is true, NtQuerySecurityObject + otherwise. Add comment to explain why. Don't waste time to call + NtQuerySecurityObject twice, just allocate big enough area. + (get_file_attribute): Call get_file_sd with justcreated set to false. + (set_file_attribute): Call get_file_sd with justcreated depending on + S_JUSTCREATED pseudo file attribute. + (check_file_access): Call get_file_sd with justcreated set to false. + * sec_acl.cc (setacl): Ditto. + (getacl): Ditto. + * security.h: Convert many functions to regparm functions. + (get_file_sd): Declare with extra bool parameter. + +2010-09-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::exists): Rearrange to handle + dangling symlinks correctly. Fix comments. + (fhandler_procsys::fill_filebuf): Remove useless comment. + +2010-09-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::open): Simplify by just + calling fhandler_base::open. + +2010-09-06 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add fhandler_procsys.o. + * devices.h (enum fh_devices): Add FH_PROCSYS. + * devices.in (dev_procsys_storage): New device. + * devices.cc: Regenerate. + * dtable.cc (build_fh_pc): Add code to allocate fhandler_procsys. + * fhandler.h (proc_len): Convert to size_t. + (procsys): Declare. + (procsys_len): Declare. + (enum virtual_ftype_t): Move here from fhandler_virtual.h. + Add members supported by fhandler_procsys. + (fhandler_virtual::exists): Return virtual_ftype_t. Change + in all derived classes. + (class fhandler_procsys): New class. + (fhandler_union): Add fhandler_procnet and fhandler_procsys members. + * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Use + ro_u_proc. + (fhandler_base::fstat_by_handle): Don't copy attributes if file is an + NT device. + (fhandler_base::fstat_by_name): Ditto. + * fhandler_netdrive.cc (fhandler_netdrive::exists): Return + virtual_ftype_t. + * fhandler_proc.cc (proc_tab): Sort alphabetically. Use _VN macro + to store length. + (proc_len): Change to size_t. + (proc_tab_cmp): New static function. + (virt_tab_search): New function to search entry in virt_tab_t + arrays. Use throughout in /proc and sibling classes instead of + loop. + (fhandler_proc::exists): Return virtual_ftype_t. + * fhandler_process.cc (process_tab): Sort alphabetically. Use _VN + macro to store length. + (fhandler_process::exists): Return virtual_ftype_t. + (fhandler_process::open): Simplify code. + * fhandler_procnet.cc (procnet_tab): Sort alphabetically. Use _VN + macro to store length. + (fhandler_procnet::exists): Return virtual_ftype_t. + (fhandler_procnet::open): Simplify. + * fhandler_procsys.cc: New file. + * fhandler_registry.cc (fhandler_registry::exists): Return + virtual_ftype_t. + * fhandler_virtual.cc (fhandler_virtual::exists): Ditto. + * fhandler_virtual.h (enum virtual_ftype_t): Move to fhandler.h. + (virt_tab_t): Add name_len member. + (_VN): New macro. + (virt_tab_search): Declare. + * mount.cc (mount_info::conv_to_win32_path): Fix comment. Backslashify + isprocsys_dev paths. + * ntdll.h (STATUS_OBJECT_TYPE_MISMATCH): Define + (STATUS_INSTANCE_NOT_AVAILABLE): Define. + (STATUS_PIPE_NOT_AVAILABLE): Define. + (STATUS_INVALID_PIPE_STATE): Define. + (STATUS_PIPE_BUSY): Define. + (SYMBOLIC_LINK_QUERY): Define. + (NtOpenSymbolicLinkObject): Declare. + (NtQuerySymbolicLinkObject): Declare. + * path.cc (path_conv::check): Accommodate fact that exists method + returns virtual_ftype_t now. Add cases for new virtual_ftype_t + types. + (cygwin_conv_path): Add GLOBALROOT prefix to native device paths. + Make sure to strip \\?\ prefix only for actual filesystem-based + paths, not for all paths. + * path.h (isproc_dev): Add FH_PROCSYS. + (isprocsys_dev): Define. + +2010-09-04 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::from_fstab_line): Reorder to make sure all + mounts from user fstab are user mounts. + (mount): Make sure all mounts are user mounts, even those added via + mount -a. + +2010-09-02 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (sigproc_init): Use American spelling in comment. + +2010-09-01 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_0): Remove myself settings. + * fork.cc (fork): Set myself process_state. + * pinfo.cc (pinfo_init): Ditto. + (pinfo::thisproc): Make sure any sendsig setting is correctly copied. + * pinfo.h: Update copyright. Remove unused code. + +2010-09-01 Christopher Faylor <me+cygwin@cgf.cx> + + * cygthread.cc (cygthread::create): Fix incorrect use of name rather + than __name. + * cygthread.h (cygthread::cygthread): Create versions which eliminate + 'n' parameter. + * dcrt0.cc (dll_crt0_1): Remove check for threadfunc_ix. Remove + obsolete comments. Set process_state to active here. + * fhandler_netdrive.cc (create_thread_and_wait): Use shortened + cygthread constructor. + * timer.cc (timer_tracker::settime): Ditto. + * window.cc (HWND): Ditto. + * fhandler_tty.cc: Use shortened cygthread constructor, where + appropriate, throughout. + * select.cc: Ditto. + * fork.cc (frok::child): Remove wait_for_sigthread. + (fork): Reformat if for slightly better clarity. + * init.cc (dll_finished_loading): New variable. + (dll_entry): Use dll_finished_loading to determine when we should call + merge_threadfunc. + * sigproc.cc (no_signals_available): Simplify by using my_readsig. + (wait_sig_inited): Delete. + (wait_sig): Define as void function. + (pending_signals): Accommodate change to wait_sig definition. + (wait_for_sigthread): Delete definition. + (sigproc_init): Initialize signal pipe here, before wait_sig thread is + created. Use void form of cygthread creation. + (init_sig_pipe): Delete. + (wait_sig): Return void rather than DWORD. Assume previous + initialization of signal pipe. Set my_sendsig to NULL when exiting. + * sigproc.h (wait_for_sigthread): Delete declaration. + +2010-09-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Set d_type. + (fhandler_netdrive::seekdir): Fix test for readdir return value. + * fhandler_registry.cc (fhandler_registry::seekdir): Ditto. + +2010-09-01 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL minor version number to 8. + +2010-08-31 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (normalize_posix_path): Preserve //./ and //?/ prefixes. + (path_conv::check): Allow access to root directory of native NT disk + devices. + +2010-08-31 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL minor version number to 7. + +2010-08-30 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_0): Move sigproc_init later, after cygheap + initialization since it relies on the cygheap existing (even if + it shouldn't matter due to dll initialization serialization). + +2010-08-30 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (std-notes): Fix typos and incorrectnesses. + +2010-08-30 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (MsgWaitForMultipleObjectsEx): Define. + (MsgWaitForMultipleObjects): Remove. + * select.cc (select_stuff::wait): Use MsgWaitForMultipleObjectsEx with + QS_ALLPOSTMESSAGE and, if possible, MWMO_INPUTAVAILABLE flags. Explain + why. Fix a potential crash due to a NULL pointer in WAIT_FAILED case. + (peek_windows): Use filter pattern on NT4. Explain why. + * wincap.h (wincaps::has_mwmo_inputavailable): New element. + * wincap.cc: Implement above element throughout. + +2010-08-29 Christopher Faylor <me+cygwin@cgf.cx> + + * winlean.h: New file. + * automode.c: Use "winlean.h". + * binmode.c: Ditto. + * gmon.c: Ditto. + * textmode.c: Ditto. + * textreadmode.c: Ditto. + * winsup.h: Ditto. + * lib/cygwin_attach_dll.c: Ditto. + * lib/dll_main.cc: Ditto. + * profile.c: Ditto. + * crt0.c: Ditto. Cleanup ancient cruft. Add dummy calls to + cygwin_premain*. + * include/sys/cygwin.h: Remove old stuff. Move premain declarations + nearer to other cygwin-specific function declarations. + * globals.cc: Add comment. + +2010-08-28 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (LoadDLLprime): Change dllname storage to string16. + (struct dll_info): Convert name to WCHAR. + (std_dll_init): Load DLLs with full path to windows system directory. + Add hint to Microsoft security advisory. + * dcrt0.cc (init_windows_system_directory): New function. + (dll_crt0_0): Call init_windows_system_directory first. + * exceptions.cc (windows_system_directory): Move to globals.cc. + (windows_system_directory_length): Ditto. + (events_init): Drop code fetching windows_system_directory. + * globals.cc (windows_system_directory): New global variable. + (windows_system_directory_length): Ditto. + * net.cc (load_ipv6_funcs): Use windows_system_directory rather than + GetSystemDirectoryW. + * netdb.cc (open_system_file): Ditto. Simplify debug output. + +2010-08-27 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (sync_wincwd): Remove. + (cygwin_internal): Drop CW_SYNC_WINCWD case. + * globals.cc (ro_u_pipedir): New R/O unicode string. + * ntdll.h (RtlSetCurrentDirectory_U): Declare. + * path.cc (cwdstuff::set): Improve comments. Drop setting Win32 CWD to + \\?\PIPE\ on init. Keep Win32 CWD in sync, if possible. Set to + \\?\PIPE\ otherwise. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Revert to 230. + * include/sys/cygwin.h (cygwin_getinfo_types): Remove CW_SYNC_WINCWD. + +2010-08-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Improve comment. + +2010-08-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Simplify code and enable + partition layout printing for non-privileged users. + +2010-08-25 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Fix comments. + +2010-08-25 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Open file with FILE_READ_ATTRIBUTES. + +2010-08-24 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Fix comment. + +2010-08-24 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): In CW_CVT_MNT_OPTS case, initialize + flags with *pflags to restore original behaviour. + +2010-08-21 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_IMPORTS): Link against advapi32.a before kernel32.a. + +2010-08-20 Christopher Faylor <me+cygwin@cgf.cx> + + * cygthread.cc: Update copyright. + +2010-08-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Close handle in conv_handle if we're + following a symlink. + +2010-08-20 Pedro Izecksohn <pedro.izecksohn@gmail.com> + + * endian.h (htobe16, htobe32, htobe64, be16toh, be32toh, be64toh, + htole16, htole32, htole64, le16toh, le32toh, le64toh): Define. + +2010-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (readdir_check_reparse_point): Rename from + is_volume_mountpoint. Return valid d_type value for underlying + reparse point type. + (readdir_get_ino): Don't rely on the handle set in pc.check. Open + file here if pc.handle() is NULL. + (fhandler_disk_file::readdir_helper): Try to set a correct d_type value + more diligent. + (fhandler_disk_file::readdir): Don't reset dirent_set_d_ino unless + we're really sure it's due to an untrusted FS. Simplify usage of + FileAttributes, which is 0 if buf is NULL, anyway. Set d_type + correctly for faked "." and ".." entries. Improve debug output. + * path.cc (symlink_info::check): Don't keep handle to volume mount + point open. Explain why. + +2010-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Revert usage + of get_stat_handle () to get_handle (). Add comment to explain why. + * syscalls.cc (statvfs): Drop using PC_KEEP_HANDLE. + +2010-08-19 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (sync_wincwd): New function. + (cygwin_internal): Rename CW_SETCWD to CW_SYNC_WINCWD. Call + sync_wincwd from here. + * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_SETCWD to + CW_SYNC_WINCWD. + +2010-08-18 Christopher Faylor <me+cygwin@cgf.cx> + + * external.cc (CW_SETCWD): New option. + * include/cygwin/version.h: Bump api minor to 231. + * include/sys/cygwin.h (CW_SETCWD): Define. + +2010-08-18 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Fix renaming file-based devices. + +2010-08-18 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (open_stackdumpfile): Don't try to open file if we + have no filesystem based CWD. Add comment. + * path.cc (cwdstuff::set): Set CWD handle to NULL if CWD is a virtual + path. Simplify matching comment. + +2010-08-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set st_rdev + to correct device number for fs_special devices. + +2010-08-16 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL minor version number to 6. + +2010-08-14 Corinna Vinschen <corinna@vinschen.de> + + * pipe.cc (fhandler_pipe::open): Duplicate content of opened pipe + fhandler before calling dup method. + +2010-08-13 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class cwdstuff): Make drive_length private. + Add "error" member. + (cwdstuff::get_error): New inline method. + (cwdstuff::get_error_desc): Declare. + (cwdstuff::set): Change first parameter to pointer to path_conv. + * path.cc (chdir): Drop doit. Align call to cwdstuff::set to + new arguments. + (cwdstuff::init): Only call cwdstuff::set if it's not already + initialized. Add comment. Drop third parameter in call to + cwdstuff::set. + (cwdstuff::set): Partially rewrite. Add lots of comments to explain + everything. Drop "doit" since it's not used anymore. Always create + new handle to CWD if not in a virtual path. Drop PEB locking when + reading PEB values in init phase. Check for accessibility to set + correct error code. Drop Vista workaround. Never write back into PEB. + Set Win32 CWD to \\?\PIPE\ on init. Simplify creation of win32 path. + Set new error member to a meaningful value. + (cwdstuff::get_error_desc): New method to generate error message + from cwd error code. + * spawn.cc (spawn_guts): Call cwdstuff::get_error_desc to create + more meaningful error message when not being able to start native + Win32 app due to CWD restrictions. When starting native Win32 app, + lock cwd and use in calls to CreateProcessW/CreateProcessAsUserW. + +2010-08-11 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (struct opt): Add "bind" option. + (mount_info::from_fstab_line): Handle "bind" option. + (fillout_mntent): Add "bind" option to mnt_opts. + (mount): Handle "bind" option. + * include/sys/mount.h (MOUNT_BIND): New mount flag. + +2010-08-10 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (init_sig_pipe): Add retry loop. + +2010-08-09 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.h (cygheap_fdmanip): Delete fh and use fd index into + cygheap->fdtab throughout. + (cygheap_fdnew): Replace fh by using fd index into cygheap->fdtab + throughout. (cygheap_fdget): Ditto. (cygheap_fdenum): Ditto. + +2010-08-09 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + Implement POSIX.1-2004 Monotonic Clock. + * hires.h: Change hires_us to hires_ns, with nanosecond resolution. + (hires_ns::primed_ft): Remove. + (hires_ns::nsecs): New prototype. + (hires_ns::usecs): Rewrite in terms of nsecs. + (hires_ns::resolution): New prototype. + * times.cc: Change hires_us to hires_ns. + (ntod): Declare. + (systime): Remove. + (hires_ns::prime): Increase resolution to nanoseconds. + (hires_ns::nsecs): Rename usecs to nsecs to reflect increased resolution. + Remove justdelta argument. + (hires_ns::resolution): New function. + (clock_gettime): Accept CLOCK_MONOTONIC. + Use EINVAL instead of ENOSYS per POSIX.1-2004. + (clock_getres): Ditto. + (clock_setres): Use EINVAL instead of ENOSYS to conform with other + implementations. + * strace.cc (strace::microseconds): Adjust for hires_ns. + * sysconf.cc (sca): Set _SC_MONOTONIC_CLOCK to _POSIX_MONOTONIC_CLOCK. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2010-08-09 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * fhandler_proc.cc: Add /proc/filesystems virtual file. + (format_proc_filesystems): New function. + * mount.cc (fs_names): Move to global scope. Redefine as array + of { "name", block_device? } structs. + (fillout_mntent): Use name member of fs_names. + * mount.h (fs_names): New prototype. + +2010-08-09 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/dlfcn.h (RTLD_LOCAL): Define. + +2010-08-06 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/dirent.h (d_fileno): Define as d_ino. + +2010-08-04 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cygwin_conv_path): Rearrange test for "." in POSIX to + relative DOS path conversion. Simplify fixing the path. + In CCP_POSIX_TO_WIN_W conversion, always drop long path prefix if path + fits into MAX_PATH. Explain why. + +2010-08-01 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (_cygtls::interrupt_now): Revert to checking for + "spinning" when choosing to defer signal. + (_cygtls::call_signal_handler): Grab func when we have the lock. + * gendef: Update copyright. + (__sigbe): Simplify slightly. + (_sigdelayed): Grab a lock before manipulating stuff. + (_cygtls::pop): Properly return popped value. + (stabilize_sig_stack): Set incyg when we have the lock. + * sigproc.cc: Update copyright. + +2010-07-28 Christopher Faylor <me+cygwin@cgf.cx> + + * cygthread.h (LPVOID_THREAD_START_ROUTINE): Define. + (cygthread::create): Rename from cygthread::cygthread. + (cygthread::cygthread): Define new constructor which accepts + LPVOID_THREAD_START_ROUTINE as the first argument. Call + cygthread::create. + * cygthread.cc (cygthread::create): Rename from cygthread::cygthread. + Use 'arglen' rather than 'n' since 'n' is no longer supplied. + * fhandler_tty.cc (process_input): Define as void/noreturn. + (process_output): Ditto. + (process_ioctl): Ditto. + (fhandler_tty_master::init): Don't "zap_h" cygthreads which are + noreturn. It's now implied. + +2010-07-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::raw_write): Remove STATUS_DISK_FULL + special handling. + +2010-07-19 Eric Blake <eblake@redhat.com> + + * mktemp.cc (_gettemp): Add flags argument. All callers updated. + (mkostemp, mkostemps): New functions. + * cygwin.din (mkostemp, mkostemps): Export. + * posix.sgml: Document them. + * include/cygwin/version.h: Bump version. + +2010-07-18 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (noload): Use "pushl" rather than "push". + +2010-07-18 Christopher Faylor <me+cygwin@cgf.cx> + + * exceptions.cc (_cygtls::interrupt_now): Avoid nonsensical tests which + delay an interrupt. + (setup_handler): Remove unneeded DEBUGGING handling. Ensure that stack + is locked when we are about to do push/pop to it. Fix debugging output. + +2010-07-18 Christopher Faylor <me+cygwin@cgf.cx> + + * gendef: Throughout, remove lock from xchgl since it is implied. + (__ZN7_cygtls3popEv): Avoid potential (but probably nonexistent) race + when clearing element after pop. + +2010-07-15 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincap_7): Set needs_count_in_si_lpres2 to false. + +2010-07-07 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Disable try_to_bin for netapp drives. + Explain why. + +2010-07-05 Corinna Vinschen <corinna@vinschen.de> + + Align seekdir and telldir API to POSIX definition. + * Makefile.in (NEW_FUNCTIONS): Remove seekdir and telldir mappings. + * dir.cc (telldir): Move functionality from telldir64 here. Use + long, rather than _off_t. + (telldir64): Just call telldir. Only keep for backward compatibility. + (seekdir): Move functionality from seekdir64 here. Use long, rather + than _off_t. + (seekdir64): Just call seekdir. Only keep for backward compatibility. + * fhandler.h: Throughout, change prototypes of seekdir and telldir + methods to use long, rather than _off64_t. + * fhandler_disk_file.cc: Change aforementioned methods accordingly. + * fhandler_netdrive.cc: Ditto. + * fhandler_registry.cc: Ditto. + * fhandler_virtual.cc: Ditto. + * include/sys/dirent.h (struct __DIR): Change __d_position from + _off_t to long to reflect API change. + (telldir): Change prototype to use long, rather than off_t. + (seekdir): Ditto. + +2010-07-04 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (path_conv::check): Move fs-specific settings to a point + where we know that we have filled out the filesystem information. + * path.h (path_conv::path_conv): Use consistent initialization for + constructors. + + * include/sys/cygwin.h: Define CW_STRERROR. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 228. + * include/external.h: Implement CW_STRERROR. + +2010-07-02 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getsockopt): Make sure SO_PEERCRED is only handled + in level SOL_SOCKET. Workaround a return value regression in Vista + and later. Add comment to explain. + +2010-06-29 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Reinstantiate a FIXME comment. + +2010-06-29 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (dump_exception): Use %W instead of %s for printing + progname. + * fork.cc (frok::parent): Fix typos in debug output. + * spawn.cc (spawn_guts): Copy wide Win32 filename into _pinfo::progname, + rather than native NT name. Use %W instead of %S for printing progname. + +2010-06-28 Christopher Faylor <me+cygwin@cgf.cx> + + * fork.cc (frok::parent): Improve error message. + +2010-06-22 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (allow_others_to_sync): Use small stack buffer rather + than big temp buffer. Fix typo in comment. + (lf_setlock): Revert to using tmp_pathbuf. + (lf_getlock): Ditto. + +2010-06-22 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Use the long time unused ACL_DEFAULT_SIZE + instead of a constant value. + * security.cc (alloc_sd): Ditto. + +2010-06-21 Christopher Faylor <me+cygwin@cgf.cx> + + * tmpbuf.h: New file. + * flock.cc: Include tmpbuf.h for new tmpbuf functionality. + (allow_others_to_sync): Use tmpbuf rather than tmp_pathbuf. Explain + why. + (lf_setlock): For consistency, use tmpbuf rather than tmp_pathbuf. + (lf_getlock): Ditto. + +2010-06-21 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (__api_fatal): Temporarily generate a stackdump. + +2010-06-21 Christopher Faylor <me+cygwin@cgf.cx> + + * tls_pbuf.cc (tmp_pathbuf::w_get): Report what's failing when too many + buffers are in use. + +2010-06-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fetch stat + handle only after checking for NFS. + +2010-06-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Use handle + returned by get_stat_handle. + (fhandler_base::fstat_helper): Reinstatiate code to re-open the file + when checking for executability if called via fstat. Explain why. + +2010-06-15 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::dup_worker): Reset path_conv handle in duplicated + fhandler. + * fhandler.cc (fhandler_base::fstatvfs): Keep handle in created + path_conv. + * fhandler.h (fhandler_base::get_stat_access): New method. + (fhandler_base::get_stat_handle): New method. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Use handle + returned by get_stat_handle. Only request inode from system if it + isn't already set in the fhandler, and only for filesystems supporting + them. + (fhandler_base::fstat_fs): Use handle returned by get_stat_handle. + Change the way open_fs is called. Explain why. + (fhandler_base::fstat_helper): Use handle returned by get_stat_handle. + Never use 0 inode number. Simplify executable recognition by re-using + get_stat_handle if file could be opened with sufficient rights. + (fhandler_disk_file::fstatvfs): Use handle returned by get_stat_handle. + (fhandler_disk_file::facl): Use handle returned by get_stat_handle in + GETACL and GETACLCNT cases. + (fhandler_disk_file::link): Use handle returned by get_stat_handle + instead of opening file here again. Add comment. + (readdir_get_ino): Keep handle in created path_conv and drop + opening file. + * ntdll.h (wait_pending): New helper function. + * path.cc (symlink_info::check): Drop unused 'opt' parameter from + declaration. Add path_conv_handle argument. + (path_conv::check): Make sure conv_handle is closed. Keep + PC_KEEP_HANDLE flag in pflags_or. Accommodate call to sym.check to + new args. + (path_conv::~path_conv): Close conv_handle. + (symlink_info::check_shortcut): Don't re-open file here, just use + incoming handle. Drop goto's and label out. + (symlink_info::check_sysfile): Don't re-open file here, just use + incoming handle. Keep track of file position to accommodate the fact + that file has been opened asynchronously in calling function. + (symlink_info::check_nfs_symlink): Don't re-open file here, just use + incoming handle. + (symlink_info::check): Drop unused 'opt' parameter. Add + path_conv_handle argument. Always try to open file with GENERIC_READ + rights first to allow reading file content w/o having to re-open the + file. Drop back to READ_CONTROL | FILE_READ_ATTRIBUTES otherwise. + Call symlink test functions (except for check_reparse_point) only if + file could be opened with GENERIC_READ. Keep file handle open if + PC_KEEP_HANDLE is set in pflags. + * path.h (enum pathconv_arg): Add PC_KEEP_HANDLE flag. + (class path_conv_handle): New class. + (class path_conv): Add conv_handle member. + (path_conv::operator =): Duplicate conv_handle. + (path_conv::handle): New method. + (path_conv::access): New method. + (path_conv::reset_conv_handle): New method. + (path_conv::close_conv_handle): New method. + +2010-06-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Fix indentation. + +2010-06-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (path_conv::get_ino_by_handle): Convert from + static function to path_conv method. Accommodate throughout. + (path_conv::ndisk_links): Unused, comment out. + * path.h (path_conv::get_ino_by_handle): Declare. + (path_conv::ndisk_links): Comment out declaration. + +2010-06-14 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Return with ENOTDIR if component is a + device. + +2010-06-14 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (get_full_path_of_dll): Revert patch from 2010-04-29. + +2010-06-12 Christopher Faylor <me+cygwin@cgf.cx> + + * times.cc (gtod): Move to sharable region. + +2010-06-09 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_shortcut): Use ro_u_empty rather than + local UNICODE_STRING object. + (symlink_info::check_sysfile): Ditto. Return immediately if NtOpenFile + failed to avoid closing random handle. Improve debug output in case + NtReadFile failed. + +2010-06-08 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Set h to NULL after closing handle + in udf check. Remove overagressive bracketing. Don't set h to NULL + without closing the handle. Fix using wrong handle in checking + file system when using parent directory handle. + +2010-06-07 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/stdio.h: Remove _GNU_SOURCE guard around getline + and getdelim prototypes since they are SUSv4 now. + +2010-06-02 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_BAD_NETWORK_PATH): Define. + (STATUS_BAD_NETWORK_NAME): Define. + * path.cc (symlink_info::check): Convert STATUS_BAD_NETWORK_PATH and + STATUS_BAD_NETWORK_NAME into an immediate ENOENT. + +2010-06-01 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (open_stackdumpfile): Correctly append .stackdump + suffix. + + * nlsfuncs.cc (rebase_locale_buf): Reorder arguments. Accommodate + throughout. Add pointer to end of buffer and avoid changing pointers + not pointing into the buffer. + +2010-06-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc (fhandler_netdrive::exists): Always free WNet + resource if created. + +2010-05-31 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_user::set_name): Allow to change the user name + if it only differs by case. + +2010-05-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (multi_wcstombs): New function. + (fhandler_registry::fstat): Call multi_wcstombs for strings of type + REG_MULTI_SZ. + (fhandler_registry::fill_filebuf): Ditto. + +2010-05-26 Christopher Faylor <me+cygwin@cgf.cx> + + * hires.h (hires_base::reset): New function. + (hires_us): Specify that hires_base is a public import. + (hires_ms): Ditto. + * times.cc (gtod): Move earlier in file. + (settimeofday): Reset gtod so that base will be subsequently + recalculated. + +2010-05-26 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Don't try to handle remote reparse + points as symlinks. Explain why. + +2010-05-26 Corinna Vinschen <corinna@vinschen.de> + + * include/inttypes.h: Change PTR definitions to int to align with the + stdint.h type definitions of intptr_t/uintptr_t. + +2010-05-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_pty_master): Add master_thread member. + * fhandler_tty.cc (fhandler_pty_master::close): Properly detach from + master thread. + (fhandler_pty_master::setup): Store cygthread pointer of pty master + control thread in master_thread. Don't zap thread handle. + +2010-05-26 Kazuhiro Fujieda <fujieda@acm.org> + Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_lc_time_from_win): Use LOCALE_SMONTHNAME1 + instead of LOCALE_SABBREVMONTHNAME1 in Japanese and Korean + locales to get abbreviated month names. Explain why. + +2010-05-18 Kazuhiro Fujieda <fujieda@acm.org> + + * environ.cc (regopt): Change the first argument to wide char string. + (environ_init): Accommodate change to the first argument of regopt. + * exception.cc (open_stackdumpfile): Accommodate change to the type of + progname in _pinfo. + * external.cc (fillout_pinfo): Ditto. + * fhandler_process.cc (format_process_winexename): Ditto. + (format_process_stat): Ditto. + * fork.cc (fork::parent): Ditto. + * pinfo.cc (pinfo_basic::pinfo_basic): Call GetModuleFileNameW instead + of GetModuleFileName. + (pinfo::thisproc): Accommodate change to the type of progname in + _pinfo. + (pinfo_init): Ditto. + * pinfo.h (_pinfo): Change the type of progname to a wide char array. + * registry.h (reg_key::get_int): Change the first argument from + constant point to pointer to constant. + (reg_key::get_string): Ditto. Change the last argument likewise. + * registry.cc (reg_key::get_int): Accommodate change to the + declaration. + (reg_key::get_string): Ditto. + * strace.cc (strace::hello): Accommodate change to the type of progname + in _pinfo. + (strace::vsprntf): Ditto. + +2010-05-07 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (DLL_OFILES): Add pseudo-reloc.o. + * dcrt0.cc (child_info_fork::handle_fork): Call + _pei386_runtime_relocator here. + (dll_crt0_1): Ditto for non-fork case. + * dll_init.cc (dll::init): Complain more in comment. Clean up + slightly. + (dll_dllcrt0_1): Call _pei386_runtime_relocator when we know we have + a filled-in per_process structure. + * globals.cc (__cygwin_user_data): Accommodate new fields for + _pei386_runtime_relocator. + * pseudo-reloc.cc: New file adapted from old lib/pseudo-reloc.c. + Include winsup.h directly. Collapse #ifdef __CYGWIN__ into one block. + Perform minor whitespace code reformatting. + (__report_error): Use small_printf to output error. + (_pei386_runtime_relocator): Conditionalize for cygwin to take + per_process pointer parameter. + * winsup.h (_pei386_runtime_relocator): Declare. + * include/cygwin/version.h + (CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED): New macro. + (CYGWIN_VERSION_USER_API_VERSION_COMBINED): Use above macro. + (CYGWIN_VERSION_USE_PSEUDO_RELOC_IN_DLL): New macro. + (CYGWIN_VERSION_API_MINOR): Bump to 227. + * include/sys/cygwin.h: Remove obsolete comment. + (per_process::unused2): Shorten. + (per_process::pseudo_reloc_start): New field. + (per_process::pseudo_reloc_end): Ditto. + (per_process::image_base): Ditto. + * lib/_cygwin_crt0_common.cc: Declare pseudo runtime externs needed for + per_process structure. + (_cygwin_crt0_common): Fill in pseudo_reloc runtime constants. + * lib/pseudo-reloc-dummy.c: New file. Dummy function to satisify ld. + * lib/pseudo-reloc.c: Delete. + +2010-05-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::init): Disable grabbing + process group ownership of tty in case we're being debugged. + +2010-05-06 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Drop setting sym.pflags before calling + mount_info::conv_to_win32_path since the flag value is overwritten by + mount_info::conv_to_win32_path anyway. + Set flags for DOS paths before calling symlink_info::check so they can + be used in that function already. + +2010-05-03 Christopher Faylor <me+cygwin@cgf.cx> + + * dll_init.cc (dll_list::alloc): Add debugging assertion. + +2010-04-29 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (get_full_path_of_dll): Handle non-existent file. + +2010-04-29 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (struct opt): Add "dos" and "ihash" options. + (fillout_mntent): Ditto. + * path.cc (path_conv::get_nt_native_path): Use path_conv's + has_dos_filenames_only method. + (path_conv::check): Add PATH_IHASH flag if FS has unreliable inode + numbers. + (symlink_info::check_shortcut): Or symlink flags to pflags. + (symlink_info::check_sysfile): Ditto. Change test accordingly. + (symlink_info::check_reparse_point): Ditto. + (symlink_info::check_nfs_symlink): Ditto. + (symlink_info::check): Check PATH_DOS flag in call to get_nt_native_path + to utilize mount flag. Ditto in test for potential restarting. Set + PATH_DOS if FS only allows DOS filename rules. + * path.h (enum path_types): Add PATH_DOS and PATH_IHASH. + (path_conv::hasgood_inode): Check PATH_IHASH instead of + fs.hasgood_inode. + (path_conv::has_dos_filenames_only): New method. + * include/sys/mount.h (MOUNT_DOS): New mount flag. + (MOUNT_IHASH): Ditto. + +2010-04-29 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Add CW_CVT_MNT_OPTS to allow mount + flag parsing. Add CW_LST_MNT_OPTS case to allow mount flag listing. + * mount.cc (fstab_read_flags): Rename from read_flags. Make externally + available. Change input string to char ** to allow returning faulty + option. Add flag for avoiding debug output. + (fstab_list_flags): New function to create list of options. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CVT_MNT_OPTS and + CW_LST_MNT_OPTS. + +2010-04-28 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (compare_flags): New function. + (read_flags): Replace loop with bsearch. Simplify error check. + +2010-04-28 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump API minor version. + +2010-04-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (__locale_mb_cur_max): Export. + * nlsfuncs.cc (__getlocaleinfo): Drop conversion to multibyte. + (__charfromwchar): New function to convert to multibyte. + (__eval_datetimefmt): Convert to return wchar_t pointer. Work on + wide char string. + (__set_lc_time_from_win): Take additional pointer to "C" category info + to accommodate C.foo locales. Rework to fill wide char members in + category info. + (__set_lc_ctype_from_win): New function. + (__set_lc_numeric_from_win): Take additional pointer to "C" category + info to accommodate C.foo locales. Rework to fill wide char members + in category info. + (__set_lc_monetary_from_win): Ditto. + (__set_lc_messages_from_win): Ditto. + (__get_current_collate_codeset): New function, called from nl_langinfo. + * include/cygwin/config.h (__HAVE_LOCALE_INFO_EXTENDED__): Define. + +2010-04-27 Christopher Faylor <me+cygwin@cgf.cx> + + * spawn.cc (find_exec): Use the first detected errno when lookup fails. + +2010-04-27 Corinna Vinschen <corinna@vinschen.de> + + * include/regex.h: Include _ansi.h to avoid missing out on preprocessor + macros in sys/_types.h. + +2010-04-26 Corinna Vinschen <corinna@vinschen.de> + + * mount.h (fs_info::inited): New inline method. + * path.cc (path_conv::check): Clear filesystem info if following a + symlink. Use new fs_info::inited method to check if FS info is already + available. + (symlink_info::check): Drop fs_update_called. Use fs_info::inited + method instead. Streamline test for leading space and trailing dot or + space. Add comments. + +2010-04-23 Corinna Vinschen <corinna@vinschen.de> + + * path.h (get_nt_native_path): Add third parameter to declaration and + declare with regparms. + * path.cc (get_nt_native_path): Add third parameter to allow conversion + of leading and trailing dots and spaces on filesystems only supporting + filenames following DOS rules. + (path_conv::get_nt_native_path): Call get_nt_native_path according to + fs.has_dos_filenames_only flag. + (getfileattr): Accommodate new parameter to get_nt_native_path. + (symlink_info::check): Revamp fs_update_called handling to call + fs.update only once per call. Call get_nt_native_path according to + fs.has_dos_filenames_only flag. Streamline filesystem dependent code + not to be called more than once unnecessarily. Drop code tweaking + incoming path for broken filesystems only allowing DOS pathnames. + Rely on changed get_nt_native_path instead. + * mount.cc (fillout_mntent): Accommodate new parameter to + get_nt_native_path. + * strfuncs.cc (tfx_rev_chars): New conversion table with comment. + (sys_cp_wcstombs): Use tfx_rev_chars rather than tfx_chars. + +2010-04-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Make sure to restart only once. + +2010-04-22 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (GETVOLINFO_VALID_MASK): Drop FILE_SEQUENTIAL_WRITE_ONCE + from mask. Expand the comment a bit. + (WIN_FAT_FLAGS): New define. + (FS_IS_WINDOWS_FAT): New macro. + (fs_info::update): Handle remote FS faking to be FAT. Subsume under + CIFS. Check for NWFS and has_buggy_basic_info only for remote + filesystems. Add check for has_dos_filenames_only. + * mount.h (class fs_info): Add has_dos_filenames_only status flag. + Implement accessors. + * path.cc (symlink_info::check): Rearrange variable definitions to + clear them up. Add a restart label to allow a clean restart within + the method. Add a check for broken filesystems only allowing DOS + pathnames in case we encounter a STATUS_OBJECT_NAME_NOT_FOUND status. + If all checks point to one of that, restart method with tweaked + incoming path. Add lengthy comments to explain what we do. + +2010-04-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Fix a comment. + +2010-04-21 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_termios.cc (tcinit): Remove previously applied change. + Replace with... + * fhandler_tty.cc (fhandler_tty_slave::init): Become process group + leader if called from dtable::init_std_file_from_handle. Add comment + to explain. + +2010-04-21 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Set access mask for + the slave side of ttys explicitely. Explain why. + +2010-04-20 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (cygwin_create_path): Free memory on error. + +2010-04-20 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct init_cygheap): Add rlim_core member. + * cygheap.cc (cygheap_init): Initialize rlim_core to RLIM_INFINITY. + * exceptions.cc (stackdump): Drop extern declaration of rlim_core. + Refer to cygheap->rlim_core instead. + (exception::handle): Disable stackdumping if cygheap->rlim_core is 0. + Don't set WCOREDUMP flag in exit code, if cygheap->rlim_core is 0. + (sigpacket::process): Ditto. + * resource.cc (rlim_core): Remove. + (getrlimit): Fetch RLIMIT_CORE value from cygheap->rlim_core. + (setrlimit): Store RLIMIT_CORE value in cygheap->rlim_core. + +2010-04-19 Christopher Faylor <me+cygwin@cgf.cx> + + * cygerrno.h: Nevermind. + +2010-04-19 Christopher Faylor <me+cygwin@cgf.cx> + + * cygerrno.h: Protect use of NTSTATUS for only when we need it. + +2010-04-19 Christopher Faylor <me+cygwin@cgf.cx> + + * lib/_cygwin_crt0_common.cc: Remove unneeded declarations. + +2010-04-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::fch_set_sd): Remove commented out + code. + +2010-04-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetNamedPipeClientProcessId): Define. + * fhandler.h (fhandler_tty_slave::fch_open_handles): Declare private. + (fhandler_tty_slave::fch_close_handles): Ditto. + (fhandler_tty_slave::cygserver_attach_tty): Drop declaration. + (fhandler_tty_slave::fstat): Declare public. + (fhandler_tty_slave::fchmod): Declare public. + (fhandler_tty_slave::fchown): Declare public. + (class fhandler_pty_master): Add master_ctl handle. + (fhandler_pty_master::pty_master_thread): Declare public. + * fhandler_termios.cc (fhandler_termios::tcinit): If the process + is started from a non-Cygwin process, make it tty process group + leader. + * fhandler_tty.cc: Throughout accommodate additional security related + arguments in calls to functions creating or opening objects. + (close_maybe): Move to start of file to reuse it + in other methods. + (struct pipe_request): Define. + (struct pipe_reply): Define. + (fhandler_tty_slave::open): Throughout, try to open synchronization + objects with MAXIMUM_ALLOWED permissions. Drop call to cygserver. + Try to duplicate pipe handles via master_ctl pipe if duplicating + directly doesn't work. + (fhandler_tty_slave::cygserver_attach_tty): Remove. + (fhandler_tty_slave::init): Close unused incoming pipe handle. + (fhandler_pty_master::close): Send exit message to master control + thread and close master_ctl handle. + (fhandler_pty_master::pty_master_thread): New method, implementing the + master control thread. + (pty_master_thread): Static helper to start master control thread. + (fhandler_pty_master::setup): Simplify creating pipe inheritance. + Make sure we're the one creating the input_available_event. Add + comment to explain why. Create master_ctl pipe and start master + control thread. Close master_ctl handle in case of error. + * security.cc (alloc_sd): Add code to handle tty objects. Add comments + to explain what exactly is required. + (get_object_sd): New function. + (get_object_attribute): New function. + (create_object_sd_from_attribute): New function. + (set_object_sd): New function. + (set_object_attribute): New function. + (set_file_attribute): Change attribute type to mode_t. + * security.h (set_file_attribute): Change attribute type to mode_t. + (get_object_sd): Declare. + (get_object_attribute): Declare. + (create_object_sd_from_attribute): Declare. + (set_object_sd): Declare. + (set_object_attribute): Declare. + * tty.cc (tty::slave_alive): Implement directly instead of via alive. + (tty::exists): Open mutex handle with READ_CONTROL access. + (tty::alive): Remove. + (tty::open_output_mutex): Convert to inline method. + (tty::open_input_mutex): Ditto. + (tty::open_mutex): Take additional ACCESS_MASK parameter for the + mutex open access mask. + (tty::open_inuse): New method. + (tty::create_inuse): Take PSECURITY_ATTRIBUTES parameter. Drop fmt + name parameter. Always create TTY_SLAVE_ALIVE event. + (tty::get_event): Take additional PSECURITY_ATTRIBUTES parameter for + CreateEvent. + * tty.h (class tty): Change declarations according to aforementioned + changes. + (tty::open_output_mutex): Implement as inline method. + (tty::open_input_mutex): Ditto. + +2010-04-19 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Set dev to + valid content for ptys. Remove setting FILE_CREATE_PIPE_INSTANCE + in access flags since it's not needed. Set the access mask for + kernel objects according to what's returned by NtQueryInformationFile, + info class FileAccessInformation. + +2010-04-19 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): On STATUS_ACCESS_VIOLATION, retry to open + for DELETE until the STATUS_ACCESS_VIOLATION goes away. Add comment + to explain why. + +2010-04-17 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (get_null_sd): Make static. Use PSECURITY_DESCRIPTOR + instead of SECURITY_DESCRIPTOR *. + (sec_acl): Fix fomratting. + * security.h (get_null_sd): Drop declaration. + +2010-04-16 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (seterrno_from_nt_status): Declare. + (__seterrno_from_nt_status): Call seterrno_from_nt_status. + * errno.cc (seterrno_from_win_error): Set errno without calling + set_errno to avoid packing strace output with errno messages. + (seterrno_from_nt_status): New function to print NT status as well as + resulting Windows error. + +2010-04-15 Corinna Vinschen <corinna@vinschen.de> + + * kernel32.cc (CreateEventW): Create event object with EVENT_ALL_ACCESS + access mask. + (CreateMutexW): Create mutex object with MUTEX_ALL_ACCESS access mask. + (CreateSemaphoreW): Create semaphore object with SEMAPHORE_ALL_ACCESS + access mask. + +2010-04-15 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (set_cygwin_privileges): Enable SE_DEBUG_PRIVILEGE, if + available. Add comments. + +2010-04-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Only test the file for being a + socket after opening it. Retry if opening failed with sharing + violation. Explain why we do this. + (fhandler_socket::bind): Create file with no sharing allowed. + +2010-04-13 John Bowman <bowman@math.ualberta.ca> + + * cygheap.cc (cwcsdup): Fix allocation size to accommodate sizeof WCHAR. + (cwcsdup1): Ditto. + +2010-04-12 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL minor version number to 5. + +2010-04-12 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (std-notes): Improve lseek description. + +2010-04-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::open): Add code to duplicate + handles within a single process to simplify openpty case. + (fhandler_tty_slave::cygserver_attach_tty): Correctly send Windows PID + to cygserver, rather than the Cygwin PID. + +2010-04-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class dev_console): Add backspace_keycode member. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize + backspace_keycode with CERASE. + (fhandler_console::read): Return dev_state->backspace_keycode if the + backspace key is pressed. + (fhandler_console::char_command): Implement DECBKM escape sequence. + +2010-04-10 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_console.cc (fhandler_console::read): Default to sending + CERASE character if termios VERASE field is zero. + (fhandler_console::fixup_after_fork_exec): Avoid a spurious debug + message. + +2010-04-10 Christopher Faylor <me+cygwin@cgf.cx> + + * mkvers.sh: Use modern date formats to construct the date. + +2010-04-09 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_lc_time_from_win): Actually set + _time_locale->md_order to the D_MD_ORDER value written to the buffer. + +2010-04-09 Christopher Faylor <me+cygwin@cgf.cx> + + * path.cc (path_conv::set_normalized_path): Use crealloc_abort to avoid + a memory leak. + * path.h (path_conv::operator =): Just use cstrdup to allocate + normalized_path, avoiding attempt to free a pointer which is allocated + in another pc. + +2010-04-07 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL minor version number to 4. + +2010-04-06 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (valid_sched_parameters): Declare extern here. + (sched_set_thread_priority): Ditto. + +2010-04-06 Corinna Vinschen <corinna@vinschen.de> + + * include/sched.h: Remove, overruled by newlib file. + * include/sys/sched.h: Ditto. + +2010-04-06 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_fifo.cc (fhandler_fifo::open): Accommodate previous return + value change to setup_overlapped. + +2010-04-02 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_base::has_ongoing_io): Declare virtual method. + * select.cc (peek_pipe): Reorganize slightly. Don't attempt to check a + handle if it has ongoing I/O. + (select_pipe_info::select_pipe_info): Delete definition. + (select_pipe_info::~select_pipe_info): Delete definition. + (thread_pipe): Get rid of WFMO call. Reorganize loop. + (pipe_cleanup): Remove dependence on destructor. + (thread_serial): Reorganize loop. + * select.h (select_pipe_info): Empty this class since it no longer has + any special requirements (for now). + + * syscalls.cc (readv): Remove an unneeded debug printf. + +2010-04-02 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_base::setup_overlapped): Delete virtual + declaration. + (fhandler_base::destroy_overlapped): Ditto. + (fhandler_base_overlapped): Remove now-unneeded friend. + (fhandler_base_overlapped::setup_overlapped): Return int, remove + parameter. + (fhandler_base_overlapped::get_overlapped): Return reference. + (fhandler_base_overlapped::fhandler_base_overlapped): Be more assertive + about zeroing everything. + (fhandler_base_overlapped::fixup_after_fork): Declare new function. + (fhandler_base_overlapped::fixup_after_exec): Ditto. + (fhandler_base_overlapped::dup): Ditto. + (fhandler_base_overlapped::close): Ditto. + * fhandler_fifo.cc (fhandler_fifo::dup): Call + fhandler_base_overlapped::dup rather than fhandler_base::dup. + * pipe.cc (fhandler_pipe::dup): Ditto. + (fhandler_pipe::init): Accommodate change in setup_overlapped arguments + for "opened_properly" case. + +2010-04-02 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Properly initialize + overlapped part of this class. + +2010-04-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::close): Revert previous change. + +2010-04-02 Christopher Faylor <me+cygwin@cgf.cx> + + * select.h (select_pipe_info::add_watch_handle): Delete declaration. + * select.cc (select_pipe_info::add_watch_handle): Delete definition. + (fhandler_pipe::select_read): Delete call to add_watch_handle. + (fhandler_pipe::select_write): Ditto. + (fhandler_pipe::select_except): Ditto. + +2010-04-02 Christopher Faylor <me+cygwin@cgf.cx> + + * dtable.cc (dtable::init_std_file_from_handle): Avoid adding fh to + fdtab until we know that it is good. + * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Handle + error conditions more consistently. Avoid handle leakage on error. + +2010-04-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::close): Avoid potential crash + if former open call has been unsuccessful. + +2010-04-01 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc: Fix indentation. + +2010-04-01 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (rebase_locale_buf): New helper function to rebase + function pointers in locale structures. Explain why this is necessary. + (__set_lc_time_from_win): Use rebase_locale_buf after realloc. + (__set_lc_numeric_from_win): Ditto. + (__set_lc_monetary_from_win): Ditto. + +2010-03-31 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (wait_sig): Make sure that strace is activated on + __SIGSTRACE by calling new strace::activate function. + * strace.cc (strace::activate): Rename from strace::strace. + * strace.h (strace::activate): Define new function. + (strace::strace): Call activate. + +2010-03-31 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.h (fhandler_base_overlapped): Temporarily (?) make + select_pipe_info a friend until the fhandler_tty intertangling can be + worked out. + * select.cc (select_pipe_info::add_watch_handle): Don't inspect the + overlapped event if we're not waiting for I/O. + (fhandler_tty_common::select_*): Change to standard function. Don't do + kludgy fhandler_pipe coercion. + +2010-03-31 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::dup): Call setup_overlapped + unconditionally. + (fhandler_base::fork_fixup): Ditto. + (fhandler_base::fixup_after_fork): Ditto. + (fhandler_base::fixup_after_exec): Ditto. + (fhandler_base_overlapped::setup_overlapped): Move to this class from + fhandler_base. + (handler_base_overlapped::destroy_overlapped): Ditto. + (fhandler_base_overlapped::wait_overlapped): Ditto. Track when we + expect pending I/O. + (fhandler_base_overlapped::read_overlapped): Move to this class from + fhandler_base. Return error if ongoing I/O. + (fhandler_base_overlapped::write_overlapped): Ditto. + (fhandler_base_overlapped::has_ongoing_io): Semi-reinstate previous + function. + * fhandler.h (fhandler_base::wait_overlapped): Move to + fhandler_base_overlapped class. + (fhandler_base::write_overlapped): Ditto. + (fhandler_base::get_overlapped): Ditto. + (fhandler_base::get_overlapped_buffer): Ditto. + (fhandler_base_overlapped): New class. + (fhandler_pipe): Inherit from fhandler_base_overlapped. Remove + overlapped stuff as a result. + (fhandler_fifo): Ditto. + * pipe.cc (fhandler_pipe::fhandler_pipe): Initialize fhandler_base_overlapped. + (pipe): Put a descriptive name in the fhandler. + +2010-03-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::wait_for_events): Remove call to + sig_dispatch_pending. + +2010-03-30 Thomas Wolff <towo@towo.net> + + * fhandler.h (class dev_console): Drop vt100_graphics_mode_active. Add + flags vt100_graphics_mode_G0, vt100_graphics_mode_G1 and iso_2022_G1. + * fhandler_console.cc: Throughout, tune VT100 graphics mode switching + to follow ISO 2022 strictly. + (fhandler_console::write) Reset VT100 graphic mode flags on terminal + full reset (ESC c). + +2010-03-30 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (open): Remove call to sig_dispatch_pending. + +2010-03-30 Corinna Vinschen <corinna@vinschen.de> + + * net.cc: Remove calls to sig_dispatch_pending throughout. + * libc/rexec.cc: Ditto. + +2010-03-30 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Allow variable FILE_SUPPORTS_SPARSE_FILES + flag in netapp flag test. Add comment. + +2010-03-29 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (find_exec): Enable finding paths in backslash notation, + especially for the exec[vl]p functions. + + * path.cc (symlink_info::check): Disable returning directories with + suffix appended here. + +2010-03-29 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump DLL minor version number to 3. + +2010-03-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fstat): Keep st_ctime and st_birthtime + fixed to 2006-12-01 00:00 UTC. + +2010-03-29 Corinna Vinschen <corinna@vinschen.de> + + * libc/rcmd.c: Enable IPv6. + +2010-03-28 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::fstat): Set st_mtime to current time. + +2010-03-28 Christopher Faylor <me+cygwin@cgf.cx> + + * globals.cc (exit_status): Add new ES_EXIT_STARTING enum. + * dcrt0.cc (cygwin_exit): Set exit_state to ES_EXIT_STARTING prior to + calling real exit. + * dll_init.cc (dll_list::detach): Remove dll from linked list and call + destructors even if exiting. Don't call __cxa_finalize in exiting case. + +2010-03-27 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_charset_from_locale): Set default charset for + locales defaulting to codepage 936 to GB2312. + +2010-03-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::evaluate_events): Make erase + const in parameter list. + (fhandler_socket::wait_for_events): Take a DWORD flags value instead of + just a bool. Call evaluate_events with erase flag according to + MSG_PEEK value in flags. Replace check for dontwait with check for + MSG_DONTWAIT in flags. + (fhandler_socket::connect): Call wait_for_events with 0 flags value. + (fhandler_socket::accept4): Ditto. + (fhandler_socket::recv_internal): Save flags in wait_flags. Drop + dontwait variable. Call wait_for_events with wait_flags. + (fhandler_socket::send_internal): Save MSG_DONTWAIT flag in wait_flags + and call wait_for_events with wait_flags as argument. Drop dontwait + variable. + * fhandler.h (class fhandler_socket): Change second parameter in + declaration of wait_for_events to const DWORD. + +2010-03-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_cygdrive::fstat): Add standard read + permissions again. + +2010-03-18 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (init_installation_root): Change to make sure that scope of + the lock lasts the entire function. + +2010-03-15 Christopher Faylor <me+cygwin@cgf.cx> + + * shared_info.h (user_info): Add dll_crt0_1 as a friend. + (user_info::version): Make LONG to accommodate spinlock use. + (user_info::create): New static function renamed from user_info_create. + (user_info::initialize): New private function renamed from + user_info_initialize. + (SHARED_VERSION): Delete. + (SHARED_VERSION_MAGIC): Ditto. + (USER_VERSION_MAGIC): Ditto. + (SHARED_INFO_CB): Ditto. + (USER_VERSION): Ditto. + (USER_VERSION_MAGIC): Ditto. + (CURR_SHARED_MAGIC): Update. + (CURR_USER_MAGIC): Ditto. + (shared_info::version): Make LONG to accommodate spinlock use. + (shared_info::create): New static function mirroring user_info::create. + (dll_crt0_1): Accommodate change to user_info::initialize. + * spinlock.h (spinlock::setto): New variable member. + (spinlock::done): New function. + (spinlock::spinlock): Generalize to allow arbitrary values and + timeouts. Call done() when lock is not needed. + * ntdll.h: Make multiple-inclusion safe. + (NtQuerySystemTime): Declare. + * shared.cc (installation_root_inited): Rename from shared_mem_inited. + (init_installation_root): Make inline. Use a spinlock to ensure that + this is initialized only once per session. + (user_info::initialize): Rename from user_shared_initialize. Protect + with spinlock on sversion and remove other spinlock-like things. + Remove reference to user_shared since it is now implicit. Refer to + spinlock version of multiple_cygwin_problem to ensure that any spinlock + is released. + (user_info::create): Rename from user_shared_create. Accommodate + change from user_shared_initialize to user_info::initialize. + (shared_info::create): New inline function. + (shared_info::initialize): Protect with spinlock on sversion. Move + heap_init back under specific control of shared_info spinlock. Remove + reference to SHARED_INFO_CB and just use sizeof(*this). + (memory_init): Move all locking into respective functions where it is + needed. Accommodate name changes. Remove call to heap_init(). + * syscalls.cc (seteuid32): Accommodate name change to + user_info::create(). + + * mount.cc (mount_info::create_root_entry): Report on errors from + add_item since they should be nonexistent. + (mount_info::init): Don't initialize nmounts. It should already be + zero. Give more verbose error when root_idx < 0. Implicitly use this + pointer rather than explicitly referencing mount_table->. + (mount_info::add_item): Minor whitespace fix. + +2010-03-15 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (no_signals_available): Get sense of the test right for + previous botched change. + +2010-03-15 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (no_signals_available): Don't try to send a signal if + still in cygwin startup code. + +2010-03-13 Christopher Faylor <me+cygwin@cgf.cx> + + * spinlock.h: New file. + (spinlock): New class. + * shared.cc: Include spinlock.h. + (memory_init): Use new spinlock methods rather than roll-your-own. + Time out after ten seconds if shared_mem_inited is not initialized. + + * sync.h: Update copyright. Remove vanity attribution. + + * sigproc.cc (sigproc_terminate): Avoid attempts to kill the signal + thread while we're still initializing or suffer a deadlock. + +2010-03-12 Christopher Faylor <me+cygwin@cgf.cx> + + Throughout change all calls of low_priority_sleep (0) to yield (). + * miscfuncs.cc (yield): Rename from low_priority_sleep. Remove all of + the logic which called Sleep() and just use SwitchToThread. + * miscfuncs.h (yield): Rename from low_priority_sleep. + (SLEEP_0_STAY_LOW): Delete unused define. + * shared.cc (memory_init): Move heap_init() call directly after shared + memory initialization to more closely mimic long-standing program flow. + * tty.cc (tty_list::terminate): Replace call to low_priority_sleep with + Sleep. + +2010-03-10 Christopher Faylor <me.cygwin@cgf.cx> + + * shared.cc (memory_init): Fix comment. Fix indentation. + +2010-03-09 Christopher Faylor <me+cygwin@cgf.cx> + + * shared_info.h (open_shared): Create function wrapper for common use + case. + (open_shared): Change fifth argument to a pointer rather than a + reference. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Eliminate use + of dummy variable and call open_shared with constant. + * fhandler_process.cc (format_process_mounts): Ditto. + * pinfo.cc (pinfo::init): Pass pointer to shloc. + * shared.cc (shared_mem_inited): New variable. + (open_shared): Crate function wrapper for common use case. + (open_shared): Accommodate change to fifth argument to a pointer. + (shared_info::initialize): Remove spinlock test. Simplify function. + Move get_session_parent_dir call back here. + (memory_init): Protect global shared settings with shared_mem_inited + spinlock. Move get_session_parent_dir call to shared_info::initialize. + +2010-03-09 Christopher Faylor <me.cygwin@cgf.cx> + + * shared.cc (inst_root_inited): Delete. + * (shared_info::initialize): Reorganize. Move call to + init_installation_root here under spinlock control. Move unneeded + non-shared_info initialization out of this function. + (memory_init): Remove call to init_installation_root. Call heap_init + and get_session_parent_dir here. + +2010-03-04 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (nt_path_has_executable_suffix): Change storage class of + blessed_executable_suffixes to static. + (rename): Revert meaning of old_explicit_suffix. Change the rules + for appending a .exe suffix and (yikes!) document them. + +2010-03-04 Charles Wilson <cygwin@cwilson.fastmail.fm> + + * cygwin.din: Export __xdr functions. + * include/cygwin/version.h: Bump version. + * posix.sgml: Add a few more XDR functions to list + of implemented Solaris functions. + +2010-03-03 Charles Wilson <cygwin@cwilson.fastmail.fm> + + Add XDR support. + * cygwin.din: Export xdr functions. + * include/cygwin/version.h: Bump version. + * cygxdr.cc: New. + * cygxdr.h: New. + * dcrt0.cc (dll_crt0_1): Print the (rare) xdr-related + error messages to stderr. + * Makefile.in: Add cygxdr. + * posix.sgml: Add new XDR functions to list of implemented Solaris + functions. + +2010-03-01 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.h: Replace /*gentls_offsets*/ at end. + +2010-03-01 Christopher Faylor <me+cygwin@cgf.cx> + + * exception.h: Fix copyright. + +2010-02-27 Christopher Faylor <me+cygwin@cgf.cx> + + Update some copyrights. + * cygtls.cc (_cygtls::call): Invoke new exception protection here. + (_cygtls::init_thread): Remove conditionalized exception handler setup. + (exception_list): Delete declaration. + (_cygtls::init_exception_handler): Delete obsolete function. + * cygtls.h: Remove (now) unneeded include. + (_cygtls): Make this a real C++ class. + (_cygtls::handle_exceptions): Remove. + (_cygtls::init_exception_handler): Remove. + (_cygtls::call2): Make private. + (myfault::faulted): Remove unneeded parentheses. + * dcrt0.cc (dll_crt0_1): Remove exception handler setup. + * dlfcn.cc (dlopen): Ditto. + (dlclose): Ditto. + * dll_init.cc (dll_dllcrt0_1): Ditto. + (dll_list::detach): Use new exception handler protection. + * exceptions.cc (dump_exception): Rename to prevent confusion with new + class. + (exception::handle): Rename from _cygtls::handle_exceptions. + Accommodate new exception class. Accommodate rename to dump_exception. + * tlsoffsets.h: Regenerate. + +2010-02-26 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.h (_cygtls::init_exception_handler): Eliminate argument. + (_cygtls::andreas): Convert to a pointer. + (san): Convert to a real class with methods. Use a linked list to + keep track of previous handlers on the "stack". + (myfault): Rewrite to use new san class rather than calling directly + into _cygtls. + * cygtls.cc (_cygtls::init_exception_handler): Just assume that we're + always using the standard exception handler. + (_cygtls::init_thread): Reflect loss of argument to + init_exception_handler. + * dcrt0.cc (dll_crt0_1): Ditto. + * dfcn.cc (dlopen): Ditto. + (dlclose): Reset the exception handler after FreeLibrary. + * dll_init.cc (dll_list::detach): Make sure that the exception handler + is initialized before calling destructors. + * exceptions.cc (_cygtls::handle_exceptions): Accommodate new andreas + pointer. + * thread.cc (verifyable_object_isvalid): Pass objectptr to faulted for + explicit NULL pointer checking. + * tlsoffsets.h: Regenerate. + +2010-02-26 Christopher Faylor <me+cygwin@cgf.cx> + + * mkimport: cd away from temp directory or Windows will have problems + removing the directory. + +2010-02-26 Corinna Vinschen <corinna@vinschen.de> + + * libc/strptime.cc: Implement support for era, alt_digits and POSIX + padding and width modifiers. + (era_info_t): New type. + (free_era_info): New static function to free era_info_t storage. + (get_era_info): New static function to create era_info_t storage + from LC_TIME era information. + (alt_digits_t): New type. + (get_alt_digits): New static function to create alt_digits_t storage + from LC_TIME alt_digits information. + (free_alt_digits): New static function to free alt_digits_t storage. + (find_alt_digits): New static function to scan input for alternative + digits and return them, if any. Return NULL otherwise. + (__strptime): New static function taking all code from strptime. + Implement handling for E, O, +, 0, and width modifiers per POSIX-1.2008. + (strptime): Convert into wrapper function to provide era_info and + alt_digits pointers and call __strptime. + (conv_num): Take additional alt_digits_t parameter and if it's not + NULL, call find_alt_digits to convert. + +2010-02-26 Corinna Vinschen <corinna@vinschen.de> + + * strsig.cc: Fix formatting and copyright. + +2010-02-26 Pierre Humblet <Pierre.Humblet@ieee.org> + + * security.cc (check_access): Use user.imp_token if appropriate. + Set errno and return if DuplicateTokenEx fails . + +2010-02-26 Corinna Vinschen <corinna@vinschen.de> + + Remove all traces of __CYGWIN_USE_BIG_TYPES__. + + * include/cygwin/config.h: Move Cygwin-specific build flags from + newlib's sys/config.h here. Add a comment. + +2010-02-25 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/cygwin/signal.h: Define SIGPWR as synonym for SIGLOST. + * strsig.cc: Ditto. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR. + +2010-02-25 Corinna Vinschen <corinna@vinschen.de> + + * lc_era.h (lc_era_t): Fix apparent glibc bug in ja_JP era definition. + +2010-02-24 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_full_privileged_inheritable_token): Fix dumb typo + when checking linked token for being a primary token. + +2010-02-24 Christopher Faylor <me+cygwin@cgf.cx> + + * dlfcn.cc (dlopen): Make sure exception handler is really loaded after + dynamic load. + +2010-02-23 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.cc (_cygtls::init_exception_handler): Force installation of + our exception handler to always be at the beginning. + +2010-02-23 Christopher Faylor <me+cygwin@cgf.cx> + + * thread.cc (pthread_mutex::unlock): Don't attempt to unlock if there + is an error. + +2010-02-22 Christopher Faylor <me+cygwin@cgf.cx> + + * include/sys/strace.h: Define _STRACE_SPECIAL. + (strace_printf_wrap): Fix NOSTRACE definitions. + (strace_printf_wrap1): Fix NOSTRACE definitions. + (special_printf): Define. + + * thread.cc: Perform minor syntax fix in a comment. Rename + "is_good_initialzer*" to "is_initializer*" throughout. Use + pthread_printf rather than debug_printf throughout. Add extra + pthread_printf debugging throughout. + (pthread_mutex::_new_mutex): New constant value. + (pthread_mutex::_unlocked_mutex): Ditto. + (pthread_mutex::_destroyed_mutex): Ditto. + (pthread_mutex::no_owner): Define new function. + (pthread_mutex::can_be_unlocked): Detect no_owner situation. Handle + PTHREAD_MUTEX_NORMAL as a special case. + (pthread::create_cancel_event): Use C++ boolean values. + (pthread::precreate): Use method to set mutex type. + (pthread_cond::pthread_cond): Ditto. + (pthread_rwlock::pthread_rwlock): Ditto. + (pthread_mutex::pthread_mutex): Set owner to _new_mutex initially. + (pthread_mutex::~pthread_mutex): Reset various elements to make it + clearer if they are incorrectly reused. + (pthread_mutex::lock): Add clarifying comment. + (pthread_mutex::unlock): Attempt to handle various mutex types + correctly. In particular, reinstate ability to have one thread unlock + another thread's mutex if type == PTHREAD_MUTEX_NORMAL. + (semaphore::_fixup_after_fork): Avoid redundancy. + (pthread_mutex::_fixup_after_fork): Ditto. Fix debugging statement. + (__pthread_cond_dowait): Accommodate changes to remove previously + inexplicable use can_be_unblocked() as a static function. + * thread.h: Rename "is_good_initialzer*" to "is_initializer*" + throughout. + (pthread_mutex): Reorganize. Make many things private. + (pthread_mutex::no_owner): Define new method. + (pthread_mutex::_new_mutex): Define new constant. + (pthread_mutex::_unlocked_mutex): Ditto. + (pthread_mutex::_destroyed_mutex): Ditto. + +2010-02-22 Corinna Vinschen <corinna@vinschen.de> + + * lc_era.h: Redefine lc_era_t to keep + default date and time formats as well to workaround YA Windows + shortcoming. Refresh with latest data. + * lc_msg.h: Refresh with latest data. + * nlsfuncs.cc (__eval_datetimefmt): Revert latest change. + (__set_lc_time_from_win): Rename res to era. Prefer default date and + time formats from era array if available. + (__set_lc_messages_from_win): Rename res to msg. + +2010-02-20 Corinna Vinschen <corinna@vinschen.de> + + * lc_era.h (lc_era): Fix "ja_JP" era_t_fmt entry to use traditional + format. + * nlsfuncs.cc (dt_flags): Remove DT_ERACAL since crippled era data + in Windows makes it useless. + (__eval_datetimefmt): Check if locale's default calender has + non-gregorian start year. Use era year also in default date entries, + if so. + +2010-02-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (warn_msdos): Enforce extended hex printing of multibyte + pathnames. + +2010-02-19 Christopher Faylor <me+cygwin@cgf.cx> + + * include/sys/strace.h: Remove old code. Add support for ptrace + tracing. + +2010-02-19 Corinna Vinschen <corinna@vinschen.de> + + * lc_era.h: New file. + * nlsfuncs.cc: Include lc_era.h. + (locale_cmp): convert arguments to char** to be usable for both types, + lc_msg_t and lc_era_t. + (__set_lc_time_from_win): Handle era-related data + +2010-02-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Try to open + directory with stat()-friendly access mask first. Explain why. + +2010-02-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set st_rdev + to same value as st_dev. Avoid useless debug output in executable + check. Add filename to debug output. + (fhandler_disk_file::facl): Simplify code calling fstat methods to + just call fstat to avoid errors with the cygdrive directory. + +2010-02-18 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (eval_datetimefmt): Rename force to flags. + (enum dt_flags): Define. + (__eval_datetimefmt): Change force to flags and change type to + dt_flags. Accommodate throughout. + (__set_lc_time_from_win): Accommodate above change. Set era-related + values to empty strings for now. + +2010-02-18 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::setup_overlapped): Revert to starting + with handle in signalled state as it seems to fix some hangs. + +2010-02-15 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Treat native DOS paths as "noacl". + +2010-02-15 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::conv_to_win32_path): Set UNC path flags to + cygdrive prefix path flags. + +2010-02-14 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base::setup_overlapped): Don't set signalled + state to true initially. + (fhandler_base::has_ongoing_io): Delete ill-advised function. + (fhandler_base::read_overlapped): Rely on caller having checked + nonblocking state. Don't attempt to (incorrectly) check it here. + (fhandler_base::write_overlapped): Remove call to has_ongoing_io. + * select.cc (peek_pipe): Ditto. + * fhandler.h (fhandler_base::has_ongoing_io): Delete declaration. + +2010-02-14 Christopher Faylor <me+cygwin@cgf.cx> + + * regex/regcomp.c (xwcrtomb): Fix one explicable and one inexcplicable + C warning. + +2010-02-13 Corinna Vinschen <corinna@vinschen.de> + + * regex/regcomp.c (xwcrtomb): Don't convert Unicode chars outside the + base plane always to UTF-8. Call wcsnrtombs instead to allow arbitrary + multibyte charsets. + +2010-02-12 Corinna Vinschen <corinna@vinschen.de> + + * regex/regcomp.c (wgetnext): Use size_t as type for n2 since that's + what's returned by mbrtowc. + * regex/regexec.c (xmbrtowc): Ditto. + +2010-02-12 Christopher Faylor <me+cygwin@cgf.cx> + + * pthread.cc (pthread_mutex_init): Explicitly fill out third arg to + pthread_mutex::init. + * thread.cc: Remov some obsolete comments. + (verifyable_object_isvalid): Reflect change to use thread_magic_t for + magic numbers. + (pthread_mutex::pthread_mutex): Set magic number to invalid initially + until we've verified that everything is valid. + (pthread_mutex::unlock): Fix a comment. + (verifyable_object::verifyable_object): Delete here. + (~verifyable_object::~verifyable_object): Ditto. + (pthread_mutex::init): Don't run is_good_initializer for non-static + objects. + * thread.h (thread_magic_t): New typedef. + (verifyable_object::verifyable_object): Use thread_magic_t; + (verifyable_object::magic): Ditto. + (pthread_mutex::is_good_initializer_or_bad_object): Remove unneeded + variable names. + (pthread_mutex::can_be_unlocked): Ditto. + (pthread_mutex::init): Ditto. Remove default for third argument. + +2010-02-12 Corinna Vinschen <corinna@vinschen.de> + + * regex/regcomp.c (xwcrtomb): New function to convert wide chars + outside of the base plane to UTF-8. Call throughout instead of + wcrtomb. + (wgetnext): Handle surrogate pairs on UTF-16 systems. + * regex/regexec.c (xmbrtowc): Ditto. + +2010-02-12 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_user_local_groups): Retrieve name of well known + builtin group from system. Explain why. + * sec_helper.cc (well_known_builtin_sid): New SID for BUILTIN group. + * security.h (well_known_builtin_sid): Declare. + +2010-02-11 Pierre Humblet <Pierre.Humblet@ieee.org> + + * registry.cc (get_registry_hive_path): Add space in string. + +2010-02-11 Corinna Vinschen <corinna@vinschen.de> + + * regex/engine.c (step): Drop Cygwin-specific definition. + (NONCHAR): Better cast here to make the test work. Move comment + from step here. + (matcher): Disable skipping initial string in multibyte case. + * regex/regcomp.c (p_bracket): Don't simplify singleton in the invert + case. + (p_b_term): Handle early end of pattern after dash in bracket + expression. + (singleton): Don't ignore the wides just because there's already a + singleton in the single byte chars. Fix condition for a singleton + wide accordingly. + (findmust): Check for LC_CTYPE charset, rather than LC_COLLATE charset. + * regex2.h (CHIN): Fix condition in the icase & invert case. + (ISWORD): Fix wrong cast to unsigned char. + +2010-02-11 Andy Koppe <andy.koppe@gmail.com> + + * nlsfuncs.cc (initial_setlocale): Move check whether charset has + changed from here... + (internal_setlocale): ...to here, to avoid unnecessary work when invoked + via CW_INT_SETLOCALE. + +2010-02-10 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_charset_from_locale): Allow "@euro" modifier only + for locales which use EUR as currency. + +2010-02-10 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__get_lcid_from_locale): Convert iu_CA to iu-Latn-CA + rather than iu-Cans-CA on Vista and later. + (__set_charset_from_locale): Set default charset for iu_CA to UTF-8. + +2010-02-10 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (_dll_crt0): Set _main_tls as early as possible. + * thread.cc (pthread_mutex::can_be_unlocked): Remove check for + MUTEX_OWNER_ANONYMOUS since it is racy and unsafe. + (pthread::init_mainthread): Initialize thread directly from _my_tls. + (pthread::self): Ditto. + (pthread::get_tls_self_pointer): Delete. + (pthread_mutex::pthread_mutex): Use an event rather than a semaphore. + (pthread_mutex::lock): Rename from _<func>. Derive self directly. + (pthread_mutex::tryunlock): Ditto. + (pthread_mutex::destroy): Ditto. + (pthread_mutex::unlock): Ditto. Accommodate change from semaphore to + event. + (pthread_mutex::_fixup_after_fork): Accommodate change from semaphore + to event. + (pthread_mutex::init): Don't attempt to initialize a semaphore unless + it is in an initialized state. Do this check under + mutex_initialization_lock.lock + * thread.h (fast_mutex::init): Use event rather than semaphore. + (fast_mutex::lock): Ditto. + (pthread_mutex::_lock): Delete. + (pthread_mutex::_unlock): Ditto. + (pthread_mutex::_trylock): Ditto. + (pthread_mutex::_destroy): Ditto. + (pthread_mutex::get_pthread_self): Ditto. + (pthread_mutex::get_tls_self_pointer): Ditto. + (pthread_mutex::lock): Un-inline. + (pthread_mutex::unlock): Ditto. + (pthread_mutex::trylock): Ditto. + (pthread_mutex::destroy): Ditto. + +2010-02-09 Christopher Faylor <me+cygwin@cgf.cx> + + * cygtls.h (struct _cygtls): Remove unneeded elements. + * thread.cc (pthread::exit): Avoid potential double call to + _my_tls.remove. + * tlsoffsets.h: Regenerate. + +2010-02-09 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (lc_wcstombs): Add `return_invalid' flag to specify + whether invalid chars should be ignored or not. Change comment. + (__set_lc_monetary_from_win): Call lc_wcstombs with return_invalid + flag set. + (__set_lc_messages_from_win): Simplify to accommodate the fact that + lc_wcstombs just ignores invalid chars. Explain why. + +2010-02-09 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_lc_messages_from_win): Fix typo. + +2010-02-09 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: New file, fix a problem in locales with modifiers. + +2010-02-09 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: New file, generated from running Linux system. + +2010-02-09 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: New file, autogenerated from CLDR data. + * nlsfuncs.cc: Include lc_msg.h. + (lc_time_buf): Remove. + (lc_numeric_buf): Remove. + (lc_monetary_buf): Remove. + (lc_mbstowcs): Fix previous fix. + (__set_lc_time_from_win): Take additional pointer to buffer pointer, + defined in newlib. + (__set_lc_numeric_from_win): Ditto. + (__set_lc_monetary_from_win): Ditto. + (locale_cmp): New static function. + (__set_lc_messages_from_win): New function to be called from newlib. + +2010-02-08 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Add CW_INT_SETLOCALE case to + allow to call internal_setlocale(). + * nlsfuncs.cc (internal_setlocale): Make externally available. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_INT_SETLOCALE. + + * nlsfuncs.cc (lc_mbstowcs): Fix call to f_mbtowc. + (__set_locale_from_locale_alias): Ignore "@cjknarrow" modifier. + +2010-02-07 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__get_lcid_from_locale): Handle "@cyrillic" modifier + for uz_UZ locale here. + (__set_charset_from_locale): Accommodate above change. + +2010-02-07 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_locale_from_locale_alias): New function to read + locale aliases from /usr/share/locale/locale.alias. + +2010-02-06 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__get_lcid_from_locale): Handle no_NO as nb_NO, rather + than nn_NO. + +2010-02-06 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (has_modifier): MOve up in file to use in + __get_lcid_from_locale as well. + (__get_lcid_from_locale): Handle no_NO locale as alias for nn_NO. + Default all sr_XY locales to Cyrillic script. Change lcid to Latin + script if "@latin" modifier has been specified. + (__set_charset_from_locale): Handle Serbian in codepage 1251 case as + well. Also check for sr_BA lcid. Restrict "@euro" modifier to + locales otherwise defaulting to ISO-8859-1. + +2010-02-06 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_charset_from_locale): Set default charset for + "ka_GE" locale to GEORGIAN-PS, for "kk_KZ" to PT154. + +2010-02-06 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_nfs_symlink): Reopen file with + FILE_READ_EA access since, surprisingly, you need it to read EAs even + on NFS. + +2010-02-06 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_full_privileged_inheritable_token): New function + to fetch token with full privileges from logon token in Vista and + later, and to make token inheritable. Add lengthy comments to explain + the function's job. + (cygwin_logon_user): Drop calling SetHandleInformation. Enable TCB + privilege and call get_full_privileged_inheritable_token. + (lsaauth): Don't fetch linked token and don't make handle inheritable + here, just call get_full_privileged_inheritable_token instead. + (lsaprivkeyauth): Ditto. + +2010-02-05 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_charset_from_locale): Set default charset for + "uz_UZ" locale to ISO-8859-1, with the "@cyrillic" modifier to UTF-8. + +2010-02-05 Christopher Faylor <me+cygwin@cgf.cx> + + * dll_init.cc (per_module::run_dtors): Use consistent method for + running destructors. + +2010-02-04 Christopher Faylor <me+cygwin@cgf.cx> + + * regcomp.c (p_ere): Workaround incorrect compiler warning. + * regerror.c (regatoi): Return non-const string or compiler complains + in certain inexplicable situations. + +2010-02-04 Corinna Vinschen <corinna@vinschen.de> + + * regex/engine.c (step): Declare and define with `int ch' rather than + `wint_t ch' parameter. Explain why. + (NONCHAR): Remove related Cygwin patch here, including wrong comment. + +2010-02-04 Corinna Vinschen <corinna@vinschen.de> + + Replace regex files with multibyte-aware version from FreeBSD. + * Makefile.in (install-headers): Remove extra command to install + regex.h. + (uninstall-headers): Remove extra command to uninstall regex.h. + * nlsfuncs.cc (collate_lcid): Make externally available to allow + access to collation internals from regex functions. + (collate_charset): Ditto. + * wchar.h: Add __cplusplus guards to make C-clean. + * include/regex.h: New file, replacing regex/regex.h. Remove UCB + advertising clause. + * regex/COPYRIGHT: Accommodate BSD license. Remove UCB advertising + clause. + * regex/cclass.h: Remove. + * regex/cname.h: New file from FreeBSD. + * regex/engine.c: Ditto. + (NONCHAR): Tweak for Cygwin. + * regex/engine.ih: Remove. + * regex/mkh: Remove. + * regex/regcomp.c: New file from FreeBSD. Tweak slightly for Cygwin. + Import required collate internals from nlsfunc.cc. + (p_ere_exp): Add GNU-specific \< and \> handling for word boundaries. + (p_simp_re): Ditto. + (__collate_range_cmp): Define. + (p_b_term): Use Cygwin-specific collate internals. + (findmust): Ditto. + * regex/regcomp.ih: Remove. + * regex/regerror.c: New file from FreeBSD. Fix a few compiler warnings. + * regex/regerror.ih: Remove. + * regex/regex.7: New file from FreeBSD. Remove UCB advertising clause. + * regex/regex.h: Remove. Replaced by include/regex.h. + * regex/regexec.c: New file from FreeBSD. Fix a few compiler warnings. + * regex/regfree.c: New file from FreeBSD. + * regex/tests: Remove. + * regex/utils.h: New file from FreeBSD. + +2010-02-03 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (get_proc_lock): Fix error message typo. + +2010-02-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Workaround + another bug in NWFS. Add comment to explain why. Improve debug output + in case the NT calls to test for binary fail. + * path.h (path_conv::fs_is_cifs): New method. + (path_conv::fs_is_nwfs): New method. + +2010-02-02 Corinna Vinschen <corinna@vinschen.de> + + * include/paths.h (_PATH_MNTTAB): Define. + (_PATH_MOUNTED): Define. + * include/mntent.h: Include paths.h. Define MNTTAB and MOUNTED as their + paths.h equivalents. Add comment. + +2010-02-01 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (atexit_lock): Delete. + (cygwin_exit): Remove atexit lock. + (cygwin_atexit): Ditto. Rename parameter to match newlib. Call + __cxa_atexit when invoked by a registered DLL. + * dll_init.cc (remove_dll_atexit): Delete. + (dll_list::find): New function. + (dll_list::detach): Use dll_list::find to find dll associated with + return address. Use __cxa_finalize to run atexit functions associated + with the dll. + (cygwin_detach_dll): Don't assume that HANDLE == void *. + * dll_init.h (dll_list::find): Declare. + (__cxa_atexit): Ditto. + (__cxa_finalize): Ditto. + + * init.cc (dll_entry): Clarify comment. + +2010-02-02 Dave Korn <dave.korn.cygwin@gmail.com> + + * how-startup-shutdown-works.txt: Add new document. + +2010-01-29 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (lsaauth): Use CYG_LSA_MAGIC as checksum start value to + decouple from Cygwin release. + +2010-01-29 Corinna Vinschen <corinna@vinschen.de> + + * libc/strfmon.c (__setup_vars): Test for an empty string rather than + for a NULL pointer. + +2010-01-29 Christopher Faylor <me+cygwin@cgf.cx> + + * dll_init.cc (remove_dll_atexit): New function. + (dll_list::detach): Run any atexit handlers registered in the DLL prior + to unloading. + +2010-01-29 Christopher Faylor <me+cygwin@cgf.cx> + + * libc/strfmon.c (__setup_vars): Fix compiler warning about assigning + const strings. Compare a pointer to NULL rather than '\0'. + + * dll_init.cc (dll_dllcrt0_1): Minor comment fix. + + * pipe.cc (fhandler_pipe::create_selectable): Remove Win9x + accommodation. + +2010-01-29 Corinna Vinschen <corinna@vinschen.de> + + Throughout, use FileBothDirectoryInformation info class rather than + FileDirectoryInformation info class to avoid problems with incomplete + filesystem implementations. Fix comments accordingly. + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Set + fname->Length to 0 in error case to avoid potential crash in debug + output. + (fhandler_disk_file::readdir): Try to speed up the working default case. + Check for STATUS_INVALID_NETWORK_RESPONSE as potential status value + returned by filesystems not implementing FileIdBothDirectoryInformation. + * ntdll.h (STATUS_INVALID_NETWORK_RESPONSE): Define. + (FILE_BOTH_DIRECTORY_INFORMATION): Rename to official name. + * path.cc (symlink_info::check): Don't request FILE_READ_EA access, it's + not required for NFS. Try to speed up the working default case. Check + for STATUS_INVALID_NETWORK_RESPONSE as potential status value returned + by filesystems not supporting non-NULL EA parameters. Fix the way + fs.update is called. Improve debug output. + +2010-01-28 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (tags, ctags, CTAGS)): Add rules to create tags file. + +2010-01-25 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__get_lcid_from_locale): Add comments. Fix typos in + comments. Make sure to set last_lcid every time. Return locale + without territory part as invalid. Handle modern serbian territory + names per ISO 3166 on older systems as well. Add appropriate comment. + (__set_charset_from_locale): Handle LCID for sr_CS as well to make older + systems happy. + +2010-01-25 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_charset_from_locale): Rearrange to set charset + more closely aligned to Glibc. + +2010-01-25 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Only try to remove long path prefix from + runpath if runpath is not NULL. + +2010-01-25 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__get_lcid_from_locale): Fix a comment. Handle special + language/TERRITORY combinations explicitely. Explain why. + +2010-01-24 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__set_charset_from_locale): Fix comment. + +2010-01-24 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (check_codepage): Move from syscalls.cc here. + (internal_setlocale): Ditto. + (initial_setlocale): Ditto. + (setlocale): Ditto. + * strfuncs.cc (__sjis_wctomb): Revert previous patch. + (__sjis_mbtowc): Ditto. + * syscalls.cc: Move setlocale-related functions to nlsfuncs.cc. + +2010-01-23 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (__sjis_wctomb): Special handling for characters which + differ between SJIS and Windows codepage 932, if charset is "SJIS". + (__sjis_mbtowc): Ditto. + (_jis_wctomb): Remove. + (__jis_mbtowc): Remove. + +2010-01-23 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (wcsxfrm): Call LCMapStringW with LCMAP_BYTEREV flag to + allow correct comparison using wcscmp. + +2010-01-22 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (strfmon): Move to implemented SUSv4 API. + +2010-01-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add nlsfunc.o and strfmon.o. + * autoload.cc (LocaleNameToLCID): Define. + * cygwin.din (strfmon): Export. + * nlsfuncs.cc: New file. Define a lot of internal functions called + from setlocale. + (wcscoll): Implement locale-aware here, using CompareStringW function. + (strcoll): Ditto. + (wcsxfrm): Implement locale-aware here, usingLCMapStringW function. + (strxfrm): Ditto. + (__set_charset_from_locale): Replace __set_charset_from_codepage. + Return Linux-compatible charset. + * strfuncs.cc (__set_charset_from_codepage): Remove. + * wchar.h (__set_charset_from_codepage): Drop definition. + * wincap.h (wincaps::has_localenames): New element. + * wincap.cc: Implement above element throughout. + * libc/strfmon.c: New file. + * libc/strptime.cc: Remove locale constant strings in favor of + access to locale-specifc data. + (strptime): Point _CurrentTimeLocale to locale-specific data. + Throughout use correct locale-specific format fields for all + locale-specific formats. + * include/monetary.h: New file. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2010-01-18 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc: Remove needless includes. + +2010-01-17 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (internal_setlocale): Use UTF-8 internally if external + charset is ASCII. + +2010-01-15 Corinna Vinschen <corinna@vinschen.de> + + * libc/fnmatch.c: Replace with multibyte capable version from FreeBSD. + +2010-01-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::accept4): Reset async flag + on accepted socket. + +2010-01-15 Pierre A. Humblet <phumblet@phumblet.no-ip.org> + + * fhandler_socket.cc (fhandler_socket::accept4): Set nonblocking + flag exactly according to flags, as on Linux. + * net.cc (cygwin_accept): Maintain BSD semantics here. + +2010-01-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (accept4): Export. + * fhandler.h (fhandler_socket::accept4): Rename from accept. Take + additional flag parameter. + * fhandler_socket.cc (fhandler_socket::accept4): Ditto. Handle + SOCK_NONBLOCK and SOCK_CLOEXEC flags. + * net.cc (cygwin_socket): Handle SOCK_NONBLOCK and SOCK_CLOEXEC flags + in type. Check for invalid flag values. + (socketpair): Ditto. + (cygwin_accept): Accommodate renaming of fhandler_socket::accept + function to accept4. + (accept4): New function. + * posix.sgml: Mention accept4 as GNU extensions. + * include/cygwin/socket.h (SOCK_NONBLOCK): Define. + (SOCK_CLOEXEC): Define. + (_SOCK_FLAG_MASK): Define when building Cygwin. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * include/sys/socket.h (accept4): Declare. + +2010-01-15 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Mention dup3 and pipe2 as GNU extensions. + +2010-01-14 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Reset locale to "C" at the last moment before + calling the application's main. + * syscalls.cc (internal_setlocale): Don't reset locale to "C here. + Change comment accordingly. + +2010-01-14 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (dup3): Export. + (pipe2): Export. + * dtable.cc (dtable::dup_worker): Take additional flags parameter. + Handle O_CLOEXEC flag. + (dtable::dup3): Rename from dup2. Take additional flags parameter. + Check for valid flags. Drop check for newfd == oldfd. + * dtable.h (dtable::dup_worker): Add flags parameter. + (dtable::dup3): Rename from dup2. + * fcntl.cc (fcntl64): Add F_DUPFD_CLOEXEC case. + * fhandler.h (fhandler_mailslot::get_object_attr): Add flags parameter. + * fhandler.cc (fhandler_base::open): Use security attribute with + inheritance according to setting of O_CLOEXEC flag. + * fhandler_console.cc (fhandler_console::open): Ditto. + * fhandler_fifo.cc (sec_user_cloexec): New inline function to + create security attribute with inheritance according to setting of + O_CLOEXEC flag. + (fhandler_fifo::open): Call sec_user_cloexec to fetch security + attribute. + (fhandler_fifo::wait): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. + * fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Take + additional flags parameter. Use security attribute with inheritance + according to setting of O_CLOEXEC flag. + (fhandler_mailslot::open): Call get_object_attr with flags parameter. + * fhandler_registry.cc (fhandler_registry::open): Call set_close_on_exec + on real handles to accommodate O_CLOEXEC flag. + * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. + * fhandler_tape.cc: Create mutex with inheritance according to setting + of O_CLOEXEC flag. + * pipe.cc: Replace usage of O_NOINHERIT with O_CLOEXEC. + (fhandler_pipe::init): Simplify setting close_on_exec flag. + (fhandler_pipe::open): Remove setting close_on_exec flag. + (fhandler_pipe::create): Use security attribute with inheritance + according to setting of O_CLOEXEC flag. + (pipe2): New exported function. + * posix_ipc.cc: Throughout, open backing files with O_CLOEXEC + flag to follow POSIX semantics. + * security.h (sec_none_cloexec): New define. + * syscalls.cc (dup): Add missing extern "C" qualifier. Accommodate + renaming of dtable::dup2 to dtable::dup3. + (dup2): Ditto. Check newfd == oldfd here. + (dup3): New function. Check newfd == oldfd here. + (open): Set close_on_exec flag according to O_CLOEXEC flag before + calling fhandler->open. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2010-01-13 Corinna Vinschen <corinna@vinschen.de> + + * include/fcntl.h (O_TTY_INIT): Define as 0. + +2010-01-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_master::init): Don't erase all default + termios settings of slave console. + +2010-01-13 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Don't exit prematurely with EROFS when trying + to rename an AF_LOCAL socket or when trying to replace an AF_LOCAL + socket. + +2010-01-12 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (ro_u_nwfs): New R/O unicode string. + * mount.cc (fs_info::update): Check for NWFS filesystem. Set + has_buggy_basic_info, if so. Add comment to explain why. + (fillout_mntent): Add "nwfs" string to fs_names array. + * mount.h (enum fs_info_type): Add nwfs. + (class fs_info): Add has_buggy_basic_info status flag. Add accessors + for has_buggy_basic_info and is_nwfs. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Accommodate + filesystems with broken FileBasicInformation handling. + * path.cc (symlink_info::check): Ditto. + * path.h (path_conv::has_buggy_basic_info): Add method. + +2010-01-12 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (build_fh_name_worker): Remove. Move all functionality + back into build_fh_name. + (build_fh_name): Drop unused HANDLE parameter. Drop call to pc.fillin. + Remove disabled build_fh_name with UNICODE_STRING name parameter. + * dtable.h (build_fh_name): Drop HANDLE parameter from declaration. + Remove declaration for build_fh_name with UNICODE_STRING name parameter. + * path.cc (path_conv::fillin): Remove. + (symlink_info::check): Fix comment. + * path.h (path_conv::fillin): Remove declaration. + * dir.cc: Accommodate change in build_fh_name parameters throughout. + * sec_acl.cc: Ditto. + * syscalls.cc: Ditto. + + * ntea.cc (getxattr_worker): Fix debug output. + (setxattr_worker): Ditto. + * times.cc (utimens_worker): Ditto. + +2010-01-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_stat): Use new in_buf. + (format_proc_cpuinfo): Replace szBuffer with a union in_buf. Use type + correct throughout. Add a couple of missing or newer cpu flags. Allow + certain AMD flags for intel as well. + +2010-01-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::fstat_helper): Declare timestamps as + PLARGE_INTEGER. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): + Accommodate fstat_helper change of timestamp arguments. + (fhandler_base::fstat_by_name): Ditto. + (fhandler_base::fstat_helper): Define with timestamps as PLARGE_INTEGER. + Accommodate in call to to_timestruc_t. + +2010-01-08 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_token_group_sidlist): Add BUILTIN\Users account + to all created tokens. + * sec_helper.cc (well_known_users_sid): Define as BUILTIN\Users. + * security.h (well_known_users_sid): Declare. + +2010-01-01 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc: Bump copyright. + +2010-01-01 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Move internal locale setting prior to + potential globify to prevent creation of unglobbed filenames in the + wrong character set. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2011 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2011 new file mode 100644 index 000000000..a8b9a3af5 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2011 @@ -0,0 +1,5318 @@ +2011-12-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (getpt): Export. + * posix.sgml (std-gnu): Add getpt. + * tty.cc (getpt): New function. + * include/cygwin/stdlib.h [!__STRICT_ANSI__] (getpt): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-12-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * thread.cc: Mark pthread_rwlock_timedrdlock and + pthread_rwlock_timedwrlock as not yet implemented in the list of + cancellation points. + +2011-12-24 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_dsp.cc (fhandler_dev_dsp::fhandler_dev_dsp): Set up device. + + * syscalls.cc (open): Very minor formatting tweak. + +2011-12-24 Corinna Vinschen <vinschen@redhat.com> + + * path.cc (struct symlink_info): Add bool argument to declaration of + check_reparse_point. + (symlink_info::check_reparse_point): Add bool argument to indicate + remote drive. Handle STATUS_PENDING. Don't evaluate junctions on + remote drives. Fix comments. + (symlink_info::check): Drop check for is_remote_drive and associated + comment here. Add fs.is_remote_drive as second parameter to + check_reparse_point call. + +2011-12-23 Corinna Vinschen <vinschen@redhat.com> + + * pinfo.cc (pinfo_basic::pinfo_basic): Fix formatting. Set uid and gid + to default values to accommodate early initialization of shared user + info. Add comment. + +2011-12-22 Corinna Vinschen <vinschen@redhat.com> + + * spawn.cc (child_info_spawn::worker): Add CREATE_BREAKAWAY_FROM_JOB + to c_flags only if current process is member of a job and breakaway + is allowed. + +2011-12-22 Corinna Vinschen <vinschen@redhat.com> + + * external.cc (cygwin_internal): Implement CW_ALLOC_DRIVE_MAP, + CW_MAP_DRIVE_MAP, CW_FREE_DRIVE_MAP. + * fhandler_process.cc: Include mount.h. + (get_volume_path_names_for_volume_name): Move to mount.cc. + (struct dos_drive_mappings): Ditto. + * mount.cc (get_volume_path_names_for_volume_name): Move here. + (dos_drive_mappings::dos_drive_mappings): Ditto. + (dos_drive_mappings::fixup_if_match): Ditto. + (dos_drive_mappings::~dos_drive_mappings): Ditto. + * mount.h (class dos_drive_mappings): Declare her. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_ALLOC_DRIVE_MAP, + CW_MAP_DRIVE_MAP, CW_FREE_DRIVE_MAP. + * include/cygwin/version.h: Bump API minor number. + +2011-12-22 Corinna Vinschen <vinschen@redhat.com> + + * fhandler_process.cc: Drop unneeded includes. + +2011-12-22 Corinna Vinschen <vinschen@redhat.com> + + Throughout use wincap.allocation_granularity instead of getpagesize. + Throughout use wincap.page_size instead of getsystempagesize. + Throughout use "status" as variable name to hold NTSTATUS values. + * fhandler_mem.cc: Check for NT_SUCCESS rather than for STATUS_SUCCESS. + Fix debug_printf output. Rectify long statements. Fix comment + formatting. + * fhandler_proc.cc: Ditto. + (format_proc_swaps): Drop useless test for ERROR_PROC_NOT_FOUND. + * fhandler_process.cc: Ditto as in fhandler_mem.cc. + (get_process_state): Rearrange allocation loop. Use malloc/realloc. + (get_mem_values): Fix potential NULL pointer usage. Drop unused + variable. + * pinfo.cc (winpids::enum_processes): Handle low memory gracefully. + * sec_auth.cc (get_priv_list): Drop local variable ret. + * shared.cc (memory_init): Drop outdated call to getpagesize. + * syscalls.cc (getsystempagesize): Remove. + * sysconf.cc: Check for NT_SUCCESS rather than for STATUS_SUCCESS. + (sysinfo): Constify sizeof_stodi. Drop useless test for + ERROR_PROC_NOT_FOUND. + * thread.cc (pthread_getattr_np): Cast pointers to uintptr_t rather + than to int for pointer arithmetic. + * winsup.h (getsystempagesize): Drop declaration. + +2011-12-21 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use correct + value in switch statement. + +2011-12-21 Corinna Vinschen <vinschen@redhat.com> + + * dcrt0.cc (_dll_crt0): Rephrase comments. Set $ebp to NULL, as in + the pthread stack setup. + * wow64.cc (wow64_revert_to_original_stack): Rephrase some comments. + Return _tlsbase-16 rather than _main_tls-4 so as not to waste stack. + +2011-12-19 Corinna Vinschen <vinschen@redhat.com> + + * syscalls.cc (rename): Fix typo in comment. Fix condition to handle + the case oldpath is no .lnk symlink and newpath points to an existing + .lnk symlink or .exe file and no explicit .lnk suffix has been given + in oldpath. Add a comment to explain. + +2011-12-19 Corinna Vinschen <vinschen@redhat.com> + + * dcrt0.cc (dll_crt0_0): Check for wincap.wow64_has_secondary_stack + rather than for wincap.is_wow64. Accommodate name change from + wow64_has_64bit_parent to wow64_needs_stack_adjustment. Align comment. + (_dll_crt0): Ditto. + * wincap.h (wincaps::wow64_has_secondary_stack): New element. + * wincap.cc: Implement above element throughout. + (wincapc::init): Set wow64_has_secondary_stack to false on non-64 bit + systems. + * wow64.cc (wow64_needs_stack_adjustment): Rename (hopefully the last + time) from wow64_has_64bit_parent. + (wow64_eval_expected_main_stack): Fix comment to reflect real life. + (wow64_test_for_64bit_parent): Fix comment. + * wow64.h (wow64_needs_stack_adjustment): Accommodate new name. + +2011-12-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base::close): Move setting isclosed() from here + to closed(). + (fhandler_base_overlapped::close): Correct comment. + (fhandler_base_overlapped::destroy_overlapped): Signal overlapped event + before closing it to potentially wake up a waiting thread. + (fhandler_base_overlapped::wait_overlapped): Expand setting of err when + closed to encompass non-signal event. Test for a cancel event before + making nonblocking decisions. + * syscalls.cc (close): Set closed flag here so that any concurrently + executing functions will be notified ASAP. + +2011-12-17 Corinna Vinschen <vinschen@redhat.com> + + * dcrt0.cc (_dll_crt0): Fix formatting. + +2011-12-17 Corinna Vinschen <vinschen@redhat.com> + + * wow64.cc (wow64_revert_to_original_stack): Fix comment. + * wow64.h (wow64_respawn_process): Declare noreturn. + +2011-12-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (set_signal_mask): Remove useless debugging output. + + * fhandler.cc (fhandler_base::write): Ditto. + (fhandler_base_overlapped::close): Cancel any ongoing I/O before + closing. + * syscalls.cc (write): Default to always reporting all writes in strace + output via syscall_printf. + * wait.cc (wait4): Fix debugging output. Use standard syscall leaver + output. + +2011-12-16 Christopher Faylor <me.cygwin2011@cgf.cx> + + Implement fhandler reference counting. + * cygheap.h (cygheap_fdmanip::release): Make virtual. + (cygheap_fdnew::~cygheap_fdnew): New destructor increments reference + count when fd has been allocated. + (cygheap_fdget::fh): New (old?) field. + (cygheap_fdget::cygheap_fdget): Increment reference count when we've + found an active fd. Set fh appropriately. + (cygheap_fdget::~cygheap_fdget): Decrement reference count when + appropriate. Delete fh if reference count goes to zero. + (cygheap_fdget::release): New function. Do more bookkeping on release. + * dtable.cc (dtable::release): Change from void to boolean return. + Only delete the fhandler when its reference count is <= 0 (this should + be a fairly unusual case). Return true if fhandler has been deleted. + (cygwin_attach_handle_to_fd): Increment reference count when fh is + assigned. + (dtable::init_std_file_from_handle): Ditto. + * dtable.h (dtable::release): Change return to boolean. + * fhandler.cc (fhandler_base::fhandler_base): Set new isclosed flag to + false. Set _refcnt to zero. + (fhandler_base::close): Simplify paranoid debugging output. Set new + isclosed() flag. + (fhandler_base_overlapped::wait_overlapped): Use isclosed() flag to + avoid querying the overlapped structure. + * fhandler.h (fhandler_base::_refcnt): New field. + (fhandler_base::refcnt): New function. + (fhandler_base::isclosed): Implement. + (fhandler_base::fhandler_base): Set isclosed to false. + + * syscalls.cc: Remove space after function before parentheses for + several strace printfs. + (dup): Add standard strace "leaver" code. + (dup2): Ditto. + (dup3): Ditto. + (remove): Ditto. + (getpid): Ditto. + (getppid): Ditto. + (lseek64): Fix strace debugging to correctly use %R. + + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Avoid sending + signals to other processes if we're debugging since it can cause a + deadlock with the calling debugger. + + * exceptions.cc (_cygtls::call_signal_handler): Add debugging-only + strace output. + +2011-12-16 Corinna Vinschen <vinschen@redhat.com> + + * dcrt0.cc (child_info_fork::alloc_stack): Correctly check if the + parent stack fits into the child stack. Align comment. + * wow64.cc (wow64_eval_expected_main_stack): New function to fetch + expected addresses of main thread stack from PE/COFF image header + values. + (wow64_test_for_64bit_parent): Fix comment. Check current stack + against real expected main thread stack addresses. + (wow64_revert_to_original_stack): Fix and add comments. Check memory + against real expected main thread stack addresses. Use orignal stack + if reserved area is >= 256K. + +2011-12-16 Christopher Faylor <me.cygwin2011@cgf.cx> + + * gendef (sigdelayed): Remember to pop all of the saved registers. + (sigreturn): Add "leave" label. + +2011-12-16 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Fix + unresolved access of wores in successful situations. + +2011-12-16 Corinna Vinschen <vinschen@redhat.com> + + * Makefile.in (DLL_OFILES): Add wow64.o. + * dcrt0.cc (CYGWIN_GUARD): Drop execute permission for stack, it's + not used for stacks by the OS either. + (child_info_fork::alloc_stack_hard_way): Ditto. + (child_info_fork::alloc_stack): Don't alloc_stack_hard_way under WOW64 + if forked from a 64 bit parent. Set child's StackBase to parent's + StackBase. Add comments to explain why. + (wow64_respawn): Move to wow64.cc. + (wow64_started_from_native64): Move to wow64.cc. + (respawn_wow64_process): Move to wow64.cc. + (dll_crt0_0): Drop wow64_test_stack_marker and move stack test into + wow64_test_for_64bit_parent function. Don't return early if WOW64 + process has been started from native 64 bit process. + (_dll_crt0): Implement moving stack for WOW64 processes started from + native 64 bit process. + * wow64.cc: New file. + (wow64_has_64bit_parent): Rename from wow64_respawn. + (wow64_test_for_64bit_parent): Rename from wow64_started_from_native64. + Change comment. + (wow64_revert_to_original_stack): New function. + (wow64_respawn_process): Rename from respawn_wow64_process for symmetry. + * wow64.h: New file. + +2011-12-16 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (_cygtls::call_signal_handler): Fix debugging to not go + to console. + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Add temporary + kludge to work around problem of make closing an fhandle while it is + being read. + * gendef (sigdelayed): Don't call a function if sig has been cleared. + + * sigproc.h (cygwait): Simplify slightly. + +2011-12-14 Corinna Vinschen <vinschen@redhat.com> + + * autoload.cc (GetSystemWow64DirectoryW): Define. + (GetVolumePathNamesForVolumeNameW): Define. + * fhandler_process.cc (get_volume_path_names_for_volume_name): New + static function to workaround missing GetVolumePathNamesForVolumeNameW + function in Windows 2000. + (dos_drive_mappings::dos_drive_mappings): Call + get_volume_path_names_for_volume_name instead of + GetVolumePathNamesForVolumeNameW. + +2011-12-13 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dcrt0.cc (init_windows_system_directory): Record + system_wow64_directory information. + * exceptions.cc (_cygtls::inside_kernel): Modernize comment. Consider + executing a DLL from the Wow64 directory as being "in the kernel". + (_cygtls::call_signal_handler): For now, only deal with main_tls + signals if main_tls is known to be executing in the cygwin DLL. To + more closely emulate linux, consider the operation to be restartable if + not executing in the main thread. + * globals.cc (windows_system_directory): Remove NO_COPY. + (windows_system_directory_length): Ditto. + (system_wow64_directory): New variable. + (system_wow64_directory_length): Ditto. + + * select.cc (cygwin_select): Don't issue a EINTR on non-main threads + since that seems to be what Linux does. Add missing break to signal + case/switch. + (select_stuff::wait): Don't issue a EINTR on non-main threads since + that seems to be what Linux does. Remove now-unneeded accommodation + for WAIT_IO_COMPLETION. Add a comment. + * sigproc.h (cygwait): Ditto. Don't return if signal_received noticed + and it's not the main thread. + + * signal.cc (sigprocmask): Add standard syscall debug stuff. + * thread.cc (pthread_sigmask): Ditto. + +2011-12-13 Corinna Vinschen <vinschen@redhat.com> + + * netdb.cc (open_system_file): Avoid MS-DOS path warning. + +2011-12-13 Corinna Vinschen <vinschen@redhat.com> + + * path.cc (conv_path_list): Fix a condition. + (cygwin_conv_path): Revert WIN_A conversion to current locale codeset. + +2011-12-13 Corinna Vinschen <vinschen@redhat.com> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Call + file_get_fnoi instead of NtQueryInformationFile. + * path.cc (file_get_fnoi): New helper function to collect a + FILE_NETWORK_OPEN_INFORMATION block. + (symlink_info::check): Call file_get_fnoi rather than + NtQueryInformationFile to collect a FILE_NETWORK_OPEN_INFORMATION block. + * path.h (file_get_fnoi): Declare. + +2011-12-13 Dave Korn <dave.korn.cygwin@gmail.com> + + * times.cc (hires_ns::resolution): Don't return less than 1. + +2011-12-12 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygthread.h (cygthread::name): Very minor formatting tweak. + + * exceptions.cc (_cygtls::call_signal_handler): Add paranoid debugging + output. + + * sigproc.h (cygwait): Call signal handler when signal is detected and + loop as appropriate. + * fhandler.h (fhandler_base_overlapped::wait_return): Remove + overlapped_signal. + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Remove + restartable signal accommodations in light of cygwait improvements. + (fhandler_base_overlapped::raw_read): Remove now-obsolete signal loop + behavior. + (fhandler_base_overlapped::raw_write): Ditto. + * fhandler_console.cc (fhandler_console::read): Ditto. + * fhandler_serial.cc (fhandler_serial::raw_read): Ditto. + (fhandler_serial::raw_write): Ditto. + * fhandler_tty.cc (fhandler_pty_slave::read): Ditto. + + * ioctl.cc (ioctl): Add standard syscall introducer and leaver debug + output. + +2011-12-12 Corinna Vinschen <vinschen@redhat.com> + + * fhandler_process.cc (dos_drive_mappings): Partially rewrite to + handle volumes mounted into juntion points correctly. + +2011-12-12 Corinna Vinschen <vinschen@redhat.com> + + * fhandler_process.cc (dos_drive_mappings::dos_drive_mappings): Fully + resolve symbolic links returned by QueryDosDeviceW. Explain why. + +2011-12-12 Corinna Vinschen <vinschen@redhat.com> + + * mount.cc (fs_info::update): Set has_buggy_reopen for Netapps as well. + +2011-12-12 Corinna Vinschen <vinschen@redhat.com> + Christopher Faylor <me.cygwin2011@cgf.cx> + + * dcrt0.cc (wow64_respawn): New static variable. + (wow64_started_from_native64): New function to check if a WOW64 + process got started from a native 64 bit process. + (respawn_wow64_process): New function to respawn process. + (dll_crt0_0): When started from a native parent, check if parent + is a 64 bit process. If so, return early. + (_dll_crt0): Respawn WOW64 process here if required. + * init.cc (respawn_wow64_process): Remove. + (dll_entry): Rename wow64_test_stack_marker to test_stack_marker. + Drop WOW64 test here. + +2011-12-11 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pipe.cc (fhandler_pipe::create): Use debug_printf to print debugging + info since this isn't a "syscall". + (pipe_worker): New function created from _pipe(). + (_pipe): Use pipe_worker to create a pipe. Use standard syscall strace + reporting on exit. + (pipe): Ditto. + (pipe2): Ditto. + +2011-12-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (select_stuff::wait): Very minor formatting fix. + (peek_windows): Report on HWND handle used in queries. + * select.h: Update copyright. + * sigproc.h (cygwait): Eliminate multi-argument variety since more + general implementation may cause odd problems in select. Also force to + always be inline. + +2011-12-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.h (cygwait): Delete duplicate va_start and add matching + va_end. + +2011-12-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.h (cygwait): Tweak test for cancellable event to make it a + little more clear. + +2011-12-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (ctrl_c_handler): YA in a series or reversions. Put + back _my_tls.remove along with a comment. + (sigpacket::process): Remove code which now causes a gdb deadlock. + * sigproc.cc (_cygtls::signal_exit): Signal debugger with signal number + earlier. + +2011-12-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dllfixdbg: Work around annoying gdb warning about missing + .gnu_debuglink. + +2011-12-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + Rename cygWFMO to cygwait throughout and use the magic of polymorphism + to "wait for stuff". + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use + simplified arg form of cygwait. + * fhandler_console.cc (fhandler_console::read): Ditto. + * fhandler_audio.cc (fhandler_dev_dsp::Audio_out::waitforspac): Ditto. + (fhandler_dev_dsp::Audio_in::waitfordata): Ditto. + * fhandler_fifo.cc (fhandler_fifo::wait): Ditto. + * fhandler_serial.cc (fhandler_serial::raw_read): Ditto. + (fhandler_serial::raw_write): Ditto. + * select.cc (cygwin_select): Ditto. + * sigproc.h (cygwait): Rename from cygWFMO. Define two argument and + single argument forms of this function. + + * fhandler_tty.cc (fhandler_pty_slave::open): Use method to query if + tty is open. + (fhandler_pty_slave::read): Send SIGHUP when master is detected as + closed. + (fhandler_pty_common::close): Close input_available_event in callers + since master may need to signal it first. + (fhandler_pty_master::close): Lie and set input_available_event when + closing, then close input_available_event. + (fhandler_pty_slave::close): Close input_available_event explicitly + here. + * tty.h (tty::is_master_closed): Declare new method. + +2011-12-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (signal_exit): Revert reversion of 2011-12-04 change + since, otherwise, you see hangs when the signal pipe is closed. + +2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (cygwin_select): Fifth time is the charm. + +2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (cygwin_select): Make sure that 0 is returned when sel.wait + times out. + +2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * include/sys/wait.h: Add in all c++ functions. + +2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (select_stuff::wait): Temporarily disallow APCS. + +2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * include/sys/wait.h: Ensure that C++ functions are only used when + using C++. + +2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (cygwin_select): Make sure that poll is called when + appropriate. + +2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc (dll_dllcrt0): Don't try to initialize dll data if we're + dynamically loaded since fork() doesn't work in that scenario anyway. + (dll_dllcrt0_1): Don't accommodate dynamically loaded dlls. + * exceptions.cc (ctrl_c_handler): Don't lock the process; there's too + much risk of deadlock. + * sigproc.cc (_cygtls::remove_wq): Don't try to remove anything from + the waitq if there is obviously nothing there. + * strace.cc (strace::activate): Allow stracing dynamically loaded + cygwin1.dll. + +2011-12-07 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_termios.cc (tty_min::kill_pgrp): Don't send __SIGSETPGRP + to ourselves since presumably we are already initialized. + +2011-12-07 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (cygwin_select): Add common introducer and leaver debug + output. + (select_stuff::poll): Remove unneeded debugging. + +2011-12-07 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (ctrl_c_handler): Remove _my_tls.remove since it can + cause deadlocks during exec and will eventually be handled anyway. + +2011-12-07 Corinna Vinschen <vinschen@redhat.com> + + * spawn.cc (child_info_spawn::worker): Add CREATE_BREAKAWAY_FROM_JOB + to all spawned processes. Explain why. + +2011-12-06 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_fifo.cc (fhandler_fifo::wait): Fix stupid typo and actually + wait for the handle. + +2011-12-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (close_my_readsig): New function. + (_cygtls::signal_exit): Close my_readsig via close_my_readsig(), + avoiding communication with the signal pipe. + (wait_sig): Close my_readsig via close_my_readsig(). + +2011-12-05 Corinna Vinschen <vinschen@redhat.com> + + * mmap.cc (mlock): Replace LOCK_VM_IN_WSL with correct MAP_PROCESS. + (munlock): Ditto. + * ntdll.h: Rearrange to have all preprocessor definitions at the start + of the file. Add comments to each definition block. + (MAP_PROCESS): Rename from LOCK_VM_IN_WSL. + (MAP_SYSTEM): Rename from LOCK_VM_IN_RAM. + +2011-12-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.h (cygWFMO): Don't assume that cancellable event is always + available. + * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::waitforspace): Use + cygWFMO instead of WaitForMultipleObjects. + (fhandler_dev_dsp::Audio_in::waitfordata): Ditto. + * fhandler_fifo.cc (fhandler_fifo::wait): Ditto. + * fhandler_serial.cc (fhandler_serial::raw_read): Ditto. + (fhandler_serial::raw_write): Ditto. + * fhandler_tty.cc (fhandler_pty_slave::read): Ditto. + * select.cc (cygwin_select): Ditto for degenerate case. + +2011-12-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.h (cygWFMO): Move inside "INSIDE_CYGWIN" #ifdef. + +2011-12-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (exception::handle): Drop abbreviation for "exception" + since I never remember what it stands for. + (sig_handle_tty_stop): Remove obsolete call to reset_signal_arrived. + (_cygtls::call_signal_handler): Rework to grab signal information from + _main_tls if none is set for _my_tls. Try harder to keep thread + locked. + (reset_signal_arrived): Delete. + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use new + cygWFMO call to wait for an event + standard cygwin stuff. Modify + debug output to acccomodate new function. + * fhandler_console.cc (fhandler_console::read): Replace + WaitForMultipleObjects with cygWFMO. + * fhandler_socket.cc (get_inet_addr): Add comment. + * gendef (_sigdelayed): Remove call to reset_signal_arrived. + * sigproc.cc (_cygtls::signal_exit): Don't close my_readsig here unless + we're in the signal thread. + (create_signal_arrived): Create signal_arrived as auto-reset so that only + one thread is woken when a signal arrives. + * sigproc.h (cygWFMO): New function. + (reset_signal_arrived): Delete declaration. + +2011-12-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + * mmap.cc (mlock): Add standard syscall return value debugging output. + (munlock): Ditto. + (posix_madvise): Ditto. + + * signal.cc: Remove obsolete sigcatchers stuff throughout. + (sigaction_worker): Add function name parameter and use it to show + standard syscall return value debugging output. Also add fault + protection. + (sigaction): Accommodate extra argument to sigaction_worker. + (siginterrupt): Ditto. + * syscalls.cc (read): Remove obsolete sigcatchers stuff. + (readv): Ditto. + +2011-12-03 Corinna Vinschen <vinschen@redhat.com> + + * mmap.cc (mlock): Drop requesting SE_LOCK_MEMORY_PRIVILEGE. Drop + outdated comment. Call NtLockVirtualMemory with LOCK_VM_IN_WSL flag. + (munlock): Drop requesting SE_LOCK_MEMORY_PRIVILEGE. Call + NtUnlockVirtualMemory with LOCK_VM_IN_WSL flag. + +2011-12-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + Throughout, remove extra space after function name from debugging + output. + Throughout, change syscalls to report on return values using new %R + format option. + * smallprint.cc (__small_vsprintf): Add parsing for %R to report on + return values and possible errno from syscalls. + + * errno.cc (errmap): Add PRIVILEGE_NOT_HELD. + + * fhandler_tty.cc (fhandler_pty_master::setup): When creating a thread + use shorter name to reduce debuggging output. + * select.cc (start_thread_pipe): Ditto. + (start_thread_serial): Ditto. + (start_thread_socket): Ditto. + (start_thread_mailslot): Ditto. + * sigproc.cc (talktome): Ditto. + +2011-12-03 Corinna Vinschen <vinschen@redhat.com> + + * fhandler.cc (fhandler_base::open): Fix comment a bit more. + +2011-12-03 Corinna Vinschen <vinschen@redhat.com> + + * fhandler.cc (fhandler_base::open): Fix typos in comment. + +2011-12-02 Corinna Vinschen <vinschen@redhat.com> + + * path.cc (conv_path_list): Take cygwin_conv_path_t as third parameter. + Allow all types of CCP conversions. Accommodate throughout. + (cygwin_conv_path): Use current ANSI or OEM codepage for WIN_A + conversions, depending on current file API codepage setting. + (cygwin_conv_path_list): Allow all CCP conversion types. + * include/sys/cygwin.h (CCP_CONVTYPE_MASK): Add to cygwin_conv_path_t + enum for convenience. + +2011-11-29 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (get_proc_lock): Remove extra NULL check. Return false on + failure. + +2011-11-29 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sync.cc: Fix comment. + +2011-11-29 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc (dll_list::reserve_space): Use %p rather than %lx to show + reserved space. + +2011-11-29 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (remove_proc): Don't terminate the currently executing + thread. + +2011-11-28 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygheap.cc (cygheap_fixup_in_child): Accommodate new HEAP_3* + classifications for cleanup-after-fork. + * cygheap_malloc.h (cygheap_types): Add HEAP_2_MAX, HEAP_3_FHANDLER. + * fhandler.h: Throughout, change clone to take a cmalloc id. + (fhandler_base::delete): Inline. + (fhandler_base_overlapped): Mark flush_async_io as a friend. + (fhandler_base_overlapped::asio_done): Declare new static member. + (fhandler_base_overlapped::asio_close_counter): Ditto. + (fhandler_base_overlapped::check_later): Declare new function. + (fhandler_base_overlapped::flush_all_async_io): Ditto. + * fhandler.cc (fhandler_base_overlapped::asio_done): Declare. + (fhandler_base_overlapped::asio_close_counter): Ditto. + (flush_async_io): Declare new thread function. + (fhandler_base_overlapped::flush_all_async_io): Declare new function. + (fhandler_base_overlapped::check_later): Ditto. + (fhandler_base_overlapped::close): Call check_later to close + nonblocking fd asynchronously. Assume that this completed + successfully. + * select.cc (pipe_data_available): Don't consider data to be + "available" if fd still has unflushed I/O. + * syscalls.cc (close_all_files): Call + fhandler_base_overlapped::flush_all_async_io to make sure that all + nonblocking pipe I/O has completed. + +2011-11-28 Corinna Vinschen <vinschen@redhat.com> + + * external.cc (fillout_pinfo): Store program name as POSIX path in + ep.progname_long. + +2011-11-28 Corinna Vinschen <vinschen@redhat.com> + + * pinfo.cc (pinfo::exit): Call TerminateProcess to avoid potential + busy loop in ntdll.dll when calling ExitProcess. Only call ExitProcess + as a fallback. + +2011-11-27 Christopher Faylor <me.cygwin2011@cgf.cx> + + * init.cc (dll_entry): Revert previous change since it caused + inexplicable fork problems. + +2011-11-26 Christopher Faylor <me.cygwin2011@cgf.cx> + + * init.cc (dll_entry): Don't bother calling through thread removal + cleanup if we are exiting. + +2011-11-26 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (stackdump): Make global. + (signal_exit): Move to sigproc.cc. + * sigproc.cc (signal_exit): Move here. Declare stackdump extern. Set + my_sendsig to indicate that signals are no longer available. + (my_readsig): Make Static again. + (sig_send): Interpret ERROR_BROKEN_PIPE as ESRCH. Remove special-case + EACCESS errno setting, just setting errno generally, even for "its_me" + case. + +2011-11-25 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (sigpacket::process): Move signal_exit processing + into... + (_cygtls::signal_exit): ...here. Close my_readsig and comment on why. + * pinfo.cc (pinfo::exit): Move sigproc_terminate earlier. Set exiting + flag in lock_process. + * sigproc.cc (my_readsig): Make global. + * sync.cc (muto::exiting_thread): Delete. + (muto::acquire): Delete #if 0'ed code. + * sync.h (muto::exiting_thread): Delete. + (set_exiting_thread): Ditto. + (lock_process::lock_process): Don't worry about setting the exiting + thread since it had no meaning. + +2011-11-24 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygthread.cc (cygthread::name): Default name to "main" if we are early + in the process of setting up the DLL and no name is known. + * dcrt0.cc (initial_env): Remove CYGWIN_SLEEP stuff. + (get_cygwin_startup_info): Activate strace here as appropriate. + (dll_crt0_0): Move get_cygwin_startup_info as early as possible to + avoid missing strace output. + * fork.cc (frok::child): Move debugging statement to point where ppid + will be set. + * pinfo.cc (pinfo::thisproc): Remove obsolete call to strace.hello. + Tweak debug output slightly. + * select.cc (select_stuff::wait): Allow APCS to be triggered while + waiting since we use them now. Report when that happens. + * sigproc.cc (child_info::child_info): Use strace.active() rather than + strace.attached(). + * spawn.cc (child_info_spawn::worker): Only write strace child pid + when we know it's a cygwin process. Accommodate change to write_child + argument list. + * strace.cc (strace::hello): Delete. Move functionality... + (strace::activate): ...to here. + (mypid): Just use raw GetCurrentProcessId () if myself isn't set. + (strace::write_childpid): Don't wait for subproc_ready. Remove arg + which was required for it. + * include/sys/strace.h (strace::hello): Delete. + (strace::write_childpid): Delete first argument. + +2011-11-23 Christopher Faylor <me.cygwin2011@cgf.cx> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset for previous changes. + + * dcrt0.cc (get_cygwin_startup_info): Signal readiness when stracing + since strace::write_child relies on it. Use strace.activate to notify + strace process, passing in arg indicating whether we're forked. + * sigproc.cc (wait_sig): Accommodate new strace::activate argument. + * spawn.cc (child_info_spawn::worker): Oops. Previous suspended test + was actually correct. Revert and document. + * strace.cc (strace::activate): Send additional flag indicating whether + this is an attempt to activate a forked process. + (strace::hello): Report on windows pid. + * include/sys/strace.h (strace::strace): Make a dummy. + (strace::activate): Modify declaration to accept an argument. + (strace::write_childpid): Set regparm. + +2011-11-23 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pipe.cc (fhandler_pipe::create): Avoid derefencing a NULL pointer. + + * child_info.h (child_info): Reorganize some elements so that the ones + which are initialized in a constructor are all together. + * sigproc.cc (child_info::child_info): Initialize values via the + constructor rather than as C statements and make sure that flags is set + to zero initially. + + * spawn.cc (child_info_spawn::worker): Use iscygwin() test for + determining when to send strace info since it is more foolproof than + checking the suspend state. + +2011-11-23 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (fhandler_pipe::create): Rename from the misnamed + "create_selectable". Change return to DWORD. + (fhandler_pty_common::pipesize): New constant. + * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Reflect + create_selectable name change. + * miscfuncs.cc (CreatePipeOverlapped): Ditto. + * pipe.cc (fhandler_pipe::create): Ditto. + (fhandler_pipe::create): Rename from the misnamed "create_selectable". + Return DWORD. Only set pipe size to default when it is passed in as + zero. + * fhandler_tty.cc (fhandler_pty_master::setup): Ditto. Use + fhandler_pty_common::pipesize rather than a raw constant. + * tty.cc (tty::not_allocated): Ditto. + + * sigproc.cc (sigproc_init): Use fhandler_pipe::create to create the + signal pipe to get a more appropriate message based pipe. + +2011-11-21 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (remove_proc): Don't do busy loop when exiting since it + doesn't matter. + +2011-11-21 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (remove_proc): Don't do busy loop when execing since + thread could have been terminated prior to setting flag. + + * signal.cc (sigwaitinfo): Zero event before closing to signal other + threads that it is no longer available. + +2011-11-18 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (get_shared_parent_dir): Use global shared_parent_dir + instead of local dir variable and create handle not inheritable to + avoid accumulating stray handles in child processes. + (get_session_parent_dir): Ditto with session_parent_dir variable. + +2011-11-17 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (shared_info::create): Open global shared data section + non-inheritable to avoid accumulating stray handles in child processes. + +2011-11-15 Christopher Faylor <me.cygwin2011@cgf.cx> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. + (cygheap_exec_info::nchildren): Move from child_info_spawn. + (cygheap_exec_info::cchildren): Ditto. + (cygheap_exec_info::record_children): Declare new function. + (cygheap_exec_info::reattach_children): Ditto. + (cygheap_exec_info::alloc): Ditto. + (child_info_spawn::nchildren): Move to cygheap_exec_info. + (child_info_spawn::cchildren): Ditto. + * sigproc.cc (cygheap_exec_info::alloc): Define new function. + (child_info_spawn::cleanup): Accommodate move of children info to + cygheap_exec_info. + (cygheap_exec_info::record_children): Define new function. + (cygheap_exec_info::reattach_children): Ditto. + (child_info_spawn::record_children): Use + cygheap_exec_info function to accomplish this task. + (child_info_spawn::reattach_children): Ditto. + * spawn.cc (child_info_spawn::worker): Allocate moreinfo using + cygheap_exec_info::alloc. + + * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Use abort for the + error to avoid a retry. + +2011-11-14 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pinfo.cc (_pinfo::dup_proc_pipe): Fatalize a warning when debugging. + +2011-11-13 Christopher Faylor <me.cygwin2011@cgf.cx> + + Remove erroneously checked-in debugging statements. + * cygheap.cc (cygheap_fixup_in_child): Here. + * debug.cc (delete_handle): Here. + * sigproc.cc (child_info_spawn::cleanup): Here. + * spawn.cc (child_info_spawn::worker): Here. + +2011-11-13 Christopher Faylor <me.cygwin2011@cgf.cx> + + Throughout, change "sig %d" in strace output to "signal %d" for + consistency. + * assert.cc (__assert_func): Output assertion string to strace too. + * fork.cc (frok::parent): Report ASAP on forked pid in debugging output. + * pinfo.cc (pinfo::_pinfo_release): Define new function. + (pinfo::init): Use _pinfo_release() rather than release() to release + shared memory stuff. + (pinfo::wait): Shorten name of process waiting thread for more concise + debugging. + (pinfo::release): Use pinfo_release to release shared memory part of + struct. + * pinfo.h (pinfo::__pinfo_release): Declare. + +2011-11-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + Throughout use "have_execed" macro rather than "hExeced" global handle. + Throughout rename _PROC_* to _CH_*. + * child_info.h: Include "pinfo.h". + (child_info_types): Rename _PROC_* -> _CH_* to avoid confusion with + similarly named constants. + (_PROC_*): Delete unneeded aliases. + (PROC_*): Ditto. + (CURR_CHILD_INFO_MAGIC): Ditto. + (cchildren): Define using "pinfo_minimal". + (child_info::set_saw_ctrl_c): Move to + (child_info_spawn::set_saw_ctrl_c): Here. + (child_info_spawn::lock): New field. + (child_info_spawn::hExeced): Ditto. + (child_info_spawn::ev): Ditto. + (child_info_spawn::~child_info_spawn): Move to sigproc.cc. + (child_info_spawn::child_info_spawn): Ditto. + (child_info_spawn::cleanup): Declare new function. + (child_info_spawn::set_saw_ctrl_c): Move to this class. Set flag only + when execed and return true when we have set the flag. + (child_info_spawn::child_info_spawn::signal_myself_exited): New function. + (child_info_spawn::wait_for_myself): Ditto. + (child_info_spawn::has_execed_cygwin): Ditto. + (child_info_spawn::has_execed): Ditto. Replaces "hExeced" test. + (child_info_spawn::operator HANDLE&): New operator. + (child_info_spawn::worker): Define old "spawn_guts" as class member. + (ch_spawn): Declare. + (have_execed): Define. + (have_execed_cygwin): Ditto. + * cygheap.h: Update comment. + * dcrt0.cc (get_cygwin_startup_info): Use _CH_* enums. + (child_info_spawn::handle_spawn): Ditto. + (dll_crt0_0): Ditto. + (multiple_cygwin_problem): Ditto. + * exceptions.cc (chExeced): Delete obsolete declaration. + (ctrl_c_handler): Reference set_saw_ctrl_c via new ch_spawn global. + * globals.cc (hExeced): Delete. + * pinfo.cc (pinfo::thisproc): Refer to cygheap as ::cygheap for + consistency in handle naming when -DDEBUGGING. + (pinfo::init): Accommodate case where myself.h is known but h0 is + passed in. + (pinfo::pinfo): New constructor for setting up a pinfo passed in by + previous exec'or. + (pinfo::proc_waiter): Don't handle subprocess if we're in the process + of exiting due to an exec of a cygwin process. Don't close + rd_proc_pipe here. Close it when we actually are finished with the + process. Use new ch_spawn.signal_myself_exited function to let exec + stub know that subprocess has exited. + (pinfo::wait): Clarify debugging output. + (pinfo::release): Use "close_h" to close all handles to avoid races. + (winpids::add): Assume that elements of the array do not need to be + zeroed and are properly initialized or suffer problems on + pinfo::release. Don't close hProcess since release does that now. + * pinfo.h: Update comment. + (pinfo_minimal): Move some elements from pinfo here so that + child_info_spawn can use them. + (pinfo): Inherit from pinfo_minimal. + (pinfo::pinfo): Modify to accommodate new pinfo_minimal. + (pinfo::allow_remove): New function. + * sigproc.cc (proc_subproc): Use boolean values for true/false. + Implement PROC_EXEC_CLEANUP. + (proc_terminate): Set ppid = 1 since the procs list will only be + iterated when the process has not execed. Don't do any cleanup here + since it is now handled in pinfo::release. + (sigproc_init): Initialize sync_proc_subproc earlier. + (child_info::child_info): Assume that all important fields are properly + initialized and avoid memset(). + (child_info_spawn::child_info_spawn): Specifically test for execing and + then set up appropriate fields in the struct. + (child_info_spawn::cleanup): Define new function. + (child_info_spawn::record_children): Specifically test for being execed + here. Fill in pinfo_minimal part of children array. + (child_info_spawn::reattach_children): Use constructor to duplicate + information for previous exec'or. Add more debugging output. + (remove_proc): Force deletion of thread when exiting due to exec. Rely + on pinfo::cleanup in release. + * sigproc.h (PROC_EXEC_CLEANUP): New enum. + (PROC_DETACHED_CHILD): Delete. + * spawn.cc (chExeced): Delete. + (child_info_spawn::worker): Rename from spawn_guts. Use elements of + child_info_spawn throughout rather than ch.whatever. Use ::cygheap to + refer to global rather than element of child_info. Use + wait_for_myself() rather than waitpid(). Call + child_info_spawn::cleanup on function return. + (spawnve): Reflect movement of spawn_guts functionality into + child_info_spawn::worker. + * syscalls.cc (popen): Ditto. + * winsup.h (spawn_guts): Delete declaration. + +2011-11-08 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (std-gnu): Add ptsname_r. + +2011-11-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (__ptsname): New macro. + * dtable.cc (decode_tty): Use __ptsname to generate the slave pty name. + * fhandler_tty.cc (fhandler_pty_master::ptsname_r): Ditto. + * bsdlib.cc: Add needed includes for openpty() changes. + (openpty): Use __ptsname to generate the slave pty name. Close slave + fd when aslave == NULL. + +2011-11-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * include/cygwin/stdlib.h: Update copyright. + +2011-11-07 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygwin.din (ptsname_r): Export. + * fhandler.cc (fhandler_base::ptsname_r): Define. + * fhandler.h (fhandler_base::ptsname): Delete. + (fhandler_base::ptsname_r): Declare. + (fhandler_pty_master::ptsname_r): Declare. + * fhandler_tty.cc (fhandler_pty_master::ptsname): Delete. + (fhandler_pty_master::ptsname_r): New reentrant function derived from + previous ptsname. + * syscalls.cc (ptsname_r): Implement new function with functionality + similar to Linux. + (ptsname): Use ptsname_r () to fill out buf. + * include/cygwin/stdlib.h (ptsname_r): Declare. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 255 to + reflect export of ptsname_r. + + * pinfo.cc (pinfo::wait): Return bool rather than int. + * pinfo.h (info::wait): Ditto. + (pinfo::reattach): Define !defined(_SIGPROC_H) case for consistency. + * sigproc.cc (child_info_spawn::reattach_children): Use correct + dwProcessId rather than pid when duplicating handle. + +2011-11-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (CHUNK_SIZE): Drop NO_COPY. + +2011-11-07 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (check_dir_not_empty): Check surplus directory entries + by calling NtQueryAttributesFile. Make STATUS_DIRECTORY_NOT_EMPTY + return value dependent on its status code. Add long comment to explain. + (unlink_nt): Add comment to explain flaw in checking the sharing mode. + Set status to STATUS_SUCCESS instead of 0. Add a retry loop to setting + the delete disposition and trying to move a directory to bin to + workaround rare cases of lingering, already deleted subdirectory + entries. Add long comment to explain. + (rename): Set status to STATUS_SUCCESS instead of 0. + +2011-11-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pinfo.cc (status_exit): Recognize STATUS_ILLEGAL_INSTRUCTION. + (child_info::proc_retry): Ditto. + +2011-11-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pinfo.cc (status_exit): Return complete error code. Handle + STATUS_ACCESS_VIOLATION correctly. + (pinfo::set_exit_code): Set self->exitcode directly from status_exit. + +2011-11-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pinfo.h (pinfo::reattach): Only set destroy to false when + proc_subproc succeeds. Return true for success. + * sigproc.cc (child_info_spawn::reattach_children): Try harder to clean + up on error by detecting reattach failures too. + +2011-11-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (child_info_spawn::reattach_children): Clean up handle + when can't open parent process or suffer handle leak. + +2011-11-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (child_info::sync): Report on exit code in strace output. + (child_info::proc_retry): Don't consider STATUS_ACCESS_VIOLATION as a + restartable event. + +2011-11-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (child_info_spawn::reattach_children): Avoid issuing an + error when we can't duplicate from "parent" since it is probably ok if + children of the previous owner of the pid disappear. + +2011-11-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (off_current): Define local in fhandler_base::raw_write. + Drop erroneous NO_COPY, add _RDATA to make R/O. + (off_append): Ditto. + * globals.cc (_RDATA): Move definition from here... + * winsup.h: ...to here. + +2011-10-30 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (fhandler_pipe::create_selectable): Remove optional + argument, take an options argument for CreateNamedPipe/CreateFile. + Change handle arguments to expect pointers. + (fhandler_fifo::fifo_state): Delete. + (fhandler_fifo::dummy_client): Ditto. + (fhandler_fifo::open_nonserver): Ditto. + (fhandler_fifo::wait_state): Ditto. + (fhandler_fifo::raw_write): Ditto. + (fhandler_fifo::read_ready): New field. + (fhandler_fifo::write_ready): Ditto. + (fhandler_fifo::wait): Modify argument. + (fhandler_fifo::fifo_name): Add a new argument. + (fhandler_fifo::fixup_after_fork): New function. + * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Remove + initialization of expunged elements. Initialize new handles to NULL. + (fhandler_fifo::open_nonserver): Delete. + (fnevent): New macro for creating a named event. + (fnpipe): New macro for creating a unique named pipe name. + (create_pipe): New macro for simplification of named pipe creation. + (fhandler_fifo::fifo_name): Use new argument when creating a shared + name. + (fhandler_fifo::open): Rewrite. Use events to synchronize. + (fhandler_fifo::wait): Rewrite to wait for new fifo events which are + supplied as a parameter. + (fhandler_fifo::raw_read): Rewrite to use handle mechanism to detect + client-side disconnect. + (fhandler_fifo::raw_write): Delete. + (fhandler_fifo::close): Remove accommodations for expunged fields. + Close event handles. + (fhandler_fifo::dup): Remove accommodations for expunged fields. + Duplicate event handles. + (fhandler_fifo::fixup_after_fork): New function. Perform fixups on + event handles. + (fhandler_fifo::set_close_on_exec): Remove accommodations for expunged + fields. Set inheritance for new handle fields. + * miscfuncs.cc (CreatePipeOverlapped): Accommodate changes in + fhandler_pipe::create_selectable. + * tty.cc (tty::not_allocated): Ditto. + * pipe.cc (fhandler_pipe::create): Ditto. + (fhandler_pipe::create_selectable): Accept an extra open_mode argument. + Pass arguments by reference and allow opening one end of the pipe at a + time. + + * sys/strace.h (debug_only_printf): Define new macro which calls + debug_printf only when DEBUGGING is defined. + +2011-10-28 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (sigpacket::process): Avoid a potential deadlock when + exiting due to a signal. + +2011-10-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (getgrouplist): Export. + * grp.cc (get_groups): New static function to run the core functionality + of initgroups and getgrouplist. + (initgroups32): Call get_groups and just create supplementary group + list in cygheap. Rename name of first argument to "user". Add an + assertion to test for a NULL user name. + (initgroups): Rename name of first argument to "user". + (getgrouplist): New function. + * posix.sgml (std-bsd): Add getgrouplist. + * include/cygwin/grp.h (getgrouplist): Declare. + * include/cygwin/version.h: Bump API minor number. + +2011-10-25 Christopher Faylor <me.cygwin2011@cgf.cx> + + * child_info.h (cchildren): New struct. + (child_info_spawn::nchildren): Rename from nprocs. + (child_info_spawn::children): Change type to cchildren for more + bookkeeping possibilities. + (child_info_spawn::child_info_spawn): Clear nchildren. + (child_info_spawn::record_children): Declare new function. + (child_info_spawn::reattach_children): Ditto. + * dcrt0.cc (child_info_spawn::handle_spawn): Call reattach_children to + gather list of processes we are potentially waiting for. + * pinfo.h (pinfo::pinfo): Make sure that rd_proc_pipe is always cleared. + (pinfo::reattach): New function. + * sigproc.cc: Move pinfo.h earlier so that it can be used in sigproc.h. + (get_proc_lock): Don't bother with a lock during DLL initialization. + (proc_subproc): Handle PROC_REATTACH_CHILD. + (proc_terminate): Orphan children only when we are not an execed + process or when the pid is about to be occupied by a non-cygwin + process. + (child_info_spawn::record_children): Define new function. + (child_info_spawn::reattach_children): Ditto. + * sigproc.h (procstuff): Define PROC_REATTACH_CHILD and renumber other + elements. + * spawn.cc (spawn_guts): Record any to-be-waited-for subprocesses if + about to exec a cygwin process. + + * sigproc.cc (sig_send): Fix harmless transposition of fifth and six + arguments to DuplicateHandle(). + (child_info::child_info): Ditto. + + * globals.cc (hExeced): Make NO_COPY. + +2011-10-25 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (hook_or_detect_cygwin): Take additional handle + to a file mapping as parameter. If this handle is not NULL, + create another file mapping for the IAT. + * spawn.cc (av::fixup): Only map the first 64K of an image and + keep the mapping handle to use as argument to hook_or_detect_cygwin. + * winsup.h (hook_or_detect_cygwin): Add mapping handle as default + parameter in declaration. + +2011-10-24 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (unlink_nt): Fix a bug which overwrites the NT status + value in case setting the delete disposition returns with + STATUS_DIRECTORY_NOT_EMPTY. + +2011-10-24 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (open_shared): Fix memory reservation of essential shared + memory regions. Drop delta computations since delta is always 0 in + non-relocated case. Add a comment. + +2011-10-23 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_slave::read): Use consistent way for + testing ReadFile return. + * pipe.cc (fhandler_pipe::create_selectable): Open the write side of + the pipe in message-mode to force writing as "chunks". Explain why. + +2011-10-23 Christopher Faylor <me.cygwin2011@cgf.cx> + + * path.cc (path_conv::get_nt_native_path): Avoid dereferencing path + when it is NULL. + +2011-10-21 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dtable.cc (dtable::delete_archetype): Improve debugging output. + (dtable::init_std_file_from_handle): Close console handle early, before + initialization. Build up openflags for passing to open_setup, just to + be safe. + (last_tty_dev): New variable. + (fh_last_tty_dev): New macro. + (fh_alloc): Try again to keep track of previously opened tty, this time + by just saving the device and using that to potentially open an + archetype. Avoid setting the "/dev/tty" name if the creation of the + fhandler failed. + (build_fh_pc): Remove unused second argument. Reorganize how and where + the name is set. Set last_tty_dev as appropriate. Avoid a NULL + dereference in a debug printf. + * dtable.h (build_fh_pc): Reflect removal of second parameter. + * fhandler.cc (fhandler_base::reset): Use new '<<' operator to copy pc + since it preserves any potentially previously set name. + (fhandler_base::set_name): Ditto. + * fhandler.h (fhandler_*::clone): Throughout use ccalloc to allocate + new fhandler, primarily to make sure that pc field is properly zeroed. + (fhandler_termios::last): Eliminate. + (fhandler_termios): Remove setting of last. + (fhandler_base::~fhandler_termios): Ditto. + * fhandler_console.cc (fhandler_console::open): Don't make decisions + about opening close-on-exec handles here since it makes no sense for + archetypes. + (fhandler_console::init): Assume that input handle has already been + opened. + * fhandler_termios.cc (fhandler_termios::last): Delete. + * path.h (path_conv::eq_worker): New function. Move bulk of operator = + here. + (operator <<): New function. + (operator =): Use eq_worker to perform old functionality. + + * child_info.h (NPROCS): Move here from sigproc.cc. + (child_info::nprocs): New field. Not used yet. + (child_info::children):: Ditto. + +2011-10-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Check invalid + success only on Samba shares. + * mount.cc (fs_info::update): Drop has_buggy_basic_info flag for + NcFsd. + * syscalls.cc (unlink_nt): Fix typo in comment. + +2011-10-21 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (ro_u_ncfsd): New R/O unicode string. + * mount.cc (fs_info::update): Check for "NcFsd" FS. Set flags and + change comments accordingly. + (fs_names): Add entry for NcFsd FS. + * mount.h (enum fs_info_type): Add ncfsd. + (class fs_info): Add ncfsd flag and accessor methods. + * path.h (class path_conv): Add fs_is_ncfsd method. + * syscalls.cc (unlink_nt): Experimentally try delete-on-close on NcFsd + in STATUS_CANNOT_DELETE case. + +2011-10-20 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (fhandler*::copyto): Free path_conv strings first. + * path.h (cfree_and_null): Rename and expand from cfree_maybe. + (path_conv &operator =): Call free_strings rather than freeing strings + directly. + +2011-10-20 Christopher Faylor <me.cygwin2011@cgf.cx> + + Throughout change TTY_* to PTY_*, tty_* to pty_*, and ttym_* to ptmx_*. + * devices.cc: Regenerate. + * dtable.cc: (fh_alloc): Preserve /dev/tty name when that's what we + opened. + (build_fh_pc): Preserve any existing name. + * fhandler.cc (fhandler_base::open_with_arch): Ditto. + * fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Force the + name to /dev/ptmx while preserving other pty master device information. + * path.h (cfree_maybe): New macro. + (path_conv::operator =): Free any allocated strings in target. + (path_conv::free_strings): Delete unused function. + + * sigproc.cc (proc_terminate): Remove previous accommodation for execed + processes since it didn't have the desired effect. Change comment to a + FIXME. + + * spawn.cc (chExeced): Mark NO_COPY. + (exe_suffixes): Ditto. + +2011-10-20 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Improve debug output. + (check_dir_not_empty): Take additional path_conv argument. Improve + debug output. Change syscall_printf to debug_printf. + (unlink_nt): Improve debug output. Change syscall_printf to + debug_printf. + (unlink): Change syscall_printf to debug_printf. + + * cygthread.h: Fix copyright dates. + +2011-10-18 Corinna Vinschen <corinna@vinschen.de> + + * path.cc: Extend two comments. Mention the name RtlpCurDirRef + for reference. + +2011-10-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Copy argv before passing to main(). + +2011-10-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (proc_terminate): Avoid setting ppid to 1 if we're execing. + +2011-10-15 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygerrno.h (__set_errno): Modify debugging output to make searching + strace logs easier. + + Throughout, change /dev/tty* to /dev/pty*. + Throughout, add flags argument to fhandler_*::dup methods. + * devices.in: Rename (temporarily?) /dev/ttyN to /dev/ptyN. Add + /dev/ptymN devices for pty masters. + * devices.cc: Regenerate. + * devices.h (MAX_CONSOLES): Set to max number supported by devices.in. + (fh_devices::FH_PTMX): Rename from FH_PTYM. + (device::operator int): Return by reference. + * dtable.cc (fh_alloc): Take pc as an argument rather than just the + device. This makes debugging easier since more information is + available. Actually implement handling for already-allocated pty + master devices. Make different decisions when generating fhandler for + not-opened devices. Add kludge to deal with opening /dev/tty. + (cnew_no_ctor): New macro. + (build_fh_pc): Make debugging output more verbose. Use new clone() + fhandler interface to duplicate archetypes. Reset last term opened. + (dtable::dup_worker): Use Use new clone() fhandler interface to + duplicate archetypes. Pass flags to child dup handler. + (dtable::dup3): Set O_NOCTTY flag if newfd is not stdin/stdout/stderr. + * fhandler.cc (fhandler_base::reset): Rename from operator =() and + reduce functionality and sense of copy direction. + (fhandler_base::open_with_arch): Use published interface to query + io_handle(). Use new copyto() fhandler method to copy from/to found + archetype. + * fhandler.h: Throughout, delete size(), add copyout, clone, and + fhandler_* (void *) methods. + (fhandler_base::reset): Rename from operator =(). + (fhandler_termios::is_dev_tty): Delete. + (fhandler_termios): change "protected" region to "private". + (fhandler_termios::is_dev_tty): Delete. + (fhandler_termios): Rearrange protected/public. + (fhandler_termios::fhandler_termios): Remember last fhandler_termios + "opened". + (fhandler_termios::~fhandler_termios): Forget last fhandler_termios + opened. + (ioctl): Rename from ioctl_termios. Take a void * argument. Reflect + argument change in pinfo::set_ctty. + (fhandler_console::dup): Declare new function. Set ctty here if + appropriate. + (fhandler_pty_master::from_master): Privatize. + (fhandler_pty_master::to_master): Ditto. + (fhandler_pty_master::dwProcessId): Ditto. + (fhandler_pty_master::fhandler_pty_master): Add an `int' argument. + (fhandler_pty_master::open_setup): Declare new function. + (fhandler_pty_master::~fhandler_pty_master): Declare new method. + (fhandler_nodevice): Remove commented out function declaration. + * fhandler_console.cc: Use get_ttyp() instead of tc() throughout. + (fhandler_console::dup): Define new function to set controlling ctty on + dup, as appropriate. + (fhandler_console::ioctl): Reflect ioctl_termios name change. + (fhandler_console::setup): Rename from get_tty_stuff. + (fhandler_console::open_setup): Reflect argument change in + pinfo::set_ctty. + (fhandler_console::fhandler_console): Set _tc here. + * fhandler_termios.cc (handler_termios::ioctl): Rename. Take a void * + arg like other ioctl functions. + * fhandler_tty.cc (fhandler_pty_slave::dup): Call myself->set_ctty to + potentially reset the controlling terminal. + (fhandler_pty_slave::ioctl): Reflect name/arg change for ioctl_termios. + (fhandler_pty_slave::fhandler_pty_slave): Take a "unit" argument. Call + setup() here so that we will know the unit number of this fhandler as + soon as possible. Set the unit as appropriate. + (handler_pty_master::open): Move most stuff to constructor and + open_setup. + (handler_pty_slave::open_setup): Reflect argument change in + pinfo::set_ctty. + (handler_pty_master::open_setup): Define new function. + (fhandler_pty_master::cleanup): Clear handles as a flag that the + destructor does not have to do "close" operations. + (fhandler_pty_master::close): Ditto. + (fhandler_pty_master::~fhandler_pty_master): Define new method. + (fhandler_pty_master::ioctl): Reflect name/arg change for + ioctl_termios. + (fhandler_pty_master::setup): Allocate tty here. Rely on handles being + returned from allocated test rather than opening them here. Avoid + setting _need_nl here since it is already zeroed in the constructor. + Set up device information with DEV_TTYM_MAJOR. + * path.h (path_conv &operator =): Take a const argument. + (path_conv::dup): Ditto. + (pathconv_arg::PC_OPEN): New enum. + (pathconv_arg::PC_CTTY): Ditto. + (path_types::PATH_CTTY): Ditto. + (path_types::PATH_OPEN): Ditto. + (path_conv::isopen): New method. + (path_conv::isctty_capable): Ditto. + * path.cc (path_conv::check): Set PATH_OPEN and PATH_CTTY as + appropriate. + * pipe.cc (fhandler_pipe::open): Use copyto to copy pipe handle. + * syscall.cc (open): Reinstate fd > 2 check to disallow resetting ctty + on non-std* handles. + * tty.cc (tty_list::allocate): Pass out handles for allocated tty. use + `not_allocated' to find unallocated ttys. Avoid keeping the lock since + the allocation of the tty should be sufficient to prevent multiple + access. + (tty::not_allocated): Clarify comment. Rename. Return handles when an + unused tty is found. Simply test for existing tty. + (tty::exists): Rewrite to use `not_allocated'. + * tty.h (NTTYS): Reset down to actual number supported by devices.in. + (tty::not_allocated): Declare new function. + (tty_list::allocate): Pass out read/write tty handles. Zero them when + not found. + * fhandler_proc.cc: Reflect name change from FH_PTYM -> FH_PTMX. + * pinfo.h (pinfo::set_ctty): Reduce/reorder arguments passed in. + * pinfo.cc (pinfo::set_ctty): Ditto. Just use tc() built into the + passed-in fhandler_termios pointer. Return true if ctty is assigned. + * syscalls.cc (open): Call build_fh_pc with PC_OPEN flag. Set PC_CTTY + if appropriate. + (stat_worker): Remove is_dev_tty () stuff. + +2011-10-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (dos_drive_mappings::fixup_if_match): Convert + native NT network paths into DOS UNC paths. + +2011-10-15 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_token_group_sidlist): Add CONSOLE LOGON SID on + systems supporting it. Never add SERVICE SID but keep code in for + future reference. Explain why. + (get_priv_list): Add cygpsid pointer parameter. Point it to the + mandatory integrity SID which matches account and privileges. + (create_token): Fetch mandatory integrity SID from call to + get_priv_list. + (lsaauth): Call get_priv_list with additional NULL pointer. Change + comment accordingly. + * sec_helper.cc (well_known_console_logon_sid): New static SID. + (cygpriv): Change to structure containing extra flag to store info + about required integrity level. + (privilege_luid): Accommodate changes to cygpriv. Return integrity + level in new high_integrity parameter. + (privilege_name): Accommodate changes to cygpriv. + (set_privilege): Drop trailing \n from debug output. + (set_cygwin_privileges): Don't set SE_CREATE_GLOBAL_PRIVILEGE anymore + since it's just not needed, but keep code in for future reference. + Change comment accordingly. + * security.h (well_known_console_logon_sid): Declare. + (privilege_luid): Align declaration to above change. + * wincap.h (wincaps::has_console_logon_sid): New element. + * wincap.cc: Implement above element throughout. + +2011-10-13 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (find_fast_cwd_pointer): Allow 'push crit-sect-addr' instead + of 'mov edi, crit-sect-addr; push edi' and set rcall accordingly. + +2011-10-13 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (copy_cwd_str): Move up in file to be accessible from + class fcwd_access_t. + (class fcwd_access_t): New class to consolidate and hide the details + of the various FAST_CWD implementations. Add implementation for + Windows 8 Developer Preview. + (fast_cwd_version): Make static private member of fcwd_access_t. + (fast_cwd_ptr): Change base type to fcwd_access_t. + (find_fast_cwd_pointer): Return fcwd_access_t**. + (find_fast_cwd): Ditto. Rip out all FAST_CWD implementations and use + fcwd_access_t methods instead. + (cwdstuff::override_win32_cwd): Ditto. + +2011-10-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::cursor_set): Disable forcing + y to the current winBottom position. Explain why. + +2011-10-11 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygwin.din: Remove some _tc* exports. Add tcgetsid(). + * dtable.cc (fh_alloc): Revert ill-advised setting of major/minor. Use + new is_dev_tty to remember that this device was opened as /dev/tty. + * fhandler.cc (fhandler_base::fstat): Remove leftover debugging + statement. + (fhandler_base::tcgetsid): New function. + * fhandler.h ((fhandler_base::tcgetsid): Declare new function. + (fhandler_base::is_dev_tty): Ditto. + (fhandler_termios): Rearrange protected/public. + (fhandler_termios::fhandler_termios): Remember last fhandler_termios + "opened". + (fhandler_termios::~fhandler_termios): Forget last fhandler_termios + opened. + (fhandler_termios::opened_as_dev_tty): Declare new field. + (fhandler_termios::is_dev_tty): Declare new function. + (fhandler_termios::tcgetsid): Ditto. + (fhandler_pty_common::use_archetype): Move here from subclass. + (fhandler_pty_slave::use_archetype): Move up. + (fhandler_pty_master::use_archetype): Ditto. + * fhandler_console.cc (fhandler_console::ioctl): Rename second argument + from `buf' to `arg' for consistency. Call ioctl_termios for common + fhandler_termios ioctl handling. + * fhandler_tty.cc (fhandler_pty_slave::ioctl): Call ioctl_termios for + common fhandler_termios ioctl handling. + (fhandler_pty_master::ioctl): Ditto. + * fhandler_termios.cc (fhandler_termios::tcgetsid): Implement new + function. + (fhandler_termios::ioctl_termios): Ditto. Implements TIOCSCTTY + handling. + * syscalls.cc (stat_worker): Set /dev/tty device info when appropriate. + * termios.cc (tcgetpgrp): Avoid extraneous "isatty" check. + (tcgetsid): Implement new function. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 253. + * include/sys/termios.h (TIOCSCTTY): Define. + +2011-10-11 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dtable.cc (fh_alloc): Don't parse /dev/tty if ctty is < 0. Reset + major/minor from the specific tty to those for /dev/tty. + +2011-10-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * syscalls.cc (open): Add temporary kludge to avoid assigning the + controlling tty on open unless the open is for stdin/stdout/stderr. + * tty.cc (tty_list::connect): Set ENXIO when can't find a tty. + +2011-10-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_process::closedir): Declare. + * fhandler_process.cc (fhandler_process::closedir): New function to + avoid a SEGV in fhandler_proc::closedir. + +2011-10-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_slave::open): Clarify debugging output. + (fhandler_pty_slave::open): Change ENOENT to ENXIO when can't open a + tty. + +2011-10-07 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (fhandler_console::tc_getpgid): New function. + * spawn.cc (spawn_guts): Add logic to put pure-windows processes "in + the background" when they are started that way. + +2011-10-07 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h (cygwin_getinfo_types): Define values + additionally as preprocessor symbols. + +2011-10-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Send __SIGSETPGRP + pseudo signal to process group instead of just calling + init_console_handler. + * sigproc.cc (wait_sig): Call init_console_handler here on __SIGSETPGRP + signal. + * sigproc.h (__SIGSETPGRP): Define. + +2011-10-06 Christian Franke <franke@computer.org> + + * include/cygwin/wait.h: Use new __wait_status_to_int() + macro to access status value in W*() status checks. + Fix status description. + * include/sys/wait.h: Allow `int' and `union wait' as + wait status parameter. Change __wait_status_to_int() + macro and wait () prototypes accordingly. Add inline + functions for C++. Remove extra `;'. + +2011-10-05 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (create_winenv): Rename from sync_winenv. Take + environment pointer as parameter and return pointer to corresponding + win32 environment block if != NULL. Otherwise just sync as before. + (cygwin_internal): Add CW_CVT_ENV_TO_WINENV case. + * include/cygwin/version.h: Bump API minor number. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CVT_ENV_TO_WINENV. + +2011-10-04 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (socketpair): Bind first socket to loopback only as well. + +2011-09-21 Christopher Faylor <me.cygwin2011@cgf.cx> + + * tty.cc (grantpt): Check for valid fd. + (unlockpt): Ditto. + +2011-09-02 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getsockopt): Drop erroneous double conversion of error + code returned by SOL_SOCKET/SO_ERROR. Fix error handling. + +2011-09-01 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: Regenerate. + +2011-09-01 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (gfpod_helper): Helper function to search DLL using + a given DLL name. Change default search path to allow /usr/bin. + (get_full_path_of_dll): Find DLLs even if the caller used a ".so" + suffix or a "lib" prefix for the DLL. + +2011-08-31 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (inode_t::unlock_and_remove_if_unused): Rename from + unlock_and_remove. + +2011-08-29 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (LOCK_OBJ_NAME_LEN): Change to accommodate extra lf_ver + field. + (class lockf_t): Add lf_ver field. + (lockf_t::lockf_t): Initialize lf_ver to 0. + (class inode_t): Change i_wait to i_cnt. Change comment to explain + change in usage. + (inode_t:use): Rename from wait. Make private. + (inode_t::unuse): Rename from unwait. Make private. + (inode_t::inuse): Rename from waiting. Make private. + (inode_t::notused): New public method to set use count to 0. + (inode_t::unlock_and_remove): New method to unlock node and to delete + it if it's unused in current process. + (fhandler_base::del_my_locks): Drop global list lock. Drop variable + no_locks_left. Simpify unlocking and removing node by just calling + unlock_and_remove. + (fixup_lockf_after_exec): Call notused method for each node. + (inode_t::get): Call use method. Lock node only if outside of list + lock. + (inode_t::get_all_locks_list): Accommodate additional lf_ver field + when creating lockf_t structure from object name. + (lockf_t::create_lock_obj_attr): Accommodate additional lf_ver field + when creating object name from lockf_t structure. Handle + STATUS_OBJECT_NAME_COLLISION gracefully in F_POSIX case as well. + Change comment accordingly. Increment lf_ver field rather than high + byte of lf_wid field. Simplify comment. + (fhandler_disk_file::lock): Always call unlock_and_remove rather than + just UNLOCK on node. + (lf_setlock): Move ret definition where it's used. Drop unneeded + tests for obj being not NULL. Only check for deadlock condition if the + lock we're trying to establish is a POSIX lock. Revamp object + collecting and wait code to cover all cases. Don't return with EDEADLK + if blocking process can't be opened for synchronization in F_POSIX case, + rather just wait like in F_FLOCK case. Change system_printf to + debug_printf in that case. Only run WaitForMultipleObjects with high + priority. Close obj and process handles prior to locking node. + +2011-08-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Fix typo in comment. + (fhandler_base::close): Move call to del_my_locks from here... + * fhandler_disk_file.cc (fhandler_disk_file::open): ...to here. + * flock.cc (struct lockfattr_t): New type. + (lockf_t::close_lock_obj): New method, use throughout. + (lockf_t::create_lock_obj_attr): New method. + (lockf_t::create_lock_obj): Use create_lock_obj_attr method. Handle + STATUS_OBJECT_NAME_COLLISION in F_FLOCK case gracefully. Add lengthy + comments to explain why and how. + (lockf_t::open_lock_obj): Use create_lock_obj_attr method. + (lockf_t::del_lock_obj): Call NtSetEvent rather than SetEvent for + symmetry. + (fhandler_disk_file::lock): Define n only where it's used. Call + need_fork_fixup only if call was successful. Handle EINTR and + ECANCELED return values from lf_setlock. + (lf_setlock): Drop WAIT_UNLOCKED and WAIT_PROC_EXITED. Don't wait + for event object handle count to become <= 1 in F_LOCK case. + Simplify WFMO return value handling. Don't handle signal and cancel + events here; just return with appropriate error code instead. + (lf_getblock): Ignore locks for which the handle can't be opened. + Use IsEventSignalled. + * ntdll.h (STATUS_INVALID_INFO_CLASS): Undef if defined elsewhere to + make sure the definition is casted to NTSTATUS. + (STATUS_INVALID_HANDLE): Define and ditto. + (STATUS_OBJECT_NAME_COLLISION): Define. + (NtSetEvent): Declare. + +2011-08-25 Rafal Zwierz <rzwierz@googlemail.com> + + * cygthread.cc (cygthread::simplestub): Notify that the thread has + detached also in freerange thread case. + +2011-08-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Never open files with + FILE_OVERWITE/FILE_OVERWRITE_IF. Set file size to 0 explicitely if + regular, existing file has been opened for writing with O_TRUNC flag + set. Explain why. + +2011-08-24 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::pthread): Drop setting parent_tls. Call + sigprocmask to copy parent thread signal mask into new parent_sigmask + member. + (pthread::thread_init_wrapper): Copy _my_tls.sigmask from new + parent_sigmask member. + * thread.h (class pthread): Drop parent_tls. Add parent_sigmask. + +2011-08-24 Christopher Faylor <me.cygwin2011@cgf.cx> + + * thread.cc (pthread::exit): Create dummy tls structure to hold + _main_tls contents if we've asked _main_tls to exit. + +2011-08-23 Corinna Vinschen <corinna@vinschen.de> + + * poll.cc (poll): Don't return prematurely if invalid fds have been + encountered. Enforce timeout set to 0 in case of invalid fds. Take + number of invalid fds into account when returning. + +2011-08-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::send_internal): Fix setting + nosignal flag. Convert ECONNABORTED on connection-oriented socket + to EPIPE, too. + +2011-08-21 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dtable.cc (conv_start_chars): Remove unneeded section attribute. + +2011-08-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/paths.h (_PATH_MAILDIR): Define. + (_PATH_SHELLS): Define. + +2011-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (format_process_maps): Define page protection + shortcuts RO, X, and WC. Use in creating access flag string. Don't + set type flag to 's' for copy-on-write pages, as on Linux. + +2011-08-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * devices.h (fh_devices): Define DEV_MISC_MAJOR, DEV_MEM_MAJOR, + DEV_SOUND_MAJOR. Use throughout. + * fhandler_proc.cc (proc_tab): Add /proc/devices and /proc/misc + virtual files. + (format_proc_devices): New function. + (format_proc_misc): New function. + +2011-08-19 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dtable.cc: Mark some const variables as static. + * environ.cc (conv_start_chars): Move to shared cygwin region and + initialize at compile time. + (match_first_char): New generic function for querying conv_start_chars. + (posify_maybe): Rename from posify. + (environ_init): Remove conv_envvars initialization. Don't check + conv_start_chars, just allow posify_maybe to make the decision. + * fhandler_console.cc (__vt100_conv): Fix formatting. Mark as const. + +2011-08-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Recognize backspace key + using the device independent key code, rather than the device dependent + scan code. + +2011-08-18 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dcrt0.cc (dll_crt0_0): Remove unneeded __stdcall decoration. + * init.cc: Reflect change to dll_crt0_0 in declaration. + +2011-08-18 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::get_debugger_info): Add missing braces. + (dtable::stdio_init): Fix incorrect negation of not_open(2) condition. + +2011-08-16 Pierre Humblet <Pierre.Humblet@ieee.org> + + * net.cc (gethostby_helper): Remove DEBUGGING code from and + streamline the second pass. + +2011-08-16 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (dlopen): Reimplement RTLD_NODELETE for Windows 2000 using + internal datastructures. Explain the code. + * ntdll.h (struct _LDR_DATA_TABLE_ENTRY): Define. + (struct _PEB_LDR_DATA): Define. + (struct _PEB): Change PVOID LoaderData to PPEB_LDR_DATA Ldr. + + * fhandler_process.cc (format_process_maps): Call NtQueryVirtualMemory + with valid return length pointer. Explain why. + +2011-08-16 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-08-16 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetModuleHandleExW): Define. + * dlfcn.cc: Throughout mark exported symbols as extern "C". + (dlopen): Unignore flags argument. Define ret to NULL. Fix typo in + comment. Support Glibc flags RTLD_NOLOAD and RTLD_NODELETE. + * include/dlfcn.h: Clean up comments. + (RTLD_NODELETE): Define. + (RTLD_NOLOAD): Define. + (RTLD_DEEPBIND): Define. + +2011-08-15 Corinna Vinschen <corinna@vinschen.de> + + * pipe.cc (pipe): Just call _pipe with O_BINARY mode. Move code to + generate normalized pathnames from here... + (_pipe): ...to here. + +2011-08-13 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (CreatePipeOverlapped): New function. + (ReadPipeOverlapped): Ditto. + (WritePipeOverlapped): Ditto. + * miscfuncs.h: Declare new functions. + * pinfo.cc (commune_process): Call WritePipeOverlapped instead of + WriteFile. Set timeout to 1 sec. + (_pinfo::commune_request): Call ReadPipeOverlapped instead of ReadFile. + Set timeout to 0.5 secs. + * sigproc.cc (sig_send): Create pipe using CreatePipeOverlapped. + +2011-08-12 Christopher Faylor <me.cygwin2011@cgf.cx> + + * miscfuncs.cc (create_pipe): Delete obsolete function. + * miscfuncs.h (create_pipe): Delete define. + + * pipe.c (fhandler_pipe::create_selectable): Delete obsolete comment. + +2011-08-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (fhandler_proc::closedir): Don't free, but delete + instead. + +2011-08-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_proc::opendir): Declare. + (fhandler_proc::closedir): Declare. + * fhandler_proc.cc (fhandler_proc::opendir): New method. Fetch list + of active processes here once to avoid potential duplicates and store + in dir->__handle. + (fhandler_proc::closedir): New method. Free dir->__handle. + (fhandler_proc::readdir): Convert pinfo into a reference to the winpids + entry in dir->__handle. + +2011-08-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Don't allow to + access process info by using the Windows PID. + * fhandler_process.cc (fhandler_process::fstat): Ditto. + (fhandler_process::fill_filebuf): Ditto. + +2011-08-11 Corinna Vinschen <corinna@vinschen.de> + + * (winpids::add): Make sure to store always a Windows PID in + pidlist, even if pid is a Cygwin PID. + (winpids::enum_processes): Fetch Cygwin processes from listing of + shared cygwin object dir in the native NT namespace. Only if winpid + is true, fetch Windows processes using an additional call to + NtQuerySystemInformation. + +2011-08-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (format_process_status): Always print process name + even for zombies. + (get_mem_values): Fix loop fetching working set list to avoid out of + memory conditions. Return all mem values set to 0 for zombies. + * ntdll.h (STATUS_PROCESS_IS_TERMINATING): Define. + +2011-08-09 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (eval_initial_heap_size): New function fetching the heap + size from the LoaderFlags field in the PE/COFF header. + (heap_init): Call eval_initial_heap_size rather than + cygwin_shared->heap_chunk_size to fetch the initial heap size. + * shared.cc (shared_info::heap_chunk_size): Remove. + * shared_info.h (class shared_info): Drop heap_chunk member. + (CURR_SHARED_MAGIC): Update. + +2011-08-09 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_NOT_FOUND): Define. + * ntea.cc (read_ea): Return correct ENOTSUP rather than EOPNOTSUPP. + Handle STATUS_INVALID_DEVICE_REQUEST and STATUS_NOT_FOUND. Explain + why. Convert conditional to switch statement. + (write_ea): Return correct ENOTSUP rather than EOPNOTSUPP. Handle + STATUS_INVALID_DEVICE_REQUEST. Convert conditional to switch statement. + +2011-08-07 Corinna Vinschen <corinna@vinschen.de> + + * resource.cc (getrlimit): Just return RLIM_INFINITY in a request for + RLIMIT_AS. + +2011-08-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (format_process_maps): Actually print info about + the application heap of the printed process, not of the current process. + +2011-08-04 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (socketpair): Release sb0 if there's no space left for sb1. + +2011-08-03 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (clock_nanosleep): Export. + * posix.sgml (std-notimpl): Move clock_nanosleep from here... + (std-susv4): ... to here. + (std-notes): Note limitations of clock_nanosleep. + * signal.cc (clock_nanosleep): Renamed from nanosleep, adding clock_id + and flags arguments and changing return values throughout. + Improve checks for illegal rqtp values. Add support for + CLOCK_MONOTONIC and TIMER_ABSTIME. + (nanosleep): Rewrite in terms of clock_nanosleep. + (sleep): Ditto. + (usleep): Ditto. + * thread.cc: Mark clock_nanosleep in list of cancellation points. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-08-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc: Use fabort in favor of api_fatal and fork_info->abort + where appropriate throughout. + (fabort): Define. + (dll_list::topsort): Don't print sorting information. Fix formatting. + (dll_list::topsort_visit): Fix formatting. + (dll_list::load_after_fork_impl): Perform comment fixups. + * sigproc.cc (child_info_fork::abort): (for now?) Always print cause of + fork failure. + * include/sys/strace.h (strace_vprintf): Remove _STRACE_NOTALL when + printing. We really do want to see this. + +2011-08-03 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygtls.h (struct _local_storage): Add cw_timer member. + * cygtls.cc (_cygtls::init_thread): Initialize locals.cw_timer. + (_cygtls::fixup_after_fork): Ditto. + * tlsoffsets.h: Regenerate. + * ntdll.h (enum _TIMER_INFORMATION_CLASS): Define. + (struct _TIMER_BASIC_INFORMATION): Define. + (NtQueryTimer): Declare function. + * thread.h (cancelable_wait): Change timeout argument to + PLARGE_INTEGER and provide NULL default. + (fast_mutex::lock): Adjust accordingly. + (pthread_cond::wait): Change timeout argument to PLARGE_INTEGER + and default to NULL. + * thread.cc (cancelable_wait): Change timeout argument to + PLARGE_INTEGER. Initialize _cygtls.locals.cw_timer if needed. + Use NT waitable timers for handling timeout. Return remaining time + to timeout argument if timeout was relative. + (pthread_cond::wait): Change timeout argument to PLARGE_INTEGER. + Adjust to change in cancelable_wait. + (pthread_mutex::lock): Adjust to change in cancelable_wait. + (pthread_spinlock::lock): Ditto. + (pthread::join): Ditto. + (__pthread_cond_dowait): Change waitlength argument to PLARGE_INTEGER. + Adjust to changes in cancelable_wait and pthread_cond::wait. + (pthread_cond_timedwait): Adjust to change in __pthread_cond_dowait. + (pthread_cond_wait): Ditto. + (semaphore::_timedwait): Adjust to change in cancelable_wait. + (semaphore::_wait): Ditto. + * exceptions.cc (handle_sigsuspend): Ditto. + * signal.cc (nanosleep): Ditto. + * wait.cc (wait4): Ditto. Fix copyright dates. + * times.cc (FACTOR, NSPERSEC): Move from here... + * hires.h (FACTOR, NSPERSEC): ...to here. + +2011-08-01 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (faccessat): Fix parens in flag expression when calling + build_fh_name. + + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Fix typo in + comment. + * fhandler_socket.cc (fhandler_socket::bind): Ditto. + * path.cc (symlink_worker): Ditto. + +2011-07-31 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc (dll_list::load_after_fork_impl): Add a hint to an error + message. + +2011-07-31 Christopher Faylor <me.cygwin2011@cgf.cx> + + * sigproc.cc (pending_signals::pending): Define new function. + (sig_dispatch_pending): Avoid calling sig_send if there are no pending + signals. + +2011-07-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_mem): Remove dup method declaration. + * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Accommodate the + fact that the entire fhandler gets copied over to the child in + operator =. + * fhandler_floppy.cc (fhandler_dev_floppy::dup): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::dup): Ditto. + * fhandler_serial.cc (fhandler_serial::dup): Ditto. + * fhandler_socket.cc (fhandler_socket::dup): Ditto. + * fhandler_virtual.cc (fhandler_virtual::dup): Ditto. + * fhandler_mem.cc (fhandler_dev_mem::dup): Ditto. Remove entirely. + +2011-07-30 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygthread.cc (cygthread::async_create): Define new function. + * cygthread.h (cygthread::create): Use correct regparm. + (cygthread::standalone): Delete from class and from all constructors. + (cygthread::cygthread): Use three only arguments for detached threads, + (cygthread::async_create): Declare. + and start the thread via QueueUserAPC/async_create. + * dcrt0.cc (dll_crt0_0): Remove handling for + wincap.has_buggy_thread_startup. + (dll_crt0_1): Ditto. + * wincap.cc: Ditto throughout. + * wincap.h: Ditto. + +2011-07-30 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (fhandler_base_overlapped::size): Declare/define size() + function for consistency. + (fhandler_termios::size): Ditto. + (fhandler_pty_common::size): Ditto. + +2011-07-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (fhandler_registry::dup): Duplicate value_name. + +2011-07-29 Corinna Vinschen <corinna@vinschen.de> + + Throughout change "WinSock" to "Winsock" in comments. + * fhandler_socket.cc (fhandler_socket::sendmsg): Add missing call to + get_inet_addr to convert AF_LOCAL to AF_INET sockets. + * net.cc (cygwin_socket): Workaround UDP Winsock problem. Add comment + to explain why. + * select.cc: Include winsock2.h rather than winsock.h. + +2011-07-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (__DIR_mounts::eval_ino): Create path_conv + with PC_KEEP_HANDLE flag. + * path.h (path_conv::operator =): Duplicate UNICODE path as well. + * security.cc (check_file_access): Use path_conv handle if available. + * syscalls.cc (access): Create fhandler with PC_KEEP_HANDLE flag set. + (euidaccess): Ditto. + (faccessat): Ditto. + +2011-07-26 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: Fix typo in comment. + * path.cc: Ditto. + +2011-07-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::ioctl): Fetch console events + using PeekConsoleInput and return only key down events in buf. + * fhandler_tty.cc (fhandler_pty_slave::ioctl): Always return EINVAL + if PeekNamedPipe fails. + (fhandler_pty_master::ioctl): Ditto. + +2011-07-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_slave::ioctl): Drop FIONBIO case. + Handle FIONREAD. + (fhandler_pty_master::ioctl): Ditto. Call fhandler_base::ioctl to + decode default condition. + * fhandler_console.cc (fhandler_console::ioctl): Handle FIONREAD. + +2011-07-21 Christopher Faylor <me.cygwin2011@cgf.cx> + Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc: Add #include for asm/socket.h for dealing with FIONREAD. + (fhandler_base::ioctl): Special-case errno for FIONREAD. + * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Rename parameter for + consistency. Call fhandler_base::ioctl to decode default condition. + * fhandler_serial.cc (fhandler_serial::ioctl): Ditto. + * fhandler_tty.cc (fhandler_pty_slave::ioctl): Call + fhandler_base::ioctl to decode default condition. + * fhandler_windows.cc (fhandler_windows::ioctl): Ditto. + +2011-07-21 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (eval_start_address): Simplify test for large address + awareness of executable, which works for 32 and 64 bit systems. + Change comment accordingly. + +2011-07-21 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (eval_start_address): New static function to evaluate the + best start address for the application heap. + (heap_init): Call eval_start_address to fetch the start value for + start_address. Move preceeding comment to eval_start_address. + +2011-07-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (pthread_condattr_getclock): Export. + (pthread_condattr_setclock): Export. + * posix.sgml (std-notimpl): Move pthread_condattr_getclock and + pthread_condattr_setclock from here... + (std-susv4): ... to here. + * sysconf.cc (sca): Set _SC_CLOCK_SELECTION to _POSIX_CLOCK_SELECTION. + * thread.cc: (pthread_condattr::pthread_condattr): Initialize clock_id. + (pthread_cond::pthread_cond): Initialize clock_id. + (pthread_cond_timedwait): Use clock_gettime() instead of gettimeofday() + in order to support all allowed clocks. + (pthread_condattr_getclock): New function. + (pthread_condattr_setclock): New function. + * thread.h (class pthread_condattr): Add clock_id member. + (class pthread_cond): Ditto. + * include/pthread.h: Remove obsolete comment. + (pthread_condattr_getclock): Declare. + (pthread_condattr_setclock): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-07-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * sysconf.cc (sca): Return -1 for _SC_THREAD_ROBUST_PRIO_INHERIT, + _SC_THREAD_ROBUST_PRIO_PROTECT, and _SC_XOPEN_UUCP. + (SC_MAX): Redefine accordingly. + (csa): Return strings for _CS_POSIX_V7_THREADS_CFLAGS, + _CS_POSIX_V7_THREADS_LDFLAGS, and _CS_V7_ENV. + (CS_MAX): Redefine accordingly. + * include/limits.h (LONG_BIT): Define. + (WORD_BIT): Define. + +2011-07-18 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (heap_init): Change type of largest_found to PVOID. Start + querying memory at 0x20000000. Use largest_found pointer when trying + to allocate largest free memory area found. + +2011-07-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::input_tcsetattr): Revert to + setting ENABLE_PROCESSED_INPUT depending on ISIG and IGNBRK. + (fhandler_console::tcgetattr): Set ISIG depending on + ENABLE_PROCESSED_INPUT as well. + +2011-07-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc (fhandler_serial::raw_read): Handle non-blocking + case more thoroughly. + +2011-07-13 Christopher Faylor <me.cygwin2011@cgf.cx> + + * setup_handler (setup_handler): Change break to goto out, missed in + 2011-07-06 changes. + +2011-07-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_slave::ioctl): Remove erroneous support + for TIOCLINUX for pty. Get rid of unneeded EINVAL handling in wake of + tty removal. Remove now-unneeded variable. + +2011-07-10 Corinna Vinschen <corinna@vinschen.de> + + * include/netdb.h (gethostbyname2): Declare. + +2011-07-09 Eric Blake <eblake@redhat.com> + + * signal.cc (handle_sigprocmask): Return error rather than setting + errno, for pthread_sigmask. + (sigprocmask): Adjust caller. + +2011-07-07 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (yield): Drop thread priority only once. + +2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (_cygtls::interrupt_now): Back out previous change + since it could theoretically cause a non-CTRL-C-able program if a + program has suffered memory corruption. + (setup_handler): Ditto. + +2011-07-06 Corinna Vinschen <corinna@vinschen.de> + + * sched.c (sched_yield): Just call SwitchToThread because yield now + potentially switches CPU. + +2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (_cygtls::interrupt_now): Don't check for spinning + here. + (setup_handler): Check for spinning here, assuming that it is + transitory and should not affect the retry loop. + +2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (CALL_HANDLER_RETRY_INNER): Rename to reflect different + functionality. + (CALL_HANDLER_RETRY_OUTER): New define. + (setup_handler): Add outer loop to signal handler to try harder to + deliver the signal. + * miscfuncs.cc (yield): Drop priority and use SleepEx() to force thread + rescheduling rather than relying on SwitchToThread(). + +2011-07-06 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (wait_sig): Fix debug output. + +2011-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::input_tcsetattr): Make + ENABLE_PROCESSED_INPUT flag only depending on value of IGNBRK. + (fhandler_console::tcgetattr): Don't set ISIG depending on + ENABLE_PROCESSED_INPUT, set IGNBRK instead. + +2011-07-05 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_file_sd): Fix comment. + +2011-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Never create files with WRITE_DAC + access. Explain why. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Improve debug + output. + +2011-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Don't open file with WRITE_DAC + access on remote filesystem. Explain why. + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for + directories. + * fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets. + * path.cc (symlink_worker): Ditto for symlinks. + +2011-07-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * environ.cc (tty_is_gone): Wrap warning at 80 characters. + +2011-07-04 Corinna Vinschen <corinna@vinschen.de> + + Throughout, open console handles with sharing for reading and writing. + * dcrt0.cc (insert_file): Open file with full sharing allowed. + * hookapi.cc (find_first_notloaded_dll): Ditto. + * spawn.cc (av::fixup): Ditto. + +2011-07-04 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Change test for console + device in call to fh->init to avoid conhost crash on W7. + +2011-07-04 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (environ_init): Reinstantiate on-the-fly CYGWIN variable + test and call to parse_options if found. + +2011-07-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base::open_with_arch): Call close_on_exec last + to avoid setting close_on_exec for archetype. + * fhandler_tty.cc (fhandler_pty_master::setup): Protect {from,to}_pty + handles. Use consistent naming in debug output. Use inheritable + handles and... + (fhandler_pty_master::fixup_after_fork): ...avoid duplicating handles + here. + (fhandler_pty_slave::open): Don't set close_on_exec flag here. + +2011-07-01 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dtable.cc (cnew): Fix whitespace. + +2011-07-01 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/param.h (NGROUPS): Redefine as NGROUPS_MAX. + (MAXHOSTNAMELEN): Redefine with same value as MAX_HOSTNAME_LEN. Change + comment. + (MAXPATHLEN): Improve comment. + (MAXSYMLINKS): Define and add comment. + +2011-07-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Move NFS-specific code into the + code block handling FH_FS stuff. + +2011-06-30 Ryan Johnson <ryan.johnson@cs.utoronto.ca> + + * dtable.cc (fh_oom): Remove. + (fh_calloc): Remove. + (cnew): Redefine to handle NULL returns from cmalloc. + (build_fh_name): Accommodate new definition of cnew. Remove unneeded + test for fh_oom. + (fh_alloc): Ditto. + +2011-06-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Add comment. + (fhandler_console::input_tcsetattr): Don't set ENABLE_PROCESSED_INPUT + if IGNBRK flag is set. + +2011-06-30 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (fh_oom): New static fhandler storage. + (fh_calloc): New static function. Add a comment to explain why this + is needed. + (cnew): Call fh_calloc as placement argument. + (build_fh_name): Check return code from cnew against address of + fh_oom to test for out of memory condition. + (fh_alloc): Ditto. + (build_fh_pc): Avoid a crash due to useing a NULL fhandler. + * pipe.cc (fhandler_pipe::create): Check if build_fh_dev returned a + valid pointer before using it. + +2011-06-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (heap_info::fill_if_match): Rename info to + note that this heap is a Windows heap. + (format_process_maps): Print info about application heap. + +2011-06-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Don't generate ^@ on + Ctrl+Alt+Space. + +2011-06-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_master::setup): Create pty pipes + non-inheritable. + +2011-06-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_master::setup): Fix crash in debug + output. + +2011-06-18 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (normalize_win32_path): Skip all slashes after recognizing + a ".." path component. Add comment. + +2011-06-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): Drop local create_options variable. + Use options member instead. + * fhandler.h (class fhandler_base): Change type of access member to + ACCESS_MASK. Change get_access and set_access methods accordingly. + Add options member. Add get_options and set_options methods. + (class fhandler_disk_file): Add prw_handle. + (fhandler_disk_file::prw_open): Declare. + (fhandler_disk_file::close): Declare. + (fhandler_disk_file::dup): Declare. + (fhandler_disk_file::fixup_after_fork): Declare. + * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file): + Initialize prw_handle to NULL. + (fhandler_disk_file::close): Close prw_handle. + (fhandler_disk_file::dup): New method. + (fhandler_disk_file::fixup_after_fork): Set prw_handle to NULL since + prw_handle is not inherited. + (fhandler_disk_file::prw_open): New method. Add long comment to + explain current behaviour. + (fhandler_disk_file::pread): Revert previous change. Change to use + prw_handle if possible. + (fhandler_disk_file::pwrite): Change to use prw_handle if possible. + +2011-06-17 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Call strace.dll_info after call to pinfo_init. + * strace.cc (strace::hello): Drop printing DLL information here since + application info is not always available at this point. + (strace::dll_info): New method to print DLL info. + * include/sys/strace.h (strace::dll_info): Declare. + +2011-06-17 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (handle_to_fn): Accommodate name change of pty named pipes, + otherwise ptys are not recognized. + +2011-06-16 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_console.cc (fhandler_console::set_unit): Set + pc.file_attributes() to reflect existence. + * fhandler.h (fhandler_pty_common::fhandler_pty_common): Ditto. + * pinfo.cc (_pinfo::set_ctty): Output device numbers in hex. + +2011-06-15 Christopher Faylor <me.cygwin2011@cgf.cx> + + * errno.cc (EIO): Lowercase "o" representative string. + +2011-06-14 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygheap.h (init_cygheap::ctty_on_hold): Remove conditionalized + variable. + * dcrt0.cc (do_exit): Remove code which handled CYGWIN=tty style ttys. + * devices.in: Remove "/dev/ttym". + * dtable.cc: Rename tty to pty where appropriate throughout. + (dtable::stdio_init): Use new t->is_console rather than using + now-deleted hwnd element in tty structure. + (dtable::init_std_file_from_handle): Remove code which handled + CYGWIN=tty style ttys. + (fh_alloc): Ditto. + * fhandler.h: Rename tty to pty where appropriate. + (fhandler_pty_common): Delete output_done_event, ioctl_request_event, + ioctl_done_event. + (fhandler_pty_master::setup): Delete argument. + (fhandler_tty_master): Delete. + (fhandler_union): Delete __tty_master. + * fhandler_console.cc (use_tty): Delete. + (fhandler_console::get_tty_stuff): Set is_console to true rather than + calling sethwnd. + (fhandler_console::send_winch_maybe): Remove CYGWIN=tty considerations. + (fhandler_console::input_tcsetattr): Ditto. + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Use new + t->is_console rather than using now-deleted hwnd element in tty + structure. + * fhandler_tty.cc: Rename tty to pty where appropriate throughout. + (tty_master): Delete. + (process_input): Ditto. + (process_output): Ditto. + (process_ioctl): Ditto. + (fhandler_tty_master::*): Ditto. + (fhandler_pty_master::process_slave_output): Remove CYGWIN=tty + considerations. + (fhandler_pty_slave::open): Ditto for *_done_event. + (fhandler_pty_slave::write): Ditto. + (fhandler_pty_slave::ioctl): Ditto. + (fhandler_pty_slave::fch_open_handles): Ditto. + (fhandler_pty_slave::fch_set_sd): Ditto. + (fhandler_pty_slave::fch_close_handles): Ditto. + (fhandler_pty_common::close): Ditto. + (fhandler_pty_master::setup): Ditto. Remove now-unneeded ispty + parameter. + (fhandler_pty_master::open): Reflect argument removal for + tty::allocate. + * select.cc: Rename tty to pty where appropriate throughout. + * sigproc.cc (proc_subproc): Remove CYGWIN=tty considerations. + * tty.cc (ttyslot): Accommodate CYGWIN=tty removal. + (tty_list::init_session): Ditto. + (tty_list::attach): Ditto. + (tty::create_master): Delete. + (tty_list::terminate): Ditto. + (tty_list::allocate): Delete "with_console" parameter. Remove + CYGWIN=tty considerations. + (tty::init): Set is_console = false. Use 'false' for was_opened since + it is a boolean. + * tty.h (*_{DONE,REQUEST}_EVENT): Delete. + (tty_min::is_console): Declare new field which replaces hwnd. + (tty_min::gethwnd): Delete. + (tty_min::sethwnd): Ditto. + (tty_list::allocate): Delete parameter. + (tty_list::terminate): Delete declaration. + * include/sys/cygwin.h (PID_USETTY): Redefine to PID_UNUSED1 and change + comment to reflect its availability. + +2011-06-13 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_tty_slave.cc (fhandler_tty_slave::fhandler_tty_slave): + Revert previous change since unit 0 is perfectly valid. + +2011-06-12 Christopher Faylor <me.cygwin2011@cgf.cx> + + Rename FH_BAD to FH_NADA throughout. + * devices.h (FH_ERROR): New value. + (iscons_dev): Extend to detect all the console device types. + * devices.in: Set aside storage for FH_ERROR. + * dtable.cc (dtable::init_std_file_from_handle): Use iscons_dev to + detect when device is a console. + (fh_alloc): Pass device to console constructor. + (build_fh_pc): Short circuit when we detect that the constructor saw an + error. + * fhandler.h (fhandler_console::fhandler_console): Accept fh_devices + parameter. + (get_tty_stuff): Change to void. + * fhandler_console (fhandler_console::set_unit): Set device to FH_ERROR + on attempt to access anything other than the current console. + (fhandler_console::get_tty_stuff): Change to void return. + (fhandler_console::open): Return EPERM on FH_ERROR device type. + (fhandler_console::fhandler_console): Set the device type appropriately + before calling get_tty_stuff and rely on that function to reset it if + necessary. + +2011-06-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * environ.cc (create_upcaseenv): Delete. + (ucenv): Don't honor create_upcaseenv. + (environ_init): Remove early retrieval of CYGWIN environment variable. + Change comment to reflect new behavior. + +2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. + (child_info::old_title): Delete. + (child_info::~child_info_spawn): Remove recording of old_title. + * dcrt0.cc (title_buf): Delete. + (child_info_spawn::handle_spawn): Remove recording of old_title. + (dll_crt0_1): Get rid of all title handling. + (do_exit): Ditto. + * environ.cc (known): Delete strip_title and title. + * fhandler_console.cc (fhandler_console::write): Remove recording of + old_title. + * globals.cc (exit_states): Remove ES_TITLE. + (display_title): Delete. + (strip_title_path): Delete. + (old_title): Delete. + * spawn.cc (spawn_guts): Remove old_title accommodation. + +2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * environ.cc (envcache): Delete. + (known): Remove envcache. + (getwinenv): Don't honor envcache setting. + +2011-06-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * environ.c: Move code earlier to allow: + (_addenv): Call parse_options() when CYGWIN environment variable is + being changed. + (parse_options): Change parameter to 'const'. + +2011-06-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * environ.cc (tty_is_gone): Add missing space to message. + +2011-06-08 Christopher Faylor <me.cygwin2011@cgf.cx> + + * environ.cc (settings::set_process_state): Delete. + (tty_is_gone): New function. + (known): Change "tty" to call tty_is_gone(). Remove unneeded '&' from + beginning of function address. + (parse_options): Remove set_process_state handling. + * shared_info.h (CURR_USER_MAGIC): Reset. + (user_info::warned_notty): New member. + +2011-06-07 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_console.cc (fhandler_console::open_shared_console): + Semi-revert to using fixed location for console stuff. + * shared.cc (offsets): Ditto. Comment. + * shared_info (shared_locations): Re-add SH_SHARED_CONSOLE. + +2011-06-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_disk_file.cc (fhandler_disk_file::pread): Reset windows file + position pointer back to previous location after successful read. + +2011-06-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler_console.cc (fhandler_console::open_shared_console): Don't + zero handle to open_shared since it is supposed to be an input. + (enum_windows): Set handle input to open_shared to NULL since it does + not represent any previously opened shared region. + * shared.cc (open_shared): Tweak debugging output. + +2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + * ntdll.h (FILE_PIPE_*): Define constants. + * select.cc (pipe_data_available): Detect closing state. + +2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pinfo.cc (_pinfo::set_ctty): Don't reset myself->{pgid,sid} if + terminal has no pgid or sid settings. + +2011-06-03 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Only raise + SIGPIPE when writing. + + * fhandler.h: Include "tty.h". + (fhandler_termios::_tc): Rename from tc. + (fhandler_termios::tc): New method. + (fhandler_termios::tcinit): Remove an argument. + (fhandler_termios::get_ttyp): Use method to retrieve value. + (fhandler_console::console_state): Move here. + (fhandler_console::dev_state): Delete. + (fhandler_console::shared_console_info): Define. + (fhandler_console::open_shared_console): Move this function under + fhandler_console umbrella. + (fhandler_console::tc): Define. Return static value. + (fhandler_console::focus_aware): Accommodate deletion of dev_state. + (fhandler_console): Add tty_list::get_cttyp as a friend. + * fhandler_console.cc (dev_state): Redefine as a pointer within + shared_console_info and change dev-> to dev. throughout. + (fhandler_console::shared_console_info): Move into fhandler_console. + (fhandler_console::open_shared_console): Move into fhandler_console + change argument to simple bool. + (enum_windows): Accommodate changes to console_state and + open_shared_console. + (console_unit::console_unit): Ditto. + (fhandler_console::get_tty_stuff): Accommodate change to dev_state. + (tty_list::get_cttyp): Accommodate change to + handler_console::shared_console_info. + (fhandler_console::read): Accommodate change from tc to tc (). + (fhandler_console::set_input_state): Ditto. + (fhandler_console::open): Accommodate tcinit argument change and change + from tc to tc(). + (fhandler_console::input_tcsetattr): Accomodate change from tc to tc(). + (fhandler_console::input_tcsetattr): Ditto. + (fhandler_console::write_normal): Ditto. + (fhandler_console::init): Ditto. + (fhandler_console::igncr_enabled): Ditto. + * fhandler_termios.cc (fhandler_termios::tcinit): Remove first argument. + Expect tc() to have been set up first. Use tc() rather than tc. + (fhandler_termios::tcsetpgrp): Accomodate change from tc to tc(). + (fhandler_termios::tcgetpgrp): Ditto. + (fhandler_termios::bg_check): Ditto. + (fhandler_termios::line_edit: Ditto. + (fhandler_tty_master::set_winsize): Ditto. + (fhandler_tty_slave::open): Ditto. + (fhandler_tty_slave::init): Ditto. + (fhandler_pty_master::write): Ditto. + (fhandler_pty_master::setup): Ditto. Accommodate change in arguments + to tcinit. + (fhandler_tty_slave::fch_open_handles): Set _tc directly. + (tty_min::is_orphaned_process_group): Don't assume that parent pid + exists. + * pinfo.cc (_pinfo::set_ctty): Reset myself->{pgid,sid} here if we were + started by a non-Cygwin process but the tty exists. + * shared_info.h (console_state): Delete from here. + * tty.h: Make multiple inclusion safe. + +2011-05-31 Christopher Faylor <me.cygwin2011@cgf.cx> + + * exceptions.cc (ctrl_c_handler): Simplify test for no parent tty. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Return NULL if + ctty is not tty/console. Improve test for slave tty/pty device. + +2011-05-31 Christopher Faylor <me.cygwin2011@cgf.cx> + + * external.cc (fillout_pinfo): Don't truncate ctty if it's < 0. + + * select.cc (pipe_data_available): Avoid printing debug info by default + or suffer very large strace files. + +2011-05-31 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (pipe_data_available): New function - uses + NtQueryInformationFile to return information about pipes. + (peek_pipe): Rewrite to use pipe_data_available for both read and write + tests. + +2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dtable.cc (dtable::select_write): Add missing argument to + debug_printf. + + * fhandler.cc (fhandler_base_overlapped::setup_overlapped): Explicitly + set io_pending to false. + (fhandler_base_overlapped::has_ongoing_io): Call GetOverlappedResult + to force completion of I/O. + (fhandler_base_overlapped::wait_overlapped): Rewrite to correctly deal + with nonblocking reads and to make more race proof. + (fhandler_base_overlapped::raw_write): Deal with new enum values. + (fhandler_base_overlapped::raw_read): Ditto. Don't deal with ongoing + I/O here since it makes no sense in the read context. + * fhandler.h (enum wait_return): Add overlapped_unknown, + overlapped_nonblocking_no_data. + * pipe.cc (pipe): Add debugging output. + +2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc (dll_list::append): Eliminate increment of unused tot + variable. + * dll_init.h (dll_list::tot): Delete. + (dll_list::populate_all_deps): Delete undefined function. + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Move EPIPE + handling under error condition. + +2011-05-30 Ryan Johnson <ryan.johnson@cs.utoronto.ca> + + * dll_init.cc (reserve_upto): Remove. + (release_upto): Ditto. + (dll_list::reserve_space): New function to reserve space needed by + DLL_LOAD dlls early in the fork process. + (dll_list::load_after_fork): Rewrite to use recursion to + track reservations it makes while trying to make dlls land where they + belong. + (dll_list::load_after_fork_impl): New function used by load_after_fork. + (dll_list::alloc): Initialize image base field. + * dll_init.h (dll_list::prefered_base): New field. + (dll_list::reserve_space): Declare new function. + (dll_list::load_after_fork): Declare new function. + * fork.cc (frok::child): call dll_list::reserve_space early, so we can + retry if it fails. + +2011-05-30 Tor Perkins <cygwin@noid.net> + + * fhandler_termios.cc (fhandler_termios::bg_check): Do not return EIO + when a process group has no leader as this is allowed and does not + imply an orphaned process group. Add a test for orphaned process + groups. + (tty_min::is_orphaned_process_group): Define new function. + * tty.h (tty_min::is_orphaned_process_group): Define new function. + +2011-05-30 Ryan Johnson <ryan.johnson@cs.utoronto.ca> + + * dll_init.cc (dll_list::find_by_modname): New function to search the + dll list for a module name only (no path). + (dll_list::alloc): Initialize newly-added members of struct dll. + (dll_list::append): New function to factor out the append operation + (used by dll_list::topsort). + (dll_list::populate_deps): New function to identify dll dependencies. + (dll_list::topsort): New function to sort the dll list topologically by + dependencies. + (dll_list::topsort_visit): New helper function for the above. + * dll_init.h (dll::ndeps): New class member. + (dll::deps): Ditto. + (dll::modname): Ditto. + (dll_list::find_by_modname): New function related to topsort. + (dll_list::populate_all_deps): Ditto. + (dll_list::populate_deps): Ditto. + (dll_list::topsort): Ditto. + (dll_list::topsort_visit): Ditto. + (dll_list::append): Ditto. + (pefile): New struct allowing simple introspection of dll images. + * fork.cc (fork): Topologically sort the dll list before forking + +2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Refresh. + (child_info::refresh_cygheap): New function. + * spawn.cc (spawn_guts): Call refresh_cygheap before creating a new + process to ensure that cygheap_max is up-to-date. + * fork.cc (frok::parent): Ditto. + +2011-05-30 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygheap.cc (cygheap_dummy): Rename from cygheap_at_start. + (cygheap): Accommodate name change to cygheap_dummy. + (cygheap_init): Ditto. + (cygheap_fixup_in_child): Simplify slightly. + * fork.cc (fork): Add an advisory comment. + +2011-05-29 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_overlapped::wait_overlapped): Make sure that + I/O is cancelled on signal. + +2011-05-28 Ryan Johnson <ryan.johnson@cs.utoronto.ca> + + * dll_init.cc (dll_list::alloc): Initialize dll::image_size. + (reserve_at): Don't reserve space needed by the target dll if the + latter overlaps the free region to be blocked. + (dll_list::load_after_fork): Use new version of reserve_at. + * dll_init.h (dll::image_size): New member. + (pefile): New struct. + +2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx> + Ryan Johnson <ryan.johnson@cs.utoronto.ca> + + * dll_init.c (dll_list::load_after_fork): Don't clear in_forkee here. + * fork.cc (frok::errmsg): Rename from 'error'. + (frok::error): New function. Handle conditional printing of error + messages. + (frok::parent): Record hchild handle for use by error function. Use + throughout. Use error function rather than setting error pointer + directly. + (fork): Clear is_forkee here. Accommodate rename of 'error' to + 'errmsg'. + * sigproc.cc (child_info::proc_retry): Detect EXITCODE_FORK_FAILED. + +2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (handler_base_overlapped::wait_overlapped): Rework to + attempt to properly set errno and bytes read for non-blocking case. + Change to just rely on res to indicate error conditions. + +2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Don't set + io_pending unless ReadFile has returned an error. (this is a partial fix, + accidentally checked in) + +2011-05-28 Christopher Faylor <me.cygwin2011@cgf.cx> + + * autoload.cc: Call _api_fatal in asm. + * child_info.h: Redefine CURR_CHILD_INFO_MAGIC. + (child_info_fork::abort): Rename from handle_failure. Change + arguments. + * cygtls.h (_local_storage::ttybuf): New field. + * dcrt0.cc (vapi_fatal): Split api_fatal. Add "in forked process" to + message when appropriate. + (api_fatal): Use vapi_fatal. + * devices.h: Make multiple inclusion safe. + (fh_devices): Add FH_CONS* stuff. Reorder slightly. + (device): Eliminate anonymous union. Add more ways to access + minor/major. + (device::setunit): Accommodate no-longer-anonymous union. + (device::is_fs): Ditto. + (device::is_fs_special): Ditto. + (device::major): New function. + (device::minor): Ditto. + (device::is_device): New function. + (device::not_device): Ditto. + (device::operator int): New operator. + (device::operator fh_devices): Ditto. + (device::operator bool): Ditto. + (device::operator DWORD): Ditto. + (device::operator =): Ditto. + (isproc_dev): New function. + (isprocsys_dev): Ditto. + (iscons_dev): Ditto. + (istty_slave_dev): Ditto. + * devices.in: Add new "/dev/cons*" strings. Accommodate + no-longer-anonymous union throughout. + (BRACK): Use more precise method for initialization. + * devices.cc: Regenerate. + * dtable.cc (dtable::stdio_init): Use get_cttyp instead of get_tty. + (dtable::find_archetype): Use new DWORD operator in device to test + archetypes. + (dtable::init_std_file_from_handle): Use different method to initialize + 'dev'. Adapt to different ctty handling and accommodate /dev/cons*. + (fh_alloc): Accommodate no-longer-anonymous union. Adapt to new + /dev/cons*. + (build_fh_pc): Make debugging output more useful. + * exceptions.cc (ctrl_c_handler): Use get_cttyp instead of get_tty. + * external.cc (fillout_pinfo): Accommodate new cons* stuff. + * fhandler.cc (fhandler_base::read): Eliminate is_slow() test. + * fhandler.h (fhandler_base::*): Adapt to changes in device.h. + (fhandler_*::is_slow): Delete. + ( fhandler_proc::get_proc_fhandler): Return fh_devices type. + * fhandler_console.cc (open_shared_console): New function. + (console_unit): New class. + (console_unit::console_unit): New constructor. + (enum_windows): New function. Declare as friend to console_unit. + (fhandler_console::set_unit): New function. + (fhandler_console::get_tty_stuff): Call set_unit to set the unit number + and determine if initialization is needed. Eliminate flags parameter. + (tty_list::get_cttyp): Rename (sorta) from get_tty. Return pointer to + correct tty_min. + (fhandler_console::open): Adapt to elimination of argument to + get_tty_stuff. + (fhandler_console::output_tcsetattr): Properly detect error condition. + (fhandler_console::fixup_after_fork_exec): Adapt to get_tty_stuff() + setting tc automatically. + * fhandler_proc.cc: Use FH_BAD rather than 0 throughout where using + fh_devices enum. + (fhandler_proc::get_proc_fhandler): Return fh_devices. Adapt to + devices.h changes. + * fhandler_process.cc: Adapt to devices.h changes. Use FH_BAD rather + than 0 throughout where using fh_devices enum. + * fhandler_procnet.cc: Ditto. + * fhandler_procsys.cc: Ditto. + * fhandler_procsysvipc.cc: Ditto. + * fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): Ditto. + * fhandler_termios.cc (handler_termios::bg_check): Use tc->ttyname() + rather than assuming that we can construct a tty. + * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Just + return get_minor() of dev. + (fhandler_pty_master::process_slave_output): Add slightly more + debugging info. + (fhandler_tty_slave::fhandler_tty_slave): Change name from ntty to + unit. + (fhandler_pty_master::open): Ditto. + (fhandler_tty_slave::ioctl): Adapt to change which causes ctty to + represent a complete device. + (fhandler_tty_master::init_console): Add debugging for failure path. + (fhandler_pty_master::setup): Use get_unit() to retrieve unit number + rather than relying on raw ntty. + (fhandler_pty_master::setup): Ditto. + * fhandler_virtual.h (virt_tab_t): Redefine fhandler as fh_devices. + * fork.cc: Remove obsolete vfork stuff. + (frok::child): Don't assume that a ctty == 0 is valid. + * mount.cc (mount_info::conv_to_win32_path): Adapt to device struct + changes. + (mount_info::conv_to_win32_path): Ditto. + * path.cc (path_conv::check): Retrive major/minor numbers via a method + rather than accessing them directly from device. Rely on dev operators + to set/retrieve device information as required by device struct change. + * path.h (isproc_dev): Move to devices.h. + (isprocsys_dev): Ditto. + (isvirtual_dev): Ditto. + (path_conv:{isdevice,isfifo,isspecial,iscygdrive,issocket,get_devn,get_unitn}): + Use device methods to access/manipulate devices. + * pinfo.cc (pinfo::exit): Don't assume that ctty == 0 is valid. Use + iscons_dev to determine if a device is a console. + (_pinfo::_ctty): Use device::parse to generate tty/cons name. + (_pinfo::set_ctty): Don't assume that ctty == 0 is valid. Remove + redundant info from debugging. + * shared.cc (offsets): Remove console offset. + * shared_info.h (shared_locations): Ditto. + * syscalls.cc (umask): Use device methods to manipulate device + information. + (ctermid): Use device::parse to generate term device name. + * tlsoffsets.h: Regenerate. + * tty.cc (ttyslot): Return minor number of ctty since ctty now + represents a full device. + (tty::create_master): Set ctty to a complete device. + (tty_list::attach): Rework to detect new /dev/cons* stuff. + (tty_list::terminate): Adapt to changes to ctty. + (tty_list::init): Adapt to change to setntty - pass in device major + number. + (tty::exists): Use get_unit() to retrive tty unit number. + (tty::open_mutex): Ditto. + (tty::open_inuse): Ditto. + (tty::create_inuse): Ditto. + (tty::get_event): Ditto. + (tty_min::ttyname): Define new function. + * tty.h (tty_min::ntty): Redefine as fh_devices. + (tty::exists): Use get_unit() to retrive tty unit number. + (tty::open_mutex): Ditto. + (tty::open_inuse): Ditto. + (tty::create_inuse): Ditto. + (tty::get_event): Ditto. + (tty_min::ttyname): Declare new function. + (tty::getntty): Declare as const. + (tty_list::operator []): Assure that only minor part of argument is + used. + + * dll_init.cc (dll_list::alloc): Detect mismatch of data segments early + issuing an explicit error message if necessary. + * heap.cc (heap_init): Adapt to changes from fork->handle_failure to + fork->abort. + * pinfo.h (EXITCODE_FORK_FAILED): New enum. (from Ryan Johnson) + * sigproc.cc (child_info_fork::abort): Rename from handle_failure. + Change arguments to allow passing in a printf-like message. + * winsup.h (api_fatal): Delete macro definition. + (api_fatal): Redefine from __api_fatal. + (vapi_fatal): Declare new function. + * include/sys/strace.h (strace_vprintf): Define new macro. + + * ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemHandleInformation. + +2011-05-27 Corinna Vinschen <corinna@vinschen.de> + + * shared.cc (offsets): Reorder so that console_state is lowest in + memory. Explain why. + (open_shared): Accommodate reordering of offsets array. + * shared_info.h (shared_locations): Reorder SH_SHARED_CONSOLE after + SH_MYSELF. + +2011-05-26 Corinna Vinschen <corinna@vinschen.de> + + * mount.h (MAX_MOUNTS): Raise to 64. + +2011-05-25 Eric Blake <eblake@redhat.com> + + * cygtls.h (strerror_r_buf): New buffer. + * errno.cc (strerror): Move guts... + (_strerror_r): ...to new function demanded by newlib. + (strerror_r): Don't clobber strerror buffer. + (_user_strerror): Drop unused declaration. + * tlsoffsets.h: Regenerate. + +2011-05-25 Corinna Vinschen <corinna@vinschen.de> + + * init.cc (dll_entry): Reinstantiate wow64_test_stack_marker and + previous stack tests. + +2011-05-25 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (std-notes): Add missing <para>. + +2011-05-24 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::conv_to_win32_path): Remove unused code. + * mount.h (class mount_info): Remove sys_mount_table_counter member. + * shared_info.h (class shared_info): Ditto. + (CURR_SHARED_MAGIC): Update. + +2011-05-24 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.h (struct _pinfo): Reduce size of progname array slightly. + Explain why. + +2011-05-23 Eric Blake <eblake@redhat.com> + + * errno.cc (strerror): Print unknown errno as int. + (__xpg_strerror_r): Likewise, and don't clobber strerror buffer. + * cygtls.h (strerror_buf): Resize to allow '-'. + +2011-05-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (thread_info::fill_if_match): Reformat. + (format_process_maps): Ditto. Fetch pointer to procinfo structure + from mapped process. Print info about global shared Cygwin regions. + +2011-05-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (struct dos_drive_mappings): Use malloc/free + rather than cmalloc/cfree. Check return value from malloc before + using it. + (struct heap_info): Ditto. + (struct thread_info): Ditto. Rename from stack_info. Rename members + and local variables accordingly. + (thread_info::thread_info): Store stack and TEB addresses. + (thread_info::fill_if_match): Print "teb" if a TEB address has been + found. Special case for WOW64, explain why. + (format_process_maps): Fetch PEB address. Print MEM_RESERVE regions + with equal signs to distinguish them from PAGE_NOACCESS regions. Fix + printing of 'p' and 's' to differ between MEM_PRIVATE and MEM_MAPPED + pages, as on Linux. Print 'g' instead of 'p for PAGE_GUARD pages. + Print PEB and SharedUserData area if recognized. + +2011-05-20 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (CygwinCreateThread): Fix condition for adding the + guardsize to the stacksize. Fix accompanying comment. + +2011-05-20 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (CygwinCreateThread): Add accidentally missing comment. + +2011-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (struct heap_info): Change type of base and end + members to char *. Print "shared" rather than "share". + (struct stack_info): New class to fetch process stack information. + (format_process_maps): Initialize and check for stack information. + +2011-05-20 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (thread_wrapper): Remove statements added for debugging + purposes. + +2011-05-20 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + (class child_info_fork): Remove stacksize, add stackaddr and guardsize + members. + * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Partial rewrite + to regenerate the stack exactly as in the parent. + (child_info_fork::alloc_stack): Set stackaddr to 0, rather than + stacksize. + (dll_crt0_1): Check for stackaddr before changing the stack addresses + in the TEB. + * fork.cc (frok::child): Check for stackaddr here. + (frok::parent): Set ch.stackaddr and ch.guardsize if not called from + the main thread. + * init.cc (dll_entry): Replace pointer to NT_TIB with pointer to TEB. + Fix incorrectly changed address test before removing _my_tls. + Set StackLimit to NULL on Windows 2000. Explain why. + * miscfuncs.cc (struct thread_wrapper_arg): Store stackbase rather + than stacksize, store commitaddr, remove guardsize. Store all pointers + as char * for easier address arithmetic. + (thread_wrapper): Rewrite to remove OS stack before calling thread + function. Add lots of comments to explain what we do. + (CygwinCreateThread): Reserve our own stack in case we got no + application stack. Add comments. + * ntdll.h (struct _TEB): Extend defintion up to DeallocationStack + member. + * thread.cc (pthread_attr::pthread_attr): Use "(size_t) -1" + rather then 0xffffffff. + * wincap.h (wincaps::has_stack_size_param_is_a_reservation): New + element. + * wincap.cc: Implement above element throughout. + +2011-05-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * thread.cc: Mark psiginfo and psignal as available in list of + optional cancellation points. + +2011-05-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (__fpurge): Export. + * posix.sgml (std-solaris): Add __fpurge. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-05-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * posix.sgml (std-susv4): Remove chroot, futimes, hstrerror. + (std-deprec): Add chroot. + (std-bsd): Add futimes, hstrerror. + (std-notimpl): Add clock_nanosleep, nexttoward, nexttowardf. + Remove initstate, which is implemented and listed in std-susv4. + +2011-05-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (error): Export. + (error_at_line): Export. + (error_message_count): Export. + (error_one_per_line): Export. + (error_print_progname): Export. + * errno.cc (error_message_count): Define. + (error_one_per_line): Define. + (error_print_progname): Define. + (_verror): New static function. + (error): New function. + (error_at_line): New function. + * posix.sgml (std-gnu): Add error, error_at_line. + * include/error.h: New header. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-05-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (clock_getcpuclockid): Export. + (pthread_getcpuclockid): Export. + * hires.h (PID_TO_CLOCKID): New macro. + (CLOCKID_TO_PID): New macro. + (CLOCKID_IS_PROCESS): New macro. + (THREADID_TO_CLOCKID): New macro. + (CLOCKID_TO_THREADID): New macro. + (CLOCKID_IS_THREAD): New macro. + * ntdll.h (enum _THREAD_INFORMATION_CLASS): Add ThreadTimes. + * posix.sgml (std-notimpl): Add clock_getcpuclockid and + pthread_getcpuclockid from here... + (std-susv4): ... to here. + (std-notes): Remove limitations of clock_getres and clock_gettime. + Note limitation of timer_create to CLOCK_REALTIME. + * sysconf.cc (sca): Set _SC_CPUTIME to _POSIX_CPUTIME, and + _SC_THREAD_CPUTIME to _POSIX_THREAD_CPUTIME. + * thread.cc (pthread_getcpuclockid): New function. + * timer.cc (timer_create): Set errno to ENOTSUP for CPU-time clocks. + * times.cc (clock_gettime): Handle CLOCK_PROCESS_CPUTIME_ID and + CLOCK_THREAD_CPUTIME_ID. + (clock_getres): Ditto. + (clock_settime): Set errno to EPERM for CPU-time clocks. + (clock_getcpuclockid): New function. + * include/pthread.h (pthread_getcpuclockid): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-05-17 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (thread_wrapper): Remove unused _cygtls record. + * mmap.cc (is_mmapped_region): Avoid crash if no mmaps exist. + +2011-05-16 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (__getlogin_username): Remove. + * uinfo.cc (getlogin_r): Fetch username from cygheap. + (getlogin): Add static buffer username and fetch username from + getlogin_r. + +2011-05-16 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (struct _local_storage): Remove unused members rarg and + _localtime_buf. Remove username in favor of a global buffer. Reorder + slightly to keep the net.cc stuff together. + * globals.cc (__getlogin_username): New global char buffer. + * tlsoffsets.h: Regenerate. + * uinfo.cc (getlogin): Copy username into __getlogin_username. + +2011-05-16 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (heap_init): Rewrite initial heap allocation to use addresses + beyond 0x20000000. Explain why and how. + * shared.cc (shared_info::heap_slop_size): Remove. + * shared_info.h (class shared_info): Remove heap_slop_inited and + heap_slop members. Remove heap_slop_size declaration. + (CURR_SHARED_MAGIC): Update. + * wincap.cc: Throughout, drop heapslop. + * wincap.h (struct wincaps): Drop heapslop. + +2011-05-16 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Check if the + requested stack is application-provided within the user heap or an + mmapped region. If so, just use it. Add comment to explain why. + * miscfuncs.cc (thread_wrapper): If an application-provided stack + has been given, implement cygtls area at the stackbase. Fix comment. + * mmap.cc (is_mmapped_region): New function. + * winsup.h (is_mmapped_region): Declare. + +2011-05-15 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (thread_wrapper): Add comments to assembler code. + +2011-05-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (pthread_attr_getguardsize): Export. + (pthread_attr_setguardsize): Export. + (pthread_attr_setstack): Export. + (pthread_attr_setstackaddr): Export. + * init.cc (dll_entry): Remove wow64_test_stack_marker. Check for + unusual stack address by testing stack addresses from current TEB. + Check validity of _my_tls by testing if it's within the stack as + given in current TEB. + * miscfuncs.cc (struct thread_wrapper_arg): New structure used to + push all required information to thread_wrapper function. + (thread_wrapper): Wrapper function for actual thread function. + If an application stack has been given, change %ebp and %esp so that + the thread function runs on that stack. If the thread has been created + by CygwinCreateThread, set up the POSIX guard pages if necessary. + (CygwinCreateThread): New function. + * miscfuncs.h (CygwinCreateThread): Declare. + * ntdll.h (struct _TEB): Define all members up to Peb. + * posix.sgml (std-susv4): Move pthread_attr_getguardsize, + pthread_attr_setguardsize and pthread_attr_setstack here. + (std-deprec): Add pthread_attr_setstackaddr. + * sysconf.cc (sca): Set _SC_THREAD_ATTR_STACKADDR to + _POSIX_THREAD_ATTR_STACKADDR. + * thread.cc (pthread::precreate): Copy pthread_attr stackaddr and + guardsize members. + (pthread::create): Call CygwinCreateThread. + (pthread_attr::pthread_attr): Initialize guardsize. + (pthread_attr_setstack): New function. + (pthread_attr_setstackaddr): New function. + (pthread_attr_setguardsize): New function. + (pthread_attr_getguardsize): New function. + (pthread_getattr_np): Copy attr.guardsize. + * thread.h (pthread_attr): Add member guardsize. + * include/pthread.h (pthread_attr_getguardsize): Declare. + (pthread_attr_setguardsize): Declare. + * include/cygwin/version.h: Bump API minor number. + +2011-05-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (struct heap_info::heap): Convert base to + uintptr_t. Add heap_id, end, flags members. + (heap_info::heap_vm_chunks): Rename from heaps. + (heap_info::heap_info): Rearrange using RtlQueryProcessDebugInformation + to get information of heap virtual memory blocks. Store heap id and + flags, as well as end address of each block. + (heap_info::fill_if_match): Check incoming base address against full + address range of heap chunks. Convert flag values in extra heap + information. + (format_process_maps): Change order so that heap check is done before + MEM_MAPPED check since there are shareable heaps. + * ntdll.h (PDI_HEAP_BLOCKS): Define. + (HEAP_FLAG_NOSERIALIZE): Define. + (HEAP_FLAG_GROWABLE): Define. + (HEAP_FLAG_EXCEPTIONS): Define. + (HEAP_FLAG_NONDEFAULT): Define. + (HEAP_FLAG_SHAREABLE): Define. + (HEAP_FLAG_EXECUTABLE): Define. + (HEAP_FLAG_DEBUGGED): Define. + (struct _DEBUG_HEAP_ARRAY): Define. + (struct _DEBUG_HEAP_BLOCK): Define. + +2011-05-12 Corinna Vinschen <corinna@vinschen.de> + + Based on newlib patch to strptime by Peter Rosin <peda@lysator.liu.se>: + * libc/time/strptime.c (is_leap_year): New static function. + (first_day): Ditto. + (__strptime): Fill in tm_yday when all of tm_year, tm_mon and tm_mday + are updated. Fill in tm_mon, tm_mday and tm_wday when both of tm_year + and tm_yday are updated. + +2011-05-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * fhandler_proc.cc (format_proc_meminfo): Rewrite to use sysinfo(). + Support RAM and swap space larger than 4GB. + Remove output elements not found with modern Linux kernels. + (format_proc_swaps): Support paging files larger than 4GB. + +2011-05-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Remove useless comment. + +2011-05-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (EnumProcessModules): Remove. + * dlfcn.cc (dlopen): Make sure errno is set if an error occurs. + (dlsym): Rewrite using RtlQueryProcessDebugInformation instead of + EnumProcessModules. + * ntdll.h (struct _DEBUG_MODULE_ARRAY): Define. + (RtlCreateQueryDebugBuffer): Declare. + (RtlDestroyQueryDebugBuffer): Declare. + (RtlQueryProcessDebugInformation): Declare. + +2011-05-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetModuleFileNameExW): Remove. + * autoload.cc (GetModuleInformation): Remove. + +2011-05-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (QueryWorkingSet): Remove. + +2011-05-11 Ryan Johnson <ryan.johnson@cs.utoronto.ca> + + * fhandler_process.cc (format_process_maps): Rework to report + all mapped address space in a process (committed or reserved), + identifying the nature of the mapping (mapped file/image, heap, + shared memory) when possible. + (dos_drive_mappings): New helper classes. + (heap_info): Ditto. + * ntdll.h (struct _MEMORY_SECTION_NAME): Define. + +2011-05-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetProcessMemoryInfo): Remove. + * resource.cc (fill_rusage): Call NtQueryInformationProcess rather than + GetProcessMemoryInfo to drop a psapi dependency. + +2011-05-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Rearrange for better readability. + Make waiting loop interruptible and cancelable. Check for SYSTEM DOS + flag before reading the file. Change return value to return 0 on + success, SOCKET_ERROR on failure. + (fhandler_socket::bind): Only set R/O DOS flag on filesystems not + supporting ACLs. + (fhandler_socket::connect): Accommodate changed return values from + get_inet_addr. Use SOCKET_ERROR instead of -1. + (fhandler_socket::sendto): Accommodate changed return values from + get_inet_addr. + * syslog.cc (connect_syslogd): Ditto. + +2011-05-10 Christian Franke <franke@computer.org> + + * security.cc (check_registry_access): Handle missing + security descriptor of HKEY_PERFORMANCE_DATA. + +2011-05-10 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: Regenerate. + +2011-05-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_uptime): Don't call GetSystemInfo. + Fetch CPU count from wincap. + (format_proc_stat): Ditto. + * globals.cc (system_info): Move to wincap. + * heap.cc (heap_init): Fetch page size from wincap. + * syscalls.cc (getpagesize): Fetch allocation granularity from wincap. + (getsystempagesize): Fetch page size from wincap. + * wincap.cc (wincap_2003): Default is_server to false. + (wincapc::init): Call GetSystemInfo here. Always set is_server value. + * wincap.h (class wincapc): Add system_info as private member. + (wincapc::cpu_count): New public method. + (wincapc::page_size): Ditto. + (wincapc::allocation_granularity): Ditto. + +2011-05-10 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (set_chunksize): Remove. + (parse_thing): Remove forkchunk entry. + * fork.cc (child_copy): Drop handling external chunksize setting. + * wincap.cc: Througout, drop chunksize. + (wincapc::set_chunksize): Remove. + * wincap.h (struct wincaps): Drop chunksize and declaration of + set_chunksize. + +2011-05-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * times.cc (settimeofday): Add EFAULT handler. + Set errno to EINVAL if tv.tv_nsec is invalid, and to EPERM if + SetSystemTime fails. Return -1 in case of failure, all for + compatibility with BSD and Linux. + (clock_settime): New function. + * cygwin.din (clock_settime): Export. + * posix.sgml (std-susv4): Add clock_settime. + Move clock_setres from here... + (std-deprec): ... to here. + (std-notes): Correct limitation of clock_setres to only CLOCK_REALTIME. + Add limitation of clock_settime to only CLOCK_REALTIME. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-05-07 Corinna Vinschen <corinna@vinschen.de> + + * registry.cc (get_registry_hive_path): Change system_printf to + debug_printf. + (load_registry_hive): Ditto. + +2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (fhandler_base::close_with_arch): Make non-virtual. + (fhandler_base::open_fs): Move closer to it's close counterpart. + +2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base::dup): Avoid duping a handle when an + fhandler has an archetype. + * fhandler_console.cc (fhandler_console::invisible_console): Move to + the top. + (fhandler_console::set_close_on_exec): Don't set close-on-exec on + handle since it's an archetype and you don't know how many things could + be using it. + +2011-05-06 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (fhandler_dev_dsp): Cosmetic change. + + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Put back + Sleep(10) for tty_master case. + + * sigproc.cc (stopped_or_terminated): Don't consider a pid which has + been reaped to be terminated. + +2011-05-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * sysconf.cc (sysinfo): New function. + * cygwin.din (sysinfo): Export. + * posix.sgml (std-gnu): Add sysinfo. + * include/sys/sysinfo.h (struct sysinfo): Define. + (sysinfo): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-05-06 Corinna Vinschen <corinna@vinschen.de> + + * libc/minires-os-if.c (get_dns_info): Drop printing uninitialized + value of dwRetVal in debug output. + +2011-05-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::read): Declare. + (fhandler_socket::write): Declare. + * fhandler_procsys.cc (fhandler_procsys::read): Add FIXME comment. + (fhandler_procsys::write): Ditto. + * fhandler_socket.cc (fhandler_socket::read): New method. + (fhandler_socket::write): New method. + * syscalls.cc: Rearrange order of read/write functions. + (read): Call fhandler read method directly instead of just readv. + (readv): Remove EINTR loop. This is done in all affected fhandler's + now. + (write): Call fhandler write method directly instead of just writev. + Fix debug output. + +2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygheap.cc (cygheap::close_ctty): Close ctty via close_with_arch(). + * debug.cc (close_handle): Call debugger on failure. + * devices.in (device::tty_to_real_device): Delete. + * devices.h (device::tty_to_real_device): Ditto. + * devices.cc: Regenerate. + * dtable.cc: Delete old ifdef'ed vfork code. + (dtable::release): Don't handle archetype here. + (dtable::init_std_file_from_handle): Consolidate console tests. + Generate major/minor for tty ASAP. Fix incorrect setting of DEV_TTYS* + for serial. + (fh_alloc): New function derived from build_fh_pc. Pass current tty + when building tty. + (build_pc_pc): Use fh_alloc to create. Set name from fh->dev if + appropriate. Generate an archetype or point to one here. + (dtable::dup_worker): Deal with archetypes. Rely on = operator copying + whole class rather than just fhandler_base. + (dtable::fixup_after_exec): Call close_with_arch to handle closing of + fhandlers with archetypes. + * fhandler.cc (fhandler_base::operator =): Call memcpy with fhandler's + size() rather than sizeof fhandler_base. + (fhandler_base::open_with_arch): New function. Handles opening of + fhandler's with archetypes, dealing with usecounts, etc. + (fhandler_base::close_with_arch): Ditto for close. + * fhandler.h: Many changes for archetypes. + (fhandler_base::set_name): Set both normalized path and regular path. + (fhandler_base::open_with_arch): New function. + (fhandler_base::open_setup): Ditto. + (fhandler_base::use_archetype): Ditto. + (fhandler_base::_archetype_usecount): Ditto. + (fhandler_*::size): Ditto. + (fhandler_dev_tape::open): Remove virtual decoration. + (fhandler_console::use_archetype): New function. Return true. + (fhandler_console::open_setup): New function. + (fhandler_console::dup): Delete. + (fhandler_tty_slave::fhandler_tty_slave): Redeclare to take an + argument. + (fhandler_tty_slave::use_archetype): New function. Return true. + (fhandler_tty_slave::cleanup): New function. + (fhandler_pty_master::use_archetype): New function. Return true. + (fhandler_pty_master::cleanup): New function. + (fhandler_pty_master::is_tty_master): New function. Return false. + (fhandler_tty_master::is_tty_master): New function. Return true. + (fhandler_dev_dsp::fhandler_dev_dsp): New function. Return true. + (report_tty_counts): Only report on archetype's usecount if there is + one. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove + handling of setsid, set_ctty, set_flags, and manage_console_count. + (fhandler_console::open_setup): New function. Implement functionality + removed from get_tty_stuff. + (fhandler_console::dup): Delete. + (fhandler_console::output_tcsetattr): Set errno on error. + (fhandler_console::fhandler_console): Set device early. + (fhandler_console::init): Use open_with_arch to open console handles. + (fhandler_console::fixup_after_fork_exec): Nuke most of the stuff for + dealing with console handles. + * fhandler_dsp.cc (fhandler_dev_dsp::open): Remove archetype handling. + (fhandler_dev_dsp::write): Ditto. + (fhandler_dev_dsp::read): Ditto. + (fhandler_dev_dsp::close): Ditto. + (fhandler_dev_dsp::dup): Ditto. + (fhandler_dev_dsp::ioctl): Ditto. + (fhandler_dev_dsp::fixup_after_fork): Ditto. + (fhandler_dev_dsp::fixup_after_exec): Ditto. + * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Add a + little more debugging. + (fhandler_tty_common::__release_output_mutex): Ditto. + (fhandler_pty_master::process_slave_output): Ditto. Don't do signal + handling or pthread_cancel handling in the tty master thread. + (process_output): Minor reorg. + (fhandler_tty_slave::fhandler_tty_slave): Set device based on new ntty + argument. + (fhandler_tty_slave::open): Remove archetype handling. Move some + processing into open_setup(). + (fhandler_tty_slave::open_setup): New function. + (fhandler_tty_slave::cleanup): New function. + (fhandler_tty_slave::close): Remove archetype handling. Move some + processing into cleanup(). + (fhandler_tty_slave::init): Rename argument from f to h. Open device + using open_with_arch(). Remove archetype handling. + (fhandler_pty_master::dup): Ditto. + (fhandler_pty_master::open): Ditto. + (fhandler_pty_master::close): Ditto. Move some handling to cleanup(). + (fhandler_pty_master::cleanup): New function. + (fhandler_tty_master::init_console): Give unique name to captive + console fhandler. + * pinfo.cc (_pinfo::set_ctty): Rename argument from arch to fh. + Eliminate archetype assumption. + * syscalls.cc (close_all_files): Use close_with_arch for closing. + (open): Use open_with_arch() rather than open(). + (close): Use close_with_arch() rather than close(). + +2011-05-05 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.h (class push_process_state): New class to push a process state + flag temporarily into myself->process_state. + * fhandler_console.cc (fhandler_console::read): Add push_process_state + handler. + (fhandler_console::write): Call bg_check from here. Add + push_process_state handler. + * fhandler_tty.cc (fhandler_tty_slave::write): Ditto. + (fhandler_tty_slave::read): Ditto. + (fhandler_pty_master::write): Ditto. + (fhandler_pty_master::read): Ditto. + * syscalls.cc (readv): Remove bg_check call and setting process state. + (writev): Ditto. + +2011-05-05 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (readv): Add myfault handler. Don't check repeatedly + open state of file handler. Streamline loop. + (writev): Add myfault handler. + +2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::raw_read): Rename from + read_overlapped. + (fhandler_base_overlapped::raw_e): Rename from write_overlapped. + * fhandler.h (fhandler_*::raw_read): Add reparm decoration. + (fhandler_*::raw_write): Ditto. + (fhandler_base_overlapped::raw_read): Rename from read_overlapped. + (fhandler_base_overlapped::raw_write): Rename from write_overlapped. + (fhandler_pipe::raw_read): Delete. + (fhandler_pipe::raw_write): Ditto. + (fhandler_mailslot::raw_read): Ditto. + * fhandler_fifo.cc (fhandler_fifo::raw_read): Reflect read_overlapped + -> raw_read rename. + (fhandler_fifo::raw_write): Ditto. + * fhandler_mailslot.cc (fhandler_mailslot::raw_read): Delete. + (fhandler_mailslot::raw_write): Reflect read_overlapped -> raw_read + rename. + * pipe.cc (fhandler_pipe::raw_read): Delete. + (fhandler_pipe::raw_write): Ditto. + +2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fork.cc (fork): Clear PID_REAPED. + * pinfo.cc (pinfo_init): Ditto. + (pinfo::init): Check for PID_REAPED. + * sigproc.cc (stopped_or_terminated): Ditto. + +2011-05-05 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pinfo.cc (_pinfo::exists): Check for PID_REAPED. + +2011-05-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::pread): Correctly return + with errno set to EBADF if file open mode is incorrect. + (fhandler_disk_file::pwrite): Ditto. + +2011-05-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (is_at_eof): Drop static storage class. Drop err + parameter since we don't change the Win32 error here anymore. + (fhandler_base::raw_read): Accommodate change to is_at_eof. + + * fhandler_disk_file.cc (fhandler_disk_file::pread): In binary mode use + direct call to NtReadFile, rather than lseek/read. + (fhandler_disk_file::pwrite): In binary mode use direct call to + NtWriteFile, rather than lseek/write. + +2011-05-05 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Reset locale to "C" even when dynamically + loaded. + +2011-05-05 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * posix.sgml (std-notimpl): Remove bsd_signal, setcontext, and + swapcontext, marked obsolete in SUSv3 and not present in SUSv4. + +2011-05-05 Christian Franke <franke@computer.org> + + * fhandler_registry.cc (fhandler_registry::exists): Fix regression + in EACCES handling. + (fhandler_registry::open): Fix "%val" case. + +2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * signal.cc (_pinfo::kill): Return success on kill(0) only if pid + exists or is in PID_EXITED state. Report pid 0 when pid does not exist + rather than pid -1. Make debug output reflect actual function call. + * sigproc.cc (stopped_or_terminated): Set process state to reaped when + we've finished waiting for it. + * include/sys/cygwin.h (PID_REAPED): New enum. + +2011-05-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (psiginfo): Export. + (psignal): Export. + (sys_siglist): Export. + * posix.sgml (std-notimpl): Move psiginfo and psignal from here... + (std-susv4): ... to here. + (std-deprec): Add sys_siglist. + * strsig.cc (sys_siglist): New array. + (psiginfo): New function. + * include/cygwin/signal.h (sys_siglist): Declare. + (psiginfo): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_list::detach (dll_list::detach): Avoid doing anything with detach + during a failing fork. + +2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc (dll_global_dtors): Avoid calling destructors during + failing fork(). + +2011-05-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_base): Remove uninterruptible_io status + flag. + (fhandler_base::ready_for_read): Remove declaration. + (fhandler_socket::ready_for_read): Ditto. + (fhandler_pipe::ready_for_read): Ditto. + (fhandler_tty_master::is_slow): Remove. + * fhandler_console.cc (fhandler_console::open): Drop setting + uninterruptible_io. + * fhandler_serial.cc (fhandler_serial::open): Ditto. + * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Ditto. + (fhandler_tty_master::init_console): Ditto. + * pipe.cc (fhandler_pipe::fhandler_pipe): Ditto. + (fhandler_pipe::open): Ditto. + (_pipe): Ditto. + * select.cc (fhandler_pipe::ready_for_read): Remove. + (fhandler_base::ready_for_read): Remove. + * syscalls.cc (readv): Drop unneeded wait variable. Remove entire test + which might lead to calling ready_for_read. Remove now unused label + out. + +2011-05-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_mailslot): Move down in file and change + parent class to fhandler_base_overlapped. Remove declaration of + method write. Add declaraiotns for raw_read and raw_write. + * fhandler_mailslot.cc (fhandler_mailslot::fhandler_mailslot): Call + fhandler_base_overlapped constructor. + (fhandler_mailslot::fstat): Call fhandler_base_overlapped::fstat. + (fhandler_mailslot::open): Drop FILE_SYNCHRONOUS_IO_NONALERT flag from + call to NtOpenFile. + (fhandler_mailslot::raw_read): New method. + (fhandler_mailslot::raw_write): Ditto. Take over length algorithm from + former write method. + (fhandler_mailslot::write): Remove. + (fhandler_mailslot::ioctl): Call fhandler_base_overlapped::ioctl. + +2011-05-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_tape::_lock): Add bool parameter. + * fhandler_tape.cc (lock): Call _lock with false argument. + (_lock): Take bool cancelable parameter. Handle O_NONBLOCK. + Make cancelable if cancelabe parameter is true. + (fhandler_dev_tape::raw_read): Call _lock with true argument. + (fhandler_dev_tape::raw_write): Ditto. + +2011-05-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add fh member. + (fhandler_dev_dsp::Audio_out::Audio_out): Take pointer to encapsulating + fhandler_dev_dsp as parameter. + (fhandler_dev_dsp::Audio_in::Audio_in): Ditto. + (fhandler_dev_dsp::Audio::Audio): Take pointer to encapsulating + fhandler_dev_dsp as parameter and store in fh. + (fhandler_dev_dsp::Audio_out::write): Change return type to int and + return number of bytes written. Return -1 if waitforspace returns false + and no bytes have been written so far. + (fhandler_dev_dsp::Audio_out::waitforspace): Change return type to bool. + Handle O_NONBLOCK. Make waiting loop interruptible and cancelable. + Return false in any of these cases, otherwise true. + (fhandler_dev_dsp::Audio_in::read): Set returned nBytes to -1 if + waitfordata returns false and nothing has been read so far. + (fhandler_dev_dsp::Audio_in::waitfordata): Change return type to bool. + Handle O_NONBLOCK. Make waiting loop interruptible and cancelable. + Return false in any of these cases, otherwise true. + (fhandler_dev_dsp::write): Call Audio_out constructor with this as + parameter. + (fhandler_dev_dsp::read): Call Audio_in constructor with this as + parameter. + +2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * thread.h (pthread::static_cancel_self): Mark as noreturn. + (pthread::cancel_self): Ditto. + * thread.cc (pthread::cancel_self): Explicitly use pthread::exit to + avoid a "function returns" error. + +2011-05-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * pinfo.h (pinfo::pinfo): Set procinfo to NULL to avoid potential + cleanup of uninitialized garbage. (Suggested by Ryan Johnson) + +2011-05-03 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (cygwin_select): Make degenerate case cancelable. + (select_stuff::destroy): New inline method to delete memory taken + by select_stuff. + (select_stuff::~select_stuff): Call destroy. + (select_stuff::wait): Add case to allow canceling select. + * select.h (select_stuff::destroy): Declare. + * thread.cc: Mark poll, pselect and poll as cancelable. + +2011-05-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Make + cancelable. Remove test for main thread, always add signal_arrived + to waited objects. + +2011-05-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_tty_slave::read): Set WFMO timeout to 0 for + nonblocking case. Drop useless waiter variable. Rewrite wait for + input_available_event to use a switch statement. Handle timeout and + failure more gracefully. Make restartable and cancelable. Rewrite + wait for input_mutex to use WFMO and a switch statement. Handle + timeout and failure more gracefully. Make restartable and cancelable. + +2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx> + + * signal.cc (_pinfo::kill): Avoid referencing 'pid' after ESRCH. + +2011-05-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (pthread_attr_getstack): Export. + (pthread_attr_getstackaddr): Export. + (pthread_getattr_np): Export. + * ntdll.h (enum _THREAD_INFORMATION_CLASS): Add ThreadBasicInformation. + (struct _THREAD_BASIC_INFORMATION): Define. + (NtQueryInformationThread): Declare. + * posix.sgml (std-susv4): Add pthread_attr_getstack. + (std-gnu): Add pthread_getattr_np. + (std-deprec): Add pthread_attr_getstackaddr. + (std-notimpl): Remove pthread_attr_[gs]etstackaddr, as they were + removed from SUSv4. + * thread.cc (pthread_attr::pthread_attr): Initialize stackaddr. + (pthread_attr_getstack): New function. + (pthread_attr_getstackaddr): New function. + (pthread_attr_setstacksize): Return EINVAL if passed size less than + PTHREAD_STACK_MIN, as required by POSIX. + (pthread_getattr_np): New function. + * thread.h (class pthread_attr): Add stackaddr member. + * include/pthread.h (pthread_attr_getstack): Declare. + (pthread_attr_getstackaddr): Declare unconditionally. + (pthread_attr_setstack): Declare inside false conditional for reference. + (pthread_getattr_np): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx> + + * Makefile.in: Allow CFLAGS to be overridden from the environment. + +2011-05-02 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (cancelable_wait): Remove test for main thread. + * fhandler_fifo.cc (fhandler_fifo::open_nonserver): Ditto. + +2011-05-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (andler_pty_master::process_slave_output): Make + interruptible and cancelable. Fix nonblocking case. + +2011-05-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::read): Make restartable and + cancelable. + +2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx> + + * strace.cc (strace::vprntf): Avoid closing unopened handle. + +2011-05-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * sysconf.cc (sca): Set _SC_SPIN_LOCKS to _POSIX_SPIN_LOCKS. + +2011-05-02 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc (dll_list::alloc): Reset 'p' in forked process. + + * select.cc (select_stuff::wait): Move cleanup() closer to WFMO to + minimize unavoidable (?) race. + +2011-05-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc (fhandler_serial::raw_read): Add restartability + after a signal. Add cancelability. + (fhandler_serial::raw_write): Wait for write to succeed if O_NONBLOCK + is not set. Add signal handling and cancelability. + +2011-05-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_windows.cc (fhandler_windows::read): Use + pthread::get_cancel_event to fetch thread's cancel event. + * flock.cc (lf_setlock): Ditto. + * posix_ipc.cc (ipc_cond_timedwait): Ditto. + * thread.cc (pthread::get_cancel_event): New static method. + * thread.h (pthread::get_cancel_event): Declare. + +2011-05-01 Corinna Vinschen <corinna@vinschen.de> + + * libc/minires-os-if.c (get_dns_info): Remove unnecessary test for + existence of DnsQuery_A. + +2011-05-01 Corinna Vinschen <corinna@vinschen.de> + + Throughout, use user32 UNICODE functions rather than ANSI functions. + * autoload.cc: Convert all definitions for ANSI user32 functions to + definitions for the corresponding UNICODE function. + (SendMessageA): Remove. + (SendNotifyMessageW): Define. + * fhandler.h (fhandler_windows::is_slow): Remove. + * fhandler_windows.cc (fhandler_windows::write): Use SendNotifyMessageW + call rather than SendMessage to make function always return immediately. + (fhandler_windows::read): Make function interruptible and a cancellation + point. Handle O_NONBLOCK. + * select.cc (peek_serial): Don't wait for signal_arrived here. + * window.cc (wininfo::winthread): Call CreateWindowExW directly rather + than CreateWindow wrapper. + +2011-05-01 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (fdsock): Drop setting uninterruptible_io to true. + +2011-05-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::is_slow): Remove. + +2011-04-30 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc (fcntl64): Call pthread_testcancel. + * fhandler_socket.cc (fhandler_socket::connect): Ditto. + (fhandler_socket::accept4): Ditto. + (fhandler_socket::recvfrom): Ditto. + (fhandler_socket::recvmsg): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Ditto. + * flock.cc (lf_setlock): Allow to cancel thread running blocking + file lock. Try to make code more readable. + (lockf): Call pthread_testcancel. + * mmap.cc (msync): Ditto. + * posix_ipc.cc (ipc_cond_timedwait): Call pthread::static_cancel_self + rather than pthread_testcancel. + * select.cc (cygwin_select): Call pthread_testcancel. + * syscalls.cc (pread): Ditto. + (pwrite): Ditto. + (readv): Ditto. + (writev): Ditto. + (open): Ditto. + (close): Ditto. + (fsync): Ditto. + * termios.cc (tcdrain): Ditto. + * thread.cc: Align list of cancellation points with above changes. + Mark not-implemented functions, too. + (cancelable_wait): Don't set unused object indices to WAIT_FAILED + since that could result in wrong behaviour. Set them to the invalid + value WAIT_TIMEOUT + 1 instead. + +2011-04-30 Corinna Vinschen <corinna@vinschen.de> + + * thread.h (class pthread): Add bool member canceled. + * thread.cc (pthread::pthread): Initialize canceled to false. + (pthread::cancel): Set canceled before setting cancel_event. + (pthread::testcancel): Check for canceled. Only wait for cancel_event + if canceled is true. Explain why. + (pthread::_fixup_after_fork): Set canceled to false. + +2011-04-29 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Sort. Map ERROR_EXE_MACHINE_TYPE_MISMATCH to + ENOEXEC. + +2011-04-29 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc: Update comment listing cancellation points per POSIX. + +2011-04-29 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc: Add comment. + (EqualSid): Remove. + (CopySid): Remove. + (AddAccessAllowedAce): Remove. + (AddAccessDeniedAce): Remove. + (MakeSelfRelativeSD): Remove. + * flock.cc: Replace above functions throughout with their ntdll.dll + equivalent. + * sec_acl.cc: Ditto. + * sec_auth.cc: Ditto. + * sec_helper.cc: Ditto. + * security.cc: Ditto. + * security.h: Ditto. + (RtlEqualSid): Declare. Explain why. + (RtlCopySid): Ditto. + +2011-04-29 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (AccessCheck): Remove. + (PrivilegeCheck): Remove. + (OpenThreadToken): Remove. + * fhandler_tty.cc: Replace above functions throughout with their + ntdll.dll equivalent. + * security.cc: Ditto. + +2011-04-29 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (IsEventSignalled): New inline function. + * cygthread.cc (cygthread::terminate_thread): Use IsEventSignalled in + place of WaitForSingleObject on event with 0 timeout. + * fhandler.cc (fhandler_base_overlapped::has_ongoing_io): Ditto. + * fhandler_fifo.cc (fhandler_fifo::open_nonserver): Ditto. + (fhandler_fifo::wait): Ditto. + * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. + * select.cc (verify_tty_slave): Ditto. + * thread.cc (pthread::testcancel): Ditto. + +2011-04-29 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (GetTokenInformation): Remove. + (SetTokenInformation): Remove. + * grp.cc: Replace above functions throughout with their ntdll.dll + equivalent. + * sec_auth.cc: Ditto. + * syscalls.cc: Ditto. + * uinfo.cc: Ditto. + +2011-04-29 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_cond_timedwait): Only wait for pthread's + cancel_event if thread's cancelability isn't disabled. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (SetSecurityDescriptorDacl): Remove. + (SetSecurityDescriptorGroup): Remove. + (SetSecurityDescriptorOwner): Remove. + * pinfo.cc: Replace above functions throughout with their ntdll.dll + equivalent. + * sec_acl.cc: Ditto. + * sec_helper.cc: Ditto. + * security.cc: Ditto. + + * sec_helper.cc (__sec_user): Remove old comment. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_cond_timedwait): Also wait for pthread's + cancel_event, if any. Call pthread_testcancel if cancel_event has been + signalled. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_cond_timedwait): Remove pthread_testcancel calls. + (_mq_send): Add pthread_testcancel call at start of function. + (_mq_receive): Ditto. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (geterrno_from_nt_status): Declare. + * errno.cc (geterrno_from_nt_status): Define. + * flock.cc: Fix copyright dates. + * ntdll.h (enum _TIMER_TYPE): Define. + (PTIMER_APC_ROUTINE): Define. + (NtCancelTimer): Declare. + (NtCreateTimer): Declare. + (NtSetTimer): Declare. + * posix_ipc.cc (ipc_cond_timedwait): Rewrite to make interruptible and + restartable. Call pthread_testcancel in case of timeout to enable + pthread_cancel on waiting thread. Replace WFMO timeout with waiting + for a waitable timer. Explain why. Replace single call to WFMO with + two calls, one for the event, one for the mutex. Don't lock mutex in + case of error. + (ipc_cond_signal): Make void function. + (ipc_cond_close): Ditto. + (_mq_send): Immediately return -1 in case of error from + ipc_cond_timedwait. + (_mq_receive): Ditto. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (GetSecurityDescriptorDacl): Remove. + (GetSecurityDescriptorGroup): Remove. + (GetSecurityDescriptorOwner): Remove. + * sec_acl.cc: Replace above functions throughout with their ntdll.dll + equivalent. Remove redundant debug output. + * sec_auth.cc: Ditto. + * security.cc: Ditto. + * uinfo.cc: Ditto. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (InitializeAcl): Remove. + (AddAce): Remove. + (FindFirstFreeAce): Remove. + (GetAce): Remove. + (InitializeSecurityDescriptor): Remove. + (OpenProcessToken): Remove. + * dcrt0.cc: Replace above functions throughout with their ntdll.dll + equivalent. + * fhandler_tty.cc: Ditto. + * flock.cc: Ditto. + * pinfo.cc: Ditto. Drop unnecessary error handling. + * sec_acl.cc: Ditto. + * sec_auth.cc: Ditto. + * sec_helper.cc: Ditto. + * security.cc: Ditto. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (InitializeSid): Remove. + (EqualPrefixSid): Remove. + (GetLengthSid): Remove. + (GetSidSubAuthority): Remove. + (GetSidSubAuthorityCount): Remove. + (GetSidIdentifierAuthority): Remove. + * fhandler_disk_file.cc: Replace above functions throughout with their + ntdll.dll equivalent. + * sec_auth.cc: Ditto. + * sec_helper.cc: Ditto. + * security.cc: Ditto. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (AllocateLocallyUniqueId): Remove. + * fhandler_disk_file.cc (fhandler_base::open_fs): Replace call to + AllocateLocallyUniqueId with call to NtAllocateLocallyUniqueId; + * posix_ipc.cc (mq_open): Ditto. Drop error handling for that call. + (sem_open): Ditto. + +2011-04-28 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetSecurityInfo): Remove. + * ntdll.h (RtlConvertToAutoInheritSecurityObject): Declare. + (RtlDeleteSecurityObject): Declare. + (RtlGetControlSecurityDescriptor): Declare. + (RtlLengthSecurityDescriptor): Declare. + * security.cc (file_mapping): New global variable. + (get_file_sd): Rewrite. Clean up code. Get rid of GetSecurityInfo + call. + (alloc_sd): Call RtlSetControlSecurityDescriptor to set + SE_DACL_PROTECTED flag. + (check_file_access): Remove mapping. Use file_mapping instead. + (check_registry_access): Rename mapping to reg_mapping. + * wincap.cc: Througout, drop use_get_sec_info_on_dirs, + * wincap.h (struct wincaps): Drop use_get_sec_info_on_dirs. + +2011-04-24 Corinna Vinschen <corinna@vinschen.de> + + * include/fenv.h: Add missing _FENV_H_ define. + +2011-04-23 Corinna Vinschen <corinna@vinschen.de> + + * registry.cc (reg_key::get_dword): Rename from get_int, use DWORD + rather than int type. Avoid compiler warning. + (reg_key::set_dword): Rename from set_int, use DWORD rather than int + type. Change return type to NTSTATUS. + (reg_key::get_string): Change return type to NTSTATUS. + (reg_key::set_string): Ditto. + * registry.h: Accommodate above changes. + * environ.cc (regopt): Test return value of reg_key::get_string as + NTSTATUS. + * sched.cc (sched_rr_get_interval): Change local int vars to DWORD. + Call reg_key::get_dword instead of reg_key::get_int. + * shared.cc (init_installation_root): Test return value of + reg_key::get_string as NTSTATUS. + (shared_info::heap_slop_size): Call reg_key::get_dword rather than + reg_key::get_int. + (shared_info::heap_chunk_size): Ditto. + * shared_info.h (CURR_SHARED_MAGIC): Update. + (class shared_info): Change heap_chunk and heap_slop to DWORD values. + +2011-04-21 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::init_thread): Drop setting locals.process_logmask. + * cygtls.cc (_cygtls::remove): Always free mallocated TLS storage on + thread exit. Drop freeing locals.process_ident. + * cygtls.h (struct _local_storage): Remove syslog-related members. + * syslog.cc (syslog_globals): New static storage for global syslog + settings. Use throughout instead of _my_tls.locals. + (openlog): Set new syslog_globals.process_ident value more carefully. + * tlsoffsets.h: Regenerate. + +2011-04-21 Thomas Stalder <cygwinml@gmail.com> + + * include/sys/poll.h: Include signal.h to get definition of sigset_t. + +2011-04-20 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygheap.cc (init_cygheap::close_ctty): Avoid closing console-cttys + since they don't use archetypes and this will just result in double + frees. + * dll_init.cc (dll_list::protect): Define. + (dll_list::alloc): Guard list access. + (dll_list::detach): Ditto. + * dll_init.h (dll_list::protect): Declare new muto. + (dll_list::guard): Define/declare function to guard list access. + * fhandler_termios.cc (fhandler_termios::sigflush): Avoid SEGV in + pathological condition of get_ttyp() == NULL. + +2011-04-20 Christopher Faylor <me.cygwin2011@cgf.cx> + + * select.cc (serial_cleanup): Make sure that device_specific_pipe is + always deleted regardless of whether it has a unique thread associated + with it + (socket_cleanup): Ditto. + (mailslot_cleanup): Ditto. + +2011-04-20 Corinna Vinschen <corinna@vinschen.de> + + * devices.h: Renumber internal devices so that FH_PROCESS is part of + the /proc family of virtual devices. + (FH_PROC_MAX_MINOR): Define. + * path.h (isproc_dev): Use FH_PROC_MAX_MINOR rather than FH_PROC. + +2011-04-19 Peter Rosin <peda@lysator.liu.se> + + * select.cc (pipe_cleanup): Make sure that device_specific_pipe is + always deleted regardless of whether it has a unique thread associated + with it. + +2011-04-19 Jon TURNEY <jon.turney@dronecode.org.uk> + + * thread.cc (semaphore::init): We cannot reliably infer anything from + the existing contents of sem, so merely warn rather than return EBUSY + if it looks like we are reinitialising a semaphore. + +2011-04-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetConsoleWindow): Drop. + (GetSystemWindowsDirectoryW): Drop. + * fhandler_console.cc (beep): Call GetSystemWindowsDirectoryW instead of + GetWindowsDirectoryW. + * uinfo.cc (cygheap_user::env_systemroot): Call + GetSystemWindowsDirectoryW and convert to multibyte on the fly. + * winlean.h (GetWindowsDirectoryW): Redefine to something invalid. + Explain why. + +2011-04-19 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_IMPORTS): Drop advapi32.dll. + * autoload.cc: Enable autoloading advapi32 functions. + * environ.cc (regopt): Use wide char arguments in reg_key functions. + * fhandler_console.cc (beep): Ditto. Use WCHAR throughout. + * registry.cc (reg_key): Rewrite reg_key class to use native NT registry + functions. Use WCHAR string parameters throughout. Use PCWSTR rather + than const WCHAR. Drop multibyte char functionality. Drop unused + methods. + (get_registry_hive_path): Use RtlQueryRegistryValues to fetch path from + registry. + (load_registry_hive): Drop useless check for user hive being available. + Load hive using NtLoadKey. + * registry.h: Accommodate above changes. + * sched.cc (sched_rr_get_interval): Use wide char arguments in reg_key + functions. + * shared.cc (init_installation_root): Ditto. + (shared_info::init_obcaseinsensitive): Use RtlQueryRegistryValues to + fetch obcaseinsensitive value. + (shared_info::heap_slop_size): Use wide char arguments in reg_key + functions. + (shared_info::heap_chunk_size): Ditto. + * syscalls.cc (gethostid): Ditto. + * winsup.h (__WIDE): Define. + (_WIDE): Define. + * libc/minires-os-if.c (get_registry_dns_items): Don't fetch values + from registry. Just extract them from given UNICODE_STRING parameter. + (get_registry_dns): Fetch all registry values at once using + RtlQueryRegistryValues. + +2011-04-19 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_ipv4fromreg_ipcnt): Rearrange to fetch all registry + values at once using RtlQueryRegistryValues. + (get_ipv4fromreg): Ditto. + +2011-04-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (fhandler_registry::fstat): Use RegQueryInfoKeyW. + +2011-04-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (read_value): Remove definition. + (print): Simplify. + (format_proc_cpuinfo): Drop useless call to GetSystemInfo. Rearrange + to use Rtl registry functions. Rename dwOldThreadAffinityMask to + orig_affinity_mask. + +2011-04-18 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzload): Don't change global timezone information + when called from gmtime or gmtime_r. + (tzparse): Ditto. + +2011-04-18 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::remove): Always close sockevt handle. + +2011-04-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (ppoll): Export. + * poll.cc (ppoll): Implement. + * posix.sgml (std-gnu): Add ppoll. + * include/cygwin/version.h: Bump API minor number. + * include/sys/poll.h (ppoll): Declare. + +2011-04-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::evaluate_events): Handle the + FD_CLOSE event specially when called from accept. Explain why. + (fhandler_socket::shutdown): Fake success on not-connected socket and + trigger socket event if the read side of a socket is affected. Explain + why. + * poll.cc (poll): Check for saw_shutdown_read on sockets to generate + POLLHUP as well. + +2011-04-18 Corinna Vinschen <corinna@vinschen.de> + + * Fix various copyrights. + +2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * signal.cc (_pinfo::kill): Set this_process_state when process + exists. + +2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * signal.cc (_pinfo::kill): Return 0 when attempting to test for + existence of an existed process which has not yet been reaped. + +2011-04-17 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygheap.h (init_cygheap::ctty): Use base class so that console can + join in the fun. + * dtable.cc (dtable::stdio_init): Remove special-case call to + set_console_ctty (). + * exceptions.cc (sigpacket::process): Conditionally flush terminal + input on certain signals. + * fhandler.h (fhandler_console::get_tty_stuff): Make non-static. + (fhandler_termios::get_ttyp): Move here. + (fhandler_termios::sigflush): Declare. + (fhandler_tty_common::get_ttyp): Delete. + * fhandler_console.cc (fhandler_console::get_tty_stuff): Pass this as + "arch" argument. + (set_console_ctty): Delete. + (tty_list::get_tty): Just return pointer to shared console region, + delaying get_tty_stuff until open(). + (fhandler_console::init): Treat NULL handle as signifying that console + should be opened with O_NOCTTY flag. Rename handle argument to the + more common 'h'. + * fhandler_termios.cc (fhandler_termios::sigflush): Define. + * fhandler_tty.cc (handler_tty_master::init_console): Pass NULL as + first argument to fhandler_console::init. + * pinfo.cc (_pinfo::set_ctty): Change third parameter to + fhandler_termios *. Add extra debugging. + * pinfo.h (_pinfo::set_ctty): Change third parameter to + fhandler_termios *. + + * exceptions.cc (handle_sigsuspend): Don't special-case non-main threads. + +2011-04-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * thread.cc (pthread_setschedprio): New function. + * include/pthread.h (pthread_setschedprio): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * cygwin.din (pthread_setschedprio): Export. + * posix.sgml (std-notimpl) Move pthread_setschedprio from here... + (std-susv4) ...to here. + +2011-04-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * fhandler_proc.cc (proc_tab): Add /proc/swaps virtual file. + (format_proc_swaps): New function. + +2011-04-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in: Move srcdir definition before others which uses it. + +2011-04-06 Jon TURNEY <jon.turney@dronecode.org.uk> + + * dll_init.cc (reserve_at, release_at): New functions. + (load_after_fork): If the DLL was loaded higher than the required + address, assume that it loaded at it's base address and also reserve + memory there to force it to be relocated. + +2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/cygwin/types.h: Move #include <sys/sysmacros.h> to + end of header so that it gets the dev_t typedef. + * include/sys/sysmacros.h (gnu_dev_major, gnu_dev_minor, + gnu_dev_makedev): Prototype and define as inline functions. + (major, minor, makedev): Redefine in terms of gnu_dev_*. + +2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/cygwin/types.h: Move multiple inclusion guards to + beginning and end of header. + +2011-04-04 Christopher Faylor <me.cygwin2011@cgf.cx> + + * Makefile.in: Move Makefile.common include earlier to fix problems + with relative ${srcdir} path which confuses make. + +2011-04-04 Corinna Vinschen <corinna@vinschen.de> + + Drop NT4 support. + * autoload.cc (DnsQuery_A): Fatal if not available. + (DnsRecordListFree): Ditto. + (DsGetDcNameW): Ditto. + (NetGetAnyDCName): Remove. + (NetGetDCName): Remove. + (EnumProcessModules): Fatal if not available. + (GetModuleFileNameExW): Ditto. + (GetModuleInformation): Ditto. + (GetProcessMemoryInfo): Ditto. + (QueryWorkingSet): Ditto. + (LsaRegisterLogonProcess): Ditto. + * fenv.cc (_feinitialise): Drop supports_sse condition. + * fhandler_disk_file.cc (path_conv::isgood_inode): Fix comment. + (fhandler_base::fstat_by_name): Drop has_fileid_dirinfo condition. + (fhandler_disk_file::opendir): Ditto. + * fhandler_netdrive.cc (fhandler_netdrive::readdir): Fix comment. + * fhandler_proc.cc (format_proc_partitions): Drop NT4-only code. + * fhandler_process.cc (get_process_state): Ditto. + * kernel32.cc (GetWindowsDirectoryW): Remove. + (GetWindowsDirectoryA): Remove. + * miscfuncs.cc (nice_to_winprio): Drop NT4-only code. + * mount.cc (fs_info::update): Fix comments. + * net.cc (get_2k_ifs): Drop NT4-only code. + * sec_auth.cc (get_logon_server): Ditto. + (lsaauth): Drop NT4-specific error handling. + * security.cc (alloc_sd): Set SE_DACL_PROTECTED unconditionally. + * select.cc (select_stuff::wait): Always use MWMO_INPUTAVAILABLE. + (peek_windows): Drop NT4-only condition in call to PeekMessage. + * syscalls.cc (gethostid): Remove NT4-only workaround. + * wincap.cc: Througout, drop has_dacl_protect, + has_broken_if_oper_status, has_process_io_counters, + has_terminal_services, has_extended_priority_class, has_guid_volumes, + has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse from + wincaps. + (wincap_nt4sp4): Remove. + (wincap_minimal): Set to wincap_2000. + (wincapc::init): Rely on availability of OSVERSIONINFOEX structure. + Treat error from GetVersionEx as fatal. Treat NT4 as fatal. + * wincap.h (struct wincaps): Drop has_dacl_protect, + has_broken_if_oper_status, has_process_io_counters, + has_terminal_services, has_extended_priority_class, has_guid_volumes, + has_fileid_dirinfo, has_mwmo_inputavailable and supports_sse flags + and methods. + * winlean.h (GetWindowsDirectoryW) Define as GetSystemWindowsDirectoryW. + (GetWindowsDirectoryA): Define as GetSystemWindowsDirectoryA. + +2011-04-04 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Fix a comment to + reflect the current state. + +2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in (fhandler_proc_CFLAGS): Define USERNAME, HOSTNAME, + and GCC_VERSION. + * fhandler_proc.cc (format_proc_version): Add build machine and GCC + version information as on Linux. + +2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + Corinna Vinschen <corinna@vinschen.de> + + * devices.h (fh_devices): Define FH_PROC_MIN_MINOR. + Reorder major-0 devices so that all /proc directories fall + between FH_PROC and FH_PROC_MIN_MINOR. + * path.h (isproc_dev): Redefine accordingly. + +2011-04-04 Corinna Vinschen <corinna@vinschen.de> + + * cygserver_setpwd.h (setlsapwd): Add username parameter to declaration. + * external.cc (cygwin_internal): In the CW_SET_PRIV_KEY case, fetch + additional username parameter. + * setlsapwd.cc (setlsapwd): Add username parameter. Allow admin to + set the hidden password for other users. + +2011-04-04 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_user_groups): Mark well-known groups as well-known. + (get_user_local_groups): Ditto. + (verify_token): Drop useless label. + * sec_helper.cc (cygsid::get_sid): Check for well-known SID if + well_known isn't set. + * security.h (well_known_sid_type): New inline function. + +2011-04-02 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (FindFirstVolumeA): Remove. + (FindNextVolumeA): Remove. + (FindVolumeClose): Remove. + (GetVolumeNameForVolumeMountPointA): Remove. + * ntdll.h (NtFlushBuffersFile): Declare. + * syscalls.cc (sync_worker): Rewrite using native NT functions. + (sync): Ditto. + +2011-04-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Express length in WCHAR + size. + +2011-04-02 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetExtendedTcpTable): Remove. + (GetTcpTable): Remove. + (CharNextExA): Remove. + (FindWindowA): Remove. + (ShowWindowAsync): Remove. + * dcrt0.cc (disable_dep): Remove unused function. + (dll_crt0_0): Drop comment babbling about TS & DEP. + * fhandler_socket.cc (address_in_use): Remove unused function. + * wincap.cc: Throughout, drop ts_has_dep_problem from wincaps. + (wincapc::init): Drop code setting ts_has_dep_problem flag. + * wincap.h (struct wincaps): Drop ts_has_dep_problem flags and method. + +2011-04-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + Implement /proc/sysvipc/* + * devices.in (dev_procsysvipc_storage): Add. + * devices.cc: Regenerate. + * devices.h (fh_devices): Add FH_PROCSYSVIPC. + * dtable.cc (build_fh_pc): Add case FH_PROCSYSVIPC. + * fhandler.h (class fhandler_procsysvipc): Declare. + (fhandler_union): Add __procsysvipc. + * fhandler_proc.cc (proc_tab): Add sysvipc virt_directory. + * fhandler_procsysvipc.cc: New file. + * Makefile.in (DLL_OFILES): Add fhandler_procsysvipc.o. + * path.h (isproc_dev): Add FH_PROCSYSVIPC to conditional. + +2011-04-01 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add avapi32.o. + * advapi32.cc: New file. + * autoload.cc: Add block of remaining advapi32 functions used by + Cygwin. Keep commented out. Explain why. + +2011-04-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * fhandler_proc.cc (format_proc_loadavg): Add running/total + processes as fourth component of output. + * fhandler_process.cc (get_process_state): Make non-static. + Add FIXME about generating an 'O' flag. + +2011-04-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_random.cc (fhandler_dev_random::crypt_gen_random): + Use CryptAcquireContextW. + * ntdll.h (STATUS_PROCEDURE_NOT_FOUND): Define. + * sec_auth.cc (open_local_policy): Rename NTSTATUS variable ret to + status. Drop usage of LsaNtStatusToWinError. + (verify_token): Call NtQuerySecurityObject instead of + GetKernelObjectSecurity. + (create_token): Rename NTSTATUS variable ret to status. Rename ret2 to + sub_status. Drop usage of LsaNtStatusToWinError. In case LsaLogonUser + fails, report the sub_status as well. + +2011-04-01 Corinna Vinschen <corinna@vinschen.de> + + * libc/strptime.c: Remove misleading comment. + +2011-03-31 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: Allow usage from plain C code. + (FSCTL_PIPE_IMPERSONATE): Define. + (enum _THREAD_INFORMATION_CLASS): Define. + (RTL_QUERY_REGISTRY_xxx): Define. + (RTL_REGISTRY_xxx): Define. + (PRTL_QUERY_REGISTRY_ROUTINE): Define. + (struct _RTL_QUERY_REGISTRY_TABLE): Define. + (enum _KEY_VALUE_INFORMATION_CLASS): Define. + (struct _KEY_VALUE_PARTIAL_INFORMATION): Define. + (NtAccessCheck): Declare. + (NtAllocateLocallyUniqueId): Declare. + (NtCreateKey): Declare. + (NtDuplicateToken): Declare. + (NtLoadKey): Declare. + (NtOpenKey): Declare. + (NtOpenProcessToken): Declare. + (NtOpenThreadToken): Declare. + (NtPrivilegeCheck): Declare. + (NtQueryInformationToken): Declare. + (NtQueryValueKey): Declare. + (NtSetInformationThread): Declare. + (NtSetInformationToken): Declare. + (NtSetValueKey): Declare. + (RtlAbsoluteToSelfRelativeSD): Declare. + (RtlAddAccessAllowedAce): Declare. + (RtlAddAccessDeniedAce): Declare. + (RtlAddAce): Declare. + (RtlCheckRegistryKey): Declare. + (RtlCopySid): Declare. + (RtlCreateAcl): Declare. + (RtlCreateRegistryKey): Declare. + (RtlCreateSecurityDescriptor): Declare. + (RtlEqualPrefixSid): Declare. + (RtlEqualSid): Declare. + (RtlFirstFreeAce): Declare. + (RtlGetAce): Declare. + (RtlGetDaclSecurityDescriptor): Declare. + (RtlGetGroupSecurityDescriptor): Declare. + (RtlGetOwnerSecurityDescriptor): Declare. + (RtlIdentifierAuthoritySid): Declare. + (RtlInitializeSid): Declare. + (RtlLengthSid): Declare. + (RtlQueryRegistryValues): Declare. + (RtlSetControlSecurityDescriptor): Declare. + (RtlSetDaclSecurityDescriptor): Declare. + (RtlSetGroupSecurityDescriptor): Declare. + (RtlSetOwnerSecurityDescriptor): Declare. + (RtlSubAuthorityCountSid): Declare. + (RtlSubAuthoritySid): Declare. + (RtlWriteRegistryValue): Declare. + +2011-03-31 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::init): Don't call GetUserName. Fetch username + from Windows environment instead. Explain why. + (cygheap_user::env_domain): Use MAX_DOMAIN_NAME_LEN rather than DNLEN + to specify the size of the domain name buffer. + +2011-03-30 Corinna Vinschen <corinna@vinschen.de> + + * hires.h: Fix copyright. + * times.cc: Ditto. + (FACTOR): Add comment. + (NSPERSEC): Ditto. + (JITTER): New definition. Comment. + (systime_ns): Avoid gratuitous copying of the value returned by + GetSystemTimeAsFileTime. + (corelocaltime, localtime, gmtime): Remove very old, unused code block. + (cygwin_tzset): Remove. + (hires_ms::timeGetTime_ns): Add missing semicolon in comment. + (hires_ms::nsecs): Redefine check for difference between internal + timer value and system time. + +2011-03-30 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (hires_ms::resolution): Make sure resolution is never 0. + (clock_setres): Ditto. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (struct _local_storage): Redefine process_ident as wchar_t + pointer. + * syslog.cc (CYGWIN_LOG_NAME): Convert to wide char constant. + (openlog): Convert incoming ident string to wide char. Fix formatting. + (vsyslog): Print ident string as wide char string. Convert message + string to wide char and call UNICODE Win32 Event functions to make sure + to use correct codeset. + * tlsoffset.h: Regenerate. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Make externally available. + * autoload.cc (GetUdpTable): Define. + * syslog.cc (connect_syslogd): Use get_inet_addr rather than _stat64 + to check for local socket file. Create socket with type returned by + get_inet_addr. If connect on UDP socket works, test if there's + really a listening peer, otherwise fall back to Windows event log. + (try_connect_syslogd): Use syslogd_inited flag to check if syslogd + is available. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::env_domain): Use LookupAccountSidW and + convert user and domain to multibyte strings to make sure to use + correct codeset. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (UuidCreate): Remove. + (UuidCreateSequential): Remove. + * passwd.cc (internal_getpwsid): Avoid a strict-aliasing compiler + error with gcc 4.5.1. + * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Ditto. + * ntdll.h (NtAllocateUuids): Declare. + * syscalls.cc (gethostid): Use NtAllocateUuids function rather than + UuidCreateSequential/UuidCreate to get rid of rpcrt4 dependency. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (pthread_spin_destroy): Export. + (pthread_spin_init): Export. + (pthread_spin_lock): Export. + (pthread_spin_trylock): Export. + (pthread_spin_unlock): Export. + * posix.sgml (std-susv4): Add pthread_spin_destroy, pthread_spin_init, + pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock. + (std-notimpl): Remove pthread_spin_[...]. + * pthread.cc (pthread_spin_init): New function. + * thread.cc (pthread_spinlock::is_good_object): New function. + (pthread_mutex::pthread_mutex): Rearrange initializers to accommodate + protected data in pthread_mutex. + (pthread_spinlock::pthread_spinlock): New constructor. + (pthread_spinlock::lock): New method. + (pthread_spinlock::unlock): New method. + (pthread_spinlock::init): New method. + (pthread_spin_lock): New function. + (pthread_spin_trylock): New function. + (pthread_spin_unlock): New function. + (pthread_spin_destroy): New function. + * thread.h (PTHREAD_SPINLOCK_MAGIC): Define. + (class pthread_mutex): Change access level of members shared with + derived classes to protected. + (pthread_mutex::set_shared): New protected method. + (class pthread_spinlock): New class, derived class of pthread_mutex. + * include/pthread.h (pthread_spin_destroy): Declare. + (pthread_spin_init): Declare. + (pthread_spin_lock): Declare. + (pthread_spin_trylock): Declare. + (pthread_spin_unlock): Declare. + * include/cygwin/types.h (pthread_spinlock_t): New typedef. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (SIO_BASE_HANDLE): Define. + (fdsock): If we got an LSP handle, try to create a copy of the base + handle instead. Change comment to explain. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 10. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (winmm): Remove time functions. Don't treat + unloadable wave functions as fatal. + * hires.h (hires_ms::timeGetTime_ns): New private method. + (hires_ms::dmsecs): Call timeGetTime_ns here. + * ntdll.h (struct _KSYSTEM_TIME): Define. + (KUSER_SHARED_DATA): Redefine to allow access to InterruptTime. + (SharedUserData): Define here. + (NtQueryTimerResolution): Declare. + (NtSetTimerResolution): Declare. + * path.cc (SharedUserData): Move to ntdll.h. + * times.cc (hires_ms::timeGetTime_ns): New private method. + Use throughout instead of timeGetTime. Document entire functionality + of timeGetTime in case we need it. + (hires_ms::resolution): Try a call to NtQueryTimerResolution + to fetch current period. Fall back to heuristic if that fails. + Cast to DWORD in assignments to minperiod. + (clock_setres): Align period to possible values per a call to + NtQueryTimerResolution. Explain why. Replace calls to timeBeginPeriod + and timeEndPeriod with underlying call to NtSetTimerResolution. Use + status code from NtSetTimerResolution to compute errno. + Convert period to ULONGLONG and store 100ns value to simplify code. + +2011-03-29 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + Corinna Vinschen <corinna@vinschen.de> + + * include/sys/xattr.h: New file. + +2011-03-28 Jon TURNEY <jon.turney@dronecode.org.uk> + + * thread.cc (semaphore::init, destroy, close): Standards conformance + fix. On a failure, return -1 and set errno. + * thread.h (semaphore::terminate): Save errno since semaphore::close() + may now modify it. + +2011-03-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (strchrnul): Export. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * posix.sgml (std-gnu): Add strchrnul. + +2011-03-27 Christopher Faylor <me.cygwin2011@cgf.cx> + + * dll_init.cc (dll::init): Accommodate ill-behaved dlls who don't fill + out p.envptr. + +2011-03-25 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Add a cheat to let a certain autoconf test succeed + on 64 bit systems. Explain why. + +2011-03-23 Christopher Faylor <me.cygwin2011@cgf.cx> + + * wincap.cc (wincap_2003): Set use_dont_resolve_hack to true. + +2011-03-23 Christopher Faylor <me.cygwin2011@cgf.cx> + + * autoload.cc (dll_load): Change error message to make it clear if a + newer DLL is being run. + +2011-03-20 Corinna Vinschen <corinna@vinschen.de> + + * fenv.cc (_feinitialise): Don't use SSE instructions on systems not + supporting them. + * wincap.h (wincaps::supports_sse): New element. + * wincap.cc: Implement above element throughout. + +2011-03-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc: Raise default cygheap size to 2 Megs. + +2011-03-18 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.h (DEFAULT_PIPEBUFSIZE): Reset to 64K. + +2011-03-18 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::alloc_fh): Initialize name strings in fdev to + empty strings or suffer a SEGV. Drop second parameter in call to + build_fh_dev. + +2011-03-18 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (class mmap_record): Pack 4 byte-aligned. Convert member dev + to plain int. + (mmap_record::alloc_fh): Create temporary device from dev and use in + call to build_fh_dev. + +2011-03-18 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap_record::page_map): Define as variable array rather than + as pointer. + (mmap_record::alloc_page_map): Remove. + (mmap_record::free_page_map): Remove. + (mmap_record::init_page_map): New method. + (mmap_record::add_record): Take mmap_record parameter by reference + rather than by value. + (mmap_record::map_pages): Fix comment. + (mmap_list::add_record): Allocate space for mmap_record including the + page_map in a single ccalloc call. Call init_page_map afterwards. + (mmap_list::del_record): Remove call to mmap_record::free_page_map. + +2011-03-16 Corinna Vinschen <corinna@vinschen.de> + + * crt0.c (mainCRTStartup): Move call to _feinitialise from here... + * dcrt0.cc (_dll_crt0): ...to here. + +2011-03-16 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc: Fix copyright dates. + +2011-03-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Only use + file id as inode number if it masters the isgood_inode check. + +2011-03-13 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Remove + special treatment for ERROR_NO_SYSTEM_RESOURCES. Cancel I/O and reset + the overlapped handle on error. + (fhandler_base_overlapped::write_overlapped): Limit writes to + max_atomic_write bytes in blocking case. Incorporate code from + now-defunct write_overlapped_fallback. Fix serious oversight where ptr + was not advanced as buffer was written. + (fhandler_base_overlapped::write_overlapped_fallback): Eliminate. + * fhandler.h (fhandler_base_overlapped::write_overlapped_fallback): + Ditto for declaration. + (DEFAULT_PIPEBUFSIZE): Lower size to slightly less than documented + worst-case atomic write size. + (fhandler_overlapped::wait_return): Remove unused element. + +2011-03-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Handle + overlapped_fallback error condition like other error conditions. Set + res carefully and specifically for each condition rather than resorting + to a default. + (fhandler_base_overlapped::write_overlapped): Preserve errno in + overlapped_fallback condition. Correct write_overlapped_fallback to + avoid inappropriate looping. + (fhandler_base_overlapped::write_overlapped_fallback): Add some more + comments. + +2011-03-09 Christopher Faylor <me.cygwin2011@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::write_overlapp): Oops! + Accommodate change in arguments to wait_overlapped. + +2011-03-09 Christopher Faylor <me+cygwin@cgf.cx> + + * errno.cc (errmap): Change mapping of NO_SYSTEM_RESOURCES to EFBIG. + * fhandler.cc (MAX_OVERLAPPED_WRITE_LEN): New constant. + (MIN_OVERLAPPED_WRITE_LEN): Ditto. + (fhandler_base_overlapped::close): Accommodate change in arguments to + wait_overlapped. + (fhandler_base_overlapped::setup_overlapped): Add __stdcall and regparm + modifiers. + (fhandler_base_overlapped::destroy_overlapped): Ditto. + (fhandler_base_overlapped::has_ongoing_io): Ditto. + (fhandler_base_overlapped::wait_overlapped): Modify to return an enum + returning various states. Accept nonblocking parameter. + (fhandler_base_overlapped::read_overlapped): Add __stdcall and regparm + modifiers. Rework to attempt to be smarter about reacting to states + returned by wait_overlapped. + (fhandler_base_overlapped::write_overlapped): Ditto. Add fallback + option for when wait_overlapped detects that smaller chunks must be + written. + (fhandler_base_overlapped::write_overlapped_fallback): Ditto. + * fhandler.h (DEFAULT_PIPEBUFSIZE): Move definition here from pipe.cc. + (fhandler_base::has_ongoing_io): Define with __stdcall and regparm + modifiers. + (fhandler_base_overlapped::wait_return): New enum. + (fhandler_base_overlapped::max_atomic_write): New variable. + (fhandler_base_overlapped:: wait_overlapped): Accommodate changes + mentioned above to arguments and modifiers. + (fhandler_base_overlapped::setup_overlapped): Ditto for modifiers. + (fhandler_base_overlapped::read_overlapped): Ditto. + (fhandler_base_overlapped::write_overlapped): Ditto. + (fhandler_base_overlapped::destroy_overlapped): Ditto. + (fhandler_base_overlapped::has_ongoing_io): Ditto. + (fhandler_base_overlapped::fhandler_base_overlapped): Zero + max_atomic_write. + * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Set max_atomic_write + to the size of the DEFAULT_PIPEBUFSIZE. + (fhandler_fifo::wait): Accommodate change in arguments to + wait_overlapped. + * pipe.cc (fhandler_pipe::fhandler_pipe): Set max_atomic_write to the + size of the DEFAULT_PIPEBUFSIZE. + (fhandler_pipe::create_selectable): Allow minimum size of DEFAULT_PIPEBUFSIZE. + (DEFAULT_PIPEBUFSIZE): Delete here, move to fhandler.h. + +2011-03-08 Corinna Vinschen <corinna@vinschen.de> + + * security.cc: Fix copyright dates. + +2011-03-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::open): When creating a file on a + filesystem supporting ACLs, create the file with WRITE_DAC access. + Explain why. + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for + directories. + * fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets. + * path.cc (symlink_worker): Ditto for symlinks. + * security.cc (get_file_sd): Always call GetSecurityInfo for directories + on XP and Server 2003. Improve comment to explain why. + (set_file_attribute): Explicitely cast mode_t value to bool in call to + get_file_sd. + * wincap.h (wincaps::use_get_sec_info_on_dirs): New element. + * wincap.cc: Implement above element throughout. + +2011-03-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::exists): Rewrite. + (fhandler_procsys::fill_filebuf): Fill buffer with valid string even if + reading the symlink fails. + +2011-03-03 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_cond_timedwait): If ipc_mutex_unlock fails, return + actual error number. + (_mq_send): Break loop if ipc_cond_timedwait returns with error. + (_mq_receive): Ditto. + +2011-03-03 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (__xpg_strerror_r): Add accidentally missing condition. + +2011-03-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::open): Call worker exists + method, rather than wrapper. + +2011-03-01 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (dll_load): Avoid in_forkee test since this apparently + fails even when not forked. + +2011-03-01 Christopher Faylor <me+cygwin@cgf.cx> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 9. + +2011-02-28 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (dll_load): Only perform DONT_RESOLVE_DLL_REFERENCES hack + on systems which need it. + * wincap.cc (use_dont_resolve_hack): Set as appropriate. + * wincap.h (use_dont_resolve_hack): Define. + +2011-02-28 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (dll_load): Make inline. Clarify logic. + +2011-02-27 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (dll_load): Only call LoadLibraryExW with + DONT_RESOLVE_DLL_REFERENCES if a normal LoadLibrary call failed with + ERROR_INVALID_ADDRESS. + (LsaRegisterLogonProcess): Align comment to previous change. + +2011-02-26 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc: Use LoadDLLfuncEx3 for all winmm functions. Accommodate + changes to LoadDLLprime. + (LoadDLLprime): Take an extra argument indicating whether this dll + needs special handling on fork. Place this information in the "handle" + location. + (LoadDLLfuncEx3): Eliminate "func" handling. Pass new + no_resolve_on_fork argument to LoadDLLprime. + (dll_load): New function. + (std_dll_init): Accommodate changes to dll_info::handle. Use dll_load + to load DLL in both cases where it is used. + +2011-02-26 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Make autoloaded ntdll function non-optional. Ditto for + secur32 functions, except for LsaRegisterLogonProcess. Change return + value to ERROR_PROC_NOT_FOUND. Explain why. + * sec_auth.cc (lsaauth): Handle ERROR_PROC_NOT_FOUND from call to + LsaRegisterLogonProcess when generating the errno value. + +2011-02-22 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc: Fix copyright dates. + * winsup.h: Ditto. + * syscalls.cc (_read): Move EXPORT_ALIAS to its rightful place. + +2011-02-21 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin.din: Mark __assert* and _abort as NOSIGFE. + +2011-02-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket (fhandler_socket::readv): Call recv_internal directly, + rather than recvmsg. + (fhandler_socket::writev): Call send_internal directly, rather than + sendmsg. + * net.cc (cygwin_recv): Call fhandler_socket::recvfrom directly, rather + than cygwin_recvfrom. + (cygwin_send): Call fhandler_socket::sendto directly, rather than + cygwin_sendto. + +2011-02-20 Christopher Faylor <me+cygwin@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::close): Finish any pending I/O + before closing. + (fhandler_base_overlapped::wait_overlapped): Defensively zero bytes + read. Add more info to debugging output. + +2011-02-18 Christopher Faylor <me+cygwin@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Add a CYGHEAP_DEBUG conditional for debugging + which allocates a lot of space at startup. + +2011-02-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc: Set alignment of .cygheap section to 64K. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Only set PID_NOTCYGWIN in _P_OVERLAY mode. + Drop flag if creating new process failed. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * Throughout fix copyright dates. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * devices.in: Throughout use slashes instead of backslashes in the + native path of devices not backed by native NT devices. + * devices.cc: Regenerate. + * globals.cc (ro_u_pmem): Use correct case. + (ro_u_globalroot): New R/O unicode string. + * path.cc (path_conv::check): Fix incorrect handling of /proc/sys + block devices if they are just visited due to a component check. + (symlink_info::posixify): Fix typo in comment. + (cygwin_conv_path): Use ro_u_globalroot instead of string constant. + (fast_cwd_version): New shared variable to store FAST_CWD version + used on the system. + (find_fast_cwd_pointer): Rename from find_fast_cwd_pointers. Don't + set global fast_cwd_ptr pointer here. Return pointer value instead. + (find_fast_cwd): New function to set fast_cwd_ptr and fast_cwd_version. + (cwdstuff::override_win32_cwd): Call find_fast_cwd from here. + Check for fast_cwd_version to differ between old and new FAST_CWD + structure. Check old_cwd for NULL to avoid SEGV. Don't set CWD if + we have neitehr a valid fast_cwd_ptr, nor a valid CWD handle in the + process parameter block. + (cwdstuff::set): Create Win32 path taking /proc/sys paths into account. + * spawn.cc (spawn_guts): Recode creating runpath. Also take /proc/sys + paths into account. Drop special CWD handling when starting non-Cygwin + processes. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::opendir): Avoid SEGV if + opening object directory fails. + * fhandler_virtual.cc (fhandler_virtual::opendir): Don't leak memory. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't + append slash if there is one already. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + Revert change from 2010-08-31: + * path.cc (normalize_posix_path): Drop support for //./ and //?/ + prefixes. + (path_conv::check): Ditto. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Use POSIX + path to check for symlink. + +2011-02-14 Corinna Vinschen <corinna@vinschen.de> + + * config/i386/profile.h: Sync with Mingw. + +2011-02-13 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (struct _FAST_CWD): Redefine to new layout used since patch + for KB 2393802. Adjust comments throughout. + (struct _FAST_CWD_OLD): Rename former definition. + (cwdstuff::override_win32_cwd): Check if the OS is using the old or the + new FAST_CWD structure layout and handle accordingly. + +2011-02-11 Christopher Faylor <me+cygwin@cgf.cx> + + * mkstatic: Make sure that we are not cd'ed to temporary directory on + exit to avoid bogus warnings on directory cleanup. + * speclib: Ditto. + * mkimport: Ditto. + +2011-02-11 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin.sc: Eliminate __cygheap_mid. + * cygheap.cc: Ditto. + +2011-02-11 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.cc (_cygheap_mid): Drop unneeded section attribute. + (cygheap_init): Just zero cygheap structure. + * cygwin.sc: Keep 16 byte alignment but drop all other alignments + related to cygheap. Eliminate unused __cygheap_end1. + +2011-02-11 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc: Raise default cygheap size to 1 Meg. Set alignment to + standard 64K. + +2011-02-11 Corinna Vinschen <corinna@vinschen.de> + + * include/endian.h: Move definitions of __BIG_ENDIAN, __LITTLE_ENDIAN, + and __BYTE_ORDER into ... + * include/bits/endian.h: New file. + * include/arpa/nameser_compat.h: Include endian.h rather than defining + BYTE_ORDER here. + * include/asm/byteorder.h: Include bits/endian.h. Drop definition of + __LITTLE_ENDIAN. + * include/netinet/ip.h: Include bits/endian.h. Drop definitions of + BIG_ENDIAN, LITTLE_ENDIAN, and BYTE_ORDER. Use underscored variants + of aforementioned constants. + * include/netinet/tcp.h: Ditto. + * include/sys/param.h: Drop disabled definitions of BIG_ENDIAN, + LITTLE_ENDIAN, and BYTE_ORDER. + + * include/netinet/ip.h: Reformat. Define setsockopt IP_TOS options + matching recent RFCs. Tweak comments. + +2011-02-10 Eric Blake <eblake@redhat.com> + + * errno.cc (includes): Avoid compilation failure if <string.h> + settles on wrong strerror_r signature. + + * errno.cc (__xpg_strerror_r): New function. + (strerror_r): Update to copy newlib's fixes. + (strerror): Set errno on failure. + (_sys_errlist): Cause EINVAL failure for reserved values. + * cygwin.din: Export new function. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Combine + this into minor 236. + +2011-02-09 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (pthread_yield): Export as alias to sched_yield. + * include/pthread.h (pthread_yield): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * posix.sgml (std-deprec): Add pthread_yield. + +2011-02-09 Christopher Faylor <me+cygwin@cgf.cx> + + * cygheap.cc: Add some __stdcall decoration where appropriate. + * lib/cygwin_crt0.c: __attribute -> __attribute__. + +2011-02-09 Christopher Faylor <me+cygwin@cgf.cx> + + * hookapi.cc (hook_or_detect_cygwin): Prevent i from being considered + uninitialized by gcc. + +2011-02-09 Christopher Faylor <me+cygwin@cgf.cx> + + * exception.h: Remove DEBUG_EXCEPTION left over debugging ifdef. + +2011-02-08 Christopher Faylor <me+cygwin@cgf.cx> + + * dll_init.cc: Fix typo in comment. + +2011-02-07 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Remove AC_ALLOCA test and test for __builtin_memset. + * configure: Regenerate. + +2011-02-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::write_normal): Remove + erroneous premature return after collecting truncated multibyte + sequence in trunc_buf. Rather fall through to printing routine. + Fix return value to take trunc_buf content into account. Improve + comments. + +2011-02-05 Christopher Faylor <me+cygwin@cgf.cx> + + * autoload.cc (wsock_init): Properly define WSAStartup function pointer + to avoid stack damage. + +2011-02-02 Corinna Vinschen <corinna@vinschen.de> + + * libc/bsdlib.cc: Include err.h. + +2011-02-02 Eric Blake <eblake@redhat.com> + + * include/err.h: Fix loss of semicolons in previous patch. + +2011-02-02 Corinna Vinschen <corinna@vinschen.de> + + * include/err.h (err): Add noreturn attribute. + (errx): Ditto. + (verr): Ditto. + (verrx): Ditto. + +2011-02-02 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (conv_path_list): Remove enclosing quotes and trailing + backslashes from Win32 environment path lists. + +2011-02-01 Christian Franke <franke@computer.org> + + * fhandler.cc (fhandler_base::fsync): Ignore ERROR_INVALID_FUNCTION + error from FlushFileBuffers(). + +2011-01-31 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (utmp_data): Fix potential buffer overflow. + +2011-01-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (address_in_use): Improve comment readability. + +2011-01-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (address_in_use): Disable. Add comment. + (fhandler_socket::bind): Change comment to explain setting the + SO_EXCLUSIVEADDRUSE socket option. Remove code which checks for + address in use. + * net.cc (cygwin_setsockopt): Never set SO_REUSEADDR option. Improve + comment to compensate for the deleted comment in fhandler_socket::bind. + * wincap.cc: Throughout, drop has_enhanced_socket_security from wincaps. + * wincap.h (struct wincaps): Drop has_enhanced_socket_security flags + and method. + +2011-01-28 Peter Foley <jpfoley2@verizon.net> + + * configure.in: Define LIBSERVER regardless of cross_host. + * configure: Regenerate. + +2011-01-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::wait_for_events): Call + pthread_testcancel in case of timeout to enable pthread_cancel + on waiting thread. + +2011-01-27 Corinna Vinschen <corinna@vinschen.de> + + * include/features.h (__STDC_ISO_10646__): Move to newlib's + sys/features.h. + +2011-01-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Fix + computation of st_blocks. + (fhandler_base::fstat_helper): Fix formatting. + +2011-01-24 Corinna Vinschen <corinna@vinschen.de> + + * include/features.h (__STDC_ISO_10646__): Define. Add comment. + +2011-01-21 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Fix permission problem with symlinks on NFS. + Rework how NtOpenFile gets called to make it more readable. Change + comment. + +2011-01-20 Corinna Vinschen <corinna@vinschen.de> + + * exec.cc: Include pinfo.h. + * winf.h: Move definitions of _P_PATH_TYPE_EXEC and _P_MODE from here... + * pinfo.h: ...to here. + (_P_PATH_TYPE_EXEC): Redefine to be bigger than _P_SYSTEM. + (_P_MODE): Redefine so as not to mask out _P_SYSTEM. + * spawn.cc (spawnlp): Add _P_PATH_TYPE_EXEC flag in call to spawnve. + (spawnlpe): Ditto. + (spawnvp): Ditto. + +2011-01-19 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (av::fixup): Reenable #! handling for all exec functions. + Return ENOEXEC in !p_type_exec case only for unrecognized files. + Fix comment formatting. + +2011-01-19 Corinna Vinschen <corinna@vinschen.de> + + * exec.cc (execlp): Add missing _P_PATH_TYPE_EXEC flag in call to + spawnve. + +2011-01-19 Corinna Vinschen <corinna@vinschen.de> + + * exec.cc: Rearrange functions in alphabetical order. + (_execve): Drop temporary define and drop export alias. + (execl): Call spawnve. + (execle): New function. + (execlp): New function. + (execv): Call spawnve. + (execve): Drop converting NULL envp to emtpy envp. + (execvp): Call spawnve. + (execvpe): Drop converting NULL envp to emtpy envp. Call spawnve. + (fexecve): Call spawnve. + * spawn.cc (spawnve): Convert NULL envp to emtpy envp. Remove outdated + comment. + (spawnlp): Call spawnve. + (spawnlpe): Ditto. + (spawnvp): Ditto. + (spawnvpe): Fix formatting. + +2011-01-19 Corinna Vinschen <corinna@vinschen.de> + + * exec.cc (strccpy): Move function from here... + * strfuncs.cc (strccpy): ...to here. + * string.h (strccpy): Declare. + * winsup.h (strccpy): Drop declaration. + +2011-01-19 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Add error codes for invalid binaries. + * exec.cc (execvp): Call spawnve with _P_PATH_TYPE_EXEC flag + from here. + (execvpe): Ditto. + * spawn.cc (spawn_guts): Filter _P_PATH_TYPE_EXEC from mode and + store in p_type_exec. Call av::fixup with addtional p_type_exec + argument. + (spawnve): Check for filtered mode. + (spawnvpe): Add _P_PATH_TYPE_EXEC flag when calling spawnve. + (av::fixup): Accept additional bool parameter p_type_exec. Only check + for script if p_type_exec is true. + * winf.h (_P_PATH_TYPE_EXEC): Define. + (_P_MODE): Define. + (av::fixup): Declare with additional bool parameter. + +2011-01-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Fix compiler warning. + +2011-01-17 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Don't follow reparse point symlinks if + PC_SYM_NOFOLLOW_REP flag is set. + (cygwin_conv_path): Set PC_SYM_NOFOLLOW_REP flag when converting from + POSIX to Win32. + * path.h (enum pathconv_arg): Define PC_SYM_NOFOLLOW_REP flag. + +2011-01-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (proc_tab_cmp): Fix typo in comment. + (fhandler_proc::fill_filebuf): Handle return value of 0 from format + function as error. + (format_proc_stat): Set errno when returning 0 size. + (format_proc_partitions): Rewrite method to fetch partition info. + +2011-01-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Always set + st_size of directories to 0. Explain why. + +2011-01-12 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml: Add madvise to BSD list. + +2011-01-12 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (madvise): Export posix_madvise as madvise. + * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR. + * include/sys/mman.h: Define madvise constants, keep Linux-specific + constants undefined. + (madvise): Declare. + +2011-01-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (struct part_t): New type. + (class fhandler_dev_floppy): Convert partitions to part_t pointer. + Add lock_partition method. + * fhandler_floppy.cc (fhandler_dev_floppy::lock_partition): New method + to implement ondemand partition locking. + (fhandler_dev_floppy::write_file): Call lock_partition from here if + writing failed due to a potential write restriction on a disk + partition. + (fhandler_dev_floppy::open): Don't lock partitions here. + (fhandler_dev_floppy::close): Keep track of partition handle reference + count. Close handles and remove partitions pointer ony if count is 0. + (fhandler_dev_floppy::dup): Just copy partitions pointer and increment + reference count. + +2011-01-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (MAX_PARTITIONS): New definition. + (class fhandler_dev_floppy): Add partitions array member. Add close + method. + * fhandler_floppy.cc (fhandler_dev_floppy::fhandler_dev_floppy): Zero + out partitions array. + (fhandler_dev_floppy::open): Fix "entire disk" condition for call to + DeviceIoControl (FSCTL_ALLOW_EXTENDED_DASD_IO). + When opening disks for writing, call DeviceIoControl (FSCTL_LOCK_VOLUME) + on all affected disk partitions starting with Vista. + (fhandler_dev_floppy::close): New method. + (fhandler_dev_floppy::dup): Duplicate handles in partitions, if any. + * wincap.h (wincaps::has_restricted_raw_disk_access): New element. + * wincap.cc: Implement above element throughout. + +2011-01-11 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * termios.cc (cfgetospeed, cfgetispeed): Constify argument per POSIX. + * include/sys/termios.h (cfgetospeed, cfgetispeed): Declare functions. + Move macros after declarations and make conditional on !__cplusplus. + +2011-01-11 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::init_thread): Call _REENT_INIT_PTR. Drop setting + current locale and calling srand48. + +2011-01-02 Christopher Faylor <me+cygwin@cgf.cx> + + * ChangeLog-2010: Create from ChangeLog. + * ChangeLog: Start fresh. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2012 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2012 new file mode 100644 index 000000000..562c48c41 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2012 @@ -0,0 +1,3065 @@ +2012-12-31 Christopher Faylor <me.cygwin2012@cgf.cx> + + * sigproc.cc (wait_sig): Remove spurious extern. + +2012-12-31 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (dtable::dup3): Fix bounds checking for valid newfd. + * syscalls.cc (dup2): Ditto. + * winsup.h (events_terminate): Delete obsolete function declaration. + +2012-12-28 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000019. + * dcrt0.cc (do_exit): Just set exit_state to ES_EVENTS_TERMINATE and + nuke call to events_terminate which just set a superfluous flag. + * sigproc.cc (signal_exit_code): New variable. + (setup_signal_exit): Define new function. + (_cygtls::signal_exit): Remove accommodations for closing the signal + pipe handle. + (exit_thread): Just sleep if we're exiting. + (wait_sig): If signal_exit_code is set, just handle bookkeeping signals + and exit ReadFile loop if there is nothing more to process. Call + signal_exit at end if signal_exit_code is non-zero. + * sigproc.h (setup_signal_exit): Declare new function. + * exceptions.cc (sigpacket::process): Use setup_signal_exit to control + exiting due to a signal. + (exception::handle): Ditto. Query exit_state rather than defunct + exit_already to determine if we are exiting. + * globals.cc (ES_SIGNAL_EXIT): New enum. + * sync.h (lock_process::release): New function for explicitly unlocking + muto. + (lock_process::~lock_process): Use release method. + +2012-12-27 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fork.cc (child_info::prefork): Fix error message formatting. + +2012-12-22 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.h (select_stuff): Remove variable names from parameter + declarations. + (select_info): Ditto. + (select_record::dump_select_record): Declare new debugging-only + function. + (select_info): Zero all fields. + (select_pipe_info): Ditto. + (select_socket_info): Ditto. + (select_serial_info): Ditto. + (select_mailslot_info): Ditto. + * select.cc (select_record::dump_select_record): Define new + debugging-only function. + (select_stuff::test_and_set): Call dump_select_record when debugging. + + * thread.cc (pthread_mutex::unlock): Revert setting of tid to 0 since, + in this context, it is a number, not a pointer. + (pthread_spinlock::unlock): Ditto. + +2012-12-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * sigproc.cc (exit_thread): undef ExitThread or suffer recursion. + Attempt to lock process prior to calling sig_send. + +2012-12-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + Revert the reversion and go with implementation described in + cgf-000017, with some modifications. + * init.cc (dll_entry): Revert previous change. + * miscfuncs.cc: Include sigproc.h for exit_thread declaration. + * winsup.h (ExitThread): Define as 'exit_thread' to ensure no + accidental use. + * sigproc.cc (exit_thread): New function. + (wait_sig): Handle __SIGTHREADEXIT case. Don't just block rather than + returning from this function. + * sigproc.h (__SIGTHREADEXIT): New enum. + (exit_thread): Declare. + * sync.cc (muto::release): Accept a tls command-line argument. + * sync.h (muto::release): Accept a tls command-line parameter. Default + to &_my_tls. + + * cygerrno.h (__set_errno): Define as extern so that no function code + is ever emitted. + * cygserver_ipc.h (cygserver_ipc.h): Ditto. + * miscfuncs.h (transform_chars): Ditto. + * path.h (has_attribute): Ditto. + * security.h (privilege_luid): Ditto. + * winsup.h (flush_file_buffers): Ditto. + +2012-12-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000018. + * init.cc (dll_entry): Grab process lock before exiting to ensure that + thread doesn't exit before parent if parent is exiting. + * _cygtls.cc (_cygtls::call2): Revert previous 2012-12-21 change. + * miscfuncs.cc (thread_wrapper): Ditto. + * thread.cc (pthread::exit): Ditto. + * sigproc.cc (exit_thread): Ditto. + (wait_sig): Ditto. + * sync.cc (muto::release): Ditto. + * sync.h (muto::release): Ditto. + * sigproc.h (__SIGTHREADEXIT): Delete enum. + (exit_thread): Delete declaration. + +2012-12-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000017. + * _cygtls.cc (_cygtls::call2): Use new exit_thread function in place of + ExitThread. + * miscfuncs.cc (thread_wrapper): Ditto. + * thread.cc (pthread::exit): Ditto. + (pthread_mutex::unlock): Set tid to NULL rather than 0. + (pthread_spinlock::unlock): Ditto. + * pinfo.cc (commune_process): Actually call lock_process constructor. + * sigproc.cc (exit_thread): New function. + (wait_sig): Handle __SIGTHREADEXIT case. Don't just block rather than + returning from this function. + * sigproc.h (__SIGTHREADEXIT): New enum. + (exit_thread): Declare. + * sync.cc (muto::release): Accept a tls command-line argument. + * sync.h (muto::release): Accept a tls command-line parameter. Default + to &_my_tls. + +2012-12-20 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (build_argv): Allow quoted filenames in @ expression. + +2012-12-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.h (select_stuff::select_stuff): Make default constructor + always zero everything while constructor with int arg just zeroes next. + * select.cc (select_stuff::test_and_set): Revert to using default + constructor. + +2012-12-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.cc (select_stuff::wait): Add windows error number to error message. + +2012-12-18 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.cc (select_stuff::test_and_set): Remove workaround and use + proper constructor. + +2012-12-18 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.cc (select_stuff::test_and_set): Work around problem of new() + not returning zeroed memory. + +2012-12-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::write): Don't attempt to sparsify + an already sparse file. Drop check for FILE_SUPPORTS_SPARSE_FILES + flag. Explicitely set FILE_ATTRIBUTE_SPARSE_FILE attribute in + cached attributes. + (fhandler_base::lseek): Only set did_lseek if sparseness is supported. + * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Don't attempt + to sparsify an already sparse file. Explicitely set + FILE_ATTRIBUTE_SPARSE_FILE attribute in cached attributes. + * mount.cc (oopt): Add "sparse" flag. + (fillout_mntent): Ditto. + * path.h (enum path_types): Add PATH_SPARSE. + (path_conv::support_sparse): New method. + (path_conv::fs_flags): Constify. + (path_conv::fs_name_len): Ditto. + include/sys/mount.h: Replace unused MOUNT_MIXED flag with MOUNT_SPARSE. + +2012-12-10 Christopher Faylor <me.cygwin2012@cgf.cx> + + * sigproc.h (sig_send): Accept tid as argument #3. Default to NULL. + * sigproc.cc (sig_send): Ditto. Pass tid to other sig_send. + (sigpending): Send current thread as arg #3. + +2012-12-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (sigpacket::process): Reorganize to avoid use of tls + before initialization. + + * fhandler_fifo.cc (fhandler_fifo::arm): Avoid improper printing of + integer as a string in debug output. + +2012-12-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * sigproc.h (sigpacket): Remove parameter names from declarations. + (sigpacket::sigtls): Rename from 'tls'. + * exceptions.cc (sigpacket::process): Define local tls variable and + assign that to sigtls if appropriate. Clarify debugging output. + * sigproc.cc (sig_send): Accommodate tls -> sigtls rename. + (pending_signals::add): Ditto. + (wait_sig): Ditto. + +2012-12-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygtls.h (_cygtls::get_signal_arrived): Add parameter to make + lock/unlock conditional. + * exceptions.cc (_cygtls::interrupt_setup): Don't get a lock when + setting signal_arrived since we already have one. + * gendef: Add some comments to make it easier to find functions. + +2012-12-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/cygwin/wait.h (WAIT_ANY): Define. + (WAIT_MYPGRP): Define. + +2012-12-05 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (class child_info_spawn): Drop unused member lock. + (CURR_CHILD_INFO_MAGIC): Update. + * sigproc.cc (child_info_spawn::child_info_spawn): Drop setting lock. + +2012-12-04 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygtls.h (_cygtls::will_wait_for_signal): Rename from + 'signal_waiting' to something more expressive. Reflect rename + throughout. + (_cygtls::get_signal_arrived): Rename from create_signal_arrived. Move + lock here. + (_cygtls::set_signal_arrived): Use get_signal_arrived. + * exceptions.cc (_cygtls::interrupt_setup): Use get_signal_arrived. + * tlsoffsets.h: Regenerate. + +2012-11-30 Christopher Faylor <me.cygwin2012@cgf.cx> + + * spawn.cc (child_info_spawn::worker): Make detection of '/c' case + insensitive when looking for cmd.exe command line. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.ac: Rename from configure.in. + * configure.in: Delete. + * configure: Regenerate. + +2012-11-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc: Drop Mingw.org considerations. + * fhandler_serial.cc: Ditto. + * fhandler_socket.cc: Ditto. + * fhandler_tape.cc: Ditto. + * fhandler_tty.cc: Ditto. + * net.cc: Ditto. + * ntdll.h: Ditto. + * sched.cc: Ditto. + * sec_helper.cc: Ditto. + +2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.in: Remove unneeded ALLOC substitution. + * configure: Regenerate. + * aclocal.m4: Ditto. + +2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.in: Add previously-missed AC_NO_EXECUTABLES. + * configure: Regenerate. + * aclocal.m4: Ditto. + +2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Use explicit path to mkdir. + +2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.cc (select): Don't return -1 when we've timed out after + looping. + +2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Revamp for new configury. + (datarootdir): Add variable setting. + (winver_stamp): Accommodate changes to mkvers.sh setting. + (libc.a): Fix race when libm.a might not have been built yet. + * configure.in: Revamp for new configury. + * aclocal.m4: Regenerate. + * configure: Ditto. + * autogen.sh: New script. + * mkvers.sh: Find include directives via CFLAGS and friends rather than + assuming that w32api lives nearby. + +2012-11-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * termios.cc (cfsetspeed): New function. + * cygwin.din (cfsetspeed): Export. + * posix.sgml (std-bsd): Add cfsetspeed. + * include/sys/termios.h (cfsetspeed): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2012-11-16 Corinna Vinschen <corinna@vinschen.de> + + * include/mntent.h: Only include paths.h when building for Cygwin. + Add comment to explain why. + +2012-11-11 Corinna Vinschen <corinna@vinschen.de> + + * winbase.h: Semi-reinstantiate to workaround lack inline assembler + implementation of InterlockedCompareExchange for i686 in Mingw64 + headers. + * pinfo.cc (pinfo::init): Remove unused variable mapaddr. + +2012-11-08 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (proc_subproc): Delete unused variable child. + +2012-11-08 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_termios.cc (fhandler_termios::line_edit): Don't do special + character handling when stopped by CTRL-S. + * fhandler_tty.cc (bytes_available): Add arguments to debug_only_printf + call. + * sigproc.cc (proc_subproc): Simplify some if logic. + +2012-11-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/sys/termios.h (CBRK): Define as alias of CEOL. + (CREPRINT): Define as alias of CRPRNT. + (CDISCARD): Define as alias of CFLUSH. + (TTYDEF_*): Define. + +2012-10-31 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/param.h: Include stddef.h to define NULL. + +2012-10-31 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rewinddir): Fix using + wrong value in condition. + +2012-10-30 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h: Add missing defines for CW_ALLOC_DRIVE_MAP, + CW_MAP_DRIVE_MAP and CW_FREE_DRIVE_MAP. + +2012-10-27 Kai Tietz <ktietz@redhat.com> + + * dcrt0.cc (quoted): Renamed strechr to strchrnul. + * environ.cc (environ_init): Likewise. + * sec_acl.cc (aclfromtext32): Likewise. + * sec_auth.cc (extract_nt_dom_user): Likewise. + * uinfo.cc (pwdgrp::next_str): Likewise. + * string.h (strechr): Likewise. + +2012-10-26 Kai Tietz <ktietz@redhat.com> + + * string.h (strechr): Replace assembler by + C code. + (ascii_strcasematch): Likewise. + (ascii_strncasematch): Likwise. + +2012-10-26 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (closedir): Fix syscall_printf. + +2012-10-26 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/signal.h (sigset_t): Define here. + +2012-10-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in (DLL_IMPORTS): Use system import libraries for + kernel32 and ntdll instead of from in-tree w32api. + (cygwin0.dll): Remove rule dependency on DLL_IMPORTS, as they + are no longer built in-tree. + +2012-10-23 Corinna Vinschen <corinna@vinschen.de> + + * thread.h (List_insert): Cast first parameter in + InterlockedCompareExchangePointer call to avoid compiler warnings. + (List_remove): Ditto. + +2012-10-22 Corinna Vinschen <corinna@vinschen.de> + + * winbase.h: Remove. + +2012-10-22 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + +2012-10-21 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 18. + +2012-10-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Remove lloffset. + Use offset directly. Add shortcut for lseek(fd, 0, SEEK_CUR) case. + (fhandler_dev_floppy::ioctl): Drop wrong RDSETBLK case. + * fhandler_raw.cc (fhandler_dev_raw::ioctl): Revamp RDSETBLK code. + +2012-10-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_slave::write): Fix potential exit from + loop with write mutex held. Delete redundant mutex release. Clear tty + error once we've grabbed it. + +2012-10-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Drop gratuitous + initializing from previous patch. + +2012-10-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::open): Fix comment. + +2012-10-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_slave::write): DWORD -> BOOL. + +2012-10-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_raw): Add members devbufalloc and + devbufalign. + (class fhandler_dev_floppy): Remove member bytes_per_sector; + * fhandler_floppy.cc (bytes_per_sector): Define as devbufalign. + (fhandler_dev_floppy::open): Set devbufalign to a multiple of the + sector size and handle devbuf allocation and alignment in !O_DIRECT + case here. Change comment accordingly. + Call FSCTL_ALLOW_EXTENDED_DASD_IO for partitions as well. + (fhandler_dev_floppy::raw_write): Fix comment. Rewrite and fix + writing behaviour when application uses read and lseek. + (fhandler_dev_floppy::lseek): Use rounddown macro. Call + SetFilePointerEx rather than the old SetFilePointer. + (fhandler_dev_floppy::ioctl): Reformat switch. Call + IOCTL_DISK_UPDATE_PROPERTIES rather than IOCTL_DISK_UPDATE_DRIVE_SIZE + in BLKRRPART case. Support BLKIOMIN, BLKIOOPT, BLKPBSZGET and + BLKALIGNOFF. + * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Initialize + all devbuf-related members. + (fhandler_dev_raw::~fhandler_dev_raw): Delete devbufalloc rather than + devbuf. + (fhandler_dev_raw::open): Drop allocating devbuf. + (fhandler_dev_raw::dup): Allocate devbufalloc and set devbuf to support + new sector-aligned devbuf handling. + (fhandler_dev_raw::fixup_after_exec): Ditto. + * fhandler_tape.cc (fhandler_dev_tape::open): Ditto, set devbufalign + to 1. + * include/cygwin/fs.h (BLKIOMIN): Define. + (BLKIOOPT): Define. + (BLKALIGNOFF): Define. + (BLKPBSZGET): Define. + +2012-10-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_raw.cc (fhandler_dev_raw::open): Allow O_EXCL flag, as on + Linux. + +2012-10-11 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_termios.cc (fhandler_termios::line_edit): Don't manipulate + output_mutex on CTRL-S/CTRL-Q to avoid a deadlock. + * fhandler_tty.cc (fhandler_pty_slave::write): Loop when output_stopped + is detected before acquiring output_mutex. Acquire output_mutex in the + loop for each write. + * tty.h: Remove some obsolete defines. + (tty_min::output_stopped): Make 'bool'. + +2012-10-10 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in.h (struct in_addr): Guard with s_addr to avoid + potential collision with Win32 headers. + +2012-10-09 Christopher Faylor <me.cygwin2012@cgf.cx> + + * child_info.h (child_info_spawn::has_execed): Remove unneeded + synchronization. + +2012-10-09 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc: Remove unneeded assert.h. + +2012-09-17 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (pinfo::init): Detect potential race where short block has + been retrieved but PID_EXECED flag is not set. + +2012-09-13 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygthread.cc (cygthread::stub): Remove old, unnecessary, FIXMEd code. + * spawn.cc (child_info_spawn::worker): Avoid calling close_all_files() + twice. + +2012-09-02 Jin-woo Ye <jojelino@gmail.com> + Corinna Vinschen <corinna@vinschen.de> + + * pseudo-reloc.cc (auto_protect_for): New function. + (__write_memory): Call auto_protect_for to handle page protection. + (do_pseudo_reloc): Call auto_protect_for to restore old page protection. + +2012-08-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (pinfo::init): Remove assertion. + +2012-08-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (_pinfo::exists): Don't consider a process with no state to + exist. + +2012-08-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * net.cc (get_adapters_addresses): Drop FIXME part of comment. + +2012-08-17 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000016. + * cygtls.h (_cygtls::push): Inline. + (_cygtls::interrupt_now): Change signal number argument to siginfo_t + argument. + (_cygtls::interrupt_setup): Ditto. + (_cygtls::set_siginfo): Delete declaration. + (_cygtls::reset_signal_arrived): Don't reset signal_arrived signal. + Just reset flag. + * exceptions.cc (_cygtls::interrupt_now): Reflect argument changes. + Pass si to interrupt_setup. + (_cygtls::interrupt_setup): Reflect argument changes. Fill out tls + infodata here using passed-in si. Use si.si_signo instead of sig. + (sigpacket::setup_handler): Move this function into sigpacket class. + Use si field from the class as appropriate. + (sigpacket::process): Don't call tls->set_siginfo here since + setup_handler could fail. Eliminate now-unneeded sig argument. + * sigproc.h (sigpacket::setup_handler): Move setup_handler to this + class. + +2012-08-17 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (sig_handle_tty_stop): Clear tls sig field. + (sigpacket::process): When continuing, set tls->sig before arming + signal_arrived. + +2012-08-17 Thomas Wolff <towo@towo.net> + + * fhandler_clipboard.cc (fhandler_dev_clipboard::read): Use + read-ahead buffer for reading Windows clipboard if caller's + buffer is too small for complete characters. + * include/limits.h: Remove outdated TODO comment. + +2012-08-16 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygtls.cc (_cygtls::operator HANDLE): Reverse '?' test stupidity. + +2012-08-16 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygheap.cc (init_cygheap::find_tls): Don't consider unitialized + threads. + * cygtls.cc (_cygtls::operator HANDLE): Return NULL when tid is not + set. + * exceptions.cc (setup_handler): Don't try to suspend a thread if it + has no handle. + +2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + Rename cancelable_wait -> cygwait throughout. + * DevNotes: Add entry cgf-000015. + * cygwait.h (cygwait): Don't allow an optional PLARGE_INTEGER + argument. + +2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygtls.h (_cygtls::create_signal_arrived): New function. + (_cygtls::set_signal_arrived): Lock creation of signal_arrived. + * cygwait.cc (cancelable_wait): Ignore signal_arrived event if _my_tls + 'sig' element does not exist. + * exceptions.cc (_cygtls::interrupt_setup): Create signal_arrived if + recipient thread has not created it. + +2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * gendef: Tighten up whitespace detection. + +2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * gendef: Delete unneeded read from <IN> which ate an arbitrary line + from cygwin.din. + +2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (sigdelayed): Move declaration to sigproc.h. + * sigproc.h (sigdelayed): Make symbol globally available. + * gendef (sigdelayed): Specifically zero incyg and stacklock. + * signal.cc (sigwaitinfo): Lock _my_tls and try harder to clean up + signal information. + +2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (_pinfo::exists): Don't consider an execed process to exist. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * gmon.c (_mcleanup): Fix scope bug when using gmon_out array. + +2012-08-14 Christopher Faylor <me.cygwin2012@cgf.cx> + + * errno.cc (errmap): Keep sorted. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (semaphore::_fixup_after_fork): Fix Win32 error output in + api_fatal call. + +2012-08-14 Christopher Faylor <me.cygwin2012@cgf.cx> + + * errno.cc (errmap): Keep sorted. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_names): Add missing ReFS entry. Change comment. + * mount.h (enum fs_info_type): Add comment. + +2012-08-13 Christopher Faylor <me.cygwin2012@cgf.cx> + + * errno.cc (errmap): Map ERROR_SXS_CANT_GEN_ACTCTX to ELIBBAD. + +2012-08-09 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000014. + * cygheap.cc (tls_sentry): Move here, rename from 'sentry' in cygtls.cc + (tls_sentry::lock): Ditto. + (nthreads): Move from cygtls.cc + (THREADLIST_CHUNK): Ditto. + (cygheap_init): Call init_tls_list(). + (init_cygheap::init_tls_list): Define new function. + (init_cygheap::add_tls): Ditto. + (init_cygheap::remove_tls): Ditto. + (init_cygheap::find_tls): Ditto. Semi-resurrect from + _cygtls::find_tls. + * cygheap.h (init_cygheap::init_tls_list): Declare new function. + (init_cygheap::add_tls): Ditto. + (init_cygheap::remove_tls): Ditto. + (init_cygheap::find_tls): Ditto. + * cygtls.cc (sentry): Delete. + (sentry::lock): Ditto. + (nthreads): Ditto. + (THREADLIST_CHUNK): Ditto. + (_cygtls::init): Delete definition. + (_cygtls::init_thread): Call cygheap->add_tls() to add thread to global + list. + (_cygtls::remove): cygheap->remove_tls() to remove thread from global + list. + * cygtls.h (_cygtls::init): Delete declaration. + * dcrt0.cc (dll_crt0_0): Delete call to _cygtls::init(). + * exceptions.cc (sigpacket::process): When no thread is specified, try + to find one via cygheap->find_tls. + +2012-08-08 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/wait.h (_wait): Define when building newlib. + +2012-08-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * signal.cc (sigwaitinfo): Change cw_sig to the correct cw_sig_eintr. + +2012-08-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (sigdelayed): Simplify declaration. + (_cygtls::call_signal_handler): Fix test for when to pop signal stack. + Only do it exactly when what is on the stack is a no-op. + +2012-08-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * spawn.cc (child_info_spawn::worker): Put back a minor variation of + Corinna's test for detecting a background process when starting a + non-cygwin process. + +2012-08-01 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h (MSG_BCAST): Define. + (MSG_MCAST): Define. + +2012-08-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_socket::recv_internal): Add bool parameter. + Add regparm attribute. + * fhandler_socket.cc (fhandler_socket::read): Call recv_internal with + second parameter set to false. + (fhandler_socket::readv): Ditto. + (fhandler_socket::recvfrom): Ditto. + (fhandler_socket::recv_internal): Convert use_recvmsg from local + variable to parameter. Use as request for using WSARecvMsg. Only + fail if WSARecvMsg can't be loaded and wsamsg->Control.len > 0, + otherwise use WSARecv{From}. Restrict dwFlags to MSG_PEEK when using + WSARecvMsg. + (fhandler_socket::recvmsg): Prefer using WSARecvMsg. Change priority + of tests for not using WSARecvMsg. Call recv_internal with second + parameter set accordingly. + +2012-08-01 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Semi-revert patch from 2012-07-01, assuming the previous + patch to etc::dir_changed fixes the underlying issue. + +2012-07-31 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (etc::dir_changed): Revert muto changes since function is + called under lock condition anyway. + +2012-07-31 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (etc::dir_changed): Change `io' to a static NO_COPY + variable. Explain why. Add a muto to guard overwriting the changed_h + handle by multiple concurrent threads. + * path.h (class etc): Drop unused changed_h member. + +2012-07-30 Christopher Faylor <me.cygwin2012@cgf.cx> + + * winlean.h: Define constant which will be needed eventually. Remove + hack in favor of another hack. + * lib/crt0.h: Use "winlean.h". + +2012-07-30 Christopher Faylor <me.cygwin2012@cgf.cx> + + * winlean.h: Add temporary define. + * winsup.h: Remove ancient debugging defines. + +2012-07-29 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygwait.cc (cancelable_wait): Add some debugging-only output. + * exceptions.cc (sig_handle_tty_stop): Make sure that incyg is cleared + when exiting if we have no parent process. Only wait for signal_arrived. + (sigpacket::process): Make continue_now a bool. Delay sending + signal_arrived until the end. Make code more defensive to avoid + calling signal handler when stopped. Only set signal_arrived when + stopped. + * sigproc.cc (sig_hold): Rename from sigCONT. Make static. + (sig_send): Accommodate sigCONT -> sig_hold rename. + (wait_sig): Ditto. + * sigproc.h (sigCONT): Delete declaration. + + * fhandler_console.cc (fhandler_console::write): Use new '%0c' facility + to print characters. Change to paranoid to avoid excessive strace + output. + * fhandler_tty.cc (fhandler_pty_master::accept_input): Make frequent + strace printf "paranoid" to help cut down on strace output size. + + * signal.cc (sigsuspend): Add standard syscall strace output. + (sigpause): Ditto. + (pause): Ditto. + +2012-07-29 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygtls.h (_cygtls::reset_signal_arrived): New function. + (set_signal_arrived::~set_signal_arrived): Use reset_signal_arrived to + reset state. + * exceptions.cc (sig_handle_tty_stop): Use WAIT_SIGNALED rather than + assume we know the return from cancelable_wait. + (_cygtls::interrupt_setup): Modify to allow calling when executing in + non-cygwin code via sigdelayed. Always reset signal_arrived. + * gendef: Throughout use start_offset rather than the completely wrong + sizeof__cygtls. + (_sigdelayed): Rewrite to avoid duplication when calling the signal + handler. + (sigreturn): Delete. + * gentls_offsets: Define start_offset rather than sizeof__cygtls. + * tlsoffsets.h: Regenerate. + +2012-07-29 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_termios.cc (fhandler_termios::line_edit): Use special case + '%0c' handling to print non-printable characters using hex notation. + * smallprint.cc (__small_vsprintf): Semi-reimplement printing of + non-printable characters in hex but only when padding is specified. + + * dcrt0.cc (dll_crt0_0): Remove tty_list initialization. + * shared.cc (memory_init): Initialize tty_list here. + + * path.cc (path_conv::check): Remove unneeded parentheses from if + check. + +2012-07-28 Corinna Vinschen <corinna@vinschen.de> + + * include/inttypes.h: Add x86_64 target considerations throughout. + Define macros in C++ according to C99 requirements. + * include/stdint.h: Ditto. + +2012-07-25 Christopher Faylor <me.cygwin2012@cgf.cx> + + * signal.cc (clock_nanosleep): Force return on signal rather than + letting cancelable_wait loop on signal. + +2012-07-25 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (enum bin_status): Add dir_not_empty. + (try_to_bin): Call NtQueryInformationFile(FileInternalInformation) + with exact buffer size. Explain why. + Ditto for NtSetInformationFile(FileRenameInformation). + Handle race-condition which might lead to renaming a non-empty + directory. + (unlink_nt): Rearrange and partially rephrase comments related to the + STATUS_SHARING_VIOLATION case. Fix condition under which a dir is + tested for being non-empty. Handle dir_not_empty return code from + try_to_bin. Gracefully handle disappearing directory in rm -r + workaround. Fix typo in comment. + +2012-07-24 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincapc::init): Drop memset call since it can result in + a race condition. Drop all considerations for pre-Windows 2000 systems + since Cygwin won't start on them anyway. + +2012-07-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + Change "set_thread_waiting" to "set_signal_arrived" throughout. + +2012-07-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000013. + * cygserver_ipc.h (ipc_set_proc_info): Use _cygtls::ipc_set_proc_info + to set per-thread signal arrived value. + * cygthread.cc (cygthread::detach): Use per-thread signal_arrived via + set_thread_waiting. + * fork.cc (_cygtls::fixup_after_fork): Clear signal_arrived. + (_cygtls::remove): Close any signal_arrived handle when thread exists. + (_cygtls::find_tls): Remove unneeded function. + * cygtls.h: Update copyright. + (class _cygtls): Reorganize to help avoid rebuilding newlib when + structure changes. + (_cygtls::event): Delete. + (_cygtls::threadkill): Ditto. + (_cygtls::signal_waiting): Declare new bool. + (_cygtls::find_tls): Delete declaration. + (_cygtls::set_threadkill): Ditto. + (_cygtls::reset_threadkill): Ditto. + (_cygtls::set_signal_arrived): Declare new function. + (class set_thread_waiting): Declare new class. + * cygwait.cc (cw_nowait_storage): Define. + (cygwait): Set per-thread signal_arrived via set_thread_waiting. Don't + special-case _main_tls. + * cygwait.h (cw_nowait): Define. + (cw_infinite): Ditto. + (cygwait): Redefine pathological wait-only case. + * dcrt0.cc (dll_crt0_0): Remove call to now-defunct events_init(). + (dll_crt0_1): Remove call to now-defunct create_signal_arrived(). + * exceptions.cc: Reflect set_signal_mask() argument reordering + throughout. Remove signal mask synchronization throughout. + (events_init): Delete definition. + (mask_sync): Delete now-unneeded mask synchronization. + (set_signal_mask): Reverse order of arguments to "standard" to, from + layout. Rename "newmask" argument to "setmask". Remove debugging. + (sig_handle_tty_stop): Use cancelable_wait rather than WFMO. + (_cygtls::interrupt_setup): Don't treat "threadkill" events specially. + Conditionally set signal_arrived depending on whether the thread has + created it or not. + (sigpacket::process): Reorganize to reflect thread-specific sending of + signals which is more in line with the way it was actually supposed to + work. + * fhandler_socket.cc (get_inet_addr): Use cancelable_wait rather than + IsEventSignalled to avoid potential race. + (fhandler_socket::wait_for_events): Set signal_arrived event using + set_thread_waiting(). + (fhandler_socket::close): Use cygwait for the case of just + waiting 10 ms for a signal. + * fhandler_tape.cc (fhandler_dev_tape::_lock): Use cancelable_wait + rather than WFMO. Redo switch/case tests accordingly. + * fhandler_termios.cc (fhandler_termios::bg_check): Use cygwait for + case of just waiting 0 ms for a potential signal. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Use + cancelable_wait rather than WFSO. + * fhandler_windows.cc (fhandler_windows::read): Set per-thread + signal_arrived via set_thread_waiting(). + * flock.cc (lf_setlock): Ditto. + * select.cc (pselect): Ditto. Set per-thread signal_arrived using + set_thread_waiting(). + * gendef: Don't special case handling of _cygtls::sig for threads. + * gentls_offsets: Use #pragma once in tlsoffsets.h. + * ntdll.h: Use #pragma once. + * poll.cc: Reflect set_signal_mask() argument reordering. + * posix_ipc.cc (ipc_mutex_lock): Use cancelable_wait rather than WFMO. + (ipc_cond_timedwait): Set perl-thread signal arrived using + set_thread_waiting(). + * security.h: Use #pragma once. + * signal.cc (abort): Reflect set_signal_mask() argument reordering. + (clock_nanosleep): Ditto. Change call to cancelable_wait to properly + specify handling of cancel and interrupt. + (sigwaitinfo): Remove handling of per-thread event in favor of + per-thread signal_arrived. Use cancelable_wait rather than WFSO. + * sigproc.cc (signal_arrived): Delete definition. + (create_signal_arrived): Ditto. + * sigproc.h (signal_arrived): Delete declaration. + (set_signal_mask): Avoid defining as a "C" function. Don't + conditionally declare. + (create_signal_arrived): Delete declaration. + * syscalls.cc (rename): Use cygwait() rather than WFSO. + * thread.h (fast_mutex::lock): Use cw_infinite rather than LARGE_NULL. + * wait.cc (wait4): Ditto. + * thread.cc (pthread_mutex::lock): Ditto. + (pthread::join): Ditto. + (semaphore::_wait): Ditto. + (pthread_kill): Remove set_threadkill() accommodation. + * tlsoffsets.h: Regenerate. + +2012-07-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 17. + +2012-07-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * mount.cc (getmntent_r): Remove unused but set variable. + +2012-07-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (getmntent_r): Export. + * mount.cc (getmntent_r): New function. + * posix.sgml (std-gnu): Add getmntent_r. + * include/mntent.h (getmntent_r): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2012-07-12 Corinna Vinschen <corinna@vinschen.de> + + * winlean.h: Make sure certain Windows macros are undefined again. + Add comment to explain why. + * winsup.h: Include winlean.h from C sources as well. + * libc/minires-os-if.c: Drop including ntdef.h. + +2012-07-12 Corinna Vinschen <corinna@vinschen.de> + + * pseudo-reloc.cc: Drop including wchar.h and ntdef.h. + (__report_error): Define module as WCHAR. + * advapi.cc: Drop including wchar.h. + * kernel32.cc: Ditto. + +2012-07-11 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (well_known_dlls): Add ole32.dll and wbemprox.dll. + +2012-07-09 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc (.rdata): Revert patch from 2012-07-06. + +2012-07-09 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (getpass): Make check for closed stream more reliable. + Check if setting tty attributes worked and only revert to old state + if so. + +2012-07-09 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in, configure.in, mkvers.sh: Revert accidental checkin from + 2012-07-06. + +2012-07-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Change mingw_lib (temporarily?) back to w32api_lib. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * winlean.h (__STRALIGN_H_): Drop definition. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procnet.cc: Fix copyright. + * syslog.cc: Ditto. + * libc/minires-os-if.c: Ditto. + * libc/minires.h: Ditto. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + In terms of network related functionality, rely on Winsock definitions + as much as possible: + * dtable.cc: Drop including sys/socket.h. + * fhandler_procnet.cc: Change includes accordingly. + * fhandler_socket.cc: Ditto. + (fhandler_socket::listen): Avoid gcc error message initializing sin6. + (LPFN_WSARECVMSG): Only define when building against w32api headers. + * net.cc: Change includes accordingly. Define USE_SYS_TYPES_FD_SET + and __WSA_ERR_MACROS_DEFINED. Define _INC_NETIOAPI temporarily and + explain why. + (struct _IP_ADAPTER_UNICAST_ADDRESS_LH): Only define when building + against w32api headers. + (struct _IP_ADAPTER_ADDRESSES_LH): Ditto. + (SIO_GET_INTERFACE_LIST): Ditto. + (ws_freeaddrinfo): Rename from freeaddrinfo so as not to collide with + Winsock declaration. Change througout. + (ws_getaddrinfo): Ditto. + (ws_getnameinfo): Ditto. + * select.cc: Include netdb.h after defining USE_SYS_TYPES_FD_SET. + * syslog.cc: Drop including netinet/in.h. Define USE_SYS_TYPES_FD_SET + and include ws2tcpip.h. + * include/netdb.h (struct addrinfo): Don't define when building Cygwin. + * include/cygwin/if.h: Don't declare if_xxx functions when building + Cygwin. + * include/cygwin/in.h: Disable most definitions when building Cygwin. + * include/cygwin/socket.h: Disable sockaddr and sockaddr_storage + definitions when building Cygwin. Same for MCAST_INCLUDE/MCAST_EXCLUDE. + * libc/inet_addr.c: Don't define __INSIDE_CYGWIN__ nor + __INSIDE_CYGWIN_NET__. + * libc/inet_network.c: Ditto. + * libc/minires.h: Drop redundant inclusion of netdb.h. Define + __INSIDE_CYGWIN_NET__ only before including netdb.h and resolver + headers. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * winbase.h: Throughout use LONG rather than long type to prepare for + 64 bit. + (InterlockedCompareExchangePointer): Define. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_registry.cc (RegOpenUserClassesRoot): Only define when + building against w32api headers. + (RegOpenCurrentUser): Ditto. + * fhandler_tty.cc (GetNamedPipeClientProcessId): Ditto. + * ntdll.h (enum _PROCESSINFOCLASS): Add ProcessImageFileName. + (RtlInitAnsiString): Declare. + (RtlUnicodeStringToAnsiSize): Declare. + * sched.cc (GetForegroundWindow): Ditto. + * sec_helper.cc (SECURITY_NT_NON_UNIQUE): Define as + SECURITY_NT_NON_UNIQUE_RID when building against w32api headers. + (cygsid::get_sid): Use SECURITY_NT_NON_UNIQUE rather than + SECURITY_NT_NON_UNIQUE_RID. + (__sec_user): Use PISECURITY_DESCRIPTOR rather than PSECURITY_DESCRIPTOR + to allow valid pointer arithmetic. + (_recycler_sd): Ditto. + (_everyone_sd): Ditto. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (_ADVAPI32_): Drop definition. + * kernel32.cc (_KERNEL32_): Ditto. + * winlean.h: Add definitions required to use Mingw64 headers. + (FILE_SHARE_VALID_FLAGS): Drop definition. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (_WIN32_WINNT): Define. Explain why. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * libc/rcmd.cc: Don't undef __INSIDE_CYGWIN_NET__. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc (.rdata): Include all sections starting with .rdata. + (.debug_pubtypes): Make sure section is loaded at the end like all other + debug sections. + +2012-07-04 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dcrt0.cc (build_argv): Guard against NULL pointer dereference found + by Clang. + +2012-07-04 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (setup_handler): Remove unneeded assignment found by + Clang. + +2012-07-04 Christopher Faylor <me.cygwin2012@cgf.cx> + + * hookapi.cc (find_first_notloaded_dll): Remove unused assignment of + importRVASize found by Clang. + +2012-07-04 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_slave::read): Remove duplicate + assignment to bytes_in_pipe found by Clang. + +2012-07-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (exception::handle): Use error_code in klog, as + intended. Found by Clang. + +2012-07-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_clipboard): Remove member eof. + * fhandler_clipboard.cc: Throughout remove handling of eof member. + (fhandler_dev_clipboard::write): Handle EOF condition immediately, + rather than pushing it erroneously to the next read call. Rearrange + code. Fix bug in CF_UNICODETEXT case which potentially dropped single + bytes at the end of the buffer. Add comment. + * strfuncs.cc (sys_cp_wcstombs): Allow returning non-NUL-terminated + buffer if dst != NULL and len == (size_t) -1. Extend leading comment + to explain what's returned in more detail. + +2012-07-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_virtual.cc (fhandler_virtual::opendir): Eliminate duplicate + assignment found by Clang. + +2012-07-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_registry.cc (fhandler_registry::open): Handle missing EROFS + error condition pointed to by Clang. + +2012-07-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (_pinfo::commune_request): Eliminate unneeded assignment + found by Clang. + +2012-07-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * external.cc (fillout_pinfo): Return NULL rather than 0. + (exit_process): Guard against NULL pointer dereference found by Clang. + +2012-07-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * mount.cc (mount_info::conv_to_win32_path): Eliminate unneeded + assignment found by Clang. + +2012-07-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * path.cc (symlink_info::check): Remove unneeded/unused variable found + by Clang. + +2012-07-02 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (dll_list::alloc): Take long UNC paths into account. + +2012-07-01 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Add some more optimization flags for cygwait, malloc and + path. Explain why -fomit-frame-pointer doesn't work right for passwd.o + and path.o. Add -static to link command line for cygwin0.dll. + + * fhandler_disk_file.cc (fhandler_disk_file::facl): Reorganize slightly + to silence compiler warning when compiling with -fstack-check. + * net.cc (inet_ntop6): Initialize structure members to silence compiler + warning when compiling with -fstack-check. + + * pseudo-reloc.cc (_pei386_runtime_relocator): Make this a C function. + Detect NULL u. + * winsup.h (_pei386_runtime_relocator): Declare this as extern "C". + * lib/_cygwin_crt0_common.cc (_pei386_runtime_relocator): Call with + NULL argument. + + * signal.cc (sigaction_worker): Eliminate last argument. Let callers + report their own strace info. Regparmize. + (sigaction): Reflect sigaction_worker changes. + (siginterrupt): Ditto. + + * exceptions.cc: Update copyright. + +2012-07-01 Christopher Faylor <me.cygwin2012@cgf.cx> + + * path.cc: Perform some whitespace fixups throughout. + +2012-06-28 Corinna Vinschen <corinna@vinschen.de> + + * kernel32.cc (_KERNEL32_): Define. Explain why. + (CreateFileMappingW): Drop undocumented flProtect flags. + +2012-06-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc: Fix includes for IOCTL codes to support Mingw64. + * fhandler_tape.cc: Ditto. + * flock.cc (allow_others_to_sync): Use PISECURITY_DESCRIPTOR since + PSECURITY_DESCRIPTOR is supposed to be the opaque type. + * ntdll.h: Remove CreateDisposition flags again, now that they are + defined in Mingw64's ntdef.h. Ditto for Create/Open flags. + +2012-06-28 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (RtlUnwind): Align declaration with MSDN. + * ntdll.h: Define CreateDisposition Flags. Add comments. + * winlean.h: Define FILE_SHARE_VALID_FLAGS if using Mingw64 headers. + +2012-06-27 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygwait.h (cancelable_wait): Make extern to avoid always including. + * select.cc (allocfd_set): Try to make a little more efficient. + (cygwin_select): Break into two functions to avoid what seems to be a + strange compiler problem with alloca and sel constructor. + (select): New function. Always honor return from call_signal_handler. + (select_stuff::wait): Always honor return from call_signal_handler. + * select.h (select_stuff::select_stuff): Use NULL to initialize + pointers rather than 0. + +2012-06-27 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (exception::handle): Cast exception code to NTSTATUS + for comparison. + * ntdll.h: Drop defining NT status codes in favor of including + ntstatus.h. + +2012-06-27 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (WritePipeOverlapped): Define second parameter LPCVOID, + rather than PCVOID. + * miscfuncs.h (WritePipeOverlapped): Ditto. + +2012-06-27 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (_ADVAPI32_): Define. Explain why. + (ImpersonateNamedPipeClient): Add missing WINAPI. + * ntdll.h (STATUS_INVALID_PARAMETER): Only define if it isn't already. + (STATUS_DLL_NOT_FOUND): Ditto. + (STATUS_ENTRYPOINT_NOT_FOUND): Ditto. + (enum _EVENT_TYPE): Guard against redefinition since it's already + defined in Mingw64's ntdef.h. + (enum _TIMER_TYPE): Ditto. + (enum _SECTION_INHERIT): Define if using Mingw64 headers since it's + missing in Mingw64's ntdef.h. + * winlean.h (__STRALIGN_H_): Define before including windows.h. + +2012-06-26 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (GetLastError): Drop redundant definition. + +2012-06-25 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygwait.cc (cancelable_wait): Make sure that timer is cancelled + before cancelling thread. + +2012-06-25 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygwait.h (cancelable_wait): Need to force time to negative to + indicate relative time. + +2012-06-21 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (realpath): Fix comment. + +2012-06-21 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (realpath): Call mount_info::conv_to_posix_path rather than + mount_info::cygdrive_posix_path to convert DOS paths to POSIX paths. + Add comment to explain why that's necessary at all. + +2012-06-18 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygwait.h (LARGE_NULL): Define. + (cancelable_wait): Define variant which accepts DWORD time argument. + (cygwait): Use cancelable_wait with DWORD argument. + (cygwait): Use cancelable_wait with DWORD argument and cw_sig_eintr for + timeout-only case. + * exceptions.cc (handle_sigsuspend): Use LARGE_NULL as second argument + to distinguish between cancelable_wait variants. + * thread.cc (pthread_mutex::lock): Ditto. + (pthread::join): Ditto. + (semaphore::_timedwait): Ditto. + * thread.h (fast_mutex::lock): Ditto. + * wait.cc (wait4): Ditto. + +2012-06-18 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygwait.cc (cancelable_wait): Mimic old cygwait behavior more closely + wrt handling of call_signal_handler. + * cygwait.h (WAIT_CANCELED): Move here and redefine. + (WAIT_SIGNALED): Ditto. + * thread.h (WAIT_CANCELED): Delete. + (WAIT_SIGNALED): Ditto. + +2012-06-18 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::init_installation_root): Rearrange code + creating valid native NT installation_root path. Only strip last + backslash from path if the result is a valid NT path. Explain why. + +2012-06-17 Christopher Faylor <me.cygwin2012@cgf.cx> + + Add '#include "cygwait.h"' throughout, where appropriate. + * DevNotes: Add entry cgf-000012. + * Makefile.in (DLL_OFILES): Add cygwait.o. + * sigproc.h: Remove cygwait definitions. + * cygwait.h: New file. Define/declare Cygwin waitfor functions. + * cygwait.cc: Ditto. + * exceptions.cc: Include cygwait.h. + (handle_sigsuspend): Accommodate change in cancelable_wait arguments. + (sigpacket::process): Display thread tls in debugging output. + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Use symbolic + names for signal and cancel return. + * fhandler_console.cc (fhandler_console::read): Ditto. + (fhandler_dev_dsp::Audio_out::waitforspace): Ditto. + fhandler_dev_dsp::Audio_in::waitfordata): Ditto. + * fhandler_fifo.cc (fhandler_fifo::wait): Ditto. + * fhandler_serial.cc (fhandler_serial::raw_read): Ditto. + * fhandler_tty.cc (fhandler_pty_slave::read): Ditto. + * select.cc (cygwin_select): Ditto. + * wait.cc (wait4): Ditto. + * thread.cc (cancelable_wait): Move definition to cygwait.h. + (pthread_cond::wait): Accommodate change in cancelable_wait arguments. + (pthread_mutex::lock): Ditto. + (pthread_spinlock::lock): Ditto. + (pthread::join): Ditto. + (pthread::thread_init_wrapper): Display tls in debugging output. + (semaphore::_timedwait): Ditto. + * thread.h (cw_sig_wait): Move to cygwait.h. + (cw_cancel_action): Delete. + (cancelable_wait): Move declaration to cygwait.h. + +2012-06-11 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * regex/regcomp.c (p_ere): Allow vertical-line following + left-parenthesis in ERE, as in glibc. + +2012-06-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/sys/elf_common.h (R_386_16): Define. + (R_386_PC16): Define. + (R_386_8): Define. + (R_386_PC8): Define. + +2012-06-09 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.cc (cygwin_select): Remove select_timeout test. + (select_stuff::wait): Return select_set_zero on timeout. + (thread_socket): Report timeout when debugging. + +2012-06-05 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/elf.h: Update from FreeBSD. + * include/machine/elf.h: New header, from FreeBSD. + * include/sys/elf.h: Ditto. + * include/sys/elf32.h: Update from FreeBSD. + * include/sys/elf64.h: Ditto. + * include/sys/elf_common.h: Ditto. + (R_IA64_*): Define Linux-style names as aliases to R_IA_64_*. + (R_SH_*): Define, based on sh-4 psABI. + (R_390_*): Define, based on s390x psABI. + * include/sys/elf_generic.h: Ditto. + +2012-06-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::link ): Translate + STATUS_NOT_SUPPORTED to EPERM as well. + +2012-06-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (dtable::dup3): Only return with lock set when O_EXCL flag + is passed in. + * syscalls.cc (dup_finish): Pass O_EXCL in flags to dtable::dup3. + +2012-06-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000011. + * fhandler.h (fhandler_base::refcnt): Delete. + (fhandler_base::inc_refcnt): New function. + (fhandler_base::dec_refcnt): New function. + * cygheap.h (cygheap_fdnew::~cygheap_fdnew): Accommodate split of + refcnt to inc_refcnt/dec_refcnt. + (cygheap_fdget::cygheap_fdget): Ditto. + (cygheap_fdget::~cygheap_fdget::cygheap_fdget): Ditto. + * dtable.cc (dtable::release): Ditto. + (cygwin_attach_handle_to_fd): Ditto. + (dtable::init_std_file_from_handle): Ditto. + (dtable::dup3): On success, return with fdtab locked. + * dtable.h (dtable): Add dup_finish as a friend. + * syscalls.cc (dup_finish): Define new function. Increment refcnt + while fdtab is locked. + (dup2): Use common dup_finish() to perform dup operation. + (dup3): Ditto. + +2012-06-03 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (ro_u_refs): New R/O unicode string. + * mount.cc (fs_info::update): Recognize ReFS. + * mount.h (enum fs_info_type): Add refs. + (class fs_info): Add refs flag and accessor methods. + * ntdll.h (RtlAddAccessAllowedAceEx): Declare. + (RtlAddAccessDeniedAceEx): Declare. + * path.h (path_conv::fs_is_refs): Define. + * sec_helper.cc (_recycler_sd): New function to create security + descriptors suitable for the recycler bin starting with Vista. + * security.cc (add_access_allowed_ace): Use RtlAddAccessAllowedAceEx + and drop code to set AceFlags explicitely. + (add_access_denied_ace): Use RtlAddAccessDeniedAceEx and drop code to + set AceFlags explicitely. + * security.h (_recycler_sd): Declare. + (recycler_sd): Define. + * syscalls.cc (desktop_ini): Change formatting. + (desktop_ini_ext): Define third line of recycler desktop.ini file + since Vista, + (try_to_bin): Handle ReFS just like NTFS. Write Vista and later + Recycler in all uppercase, just like shell32 does when recreating it. + Fix comments to include ReFS. Don't implicitely reuse object + attributes from earlier NtOpenFile call, rather recreate it for safety. + Use recycler_sd call when creating security descriptor for Recycler + dirs and files on Vista and later. Write third line of desktop.ini + when on Vista and later. + +2012-06-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * winbase.h: Add missing copyright date. + +2012-06-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.cc (cygwin_select): Make sure that we only return -1 as an + error return. + (select_stuff::wait): Semi-revert to previous method for filling out + w4. + +2012-06-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * select.cc (cygwin_select): Add some comments. + (select_stuff::wait): Ditto. + +2012-06-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000010. + * select.cc (set_handle_or_return_if_not_open): Remove unneeded final + backslash from definition. + (cygwin_select): Reorganize to incorporate outer retry loop. Move + remaining time recalculation here for retry case. Use + select_stuff::wait_states for loop control. + (select_stuff::cleanup): Avoid unneeded initialization. + (select_stuff::wait): Modify definition to return + select_stuff::wait_states. Eliminate is_cancelable. Don't inspect + element 1 of an array if it is a cancel handle. Remove loop. Rely on + being called from enclosing loop in cygwin_select. Remove time + recalculation when restarting. Try harder to always return from the + bottom. + * select.h (select_stuff::wait_state): New enum. + (select_stuff::wait): Modify declaration to return + select_stuff::wait_states. + +2012-06-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (setup_handler): Make debugging output a little more + verbose. + +2012-06-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygtls.h (_cygtls::protect_linked_list): Delete unused field. + +2012-05-30 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (find_first_notloaded_dll): Extend comment. Fix usage of + mapped memory. Shorten static library name buffer to MAX_PATH. Use + strlcpy to copy library name to buffer. Only Unmap "map" if it has been + Mapped before. + * pinfo.cc (status_exit): Drop unneeded declaration of + find_first_notloaded_dll in favor of the declaration in winsup.h. + +2012-05-30 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc: Remove temporary newlib workaround, now that newlib + handles thread cancellation by itself. + (class __cygwin_lock_handler): Remove. + (__cygwin_lock_cleanup): Remove. + (__cygwin_lock_lock): Revert newlib workaround, + (__cygwin_lock_trylock): Ditto. + (__cygwin_lock_unlock): Ditto. + (pthread::pop_cleanup_handler): Ditto. + +2012-05-29 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (select_stuff::wait): Temporarily disable restarting + entirely. + +2012-05-29 Corinna Vinschen <corinna@vinschen.de> + + * security.h (cygsidlist::+=): Correctly copy well_known_sid info from + source cygsid. + +2012-05-25 Corinna Vinschen <corinna@vinschen.de> + + * registry.cc (reg_key::build_reg): Fix typo in debug output. + +2012-05-25 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (select_stuff::wait): When not returning after receiving + a signal, recalculate timeout. Apply temporary fix to avoid crashes + after calling the signal handler. Explain. + +2012-05-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc (fhandler_serial::raw_read): Check for + ERROR_OPERATION_ABORTED rather than ERROR_IO_INCOMPLETE after CancelIo. + +2012-05-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc (fhandler_serial::raw_read): Just call ReadFile + directly in case of non-blocking I/O and handle result gracefully. + +2012-05-24 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (__cygwin_lock_lock): Replace null thread check with test + for cygwin_finished_initializing to handle process startup. + (__cygwin_lock_trylock): Ditto. + (__cygwin_lock_unlock): Ditto. + +2012-05-23 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (__cygwin_lock_lock): Take null thread at process startup + into account. + (__cygwin_lock_trylock): Ditto. + (__cygwin_lock_unlock): Ditto. + +2012-05-23 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::cancel): Re-allow asynchronous cancellation from + Cygwin code since it looks like the problem is Windows only. + +2012-05-23 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc: Add a temporary workaround to help Cygwin along while + newlib doesn't install cleanup handlers. Explain the problem. + (class __cygwin_lock_handler): New class. + (__cygwin_lock_cleanup): New function. + (__cygwin_lock_lock): Push __cygwin_lock_cleanup thread cleanup + handler. + (__cygwin_lock_trylock): Ditto. + (__cygwin_lock_unlock): Pop thread cleanup handler. + (pthread::pop_cleanup_handler): Temporarily allow cleanup function to + destroy cleanup handler so we can pop in another function than we + pushed in. + +2012-05-23 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::cancel): Only allow asynchronous cancellation + if the thread is not executing Cygwin or Windows code. Explain why. + +2012-05-23 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::precreate): Make sure mutex is recursive. + Explain why. + +2012-05-23 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::pop_cleanup_handler): Move setting the cancelstate + to PTHREAD_CANCEL_DISABLE from here... + (pthread::pop_all_cleanup_handlers): ...to here, otherwise any explicit + call to pthread_cleanup_pop disables cancellation for this thread. + +2012-05-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (refcnt): Add i interlocked. Explain why. + * winbase.h (ilockadd): New function. + (InterlockedAdd): Define as ilockadd. + +2012-05-22 Corinna Vinschen <corinna@vinschen.de> + + * devices.in: Fix native name of /dev/kmem. + * devices.cc: Regenerate. + * dtable.cc (fh_alloc): Don't forget FH_KMEM. + * fhandler_mem.cc (fhandler_dev_mem::open): Set errno to EACCES rather + than ENOENT on systems not granting access to physical memory from + user space. + +2012-05-22 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::cancel): Set thread's cancel_event in + PTHREAD_CANCEL_ASYNCHRONOUS case, too. Explain why. + +2012-05-21 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (strace::activate): Move printing heap size from here... + * heap.cc (heap_init_info): ...to here. Explain why. Print heap + size in hex and decimal. + +2012-05-21 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_recvfrom): Don't shortcircuit if len == 0. Add comment + to explain why. + (cygwin_recv): Ditto. + (cygwin_recvmsg): Ditto. + +2012-05-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (path_conv::isgood_inode): Rearrange, take + Samba versions >= 3.5.4 into account, add comments. + +2012-05-16 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000009. + * smallprint.cc (__small_vsprintf): Always treat '%c' and '%C' as + characters. Don't decode them if they are > 127. + (__small_vswprintf): Ditto. + +2012-05-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000008. + * fhandler_tty.cc (bytes_available): Simplify by returning the number + of bytes available in the message unless that is zero. + +2012-05-14 Christopher Faylor <me.cygwin2012@cgf.cx> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + +2012-05-14 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000007. + * child_info.h (child_info_spawn::parent_winpid): Declare new field. + (child_info_spawn::get_parent_handle): Declare new function. + * dcrt0.cc (child_info_spawn::get_parent_handle): Define new function. + (child_info_spawn::handle_spawn): Recreate parent handle if possible + when dynamically loaded. Don't mess with parent handle if it's NULL. + * spawn.cc (child_info_spawn::worker): Set parent_winpid appropriately. + +2012-05-12 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000006. + * thread.cc (pthread::pop_cleanup_handler): Set cancel state to + disabled to avoid recursively waiting for cancel. + +2012-05-12 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000005. + * fhandler.h (PIPE_ADD_PID): Redefine to something we actually DON'T + use. + * pipe.cc (fhandler_pipe::create): Avoid clearing all open_mode bits + when checking for PIPE_ADD_PID. Properly keep track of len so that + passed in name is not overwritten. + +2012-05-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (memrchr): Export. + * posix.sgml (std-gnu): Add memrchr. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2012-05-10 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 16. + +2012-05-08 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000004. + * pinfo.cc (pinfo::init): Reuse shared memory if the state is marked + with PID_REAPED. + * spawn.cc (child_info_spawn::worker): Don't duplicate myself_pinfo + into non-cygwin child. + + * fork.cc (frok::parent): Improve error output. + +2012-05-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000003. + * cygheap.h (init_cygheap::pid_handle): Delete. + * dcrt0.cc (child_info_spawn::handle_spawn): Keep parent open if we + have execed. + * pinfo.cc (pinfo::thisproc): Remove pid_handle manipulations. + (pinfo::init): Don't consider a reaped process to be available. + * spawn.cc (child_info_spawn::worker): Remove pid_handle manipulations. + Make wr_proc_pipe and parent noninheritable when starting a program + which doesn't use the Cygwin DLL. Conditionally reset wr_proc_pipe to + inheritable if CreateProcess fails. Inject wr_proc_pipe handle into + non-Cygwin process. Consider a non-cygwin process to be 'synced'. + +2012-05-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: Add entry cgf-000002. + * fhandler_tty.cc (bytes_available): Revert to previous Oct-2011 + behavior where a dummy buffer is used to determine how many bytes will + be read. + (fhandler_pty_master::ioctl): Correct coercion in assignment. + +2012-05-03 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (get_adapters_addresses): Only create thread on affected + systems. Change comment acordingly. + * wincap.h (wincaps::has_gaa_largeaddress_bug): New element. + * wincap.cc: Implement above element throughout. + (wincap_8): New globale wincaps to support Windows 8. + (wincapc::init): Take Windows 8 into account. Set new + has_gaa_largeaddress_bug member to false on 32 bit systems. + +2012-05-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * DevNotes: New file. Add entry cgf-000001. + * sigproc.cc (proc_terminate): Don't set parent pid of child to 1 if + we've execed since the execed process is still considered the parent. + + * child_info.h: Bump copyright. + +2012-05-02 Corinna Vinschen <corinna@vinschen.de> + + * fenv.cc (fesetround): Fix test for valid input parameter. + (fesetprec): Ditto. + +2012-04-30 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler.h (PIPE_ADD_PID): Define new flag. + * pipe.cc (fhandler_pipe::create): Don't indiscriminately add process + id to every pipe since some pipe names (fifo, tty) don't need it. + * sigproc.cc (sigproc_init): Pass PIPE_ADD_PID to fhandler_pipe::create + to ensure that pid is always part of sigwait pipe name. + +2012-04-28 Christopher Faylor <me.cygwin2012@cgf.cx> + + * environ.cc (struct parse_thing): Add "pipe_byte" option. + * globals.cc (pipe_byte): Declare. + * pipe.cc (fhandler_pipe::create): Use current process id in pipe name + rather than pid for simple name collision avoidance. Do this only once + to avoid extra overhead when a busy pipe is found. Honor pipe_byte to + create non-message pipes if set. + * sigproc.cc (sigproc_init): Use a specific name for the signal pipe. + +2012-04-27 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (find_fast_cwd_pointer): Fix for W8 CP 32 bit. + +2012-04-25 Thomas Wolff <towo@towo.net> + + * fhandler.h (class dev_console): Add member ext_mouse_mode5. + * fhandler_console.cc (fhandler_console::read): Implement extended + mouse mode 1005 (xterm, mintty). + Fix actual mouse reporting for large coordinates. + +2012-04-24 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 15. + +2012-04-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (ALT_PRESSED): Define earlier, never undefine. + (CTRL_PRESSED): Ditto. + (fhandler_console::read): Simplify expressions testing for pressed ALT + or CTRL modifier keys. + (get_nonascii_key): Ditto. + +2012-04-24 Thomas Wolff <towo@towo.net> + + * fhandler.h (class dev_console): Add members ext_mouse_mode6 and + ext_mouse_mode15. + * fhandler_console.cc (fhandler_console::read): Implement extended + mouse modes 1015 (urxvt, mintty, xterm) and 1006 (xterm). Recognize, + but don't implement extended mouse mode 1005 (xterm, mintty). + Support mouse coordinates greater than 222 (each axis). Fix formatting. + (fhandler_console::char_command): Initialize enhanced mouse reporting + modes. + +2012-04-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (fh_alloc): Only disallow opening of nonexistent on-disk + device. + * path.cc (path_conv::check): Remove PATH_KEPT_HANDLE setting. + * path.h (path_types): Remove PATH_KEPT_HANDLE. + (path_conv::kept_handle): Delete now-unneeded function. + +2012-04-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (fh_alloc): Keep fh which was flagged as error if it is for + an on-disk device and we were stating it. + * path.cc (path_conv::check): Set PATH_KEPT_HANDLE. + * path.h (path_types): Add PATH_KEPT_HANDLE. + (path_conv::kept_handle): Implement. + +2012-04-18 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler.h (fhandler_base::nohandle): Revert to standard + implementation. + * dtable.cc (dtable::fixup_after_exec): Specifically reject releasing + nohandle() type fhandlers rather than relying on contents of io_handle. + (dtable::fixup_after_fork): Ditto. + * fhandler_termios.cc: Add includes necessary for definitions of + have_execed and have_execed_cygwin. + (fhandler_termios::sigflush): Don't flush console input when we've + started a non-Cygwin process. + +2012-04-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * wincap.h: Rename assitant to assistant throughout. + * wincap.cc: Ditto. + * devices.in (exists_console): Use fhandler_console::exists () rather + than raw test. + * devices.cc: Regenerate. + * fhandler.h (fhandler_console::exists): Define new function. + * fhandler_console.cc (fhandler_console::need_invisible): Use + fhandler_console::exists () rather than raw test. + * spawn.cc: Rename assitant to assistant throughout. + (child_info_spawn::worker): Simplify test for when to start a + non-Cygwin process in its own process group. Just do it whenever we + start a non-Cygwin process. + +2012-04-12 Christopher Faylor <me.cygwin2012@cgf.cx> + + * devices.in (exists_console): Allow /dev/con{sole,in,out} to be + referenced if a console exists. + * devices.cc: Regenerate. + * fhandler_console.cc (fhandler_console::set_unit): Ditto. + +2012-04-11 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (fhandler_base::stat_fixup): Fix inode numbers of + non-device files in virtual fileysystems. + +2012-04-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (cygwin_attach_handle_to_fd): Defend against NULL return + from build_fh_*. + (dtable::init_std_file_from_handle): Ditto. + * mmap.cc (mmap_record::alloc_fh): Ditto. + * path.cc (path_conv::check): Ditto. + +2012-04-06 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler.h (fhandler_base::nohandle): Implement "by hand" rather than + through macro. Set io_handle to INVALID_HANDLE_VALUE when setting flag + to true. + +2012-04-06 Christopher Faylor <me.cygwin2012@cgf.cx> + + * path.c (path_conv::check): Avoid directly referencing fields of the + dev structure when it can be easily avoided. + +2012-04-05 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 14. + +2012-04-05 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (pwdgrp::read_passwd): Fix pretty_ls entry typo contain + the required number of colons. + +2012-04-04 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler.h (fhandler_pty_common::bytes_available): Declare new + function. + (fhandler_pty_master::flush_to_slave): Ditto. + * fhandler_tty.cc (bytes_available): Define new function. + (fhandler_pty_common::bytes_available): Ditto. + (handler_pty_master::flush_to_slave): Ditto. + (fhandler_pty_master::process_slave_output): Call flush_to_slave () + here. Use bytes_available () rather than PeekNamedPipe. Clean up + sloppy logic. + (fhandler_pty_slave::read): Use bytes_available () rather than + PeekNamedPipe. + (fhandler_pty_slave::ioctl): Ditto. + (fhandler_pty_master::ioctl): Ditto. + (fhandler_pty_master::cleanup): Remove ancient #if 0. + * select.cc (peek_pipe): Call flush_to_slave whenever we're checking + for a pty master. + +2012-04-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_nodevice.cc (fhandler_nodevice::open): Convert EROFS to + ENOENT if non-existent file got opened for reading only. Explain why. + * path.cc (path_conv::check): Stick to ENOENT if file has been opened + for informational purposes only. Add to comment. + +2012-04-04 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::check): Convert device type to FH_FS for + non-existent files on /dev, unless /dev itself doesn't exist on disk. + Add comment to explain why. + +2012-04-04 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (rvadelta): Compute max_size using SizeOfRawData rather + than VirtualSize. + +2012-04-04 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (_getpass_close_fd): New static pthread cleanup handler. + (getpass): Rework to use /dev/tty in the first place. Install + _getpass_close_fd as pthread cleanup handler. Flush prompt explicitely. + Lock input and switch off signal input handling when reading password. + +2012-04-03 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 13. + +2012-04-03 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (fhandler_base::stat_fixup): Replace string comparison + with new device::is_dev_resident() call. + +2012-04-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * devices.h (lives_in_dev): New field. + (dev_on_fs): Set bit size. + (is_dev_resident): Define new method. + * devices.in: Use different method for labelling requested name for dev + storage: prefix it with a ='. Use an actual ':' to denote an internal + device. + (exists_console): Avoid repeated test. + (exists_ntdev_silent): Rename from the less-descriptive exists_ntdevs. + (dev_dev_storage): Delete unneeded define. + * gendevices: Add a flag to each line denoting whether the device lives + in /dev space. + (generate): Handle special ":" case here for internal devices. Parse + =something_dev as requiring a storage location. Tack the rest of the + line back onto the reformulated "$rest". + * devices.cc: Regenerate. + +2012-04-02 Corinna Vinschen <corinna@vinschen.de> + + * devices.h (device::get_device): New method. + * fhandler_dev.cc (fhandler_dev::readdir): Set st_ino to device number. + * syscalls.cc (fhandler_base::stat_fixup): Ditto. Fix link count for + CD-ROM devices. Fix typo in comment. + +2012-04-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::stat_fixup): Rename from + fhandler_base::set_ino_and_dev. + * syscalls.cc (fhandler_base::stat_fixup): Ditto. Accommodate name + change throughout. Fixup link count of console devices. + +2012-04-02 Corinna Vinschen <corinna@vinschen.de> + + * devices.h (FH_CYGDRIVE): Define as DEV_VIRTFS_MAJOR class device. + (DEV_CYGDRIVE_MAJOR): Remove. + (iscygdrive_dev): Define. + * dtable.cc (fh_alloc): Accommodate above change. + * path.cc (path_conv::check): Use iscygdrive_dev to check for cygdrive. + * syscalls.cc (fhandler_base::set_ino_and_dev): Drop check for + DEV_CYGDRIVE_MAJOR from conditional. + +2012-04-02 Corinna Vinschen <corinna@vinschen.de> + + * devices.h (FH_DEV): Define as DEV_VIRTFS_MAJOR class device. + (DEV_DEV_MAJOR): Remove. + * dtable.cc (fh_alloc): Accommodate above change. + * syscalls.cc (set_ino_and_dev): Drop check for DEV_DEV_MAJOR from + conditional. + +2012-04-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::set_ino_and_dev): Declare. + * syscalls.cc (fhandler_base::set_ino_and_dev): New method to set + st_ino, st_dev, and st_rdev for devices in a single spot. + (fstat64): Call fhandler_base::set_ino_and_dev instead of setting + st_ino, st_dev, and st_rdev here. + (stat_worker): Ditto. + +2012-04-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev::open): Declare. + (fhandler_dev::close): Declare. + (fhandler_dev::fstat): Declare. + (fhandler_dev::fstatvfs): Declare. + (fhandler_cygdrive::fstatvfs): Declare. + * fhandler_dev.cc (fhandler_dev::open): New method. + (fhandler_dev::close): Ditto. + (fhandler_dev::fstat): Ditto. + (fhandler_dev::fstatvfs): Ditto. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't fill + st_rdev. + (fhandler_cygdrive::fstatvfs): New method. + * path.h (path_conv::fs_got_fs): New method. + * mount.h (fs_info::got_fs): Change type to bool, make public. + +2012-04-02 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fillout_mntent): Use "none" rather than 0 when checking + FS type. + +2012-04-01 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (dtable::fixup_close): Define new function. + (dtable::fixup_after_exec): Use fixup_close() and detect when it was + not possible to open an inherited file handle. + (dtable::fixup_after_fork): Defensively close any file handles which + were not, for some reason, inheritable. + * dtable.h: Make #pragma once. + (dtable::fixup_close): Declare new function. + * fhandler_console.cc (fhandler_console::set_unit): Set I/O handles to + NULL when this function fails. + +2012-04-01 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_dev.cc (fhandler_dev::readdir): Fix formatting. Simplify + code. Use device::type() to fetch dirent compatible device type. + Add comment. + +2012-03-31 Christopher Faylor <me.cygwin2012@cgf.cx> + + * devices.h (device::exists_func): Redefine field. + (device::dev_on_fs): Remove unneeded bit field. Just make a normal + boolean. + (device::exists): Redefine function. + * devices.in: Move previous functions earlier since they are now only + defined static. Rename some functions due to an as-yet unresolved bug + in gendevices. Rename posix part of internal-only devices with a + double-slash. gendevices will eventuall translate that to a ":". + (device::parse): Rework to use dev pointer and dev_storage_end. + * devices.cc: Regenerate. + * gendevices: Translate "// to ": after shilka processing. + +2012-03-31 Corinna Vinschen <corinna@vinschen.de> + + * devices.cc: Regenerate. + * devices.h (device::exists_func): New member function pointer, + replacing noexpose. + (device::expose): Remove. + (device::exists_never): Declare. + (device::exists_ptys): Declare. + (device::exists_cons): Declare. + (device::exists_console): Declare. + (device::exists_nt_dev): Declare. + (device::exists): Declare. + * devices.in (dev_storage): Replace former noexpose values with + pointers to matching exists_XXX method. + (device::exists_never): New method. + (device::exists_ptys): New method. + (device::exists_cons): New method. + (device::exists_console): New method. + (device::exists_nt_dev): New method. + (device::exists): New method. + * fhandler_dev.cc (fhandler_dev::readdir): Replace call to + device::expose with call to device::exists and drop all further + existence filtering since it's done in device::exists now. + * path.cc (path_conv::check): Replace call to device::expose with call + to device::exists. + +2012-03-30 Christopher Faylor <me.cygwin2012@cgf.cx> + + * devices.cc: Regenerate. + * devices.h (device::noexpose): New field. + (device::dev_on_fs): Make a bit field. + (get_major): Use proper type for declaration. + (expose): New field. + (ext_dev_storage): Delete declaration. + (dev_storage_size): Ditto. + (dev_storage): New declaration. + (dev_storage_end): Ditto. + * devices.in: Mark /dev/ptym*, /dev/com*, /dev/pipe, /dev/fifo, and + "/dev" as "no expose". + * fhandler.h (fhandler_dev::lastrealpos): Delete declaration. + (fhandler_dev::devidx): Declare new field. + * fhandler_disk_file.cc: Move fhandler_dev functions into + fhandler_dev.cc. + * fhandler_dev.cc: Add includes needed for functions moved from + fhandler_disk_file.cc. + (dev_storage_scan_start): Define place to start listing devices. + (dev_storage_size): Define size of array to scan. + (fhandler_dev::fhandler_dev): Move here from fhandler_disk_file.cc. + (fhandler_dev::opendir): Ditto. + (fhandler_dev::readdir): Just check devidx for non-NULL to determine + when to go to disk for /dev content. Use dev_storage rather than + ext_dev_storage. Iterate over dev_storage using devidx pointer. Use + accessor functions rather than raw references to the device struct. + Only increment dir->__d_position when we are actually going to be + returning something. Add debug_printf for exit. + (fhandler_dev::rewinddir): Set devidx as appropriate depending on + whether there's a /dev on disk or not. + * gendevices: Don't mark dev_storage static but do put it in the _RDATA + section. + * path.cc (path_conv::check): Use new "device::expose()" function to + decide to forbid programs from referencing internal device types. + +2012-03-30 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (std-notes): Change description of flock restrictions. + +2012-03-30 Corinna Vinschen <corinna@vinschen.de> + + * devices.h (DEV_TTY_MAJOR): Define, use throughout where appropriate. + (DEV_VIRTFS_MAJOR): Ditto. + * fhandler_dev.cc (fhandler_dev::readdir): Add comments. Tweak tests + for invisible devices. Don't print comX devices, only ttySX. Drop + requirement to call stat64. + +2012-03-29 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add fhandler_dev.o. + * devices.h (DEV_DEV_MAJOR): Define. + (FH_DEV): Redefine in terms of DEV_DEV_MAJOR. + (ext_dev_storage): Declare. + (dev_storage_size): Declare. + (dev_dev_storage): Declare. + (dev_dev): Define. + (isdev_dev): Define. + * devices.in (dev_dev_storage): Activate. + (ext_dev_storage): Define as externally available pointer to + dev_storage. + (dev_storage_size): Define to contain number of dev_storage elements. + * dir.cc (rmdir): Handle /dev as always not empty. + * dtable.cc (fh_alloc): Handle DEV_DEV_MAJOR. + * fhandler.h (fhandler_dev): New class, derived from fhandler_disk_file. + (fhandler_union): Add fhandler_dev member. + * fhandler_disk_file.cc (class __DIR_mounts): Handle /dev directory + to make sure it always exists. + * fhandler_dev.cc: New file implementing /dev. + * globals.cc (ro_u_dev): New R/O unicode string. + * path.cc (path_conv::check): Handle FH_DEV device. + +2012-03-29 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_console.cc (fhandler_console::set_unit): Don't succeed + unless we are opening a console actually associated with this process. + +2012-03-29 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (acl32): Fix potential crash if build_fh_name returns NULL. + +2012-03-29 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (ctrl_c_handler): Don't generate a SIGINT if we've + execed a non-cygwin process. Let the Windows process deal with it + itself. + +2012-03-28 Christopher Faylor <me.cygwin2012@cgf.cx> + + * sigproc.cc (proc_terminate): Avoid releasing myself. + +2012-03-28 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (clock_setres): Set minperiod to period. + +2012-03-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (process_tab): Add entry for mountinfo. + (format_process_mountstuff): New function, derived from + format_process_mounts. Only open another user's user_info shared + memory area if the process is owned by another user. Actually + access the opened shared user_info to get the right mount table. + For other users, don't print remote cygdrive mount points. Print + mountinfo or mounts output depending on the bool mountinfo argument. + (format_process_mounts): Just call format_process_mountstuff with + mountinfo set to false. + (format_process_mountinfo): Ditto with mountinfo set to true. + +2012-03-27 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (clock_setres): Revert previous change. + +2012-03-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_clipboard): Add fstat method. + * fhandler_clipboard.cc (cygcb_t): New type for Cygwin-specific + clipboard format. + (set_clipboard): Use new clipboard format to allow setting a timestamp. + (fhandler_dev_clipboard::fstat): New method. Read modification and + access timestamp as well as length from clipboard data. + (fhandler_dev_clipboard::read): Use new clipboard format. + +2012-03-26 Corinna Vinschen <corinna@vinschen.de> + + * hires.h (hires_ms::dmsecs): Drop unused method. + * times.cc (JITTER): Remove. + (gtod): Revert to process-local variable. + (hires_ms::nsecs): Just return system time to disallow discrepancy with + the OS. + (hires_ms::resolution): Return coarsest timer value from OS. Add + comment to explain why. + (clock_setres): Ditto. + +2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * child_info.h: Reset magic number. + +2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * child_info.h (child_info::postfork): Define new function. + * fork.cc (frok::parent): Call postfork to do all of the manipulation + required prior to calling pinfo::remember. + * pinfo.h (pinfo::set_rd_proc_pipe): Just set pinfo's rd_proc_pipe. + Don't bother setting it to NULL. + * sigproc.cc (child_info_spawn::wait_for_myself): Call postfork to set + up myself for waiting. + * spawn.cc (child_info_spawn::worker): Avoid now-unnecessary global + lock. Consistently test mode rather than chtype when making + wr_proc_pipe decisions. Call postfork() to set up stuff prior to + pinfo::remember. + +2012-03-21 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (well_known_dlls): Add advapi32.dll. + +2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * child_info.h: Reset magic number. + (child_info_spawn::wait_for_myself): Move function to sigproc.cc. + * pinfo.cc (is_toplevel_proc): Delete unneeded variable. + * sigproc.cc (child_info_spawn::wait_for_myself): Move function from + header to here. Do all setup required to properly wait for top-level + execed process to exit. + * spawn.cc (child_info_spawn::worker): Attempt to properly handle + _P_DETACH. Set wr_proc_pipe if top-level process even when execing. + Just call wait_for_myself() to... wait for myself. Don't call cleanup + twice. + +2012-03-21 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (proc_waiter): Remove debugging. + +2012-03-20 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (set_std_handle): Call SetStdHandle with NULL if fd is + closed. + (dtable::release): "Close" standard handle if appropriate. + * dcrt0.cc (dll_crt0_0): Fix minor switch formatting problem. + * fork.cc (frok::parent): Make minor comment indentation change. + +2012-03-20 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (lseek): Fix debug output. + +2012-03-20 Christian Franke <franke@computer.org> + + * ntdll.h (SharedUserData): Add volatile qualifier. This fixes a + possible infinite loop in hires_ms::timeGetTime_ns. + +2012-03-20 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h: Fix definitions of MCAST_INCLUDE and + MCAST_EXCLUDE. + +2012-03-20 Christopher Faylor <me.cygwin2012@cgf.cx> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Reset. + (child_info::rd_proc_pipe): Declare new field. + (child_info::wr_proc_pipe): Ditto. + (child_info::prefork): Declare new function, derived from previous + pinfo version. + * dcrt0.cc (child_info_fork::handle_fork): Close previous wr_proc_pipe + when appropriate and assign new one from passed-in child_info block. + (child_info_spawn::handle_spawn): Assign our wr_proc_pipe handle from + passed-in child_info block. + * fork.cc (child_info::prefork): Define new function. + (frok::child): Clear rd_proc_pipe and wr_proc_pipe so they will not be + closed by the child_info destructor. + (frok::parent): Use child_info prefork handling, outside of retry loop. + Set rd_proc_pipe in child's pinfo after successful CreateProcess. + Eliminate postfork call. + * globals.cc (my_wr_proc_pipe): Define/declare new variable. + * pinfo.cc (pinfo::pending_rd_proc_pipe): Delete. + (pinfo::pending_wr_proc_pipe): Ditto. + (pinfo::prefork): Ditto. + (pinfo::postfork): Ditto. + (pinfo::postexec): Ditto. + (pinfo::wait): Assume that rd_proc_pipe is set up correctly prior to + call. + (_pinfo::alert_parent): Replace "wr_proc_pipe" with "my_wr_proc_pipe". + * pinfo.h (_pinfo::_wr_proc_pipe): Delete declaration. + (_pinfo::set_rd_proc_pipe): Define new function. + (pinfo::pending_rd_proc_pipe): Delete declaration. + (pinfo::pending_wr_proc_pipe): Ditto. + (pinfo::prefork): Ditto. + (pinfo::postfork): Ditto. + (pinfo::postexec): Ditto. + (pinfo::wr_proc_pipe): Ditto. + * sigproc.cc (child_info::child_info): Clear rd_proc_pipe and + wr_proc_pipe. + (child_info::cleanup): Close rd_proc_pipe and + wr_proc_pipe if necessary. + (child_info_fork::child_info_fork): Set forker_finished to NULL by + default. + (child_info_spawn::child_info_spawn): Use my_wr_proc_pipe rather than + myself->wr_proc_pipe. + (child_info::sync): Ditto. + (child_info_spawn::cleanup): Call child_info::cleanup. + * spawn.cc (child_info_spawn::worker): Remove call to myself.prefork(). + Set wr_proc_pipe when execing or set up new rd_proc_pipe/wr_proc_pipe + via child_info::prefork when spawning. Remove call to pinfo::postexec. + Set rd_proc_pipe in child pinfo when spawning. Use my_wr_proc_pipe + rather than myself->wr_proc_pipe. Remove call to postfork. + +2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (pinfo_init): Cosmetic change: unset "destroy" for myself. + (pinfo::wait): Change some comments. + (pinfo::prefork): Move a comment. + (pinfo::postfork): Set pending_*_pipe variables to NULL if closed. + (pinfo::postexec): Use right name when closing handle. + (_pinfo::alert_parent): Ditto. + * sigproc.h (hold_everything): Remove debugging label. + +2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygserver_ipc.h: Include sigproc.h for signal_arrived declaration. + +2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygprops.h: Use #pragma once. + * mkglobals_h: Ditto for generated globals.h file. + * globals.cc: Use specific NO_GLOBALS_H flag to control inclusion of + globals.h. + * winsup.h: Honor NO_GLOBALS_H to control inclusion of globals.h. Make + clear_procimptoken extern inline so that it is only defined when + needed. + +2012-03-19 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (cancelable_wait): Don't malloc tbi, just make it a struct + on the stack to avoid memory leak. + +2012-03-19 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (pinfo::wait): Handle case where prefork was not called + prior to calling wait(). This is the case when we are reabsorbing + processes after being execed. + +2012-03-16 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fork.cc (lock_signals): Move to sigproc.h. + (lock_pthread): Ditto. + (hold_everything): Ditto. + (frok::parent): Call myself.prefork() just before calling + CreateProcess. Call myself.postfork () on function exit. + * pinfo.cc (pinfo::pending_rd_proc_pipe): Define. + (pinfo::pending_wr_proc_pipe): Ditto. + (_pinfo::dup_proc_pipe): Delete. + (pinfo::wait): Move pipe creation into pinfo::prefork. Set pipe + variables from pending_*. + (_pinfo::sync_proc_pipe): Delete. + (_pinfo::proc_pipe_owner): Ditto. + (pinfo::prefork): Define new function. + (pinfo::postfork): Ditto. + (pinfo::postexec): Ditto. + (_pinfo::alert_parent): Remove obsolete call to sync_proc_pipe. + (_pinfo::dup_proc_pipe): Delete declaration. + (_pinfo::sync_proc_pipe): Ditto. + (pinfo::pending_rd_proc_pipe): Declare. + (pinfo::pending_wr_proc_pipe): Ditto. + (pinfo::prefork): Declare new function. + (pinfo::postfork): Ditto. + (pinfo::postexec): Ditto. + (pinfo::wr_proc_pipe): Define new wrapper function. + * sigproc.h: Include "sync.h". Move locking functions from fork to + here. + * spawn.cc (child_info_spawn::worker): Delete now-unneeded requirement + to record orig_wr_proc_pipe. Call hold_everything prior to doing + anything. Call myself.prefork() if spawning. Replace wr_proc_pipe + synchronization with call to myself.postexec(). Call myself.postfork() + if not execing. + * sync.h: Replace #ifdef wrapper with "#pragma once". + +2012-03-13 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (hook_or_detect_cygwin): Change condition when to use + importRVAMaxSize or importRVASize for the mapping size. Make sure + to map never more than the section size. Change comments accordingly. + +2012-03-13 Corinna Vinschen <corinna@vinschen.de> + + * include/netdb.h (h_errno): Add self-referencing macro and comment. + +2012-03-12 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler.h (wait_return): Add overlapped_nullread. + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Detect + zero-byte read as a special case. + (fhandler_base_overlapped::raw_read): Keep looping when zero-byte read + detected without EOF. + (fhandler_base_overlapped::raw_write): Quiet gcc warning by adding + overlapped_nullread to switch statement even though it will never + actually be hit. + +2012-03-10 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (fh_alloc): Treat pc.dev as unsigned. + * fhandler_console.cc (fhandler_console::set_unit): Use lock always to + avoid races between competing cygwin processes running on the console. + +2012-03-09 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (find_first_notloaded_dll): Fix a compiler warning. + +2012-03-09 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (rvadelta): Add parameter to return maximum available + size from start of import RVA table to end of section. + (find_first_notloaded_dll): Take big executables into account. Use + offset and size computation as in hook_or_detect_cygwin, just simpler. + (hook_or_detect_cygwin): Return NULL rather than false througout. + Change computation of required mapping size to take non-gcc compilers + into account. Explain the differences and what we do against them. + Don't alloca buf if fn is NULL. Never use buf if fn is NULL. + +2012-03-08 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (call_gaa): New thread function to call GetAdaptersAddresses. + (get_adapters_addresses): Call call_gaa. If necessary, call it as + child thread. Explain why that's necessary. + +2012-03-08 Václav Zeman <vhaisman@gmail.com> + + * path.cc (readlink): Avoid calling strlen() twice. + +2012-03-07 Corinna Vinschen <corinna@vinschen.de> + + * Throughout, replace usage of w32api's min with MIN from sys/param.h. + +2012-03-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (_pinfo::dup_proc_pipe): Reorganize to provide more + information for failing condition. + (pinfo::wait): Pass name of function to dup_proc_pipe. Eliminate error + check for dup_proc_pipe since it never actually returned an error. + * pinfo.h (_pinfo::dup_proc_pipe): Add an argument. + * spawn.cc (child_info_spawn::worker): Pass name of function to + dup_proc_pipe. + +2012-03-07 Corinna Vinschen <corinna@vinschen.de> + + * glob.cc (MAXPATHLEN): Reinstantiate with a value of 8192. + +2012-03-05 Denis Excoffier <cygwin@Denis-Excoffier.org> + + * pinfo.cc (_pinfo::dup_proc_pipe): Fix order of arguments in debug + output. + +2012-03-05 Corinna Vinschen <corinna@vinschen.de> + + * init.cc (dll_entry): Move wincap.init call back from here... + * dcrt0.cc (dll_crt0_0): ...to here. + +2012-03-05 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (enum fcwd_version_t): Move here from path.cc. + (class fcwd_access_t): Ditto. Only declare methods. + (class cwdstuff): Move fast_cwd_ptr and fast_cwd_version from shared + DLL section here. + * path.cc: Keep fcwd_access_t method definitions. + (fcwd_access_t::fast_cwd_version): New method. + (find_fast_cwd_pointer): Change comment. Mention test on W8CP. + (cwdstuff::init): Initialize fast_cwd_ptr and fast_cwd_version. + +2012-03-05 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (dll_list::operator[]): Extend comment a bit more to + explain previous patch. + +2012-03-04 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (dll_list::alloc): Compare linked DLLs by basename only. + Explain why. Add code to check if a DLL with the same basename but + different path is the same DLL. Bail out if not. + (in_load_after_fork): New static NO_COPY bool to allow to differ + between linked and loaded DLL at fork. + (dll_list::load_after_fork): Set in_load_after_fork accordingly. + (dll_dllcrt0_1): Don't treat DLL as linked if in_load_after_fork is set. + Drop test for in_forkee. + +2012-03-04 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc: Revert pathname changes from 2012-02-08. + (dll_list::operator[]): Add long comment to explain the misery. + (dll_list::alloc): Skip long pathname prefix potentially returned by + GetModuleFileNameW. + * dll_init.h (dll_list::find_by_modname): Add back declaration. + +2012-03-04 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc: Bump copyright date. + +2012-03-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler_console.cc (fhandler_console::dup): Only set ctty when we + haven't specifically called setsid. + * fhandler_tty.cc (fhandler_pty_slave::dup): Ditto. Also add comment + documenting research into rxvt problem. + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Don't check + specifically for myself->ctty == -1. Test for > 0 as that is the + correct test. + (fhandler_termios::sigflush): Ditto. + +2012-03-02 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (allow_others_to_sync): Reorder conditional expression to + check for DACL presence first, since otherwise dacl pointer value is + undefined. Add comment. + +2012-03-02 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (allow_others_to_sync): Use RtlGetDaclSecurityDescriptor + rather than accessing the SECURITY_DESCRIPTOR structure directly. + Take no DACL and NULL DACL into account. + +2012-03-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::input_tcsetattr): Revert + previous patch. + (fhandler_console::open_setup): Install Ctrl-C handler here, if this + console is the controlling tty and the process hasn't been started by + a Cygwin process. + +2012-03-02 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc (fhandler_console::input_tcsetattr): Set the + state of the Ctrl-C handler depending on the setting of + ENABLE_PROCESSED_INPUT. + +2012-02-28 Eric Blake <eblake@redhat.com> + + * include/sys/termios.h (tcgetsid): Fix return type. + * termios.cc (tcgetsid): Likewise. + * fhandler_termios.cc (fhandler_termios::tcgetsid): Likewise. + * fhandler.h (fhandler_base): Likewise. + * fhandler.cc (fhandler_base::tcgetsid): Likewise. + +2012-02-28 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (well_known_dlls): Add shlwapi.dll. + +2012-02-27 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (dll_cmp): New comparison function for bsearch. + (well_known_dlls): New array containing well-known DLLs. + (_cygtls::call2): Add code for BLODA detection. + * net.cc (fdsock): Ditto. + +2012-02-26 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (enum settings): Add setbool. Rename justset to setdword + to avoid future problems. + (struct parse_thing): Change all justset to setbool for bool variables. + (parse_options): Add a case for setbool setting for bool variables + since justset (now setdword) always writes a DWORD value, thus + overwriting adjacent memory locations. + * external.cc (cygwin_internal): Drop extern declaration. + +2012-02-26 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (dos_file_warning): Drop declaration. + (ignore_case_with_glob): Ditto. + (allow_winsymlinks): Ditto. + (reset_com): Move definition to globals.cc. + (struct parse_thing): Add "detect_bloda" option. + * fhandler_serial.cc (fhandler_serial::open): Drop (incorrect) + declaration of reset_com. + * globals.cc (ignore_case_with_glob): Move definition into C++-only + block. + (dos_file_warning): Define. + (allow_winsymlinks): Define. + (reset_com): Define. + (detect_bloda): Define. + * path.cc (dos_file_warning): Drop definition here. + (allow_winsymlinks): Drop definition here. + +2012-02-26 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (LOCK_DIR_NAME_FMT): Define. + (LOCK_DIR_NAME_LEN): Define. + (LOCK_DIR_NAME_DEV_OFF): Define. + (LOCK_DIR_NAME_INO_OFF): Define. + (LOCK_OBJ_NAME_FMT): Define. Add comment. + (class lockf_t): Use bitsize-explicit types. Declare from_obj_name, + (class inode_t): Make use, unuse and inuse methods public. Add a + lock argument to get method declaration. + (inode_t::get): Add lock argument. Only lock node if lock arg is true. + (inode_t::inode_t): Use LOCK_DIR_NAME_FMT as format string. + (lockf_t::from_obj_name): New method to generate lockf_t content from + lock event object basename. + (inode_t::get_all_locks_list): Just call from_obj_name here and copy + result into final lockf_t. + (create_lock_obj_attr): Use LOCK_OBJ_NAME_FMT as format string. + (create_lock_in_parent): New thread function to create lockf_t + structure in parent process. + (delete_lock_in_parent): New thread function to reap stale BSD locks in + parent process. + (lockf_t::create_lock_obj): Try to duplicate lock object handle into + parent process and call create_lock_in_parent as parent remote thread. + (lockf_t::del_lock_obj): Call delete_lock_in_parent as parent remote + thread. + (fhandler_disk_file::lock): Add lock arg to inode_t::get call. + +2012-02-25 Christopher Faylor <me.cygwin2012@cgf.cx> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 12. + +2012-02-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (scandirat): Export. + * posix.sgml (std-gnu): Add scandirat. + * syscalls.cc (scandirat): New function. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * include/sys/dirent.h (scandirat): Declare. + +2012-02-21 Corinna Vinschen <corinna@vinschen.de> + + Based on an idea from Nick Lowe <nick.lowe@gmail.com>: + * shared.cc (shared_info::init_obcaseinsensitive): Check actual state + of case sensitivity on post-Windows 2000 systems. + * wincap.h (wincaps::kernel_is_always_casesensitive): New element. + * wincap.cc: Implement above element throughout. + +2012-02-20 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (inode_t::del_my_locks): Drop useless counter lc. Close + lock object handle explicitely in case of called during fork. Add + comment to explain why. + * fork.cc (frok::child): Drop declaration of fixup_lockf_after_fork. + +2012-02-17 Corinna Vinschen <corinna@vinschen.de> + + * timer.cc (getitimer): Don't create another local ret variable in + timer_gettime calling branch. Simplify conditional since timer_gettime + always returns 0 or -1 anyway. + +2012-02-17 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (struct _PEB): Add EnvironmentUpdateCount member. + * spawn.cc (child_info_spawn::worker): Speed up job recognition. Expand + comment to explain every little detail and so we never forget. + * wincap.h (wincaps::has_program_compatibility_assitant): New element. + * wincap.cc: Implement above element throughout. + +2012-02-17 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (get_disk_type): Drop unneeded toupper call. Convert case + constants to wide chars. + +2012-02-16 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NetUseGetInfo): Define. + * fhandler_disk_file.cc (fhandler_cygdrive::opendir): Rename flptst + to drive. Call new get_disk_type function rather than is_floppy and + check SMB drives with the NetUseGetInfo function. Explain why. + * mount.cc (get_disk_type): New function to evaluate disk type from + native NT device name. + (is_floppy): Remove. + * mount.h (enum disk_type): Define. + (get_disk_type): Declare. + * path.h (is_floppy): Drop declaration. + +2012-02-15 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc: Revert change from 2012-02-13 which used the + Windows-provided stack rather than an own stack created in + CygwinCreateThread. + (struct thread_wrapper_arg): Rename commitsize to stacklimit. + (CygwinCreateThread): Rename commitsize to real_stacklimit. + +2012-02-15 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Use tmp_pathbuf for + name. + (handle_to_fn): Ditto for device. Fix size in QueryDosDeviceW call. + +2012-02-15 Christopher Faylor <me.cygwin2012@cgf.cx> + + * smallprint.cc (tmpbuf): Declare new class holding a static buffer, + protected by a lock. + (__small_vsprintf): Use tmpbuf to hold large buffer. + (__small_vswprintf): Ditto. + +2012-02-15 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (lf_setlock): Add timeout variable and set before calling + WFMO. Drop debug output if process is not available. Set timeout to + 0 instead. Document timeout 0 in WFMO comment. + (lf_getblock): Drop invalid F_POSIX lock type shortcut. Only return + overlap if event is not signalled. Fix comment. + +2012-02-14 Christopher Faylor <me.cygwin2012@cgf.cx> + + * pinfo.cc (_pinfo::set_ctty): Revert 2012-02-07 change to skip + function if tty in question == our ctty. + + * syscalls.cc (setsid): Avoid two function calls. + + * dtable.cc (dtable::dup_worker): Remove debugging. + + * init.cc (search_for): Calculate for every new process rather than + using shared value. + (threadfunc_ix): Fill in for every new process rather than sing shared + value. + +2012-02-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_cygdrive::fstat): Don't bother to + set st_nlink correctly, just set it to 1 to avoid potential network + timeouts. + +2012-02-14 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (lf_setlock): Don't close waited lock object handle before + we own the node lock. Fix comment. + +2012-02-14 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::init_installation_root): Convert function + init_installation_root into a cygheap method. + * cygheap.h (struct init_cygheap): Move installation_root, + installation_key, and installation_key_buf from shared + .cygwin_dll_common DLL section to cygheap. Declare new method + init_installation_root. + * dtable.cc (handle_to_fn): Accommodate the move of installation strings + to the cygheap. + * external.cc (cygwin_internal): Ditto. + * fhandler_console.cc (fhandler_console::open_shared_console): Ditto. + * fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Ditto. + * fhandler_tty.cc: Ditto, throughout. + * mount.cc (mount_info::init): Ditto. + * pipe.cc (fhandler_pipe::create): Ditto. + * shared.cc: Ditto, throughout. + (installation_root): Remove. + (installation_key): Move to cygheap. + (installation_key_buf): Ditto. + (installation_root_inited): Remove. + (SPIN_WAIT): Remove. + (init_installation_root): Move to cygheap. + (memory_init): Call cygheap->init_installation_root right after + cygheap->user.init. Drop call of init_installation_root function. + * shared_info.h (init_installation_root): Drop declaration. + (installation_root): Ditto. + (installation_key): Ditto. + * uinfo.cc (pwdgrp::load): Accommodate the move of installation strings + to the cygheap. + +2012-02-14 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc: Drop including unused headers. + +2012-02-13 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (struct thread_wrapper_arg): Convert char * to PBYTE. + Change related casts throughout. + (thread_wrapper): Only do the thread change if the application provided + the stack. Otherwise, just use the Windows-provided stack. Set up + POSIX guardpage here, if necessary. Move related comment from + CygwinCreateThread here. + (CygwinCreateThread): Never allocate and set up own stack here. Just + compute stack size to reserve and use value in CreateThread call if + stack hasn't been provided by the application. + +2012-02-13 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (clean): Remove non-existent regexp dir. + + * collate.h: New header. + (__collate_range_cmp): Declare. + (__collate_load_error): Define. + * glob.cc: Pull in latest version from FreeBSD. Simplify and reduce + Cygwin-specific changes. + * regex/regcomp.c: Include collate.h on Cygwin as well. + (__collate_range_cmp): Move from here... + * nlsfuncs.cc (__collate_range_cmp): ...to here. + + * miscfuncs.cc (thread_wrapper): Fix typo in comment. + (CygwinCreateThread): Take dead zone of Windows stack into account. + Change the way how the stack is commited and how to handle guardpages. + Explain how and why. + * thread.h (PTHREAD_DEFAULT_STACKSIZE): Change definition. Explain why. + +2012-02-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/pthread.h: Include time.h as required by POSIX. + +2012-02-12 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exception.h (stackdump): Declare. + * exceptions.cc (stackdump): Rework to perform all operations needed + for a stackdump and to avoid recursion. + (exception::handle): Use simplified stackdump interface. + * sigproc.cc (signal::exit): Ditto. Delete now, uneeded declaration. + +2012-02-11 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (DEFAULT_STACKSIZE): Remove. + (CygwinCreateThread): Simplify code by assuming that now stack-related + input values are undefined. Set stack protection to PAGE_READWRITE, + as is default on Windows. Add lengthy comment to explain POSIX + guardpage. + * thread.cc (pthread_attr::pthread_attr): Initialize stacksize as + PTHREAD_DEFAULT_STACKSIZE. Initialize guardsize as + PTHREAD_DEFAULT_GUARDSIZE. + * thread.h (PTHREAD_DEFAULT_STACKSIZE): Define. Add comment to explain. + (PTHREAD_DEFAULT_GUARDSIZE): Define. + +2012-02-10 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (DEFAULT_STACKSIZE): Set to 1 Megs. Drop comment about + RLIMIT_STACK. + + * registry.cc (get_registry_hive_path): Expect the user hive path to + be never longer than MAX_PATH. Don't prepend native NT path prefix + here. Add comment. + (load_registry_hive): Prepend native NT path prefix here. Additionally + try to load user's classes hive. + * uinfo.cc (cygheap_user::env_userprofile): Reduce size of + userprofile_env_buf to MAX_PATH. Add comment. + +2012-02-10 Christopher Faylor <me.cygwin2012@cgf.cx> + + * syscalls.cc (setsid): On second thought, in the spirit of keeping + things kludgy, set ctty to -2 here as a special flag, and... + (open): ...only eschew setting O_NOCTTY when that case is detected. + +2012-02-10 Christopher Faylor <me.cygwin2012@cgf.cx> + + * syscalls.cc (open): Semi-revert (?) to allowing open of a tty to + become controlling tty if there is no controlling tty. + +2012-02-09 Christopher Faylor <me.cygwin2012@cgf.cx> + + * exceptions.cc (setup_handler): Reduce system_printf to sigproc_printf + since it is for a transient situation which will undoubtedly be + handled. + +2012-02-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::write): Set + bytes_to_write to 0 in case it fits into the buffer, otherwise suffer + early EOF in caller. + +2012-02-09 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.h (struct dll): Re-add modname. + * dll_init.cc: Throughout, use modname where it was used before. + (dll_list::operator[]): Use modname. Move comment from dll_list::alloc + here and remove hint about GetModuleBaseNameW. + (dll_list::alloc): Store full path in name, pointer to basename in + modname. Search dll using modname. + +2012-02-08 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (dtable::init_std_file_from_handle): Reinstate opening tty + handles with O_RDWR permissions. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (__pthread_cond_wait_init): New static function replacing + __pthread_cond_dowait. Only check and potentially initialize cond and + mutex, drop call to (*cond)->wait. + (pthread_cond_timedwait): Replace call to __pthread_cond_dowait with + separate calls to __pthread_cond_wait_init and (*cond)->wait to be + able to initialize cond before accessing its clock_id member. + (pthread_cond_wait): Ditto (more or less). + +2012-02-08 Christian Franke <franke@computer.org> + + * include/sys/wait.h: Remove C++ inline functions for `union wait'. + For C++ use `void *' as __wait_status_ptr_t instead. This is less type + safe but fixes compile error on `wait(NULL)'. Remove extra `;'. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (child_info_fork::abort): Call TerminateProcess rather + than ExitProcess. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::env_userprofile): Simplify since network + drives are not supported here. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::env_userprofile): Convert native + userprofile path returned from get_registry_hive_path to Win32 path. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc: Throughout, drop usage of modname in favor of name. + (dll_list::find_by_modname): Remove. + (dll_list::alloc): Only store module basename in name. Add comment to + explain why. Simplify address check. Fix formatting in comment. + * dll_init.h (struct dll): Drop modname and find_by_modname. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (dll_list::alloc): Add DLL name to fabort output. Fix + fabort string in case of bss start. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/sysmacros.h: Include sys/types.h. + +2012-02-07 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::create_root_entry): Fix format specifier in + api_fatal message. + +2012-02-07 Corinna Vinschen <corinna@vinschen.de> + + * include/process.h: Move here from include/cygwin subdir. + * exec.cc: Change include of process.h to reflect the fact that it's + now back in include. + * spawn.cc: Ditto. + * syscalls.cc: Ditto. + +2012-02-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygheap.cc (init_cygheap::manage_console_count): Delete. + * cygheap.h (init_cygheap::manage_console_count): Ditto. + (init_cygheap::console_count): Ditto. + * fhandler.h (fhandler_console::has_a): Ditto. + (fhandler_console::free_console): Declare new function. + * fhandler_console.cc (fhandler_console::free_console): Define new + function. + (fhandler_console::open_setup): Delete call to manage_console_count. + (fhandler_console::close): Ditto. Replace with call to free_console(). + * fhandler_tty.cc (fhandler_pty_slave::open): Delete call to + manage_console_count. + (fhandler_pty_slave::cleanup): Ditto. + (fhandler_pty_slave::close): Call fhandler_console::free_console() if + this is our controlling tty. + * pinfo.cc (_pinfo::set_ctty): Skip function if tty in question == our + ctty. Delete call to manage_console_count. + + * syscalls.cc (close_all_files): Avoid locking and avoid setting errno + when iterating over fds. + +2012-02-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 11. + +2012-02-03 Václav Zeman <vhaisman@gmail.com> + + * grp.cc (pwdgrp::parse_group): Convert grp from macro to reference. + * passwd.cc (pwdgrp::parse_passwd): Ditto for res. + +2012-02-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * syscalls.cc (close_all_files): Use cygheap_fdget to manipulate + fhandler. Use debug_only_printf. + +2012-02-02 Corinna Vinschen <corinna@vinschen.de> + + Fix memory and handle leaks due to fdopendir: + * dir.cc (closedir): Call global close instead of just releasing the + fhandler. + * fhandler_disk_file.cc (fhandler_disk_file::closedir): Don't close + fhandler handle here, rely on global closedir doing the right thing. + * fhandler_registry.cc (fhandler_registry::readdir): Also delete + d_hash when closing registry key. + (fhandler_registry::rewinddir): Ditto. + + Avoid infinite recursion in VirtualStore under UAC: + * fhandler_registry.cc (VIRT_CLASSES_KEY_PREFIX): Define. + (VIRT_CLASSES_KEY_SUFFIX): Ditto. + (VIRT_CLASSES_KEY): Ditto. + (VIRT_CLASSES_LINKTGT): Ditto. + (fhandler_registry::exists): Return virt_symlink as file type if + this is a Classes key under the VirtualStore. + (fhandler_registry::fstat): Handle virt_symlink. + (fhandler_registry::readdir): Return DT_LNK as d_type if this is a + Classes key under the VirtualStore. + (fhandler_registry::fill_filebuf): Handle Classes symlink. + + Handle user impersonation in /proc/registry access: + * autoload.cc (RegOpenUserClassesRoot): Define. + (RegOpenCurrentUser): Define. + * fhandler_registry.cc (RegOpenUserClassesRoot): Declare function + missing in w32api. + (RegOpenCurrentUser): Ditto. + (fetch_hkey): New function. + (fhandler_registry::open): Call fetch_hkey to get root registry key. + (open_key): Ditto. + +2012-02-01 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fcntl.cc (fcntl64): Add introductory debug statement. Call dup3 + directly via dtable method to avoid over-incrementing refcnt. + +2012-02-01 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (dtable::dup_worker): Add comment explaining why refcnt + isn't incremented here. + (dtable::dup3): Simplify slightly. Add comment. + * syscalls.cc (dup3): Increment refcnt here, similarly to dup2. + +2012-02-01 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler.cc (fhandler_base_overlapped::has_ongoing_io): Don't block + GetOverlappedResult since previous IsEventSignalled will have reset the + handle. + * select.cc (cygwin_select): Remove space before parentheses in syscall + debugging output. + (pipe_data_available): Streamline if block. + +2012-01-31 Christopher Faylor <me.cygwin2012@cgf.cx> + + * syscalls.cc (dup3): Fix debug typo. + + * fhandler.cc (flush_async_io): Assume only called for writer. Call + GetOverlappedResult directly rather than kludging call to + has_ongoing_io. + (fhandler_base_overlapped::close): Only start flush thread when closing + write handle. Only cancel I/O when reading. + +2012-01-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din: Fix order (DATA first). + +2012-01-27 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (is_dos_path): New macro to recognize drive letter and UNC + DOS paths. + (globify): Call is_dos_path instead of isdrive. + +2012-01-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * sigproc.cc (child_info::retry_count): Default to 1. + +2012-01-23 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (gethostid): Simplify. Just fetch MachineGuid and + create hash from there. + +2012-01-22 Christopher Faylor <me.cygwin2012@cgf.cx> + + * fhandler.h (fhandler_fifo::arm): Declare new function. + * fhandler_fifo.cc (fhandler_fifo::arm): Define new function. + (fhandler_fifo::open): Fix handling of RDWR pipes to avoid opening a + second handle. Use arm() function to set events. + (fhandler_fifo::raw_read): Correctly go into "connect again logic" when + we detect another writer is available. Use arm() function to set event. + * pipe.cc (fhandler_pipe::create): Add more detail to debugging output. + +2012-01-22 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygheap.h (cygheap_fdmanip::release): Simplify. + * dtable.cc (dtable::release): Make void again. Skip not_open check + since it is guaranteed to be open. Don't bother deleting here since + actual deletion will be handled in cygheap_fdget::~cygheap_fdget. + * dtable.h (dtable::release): Make void again. + * syscalls.cc (dup2): Bump fhandler use count on successful dup. + +2012-01-22 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygheap.h (cygheap_fdget::~cygheap_fdget): Simplify now that refcnt + reports reference count changes itself. + * fhandler.cc (fhandler_base::reset): Set _refcnt to 0. + * fhandler.h (fhandler_base::refcnt): Report refcnt when debugging. + + * select.cc (cygwin_select): Set return_on_signal to indicate when + select should be interrupted. + (select_stuff::wait): Keep looping unless return_on_signal is set. + * select.h (select_stuff::return_on_signal): New variable. + (select_stuff::select_stuff): Zero return_on_signal. + +2012-01-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_registry::opendir): Declare. + * fhandler_registry.cc (fhandler_registry::opendir): New function. + +2012-01-13 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/cygwin/config.h (_GLIBC_EXTENSION): Define. + +2012-01-11 Christopher Faylor <me.cygwin2012@cgf.cx> + + * spawn.cc (child_info_spawn::worker): Delete debugging. + +2012-01-11 Christopher Faylor <me.cygwin2012@cgf.cx> + + Update copyright on all files checked in so far this year. + * fhandler.h: Use #pragma once rather than ifdef guards. + (fhandler_console::tc_getpgid): Return our pgid if we have never opened + a console. + * fork.cc: Rearrange includes to accommodate fhandler.h use of pinfo.h. + * sigproc.cc: Ditto. + * spawn.cc: Ditto. + (child_info_spawn::worker): Query myself->pgid rather than calling + expensive function. + * thread.h: Use #pragma once rather than ifdef guards. + * pinfo.h: Use #pragma once rather than ifdef guards. + (pinfo::remember): Don't define if sigproc.h has not been included. + (pinfo::reattach): Ditto. + * sigproc.h: Use #pragma once rather than ifdef guards. Use different + test to see if pinfo.h has been included. + +2012-01-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/process.h: Move here from newlib. + * exec.cc: Change include of process.h to reflect the fact that it's + now in the include/cygwin subfolder. + * spawn.cc: Ditto. + * syscalls.cc: Ditto. + +2012-01-09 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (thread_wrapper): Make sure stack is 16 byte aligned + to make gcc-3 compiled pthread applications happy. + +2012-01-08 Christopher Faylor <me.cygwin2012@cgf.cx> + + * dtable.cc (dtable::stdio_init): Always initialize console when we + have one. + * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Use a better + method to print tty name for debugging. + (fhandler_termios::bg_check): Ditto. + * pinfo.cc (_pinfo::set_ctty): Remove leftover debugging stuff. + Simplify behavior when setting tty's sid and pgid to avoid overwriting + previously set values. + + * spawn.cc (ch_spawn): Cosmetic change. + +2012-01-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (pthread_sigqueue): Export. + * posix.sgml (std-gnu): Add pthread_sigqueue. + * thread.cc (pthread_sigqueue): New function. + * thread.h (pthread_sigqueue): New function. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2012-01-02 Christopher Faylor <me.cygwin2012@cgf.cx> + + * path.cc (get_current_dir_name): Avoid memory leak. Don't return PWD + contents if directory doesn't actually exist. + +2012-01-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin.din (get_current_dir_name): Export. + * path.cc (get_current_dir_name): New function. + * posix.sgml (std-gnu): Add get_current_dir_name. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2013 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2013 new file mode 100644 index 000000000..574984e3c --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2013 @@ -0,0 +1,2078 @@ +2013-12-31 Christopher Faylor <me.cygwin2013@cgf.cx> + + * fhandler_console.cc (region_split): New function. + (delta): Ditto. + (ReadConsoleOutputWrapper): Ditto. + (fhandler_console::char_command): Use ReadConsoleOutputWrapper to avoid + OOM condition from ReadConsoleOutputW. Add more debugging. + +2013-12-22 Christopher Faylor <me.cygwin2013@cgf.cx> + + * strace.cc (strace::vsprntf): Fix potential (if unlikely) use of + uninitialized variable. + +2013-12-18 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Remove NtSetTimerResolution. + * pinfo.cc (pinfo::init): Increase wait interval when waiting for + procinfo to stabilize. + +2013-12-17 Christopher Faylor <me.cygwin2013@cgf.cx> + + * autoload.cc (timeBeginPeriod): Delete. + * dcrt0.cc (dll_crt0_1): Use NtSetTimerResolution rather than + timeBeginPeriod. + +2013-12-17 Christopher Faylor <me.cygwin2013@cgf.cx> + + * autoload.cc (timeBeginPeriod): Autoload. + * dcrt0.cc (dll_crt0_1): Use timeBeginPeriod to set default resolution + to 1 ms. + * pinfo.cc (pinfo::thisproc): Set ppid for redirected _pinfo blocks too. + (pinfo::init): Avoid using VirtualQuery. Just rely on the assumption that + procinfo will be populated. + * pinfo.h (_pinfo::ppid): Move into redirected block. + +2013-12-17 Christopher Faylor <me.cygwin2013@cgf.cx> + + * external.cc (fillout_pinfo): Remove nonsensical loop. + * fork.cc (frok::parent): When initializing pinfo for child new PID_NEW + flag + actual defined constant rather than raw number. Don't set + start_time here. + * pinfo.cc (pinfo::thisproc): Use PID_NEW when initializing pinfo. + Avoid checking h for NULL multiple times. Don't set start_time here. + (pinfo_init): Aways set ppid last. Tweak strace output. + (pinfo::init): Handle new PID_NEW flag. Wait for shared memory to + contain useful information. Set start_time if PID_NEW. + (_onreturn:h): Define as HANDLE rather than HANDLE *. + (_onreturn::~onreturn): Accommodate h definition change. + (_onreturn::no_close_handle): Rename from no_close_p_handle. Take a + pinfo arg and set hProcess to h before zeroing. + (winpids::add): Don't open a handle to our own process. Change logic + associated with when a handle gets closed. Accommodate no_close_handle + changes. + (winpids::enum_processes): Simplify process enumeration loop. + (winpids::set): Eliminate ill-considered malloc locking. + * sigproc.cc (proc_subproc): Always set ppid last. + +2013-12-17 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (sig_send): Set PIPE_NOWAIT for pipes which are not us. + +2013-12-17 Christopher Faylor <me.cygwin2013@cgf.cx> + + * fhandler.h (fhandler_pty_master::~fhandler_pty_master): Delete. + * fhandler_tty.cc (fhandler_pty_master::~fhandler_pty_master): Ditto. + +2013-12-11 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (NT_TRANSACTIONAL_ERROR): Define. + (stop_transaction): Take "trans" HANDLE by reference and set it to + NULL after closing it. + (unlink_nt): If NtOpenFile fails due to a transactional error, stop + transaction and retry NtOpenFile. Simplify check for having to call + stop_transaction. + (rename): If NtOpenFile fails due to a transactional error, stop + transaction and retry NtOpenFile in both affected cases. Simplify check + for having to call stop_transaction and add comment from unlink_nt. + +2013-12-11 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Fix formatting. + +2013-12-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_clipboard): Add private member + cygnativeformat. Declare private method set_clipboard. + * fhandler_clipboard.cc (cygnativeformat): Convert static variable to + fhandler_dev_clipboard member. + (fhandler_dev_clipboard::set_clipboard): Convert from static function + to fhandler_dev_clipboard method. + +2013-12-09 Christopher Faylor <me.cygwin2013@cgf.cx> + + * globals.cc (hntdll): Define/declare. + * exceptions.cc (inside_kernel): Don't call GetModuleFileName if we + know we're in ntdll. + * sigproc.cc (wait_sig): Initialize hntdll. + +2013-12-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/stdlib.h (initstate, random, setstate, srandom): + Harden _XOPEN_SOURCE guard against applications defining _XOPEN_SOURCE + with empty value. + +2013-12-08 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 28. + +2013-12-07 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_native): Workaround Windows 8.1 bug: Drop long path + prefix from symlink target path. Add comment to explain why. + +2013-12-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * syscalls.cc (dup): Use cygheap_fdnew properly. + +2013-12-05 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygheap.h (cygheap_fdnew): Avoid setting errno directly since it will + have been set by a previous function. + * dtable.h (dtable::extend): Accept second size_t argument. + * dtable.cc (dtable::extend): Accept second "min" argument which allows + checking for OPEN_MAX_MAX boundary conditions. + (dtable_init): Accommodate second argument to dtable::extend. + (dtable::find_unused_handle): Ditto. + * syscalls.cc (setdtablesize): Ditto. + (dup): Return any error passed by cygheap_fdnew() directly. + (getdtablesize): Just return dtable size directly. + +2013-12-04 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dtable.cc (dtable::find_unused_handle): When extending, always make + sure that there is a NOFILE_INCR chunk following the free fd. + +2013-12-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * select.cc (select): Add workaround for, as yet undebugged, + pathological case. + +2013-12-01 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dtable.cc (dtable::find_unused_handle): Break out of the right loop. + +2013-12-01 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dtable.cc (dtable::find_unused_handle): Fix off-by-one error. Always + exit through the bottom. + (cygwin_attach_handle_to_fd): Make sure that fd tab is locked for the + duration of this function. + * dtable.h (dtable::lock): Make public. + (dtable::unlock): Ditto. + (dtable): Remove friends. + +2013-12-01 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::extend): Change local variable new_size to size_t + as well. + + * thread.cc: Fix comment. + +2013-11-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dtable.h (dtable::first_fd_for_open): Change declaration to size_t. + (dtable::extend): Change parameter to size_t. + (dtable::find_unused_handle): Ditto. + * dtable.cc: Remove now-unused header. + (dtable::extend): Remove pointless test. Change parameter to size_t. + (dtable::find_unused_handle): Rework to avoid MAX calculation in + extend() call. Change parameter to size_t. + +2013-11-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dtable.cc (build_fh_pc): When creating an archetype, use native name + rather than unix name if name doesn't exist. + +2013-11-29 Christopher Faylor <me.cygwin2013@cgf.cx> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 27. + +2013-11-29 Jon TURNEY <jon.turney@dronecode.org.uk> + + * include/cygwin/stdlib.h (initstate, random, setstate, srandom): + Prototype if not __STRICT_ANSI__ or _XOPEN_SOURCE is defined + appropriately. + +2013-11-28 Alexey Pavlov <alexpux@gmail.com> + + * include/glob.h: Fix invalid use of 'restrict' error. + +2013-11-27 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Enhance debug output in case reopen fails. + +2013-11-27 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Drop fh_dup, reuse tmp_fh instead. + +2013-11-27 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (try_to_bin): Take additional parameter to get file open + flags. If the file to move to the bin has been opened casesensitive, + reopen it caseinsensitive. Explain why. Revert the default name of + the Vista-and-later recycler to mixed case for readability. + (unlink_nt): Call try_to_bin with file open flags as evaluated. + +2013-11-26 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (wcscoll): Add "__restrict" to definition. + (wcsxfrm): Ditto. + +2013-11-26 Corinna Vinschen <corinna@vinschen.de> + + * common.din: Export posix_spawn[...] functions. + * exec.cc (execve): Add EXPORT_ALIAS _execve. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * posix.sgml (std-susv4): Add posix_spawn[...] here. + (std-notimpl): Drop here. + +2013-11-26 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (strcoll): Add "__restrict" to definition. + (strxfrm): Ditto. + +2013-11-25 Corinna Vinschen <corinna@vinschen.de> + + Throughout, keep function definitions and declarations in sync with + newlib in terms of C99 "restrict" keyword. + +2013-11-24 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc: Include sys/param.h for MAX definition. + +2013-11-24 Corinna Vinschen <corinna@vinschen.de> + + Throughout, drop unnecessary explicit includes of windows header files + included by default. + * winlean.h: Add long comment to explain why we have to define certain + symbols. + (_NORMALIZE_): Define. + (_WINNLS_): Drop definition and subsequent undef. + (_WINNETWK_): Ditto. + (_WINSVC_): Ditto. + +2013-11-23 Eric Blake <eblake@redhat.com> + + dup2: fix off-by-one crash + * dtable.cc (dup3): Fix off-by-one. + (find_unused_handle): Reduce time spent expanding during dup. + * syscalls.cc (setdtablesize): Report error on invalid value. + +2013-11-20 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/stdlib.h (realpath): Drop declaration. It's declared + in newlib's stdlib.h now. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (RtlGetVersion): Declare. + * wincap.cc (wincapc::init): Rather than GetVersionEx, call + RtlGetVersion which is not crippled by missing Windows 8.1 manifest. + * wincap.h (wincapc): Change type of version to RTL_OSVERSIONINFOEXW. + Align formatting of all class members. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincapc::init): Revert previous change. It's not working. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getaddrinfo): Fix a comment. Only memset whints if + hints is NULL. Add a comment and set whints.ai_family explicitely to + AF_UNSPEC to follow glibc man page closely. Check flags against whints + for locality. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincapc::init): Fix dwMinorVersion for Windows 8.1 and + Server 2012. Explain why this is necessary. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (IdnToAscii): Define. + (IdnToUnicode): Define. + (FreeAddrInfoW): Define. + (GetAddrInfoW): Define. + (GetNameInfoW): Define. + * net.cc: Drop W. Richard STEVENS libgai implementation. + (cygwin_freeaddrinfo): Move code from ipv4_freeaddrinfo here. Move + definition up in file to avoid forward declaration in ga_duplist. + (ga_dup): Take addrinfoW as input. Add parameters to get IDN flags + and to set error value. Handle IDN flags and especially AI_CANONIDN. + Convert input wchar_t ai_canonname string to multibyte for output. + (ga_duplist): Add parameters to get IDN flags and to set error value + and propagate to ga_dup. Call cygwin_freeaddrinfo. + (gai_errmap): Add comments. Align error strings to GLibc. Add + EAI_IDN_ENCODE entry. + (get_ipv6_funcs): Remove. + (load_ipv6_guard): Remove. + (ipv6_inited): Remove. + (load_ipv6): Remove. + (load_ipv6_funcs): Remove. + (cygwin_getaddrinfo): Drop calling load_ipv6. Handle AI_IDN* flags. + Convert input strings to wchar_t and call GetAddrInfoW/FreeAddrInfoW. + In case hints is NULL, set default ai_flags explicitely to + AI_V4MAPPED | AI_ADDRCONFIG, as documented for Glibc. Only add AI_ALL + if AI_ADDRCONFIG is not given. Unconditionally add Windows-specific + AI_DISABLE_IDN_ENCODING to ai_flags to make IDN behaviour compatible + to Glibc even on Windows 8 and later. + (cygwin_getnameinfo): Drop calling load_ipv6. Handle NI_IDN* flags. + Call GetNameInfoW and convert returned strings from wchar_t to + multibyte. + * include/netdb.h: Add comments to describe flags and error values. + (AI_*): Define all flags using hex values for clearness. + (AI_IDN): Define. + (AI_CANONIDN): Define. + (AI_IDN_ALLOW_UNASSIGNED): Define. + (AI_IDN_USE_STD3_ASCII_RULES): Define. + (NI_*): Define all flags using hex values for clearness. + (NI_IDN): Define. + (NI_IDN_ALLOW_UNASSIGNED): Define. + (NI_IDN_USE_STD3_ASCII_RULES): Define. + (EAI_IDN_ENCODE): Define. + +2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * configure.ac: Detect windows headers/libs after we've figured out the + C compiler. + * configure: Regenerate. + * aclocal.m4: Regenerate. + +2013-10-30 Corinna Vinschen <corinna@vinschen.de> + + * devices.in (dev_cygdrive_storage): Revert mapping to \Device\Null. + (dev_storage): Ditto for /dev. + * devices.cc: Regenerate. + * fhandler.cc (fhandler_base::open_null): New method to open a fake + \Device\Null handler. + (fhandler_base::open): Fix formatting. Change O_ACCMODE test to a + switch statement. Simplify a test which still tested for a now unused + create_disposition. + * fhandler.h (fhandler_base::open_null): Declare. + (fhandler_netdrive::close): Declare. + * fhandler_dev.cc (fhandler_dev::open): Open fake \Device\Null handle + by just calling new open_null method. + * fhandler_disk_file.cc (fhandler_cygdrive::open): Ditto. + * fhandler_netdrive.cc (fhandler_netdrive::open): Call open_null + rather than setting nohandle. + (fhandler_netdrive::close): New method. + * fhandler_registry.cc (fetch_hkey): Fix token in RegOpenUserClassesRoot + call. Create valid key for HKEY_CURRENT_CONFIG by mapping to real key + HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current. + (fhandler_registry::open): Set nohandle only when using pseudo registry + handle. + * fhandler_virtual.cc (fhandler_virtual::opendir): Call open rather + than just setting nohandle here. + * fhandler_virtual::fstatvfs): Set ST_RDONLY fs flag. + * globals.cc (ro_u_null): New readonly UNICODE_STRING for \Device\Null. + * path.h (path_conv::set_path): Revert previous change caring for + wide_path. + +2013-10-30 Corinna Vinschen <corinna@vinschen.de> + + * devices.in (dev_cygdrive_storage): Map to \Device\Null. + (dev_storage): Map /dev and /dev/windows to \Device\Null. + * devices.cc: Regenerate. + * dir.cc (opendir): Create unique id. Explain why. + * fhandler.h (fhandler_dev::get_dev): Implement inline. + (fhandler_cygdrive::close): Drop declaration. + (fhandler_cygdrive::get_dev): Implement inline. + (fhandler_windows::get_hwnd): Ditto. + (fhandler_windows::set_close_on_exec): Drop declaration. + (fhandler_windows::fixup_after_fork): Ditto. + * fhandler_dev.cc (fhandler_dev::open): Call fhandler_disk_file::open + without O_CREAT flag. Explain why. Create \Device\Null handle if + /dev/ doesn't actually exist. + (fhandler_dev::close): Drop nohandle case. + (fhandler_dev::fstatvfs): Drop nohandle check. Test for fs_got_fs + instead. Set ST_RDONLY fs flag for simulated /dev. + (fhandler_dev::opendir): If /dev doesn't exist, call open() to create + fake \Device\Null handle. Don't set nohandle. Set dir_exists + correctly. + (fhandler_dev::rewinddir): Call fhandler_disk_file::rewinddir only if + /dev is a real directory. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): If called for + the cygdrive dir, call open() to create fake \Device\Null handle. + Only attach __DIR_mounts buffer to dir if not called for cygdrive dir. + Don't set nohandle. + (fhandler_cygdrive::open): Create \Device\Null handle. + (fhandler_cygdrive::close): Remove. + (fhandler_cygdrive::fstatvfs): Set ST_RDONLY fs flag. + * fhandler_windows.cc (fhandler_windows::open): Create \Device\Null + handle. + (fhandler_windows::read): Don't add io_handle to WFMO handle array. + Change subsequent test for return value accordingly. Fix test for + "message arrived". + (fhandler_windows::set_close_on_exec): Remove. + (fhandler_windows::fixup_after_fork): Remove. + * path.h (path_conv::set_path): Make sure wide_path is NULL when + setting a new path. + * select.cc (peek_windows): Use correct hWnd value, not io_handle. + (fhandler_windows::select_read): Don't use io_handle as wait object. + (fhandler_windows::select_write): Ditto. + (fhandler_windows::select_except): Ditto. + +2013-10-27 Corinna Vinschen <corinna@vinschen.de> + + * exception.h: Fold in content of include/exceptions.h. + * include/exceptions.h: Remove. + +2013-10-26 Corinna Vinschen <corinna@vinschen.de> + + * devices.in (dev_storage): Map /dev/dsp to \Device\Null. + * devices.cc: Regenerate. + * fhandler_dsp.cc (fhandler_dev_dsp::open): Call fhandler_base::open. + (fhandler_dev_dsp::close): Call fhandler_base::close. + (fhandler_dev_dsp::fixup_after_fork): Call + fhandler_base::fixup_after_fork. + + * fhandler_raw.cc (fhandler_dev_raw::fixup_after_fork): Call + fhandler_base::fixup_after_fork. + +2013-10-26 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (_exception_list): Drop redefinition for x86_64. + * include/exceptions.h: Disable content for x86_64 since it's not + using frame based exception handling anymore. + +2013-10-25 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (fhandler_base::lock): Only refuse to lock nohandle and + old-style console devices when called to perform BSD flock locking. + Add a FIXME to comment and align description. + + * ntdll.h (THREADINFOCLASS): Following MSDN, rename throughout from + THREAD_INFORMATION_CLASS. + +2013-10-25 Corinna Vinschen <corinna@vinschen.de> + + * devices.in (dev_storage): Map /dev/clipboard to \Device\Null. + * devices.cc: Regenerate. + * fhandler.h (fhandler_dev_clipboard::open): Drop declaration. + * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Drop call to + open. Set private members to 0 and call fhandler_base::dup. + (fhandler_dev_clipboard::open): Remove so that default + fhandler_base::open is used to open \Device\Null. + (set_clipboard): Drop gratuitios call to RegisterClipboardFormatW. + (fhandler_dev_clipboard::close): Call fhandler_base::close from here. + +2013-10-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_fs): Fix comment. + +2013-10-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Drop gratuitios + handling of membuffer. It's NULL anyway. + (fhandler_dev_clipboard::lseek): Set membuffer to NULL after freeing + it to avoid subsequent crashes when accessing invalid pointer. + +2013-10-25 Corinna Vinschen <corinna@vinschen.de> + + * devices.in (dev_storage): Map /dev/random and /dev/urandom to + \Device\Null. + * devices.cc: Regenerate. + * fhandler.h (fhandler_dev_random::open): Drop declaration. + (fhandler_dev_random::close): Ditto. + (fhandler_dev_random::crypt_gen_random): Convert to static method. + * fhandler_random.cc (fhandler_dev_random::open): Remove so that default + fhandler_base::open is used to open \Device\Null. + (fhandler_dev_random::close): Ditto. + * fhandler_socket.cc (entropy_source): Delete. + (fhandler_socket::af_local_set_secret): Remove entropy_source code and + call fhandler_dev_random::crypt_gen_random directly instead. + +2013-10-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_dev_zero::lseek): Convert to inline method. + (class fhandler_dev_random): Drop dummy_offset. + (fhandler_dev_random::lseek): Convert to inline method. + (fhandler_dev_dsp::lseek): Ditto. + * fhandler_dsp.cc (fhandler_dev_dsp::lseek): Drop here. + * fhandler_random.cc (fhandler_dev_random::open): Drop setting + dummy_offset. + (fhandler_dev_random::lseek): Drop here. + * fhandler_tape.cc (fhandler_dev_tape::lseek): Make no-op, but keep + old code for reference. + * fhandler_zero.cc (fhandler_dev_zero::lseek): Drop here. + +2013-10-24 Christopher Faylor <me.cygwin2013@cgf.cx> + + * external.cc (fillout_pinfo): If start_time is 0, wait a while before + returning the pinfo structure. + + * fhandler.cc (fhandler_base::open_setup): Convert from inline. + * fhandler.h (fhandler_base::open_setup): Declare. + * fhandler_console.cc (fhandler_console::open_setup): Always call + fhandler_base::open_setup. + * fhandler_tty.cc (fhandler_pty_slave::open_setup): Ditto. + (fhandler_pty_master::open_setup): Ditto. + +2013-10-24 Corinna Vinschen <corinna@vinschen.de> + + * devices.in (dev_storage): Map /dev/zero and /dev/full to \Device\Null. + * devices.cc: Regenerate. + * dtable.h (struct dtable): Make fhandler_base friend, rather + than fhandler_disk_file. + * fhandler.cc (fhandler_base::open_with_arch): Create unique id. + (fhandler_base::cleanup): Call del_my_locks. + (fhandler_base::fcntl): Handle F_GETLK, F_SETLK and F_SETLKW. + * fhandler.h (fhandler_base::get_dev): Return real device number. + (fhandler_base::set_unique_id): New inline method. + (fhandler_disk_file::lock): Drop declaration. + (fhandler_disk_file::get_dev): New method, return pc.fs_serial_number. + (fhandler_dev_zero::open): Drop declaration. + * fhandler_disk_file.cc (fhandler_disk_file::close): Move + del_my_locks call to fhandler_base::open_with_arch. + (fhandler_disk_file::fcntl): Move handling of locking commands to + fhandler_base::fcntl. + (fhandler_base::open_fs): Drop call to NtAllocateLocallyUniqueId. + * fhandler_zero.cc (fhandler_dev_zero::open): Remove so that default + fhandler_base::open is used to open \Device\Null. + * flock.cc (fixup_lockf_after_exec): Finding a single fhandler is + enough here. + (fhandler_base::lock): Replace fhandler_disk_file::lock. Refuse to lock + nohandle devices. Handle read/write test using POSIX flags. Explain + why. Never fail on SEEK_CUR or SEEK_END, rather assume position 0, + just as Linux. + * net.cc (fdsock): Create unique id. + +2013-10-23 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h (_READ_WRITE_BUFSIZE_TYPE): Define. + +2013-10-23 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::fstat): Drop FH_FULL case to align + /dev/full permissions to Linux. + +2013-10-22 Christopher Faylor <me.cygwin2013@cgf.cx> + + * fhandler.h (fhandler_base::cleanup): Mark as extern rather than + inline. + * fhandler_base.cc (fhandler_base::cleanup): Define. + * fhandler_tty.cc (fhandler_pty_slave::cleanup): Call fhandler_base::cleanup. + (fhandler_pty_master::cleanup): Ditto. + +2013-10-18 Christopher Faylor <me.cygwin2013@cgf.cx> + + * fhandler_termios.cc (tty_min::kill_pgrp): Don't send a signal to + myself if this process is exiting. + +2013-10-18 Christopher Faylor <me.cygwin2013@cgf.cx> + + * tty.cc (tty_list::allocate): Set sid to 0 rather than -1 since -1 is + an error condition. + +2013-10-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (format_process_ctty): Fix random content of + /proc/$PID/ctty if the process has no controlling tty. Set to just + "\n" instead. + +2013-10-15 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CryptAcquireContextW): Remove. + (CryptGenRandom): Remove. + (CryptReleaseContext): Remove. + (SystemFunction036): Define. Add comment to explain that this is + actually the RtlGenRandom function. + * fhandler.h (class fhandler_dev_random): Drop crypt_prov member. + (fhandler_dev_random::fhandler_dev_random): Define inline. + (fhandler_dev_random::dup): Drop declaration. + * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Remove + here. + (fhandler_dev_random::crypt_gen_random): Use RtlGenRandom to drop + dependency to old Crypto API. + (fhandler_dev_random::read): Implement an enhanced version of reading + random bytes from RtlGenRandom for the sake of a better /dev/random + emulation. + (fhandler_dev_random::close): Just return 0 since crypt_prov doesn't + exisyt anymore. + (fhandler_dev_random::dup): Drop entirely for the same reason. + +2013-10-15 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (mmap64): Convert pagesize from DWORD to size_t to avoid + a rounding error for allocations beyond 4 Gigs. + +2013-10-05 Christopher Faylor <me.cygwin2013@cgf.cx> + + * ntdll.h: Guard against new header files. + +2013-09-25 Christopher Faylor <me.cygwin2013@cgf.cx> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 26. + +2013-09-25 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.h (hold_everything::ischild): Declare as reference. + (hold_everything::hold_everything): Store address of caller's notion of + "ischild". + +2013-09-25 Christopher Faylor <me.cygwin2013@cgf.cx> + Paul Kunysch <paul.kunysch@emsys.de> + + * thread.cc (semaphore::_getvalue): Set *sval as appropriate. Set + errno and return -1 on error. + +2013-08-31 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Belatedly bump + to 25. + +2013-08-31 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (RAISEHEAP_SIZE): New definition. + (user_heap_info::sbrk): Make failed commit an error condition again. + Only reserve RAISEHEAP_SIZE sized chunk for further heap reservations + by default. + +2013-08-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygheap.h (user_heap_info::sbrk): Declare new function. + (user_heap_info::init): Ditto. + * heap.cc (user_heap_info::init): Rename from heap_init(). Avoid + explictly using cygheap->user_heap. + (sbrk): Use user_heap_info method via cygheap->user_heap. + (user_heap_info::sbrk): Renamed from sbrk(). Eliminate explicit use of + cygheap->user_heap. Change some pointer arithmetic to use (char *) for + consistency. + * shared.cc (shared_info::initialize): Change heap_init call to + cygheap->user_heap.init. + +2013-08-30 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (sbrk): Add a FIXME comment to VirtualFree call. Fix memory + reservation and commit strategy when more memory is requested than + available on the heap. Release newly reserved memory if commiting + it fails. Add more comments to explain what we do. + +2013-08-30 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo_drive::open): Handle bus reset gracefully + after opening the device. + +2013-08-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (pending_signals::add): Properly maintain linked list. + (wait_sig): Use already calculated 'next' element when signal is + blocked. + +2013-08-26 Corinna Vinschen <corinna@vinschen.de> + + * mtinfo.h (class mtinfo_part): Change type of block numbers to int64_t. + (mtinfo_part::initialize): Ditto for nblock parameter in declaration. + (class mtinfo_drive): Change type of block number to int64_t. Change + all parameters indicating a block number to int64_t in method + declarations. + * fhandler_tape.cc (mtinfo_part::initialize): Ditto in definition. + (mtinfo_drive::get_pos): Ditto. Replace low and high with a + ULARGE_INTEGER and use it's components in call to GetTapePosition. + Store full value in block. + (mtinfo_drive::_set_pos): Change type of count parameter to int64_t. + Change call to SetTapePosition accordingly. + (mtinfo_drive::set_pos): Change type of count parameter to int64_t. + Change local variables holding block numbers accordingly. + (mtinfo_drive::get_status): Don't bail out early if fetching media + parameters fails. + (mtinfo_drive::ioctl): Add explicit cast matching receiving type in + MTTELL and MTIOCPOS calls. + +2013-08-23 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (lockf_t::from_obj_name): Fix test for valid pid. + +2013-08-23 Christopher Faylor <me.cygwin2013@cgf.cx> + + * spawn.cc (child_info_spawn): Revert previous change. Always set + lpReserved2. + +2013-08-23 Christopher Faylor <me.cygwin2013@cgf.cx> + + * child_info.h (PROC_MAGIC_GENERIC): Define differently for x86 vs. + x86_64. + +2013-08-23 Corinna Vinschen <corinna@vinschen.de> + + * path.h (enum path_types): Drop definition of PATH_64BITEXEC. + (path_conv::iscygexec32): Drop unused inline function. + (path_conv::iscygexec64): Ditto. + (path_conv::set_cygexec): Remove unnecessary setting of PATH_64BITEXEC. + * spawn.cc (child_info_spawn::worker): Disable setting of + STARTUPINFOW::lpReserved2 and STARTUPINFOW::cbReserved2 for non-Cygwin + child processes. Explain why. + +2013-08-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo_drive::create_partitions): Allow partitioning + of drives supporting select partitions. + (mtinfo_drive::get_status): Fill in current partition and number of + partitions on tape into mt_resid. + * include/cygwin/mtio.h (struct mtget): Align mt_resid comment to + aforementioned change. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2013-08-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo_drive::create_partitions): Fix long-standing + bug disabling creation of two partitions on drives supporting initiator + partitions. + (mtinfo_drive::set_blocksize): Update media information after setting + blocksize succeeded. + (mtinfo_drive::get_status): Fetch fresh media information. + +2013-08-19 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: Regenerate. + * nlsfuncs.cc (__get_lcid_from_locale): Update list of Script-only + locales to Windows 8. + (__set_charset_from_locale): Take locales added with Windows 8 and 8.1 + into account. + +2013-08-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (mtinfo_drive::set_pos): Remove unneeded linebreak. + (mtinfo_drive::get_status): Drop using get_ll when it's not required. + +2013-08-14 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h (struct per_process): Add posix_memalign. Reduce + size of unused2 accordingly. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize + u->posix_memalign with address of posix_memalign. + * malloc_wrapper.cc (posix_memalign): Call user-provided posix_memalign + rather than just returning ENOSYS. + * globals.cc (__cygwin_user_data): Initialize posix_memalign member. + +2013-08-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 24. + +2013-08-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::open_fs): Fix indentation. + +2013-07-31 Christopher Faylor <me.cygwin2013@cgf.cx> + + * fhandler_tty.cc: Revert accidental checkin. + * update-copyright: Ditto. + +2013-07-31 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygheap.cc (cmalloc): Use size_t for size field. + (cmalloc_abort): Ditto. + (crealloc): Ditto. + (crealloc_abort): Ditto. + (ccalloc): Ditto. + (ccalloc_abort): Ditto. + * cygheap_malloc.h (HEAP_USER): Add. + (cmalloc): Use size_t for size field in declaration. + (cmalloc_abort): Ditto. + (crealloc): Ditto. + (crealloc_abort): Ditto. + (ccalloc): Ditto. + (ccalloc_abort): Ditto. + +2013-07-31 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (normalize_posix_path): Don't check existence of / or // dir + in parent dir check. + +2013-07-26 Christopher Faylor <me.cygwin2013@cgf.cx> + + * environ.cc (tty_is_gone): Delete. + (known): Delete tty, add wincmdln. + * globals.cc: Reorganize list of environment bools, remove explicit = + false for slight load time optimization. + (wincmdln): New global. + * spawn.cc (child_info_spawn::worker): Honor wincmdln. + +2013-07-23 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (struct _SEMAPHORE_BASIC_INFORMATION): Define. + (enum _SEMAPHORE_INFORMATION_CLASS): Define. + (NtQuerySemaphore): Declare. + * thread.h (class semaphore): Add member startvalue. + (semaphore::fixup_before_fork): New inline method. + (semaphore::_fixup_before_fork): Declare. + * thread.cc (MTinterface::fixup_before_fork): Additionally call + semaphore::fixup_before_fork. + (semaphore::semaphore): Set currentvalue to -1. Set startvalue to + incoming initializer value. + (semaphore::_getvalue): Just query semaphore using NtQuerySemaphore + rather then using WFSO/Release. + (semaphore::_post): Drop setting currentvalue. It's not thread-safe. + (semaphore::_trywait): Ditto. + (semaphore::_timedwait): Ditto. + (semaphore::_wait): Ditto. + (semaphore::_fixup_before_fork): New method, setting currentvalue from + actual windows semaphore right before fork. + (semaphore::_fixup_after_fork): Drop kludge from 2013-07-10. Drop + FIXME comment. + +2013-07-23 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (well_known_dlls): Add kernelbase.dll. + +2013-07-22 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 23. + +2013-07-21 Corinna Vinschen <corinna@vinschen.de> + + * regex/regcomp.c (wgetnext): Add a kludge to be more glibc compatible. + Add comment to explain. + +2013-07-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (signal_exit): Remove comment. Use + __builtin_frame_address. + +2013-07-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (signal_exit): Nope. Nevermind. Dump core + unconditionally. + +2013-07-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (signal_exit): Add a FIXME comment. + +2013-07-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (signal_exit): Only dump core when it's a "kernel" + signal. Only use RtlCaptureContext on x86_64. It doesn't seem to do + what's expected on x86. + +2013-07-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * spawn.cc (child_info_spawn::worker): Reinstate using temp buffer for + wide character command-line storage. Use wcs method to convert command + line. + * winf.h (lb_wcs): Delete. + (linebuf::wcs): Implement new single-argument method. + +2013-07-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * lib/libcmain.c (main): Don't point to last quoted character if the + only thing in the buffer is the program name. + +2013-07-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * common.din: Export GetCommandLine{A,W}. + * kernel32.cc: Add includes needed for GetCommandLine functions. + (ucmd): New function. + (cygwin_GetCommandLineW): Ditto. + (cygwin_GetCommandLineA): Ditto. + * spawn.cc (child_info_spawn::worker): Rename one_line -> cmd. Use + lb_wcs macro to generate a wide character version of the line buffer. + Remove duplicate printing of command line. Don't access members of + linebuf directly. + * winf.h: Use pragma once. + (linebuf): Make storage private. + (linebuf::operator size_t): New operator. Return size of buf. + (linebuf::operator wchar_t): New operator. + (linebuf::wcs): New function. + (lb_wcs): New macro. + * include/cygwin/version.h: Bump API minor number to 268. + + * strfuncs.cc: Clarify descriptive file comment. + +2013-07-19 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::remove): Close cw_timer handle, thus avoiding + handle leak. + +2013-07-19 Jon TURNEY <jon.turney@dronecode.org.uk> + + * cygserver_ipc.h (ipc_retval::ipc_retval): Take ssize_t as argument + to make sure entire ipc_retval union is initialized on all supported + platforms. + +2013-07-18 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (normalize_posix_path): Start checking path before ".." at + dst, rather than at dst_start, otherwise suffer loss of one leading + slash in case of UNC paths. + +2013-07-17 Christopher Faylor <me.cygwin2013@cgf.cx> + + * winsup.h (cygbench): Fix declaration to match definition. + * dcrt0.cc (initial_env): Remove unused variable. + +2013-07-15 Corinna Vinschen <corinna@vinschen.de> + + Remove /dev/mem, /dev/kmem, /dev/port support. + * Makefile.in (DLL_OFILES): Drop fhandler_mem.o. + (fhandler_mem_CFLAGS): Remove rule. + * devices.in (enum fh_devices): Remove FH_MEM, FH_KMEM and FH_PORT. + * devices.cc: Regenerate. + * dtable.cc (fh_alloc): Drop handling for FH_MEM, FH_KMEM and FH_PORT. + * fhandler.h (class fhandler_dev_mem): Remove. + * fhandler_mem.cc: Remove file. + * globals.cc (ro_u_pmem): Remove. + * mmap.cc (fhandler_dev_mem::mmap): Remove. + (fhandler_dev_mem::munmap): Remove. + (fhandler_dev_mem::fixup_mmap_after_fork): Remove. + +2013-07-15 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 22. + +2013-07-15 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_native): Fix common prefix search. Enhance comment. + +2013-07-11 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Drop unused code. + +2013-07-10 Christopher Faylor <me.cygwin2013@cgf.cx> + + * gentlsoffsets: Clean up a little. + + * thread.cc (semaphore::_fixup_after_fork): Report on potential problem + parameter. Make sure that currentvalue is never zero. + (semaphore::init): Make cosmetic change. + +2013-07-10 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in (.text.*): Fold into .text on all platforms. + (.eh_frame): Add section. + * environ.cc (my_findenv): Drop __stdcall attribute. + (getearly): Ditto. + (findenv_func): Drop cast. + +2013-07-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * fhandler.cc (fhandler_base::close_with_arch): Make sure that the + archetype is deleted when close_with_arch is referenced *via* the + archetype. + +2013-06-28 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (find_fast_cwd_pointer): Use gas syntax for assembler + description in all comments. Make algorithm work on Windows 8.1 + Preview. + +2013-06-27 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (child_info_fork::alloc_stack): Fix a comparison to avoid + taking 4K more stack in forked child. + * fork.cc (frok::parent): Print child exit code in hex if sync failed. + +2013-06-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * common.din (rawmemchr): Export. + * posix.sgml (std-gnu): Add rawmemchr. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2013-06-21 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cygwin_conv_path): Handle NULL "from" path gracefully. + * path.sgml (func-cygwin-conv-path): Document returning EINVAL if + "from" is NULL. + +2013-06-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * winf.h (av::unshift): Make __reg2. + +2013-06-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * spawn.cc (child_info_spawn::worker): Eliminate call to newargv.set() + in favor of conglomerated newargv.setup(). Let newargv.setup() decide + when to call dup_all(). Only set argc and argv for cygwin processes. + (av::setup): Rename from av::fixup. Accept argc and argv parameters. + Fill out argv and argc here. Duplicate whole argv structure when this + is a Cygwin executable. + * winf.cc (linebuf::fromargv): Don't bother duplicating argv elements + since they will never be used. + * winf.h (av::set): Delete. + (av::setup): Rename from av::fixup. Add two parameters. + (av::replace0_maybe): Assign calloced to 1 rather than 'true' for + clarity. + (av::dup_maybe): Delete. + (av::dup_all): Set calloced to show that we have duplicated all of the + arguments in the list. + +2013-06-18 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__collate_range_cmp): Convert input to wchar_t and call + wcscoll since all calling functions are using wide chars. Explain in + preceeding comment. + +2013-06-18 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (child_info_spawn::worker): Eliminate wascygexec. + +2013-06-18 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dcrt0.cc (child_info_fork::alloc_stack): Don't subtract 4096 from + stack pointer since getstack() already does that. + +2013-06-18 Corinna Vinschen <corinna@vinschen.de> + + * gmon.c: Drop gratuitous inclusion of strings.h. Remove __MINGW32__ + around definition of bzero. + +2013-06-18 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (VPATH): Drop CONFIG_DIR. + (EXTRA_DLL_OFILES): Remove. + (DLL_OFILES): Remove EXTRA_DLL_OFILES. + (ASFLAGS): Define as -D_WIN64 on x86_64. + (GMON_OFILES): Add mcountFunc.o. + ($(srcdir)/$(TLSOFFSETS_H)): Use target_cpu rather than CONFIG_DIR. + * configure.ac (CONFIG_DIR): Remove definition. + * configure: Regenerate. + * gcrt0.c: Use latest version from Mingw-w64 project. + * gmon.c: Ditto. + * gmon.h: Ditto. + * mcount.c: Ditto. + * mcountFunc.S: Ditto, new file. + * profil.c: Ditto. + * profil.h: Ditto. + * config: Remove entire directory. + +2013-06-17 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (cnt_bs): New inline function. + (symlink_native): Fix creating relative native symlink. + +2013-06-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_clipboard.cc (fhandler_dev_clipboard::read): Fix buffer + read access overrun when pos > 0. + +2013-06-17 Corinna Vinschen <corinna@vinschen.de> + + * times.cc (GetSystemTimePreciseAsFileTime): Add comment to declaration. + (__to_clock_t): Remove a debug_printf. + (times): Align syscall_printf to debug output of other system calls. + +2013-06-14 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetSystemTimePreciseAsFileTime): Define. + * times.cc (GetSystemTimePreciseAsFileTime): Temporarily declare here + to workaround missing definition in 32 bit w32api headers. + (get_system_time): New always inline function to call either + GetSystemTimePreciseAsFileTime or GetSystemTimeAsFileTime on a per OS + basis. Call throughout instead of GetSystemTimeAsFileTime. + * wincap.h (wincaps::has_precise_system_time): New element. + * wincap.cc: Implement above element throughout. + +2013-06-14 Corinna Vinschen <corinna@vinschen.de> + + Streamline time/times functionality. Remove last remains of former + Windows 9x compatibility. + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Drop now unneeded + casts in calls to_timestruc_t. + (fhandler_base::utimens_fs): Ditto for timespec_to_filetime. + * fhandler_proc.cc (format_proc_stat): Ditto for to_time_t. + * hires.h (class hires_ms): Remove unused member initime_ns. + Remove declarations for timeGetTime_ns and prime. + (hires_ms::uptime): Remove. + * posix_ipc.cc (ipc_cond_timedwait): Ditto for timespec_to_filetime. + * fhandler_registry.cc (fhandler_registry::fstat): Add cast. + * resource.cc (fill_rusage): Call NtQueryInformationProcess rather than + GetProcessTimes to deal with LARGE_INTEGER rather than FILETIME. + * times.cc: Simplify time handling. Throughout, use LARGE_INTEGER + rather than FILETIME to simplify computations. Throughout use + {u}int64_t rather than {unsigned} long long. Drop unneeded casts since + NSPERSEC is 64 bit anyway. + (systime_ns): Remove. + (times): Call NtQuerySystemInformation to fetch boot time. Call + NtQueryInformationProcess rather than GetProcessTimes to deal with + LARGE_INTEGER rather than FILETIME. Call GetSystemTimeAsFileTime. + (totimeval): Use constant 1000000 as in other functions. + (time_t_to_filetime): Remove. + (to_time_t): Change return type to time_t. + (time_as_timestruc_t): Rename filetime to systime. + (time): Ditto. Add cast. + (hires_ns::nsecs): Fix return type cast. + (hires_ms::timeGetTime_ns): Remove. + (hires_ns::prime): Remove. + (hires_ms::nsecs): Drop call to prime. Call GetSystemTimeAsFileTime + directly. Subtract FACTOR here since it's the only function needing + to do so. + (minperiod): Cosmetically change to ULONG. + (hires_ns::resolution): Fix return type cast. + (hires_ms::resolution): Simplify, rely on NtQueryTimerResolution. + * winsup.h: Align time related prototypes to above changes. + +2013-06-13 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (gen_old_if_name): New function to generate short interface + names for old pre-1.7 applications. + (get_ifs): Call gen_old_if_name for said old applications. + +2013-06-13 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (fcntl, flock, lockf): Point to implementation notes. + +2013-06-12 Fedin Pavel <p.fedin@samsung.com> + + * path.cc (normalize_posix_path): Fix long-standing problem which + allows to access files via ".." using an invalid POSIX path. + +2013-06-11 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc (FileDescription): Remove (R). + +2013-06-10 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_user_groups): Don't handle ERROR_ACCESS_DENIED as + error. Explain why. + +2013-06-08 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (try_to_debug): Don't use yield() when waiting for + another process. + (sigpacket::setup_handler): Fix long-standing problem where loop could + exit with lock held. + +2013-06-08 Christopher Faylor <me.cygwin2013@cgf.cx> + + * miscfuncs.cc (yield): Revert (after researching) to calling Sleep + with 0. We don't want to actually sleep when calling this function. + +2013-06-08 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygwait.cc (cygwait): Remove lock around sig retrieval since this + code is essentially guarded by thread-specific signal_arrived. + * exceptions.cc (_cygtls::handle_SIGCONT): Simplify. Eliminate + lock/unlock since code is guarded by signal_arrived. + +2013-06-07 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc (LegalCopyright): Belatedly bump to 2013. + +2013-06-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (_cygtls::handle_SIGCONT): Reinstate previous behavior + but make sure that yield() isn't called when signal stack is locked. + +2013-06-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (exception::handle): Add comment explaining si_addr + behavior. + +2013-06-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * DevNotes: Add entry cgf-000023. + * sigproc.cc (exit_thread): Remove now-unneeded sleep code. + +2013-06-07 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 21. + +2013-06-07 Corinna Vinschen <corinna@vinschen.de> + + * posix.sgml (std-notes): Fix typo. + +2013-06-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::pread): Skip to non-atomic + code if mandatory locking is used on this descriptor. Explain why. + (fhandler_disk_file::pwrite): Ditto. + * posix.sgml (std-notes): Extend description of file locking. + +2013-06-06 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::handle_SIGCONT): Simplify loop waiting for + sig_handle_tty_stop to wake up. Make sure to unlock before calling + yield to avoid starvation of sig_handle_tty_stop. Add comments. + * miscfuncs.cc (yield): Explain why yield should never be called under + _cygtls::lock conditions. Call SleepEx with 1ms timeout. Explain why. + +2013-06-05 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 20. + +2013-06-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::lock): Move to flock.cc. + (fhandler_base::fixup_after_exec): Reset mandatory_locking. + * fhandler.h (class fhandler_base): Add mandatory_locking status flag. + Add mandatory_locking accessor methods. Accommodate change throughout. + (fhandler_base::mand_lock): Declare. + (class fhandler_disk_file): Drop in favor of new status flag. + * (fhandler_disk_file::fcntl): Call need_fork_fixup if mandatory_locking + flag gets set. + * flock.cc (fhandler_base::lock): Define here. + (flock): Handle mandatory_locking. + (lockf): Ditto. + (fhandler_base::mand_lock): Define. + +2013-06-03 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (exit_thread): Allow to exit the thread while running + global dtors. Explain why. + +2013-06-02 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CancelSynchronousIo): Define. + * fcntl.cc (fcntl64): Drop handling of locking commands. + * fhandler.h (class fhandler_disk_file): Add mandatory_locking. + (fhandler_disk_file::fcntl): Declare. + (fhandler_disk_file::mand_lock): Declare. + * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file): + Initialize mandatory_locking. + (fhandler_disk_file::fcntl): New method. Handle F_LCK_MANDATORY and + locking commands. + (fhandler_disk_file::dup): Duplicate mandatory_locking. Fix a bug + when duplicating prw_handle failed. + (fhandler_disk_file::fixup_after_fork): Reset mandatory_locking. + * flock.cc (fhandler_disk_file::lock): Add comment. + (struct lock_parms): New struct to pass parameters to blocking_lock_thr + thread function. + (blocking_lock_thr): New thread function. + (fhandler_disk_file::mand_lock): New methof implementing mandatory + locking with Windows semantics. + * ntdll.h (NtLockFile): Declare. + (NtUnlockFile): Declare. + * include/fcntl.h: Fix a comment. + (F_LCK_MANDATORY): Define. Add lengthy comment to explain. + +2013-06-02 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (exception::handle): Resurrect accidentally lost + patch from 2009-07-22: Set si_addr according to POSIX for SIGSEGV. + +2013-05-31 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/socket.h: Move SHUT_xx definitions from here... + * include/cygwin/socket.h: ...to here. + +2013-05-31 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/if.h: Include cygwin/socket.h rather than sys/socket.h + to avoid circular dependency resulting in bogus compile time warnings. + +2013-05-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::read): Just call + fhandler_base::raw_read from here. Drop comment. + (fhandler_procsys::write): Drop comment. + +2013-05-27 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (dll_list::topsort): Fix early-return condition to + accommodate process with all runtime loaded DLLs already dlclosed + at fork time. + * gendef (_sigfe_maybe): Fix code handling early return if we don't + have a tls, broken on 2013-05-21. + +2013-05-24 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DEFS): Unused, remove. + (COMPILE.cc): Move -mno-use-libstdc-wrappers flag from here... + ($(TEST_DLL_NAME)): ...to here since it's a link time flag. + +2013-05-24 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo::status_exit): Enhance comment. + +2013-05-24 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (win_env::add_cache): Set the Windows environment variable + using wide chars to make sure native chars don't get scrambled. + * environ.h (build_env): Fix formatting in declaration. + * pinfo.cc (pinfo::status_exit): Handle STATUS_NO_MEMORY. Explain why. + +2013-05-24 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (frok::parent): Always set CREATE_UNICODE_ENVIRONMENT flag. + Explain why. + +2013-05-23 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (frok::parent): Call CreateProcessW with command line set + to the parent command line. Change comment to explain why. + +2013-05-23 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Fix datatype of + stacksize to SIZE_T. Cast to SIZE_T in pointer arithmetic. Slightly + enhance output in case of a fatal error. + * fork.cc (frok::parent): Always set ch.stackaddr to DeallocationStack + value of current thread to help stack reservation in + child_info_fork::alloc_stack_hard_way along. Simplify subsequent code + storing stack values in ch. Print guardsize in hex, too. + +2013-05-23 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (set_winsymlinks): Handle "winsymlinks:nativestrict" + option. On pre-Vista warn the user if the "winsymlinks:native*" option + is set. + * globals.cc (enum winsym_t): Add WSYM_nativestrict. + * path.cc (symlink_native): Don't create native symlink if target + does not exist. Explain why. Improve comments. + (symlink_worker): Change AFS symlink handling to WSYM_nativestrict. + Handle WSYM_nativestrict throughout. Change condition for bail out + to wsym_type == WSYM_nativestrict. Add comment. Fix formatting. + * shared_info.h (CURR_USER_MAGIC): Change to reflect change in + class user_info. + (class user_info): Add member warned_nonativesyms. + +2013-05-22 Corinna Vinschen <corinna@vinschen.de> + + * spinlock.h (ULONG): Replace LONG operator with ULONG to accommodate + the fact that CURR_SHARED_MAGIC and USER_SHARED_MAGIC are unsigned + values. + * shared.cc (shared_info::initialize): Drop explicit cast here. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add arc4random.o. + * common.din: Export arc4random, arc4random_addrandom, arc4random_buf, + arc4random_stir and arc4random_uniform. + * mktemp.cc (arc4random): Remove static replacement function. + * posix.sgml (std-bsd): Add arc4random functions. + * include/cygwin/stdlib.h: Declare arc4random functions. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * libc/arc4random.cc: New file implementing arc4random functions taken + from FreeBSD. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (__isthreaded): New global variable. Explain what it's + used for. + * miscfuncs.cc (thread_wrapper): Set __isthreaded to 1 here. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_dev_random): Change type of pseudo to + uint32_t to make sure it's 32 bit on all supported platforms. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + x86_64 only: + * gendef (_sigfe_maybe): Drop pushing %r12, use %r10 instead since we + don't call yield anymore. + (_sigfe): Ditto. + (_sigbe): Ditto. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + * libc/base64.c: New file. + * Makefile.in (DLL_OFILES): Add base64.o. + * common.din: Export __b64_ntop and __b64_pton. + * posix.sgml (std-bsd): Add __b64_ntop and __b64_pton. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (open): Only return ENOTDIR if file exists. + +2013-05-16 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (sig_hold): Delete. + (sigheld): Delete. + (sig_send): Eliminate special-case __SIGHOLD handling. + (wait_sig): Just flag when signals are on hold and add them to the + queue rather than stalling the wait_sig loop. Clear the flag when + __SIGNOHOLD is specified. + +2013-05-14 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (devices_CFLAGS): Drop -Os. + +2013-05-14 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (localtime_CFLAGS): Define as -fwrapv since localtime + code requires int overflows to be fully defined. + * localtime.cc: Align a bit more to upstream code. + +2013-05-14 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (get_groups): Convert to void function. + (initgroups32): Accommodate the aforementioned change. + (getgrouplist): Ditto. + +2013-05-14 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (get_groups): Never return error. Always create a group list, + even if it's empty. + +2013-05-13 Christopher Faylor <me.cygwin2013@cgf.cx> + + * include/cygwin/version.h: Bump api minor number to reflect previous + change. + +2013-05-13 Christopher Faylor <me.cygwin2013@cgf.cx> + + * i686.din: Remove _strtold. + * x86_64.din: Move strtold definition... + * common.din: ...to here. + +2013-05-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * fhandler_tty.cc (fhandler_pty_common::__acquire_output_mutex): Never + wait an INFINITE amount of time. Instead default to 1/10 second. + (fhandler_pty_slave::open): Just default to INFINITE wait rather than + (now) waiting longer than other similar calls. + +2013-05-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * spawn.cc (ILLEGAL_SIG_FUNC_PTR): New define. + (system_call_handle): Rename from system_call_cleanup. + (is_system_call): New convenience method. + (system_call_handle::system_call_handle): Use ILLEGAL_SIG_FUNC_PTR + rather than cast. Call sig_send here rather than in caller. + Initialize oldint. + (system_call_handle::arm): New function pulled from constructor. + (~system_call_handle::system_call_handle): Use is_system_call(). + (child_info_spawn::worker): Use system_call_handle to set up for system + call early. Use arm call prior to waiting for child to properly set up + signal handling. Move comment closer to code it is commenting on. + +2013-05-01 Christopher Faylor <me.cygwin2013@cgf.cx> + + * resource.cc (setrlimit): Use consistent commenting style. Return + EINVAL when rlim_cur > rlim_max. + +2013-04-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + Throughout, (mainly in fhandler*) fix remaining gcc 4.7 mismatch + warnings between regparm definitions and declarations. + * smallprint.cc (__small_vswprintf): Conditionalize declaration and + setting of l_opt for only x86_64. + * spawn.cc (child_info_spawn::worker): Remove unused 'pid' variable. + * thread.cc (verifyable_object_isvalid): Temporarily define as + non-inline with gcc 4.7+, regardless of target. + +2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * gendef: Fix sigfe.s typo. + +2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * spawn.cc (system_call_cleanup): Rename from pthread_cleanup. Extend + functionality. + (system_call_cleanup::system_call_cleanup): Set up signals like + system() requires. Unblock previously-blocked signal handling. + (system_call_cleanup::~system_call_cleanup): Restore signal handling + after system(). + (child_info_spawn::worker): Put signals on hold and use + system_call_cleanup class to set and restore signals rather than doing + it prior to to running the program. Remove the ill-conceived + pthread_cleanup stuff. + +2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (cygwin_exception::dumpstack): Guard against wild + pointer dereference. + (CYG_EXC_CONTINUE_EXECUTION): Define based on standard Windows + definition. + (CYG_EXC_CONTINUE_SEARCH): Ditto. + (exception::handle): Move andreas detection earlier. Make comment + clearer. + (signal_exit): Set core-dumped flag. + +2013-04-30 Christopher Faylor <me.cygwin2013@cgf.cx> + + * i686.din: New file. + * x86_64.din: New file. + * common.din: New file. + * cygwin.din: Delete. + * cygwin64.din: Delete. + * gendef: Rework to take options rather than using positional + parameters. Accept multiple files as input. + * Makefile.in: Rework to allow multiple .din files as input to gendef. + * configure.in: Change names of .din files to be expressively target + specific. + * aclocal.m4: Regenerate. + * configure: Ditto. + +2013-04-29 Christopher Faylor <me.cygwin2013@cgf.cx> + + * autoload.cc (CreateSymbolicLinkW): Rename from CreateSymbolicLink. + +2013-04-26 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc (fcntl): Define as export alias for fcntl64 on x86_64. + +2013-04-24 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CreateSymbolicLink): Define. + * environ.cc (set_winsymlinks): Set allow_winsymlinks. + (parse_thing): Change "winsymlinks" to set by function. + * globals.cc (enum winsym_t): Define. + (allow_winsymlinks): Define as winsym_t. + (ro_u_afs): New R/O Unicode string. + * mount.cc (fs_info::update): Fix comment. Handle AFS. + (fs_names): Add "afs". + * mount.h (enum fs_info_type): Add afs. + (class fs_info): Implement afs. + * path.cc (symlink): Drop third parameter in call to symlink_worker. + (symlink_nfs): New function. + (symlink_native): New function. + (symlink_worker): Drop third argument. Handle native symlink type by + calling symlink_native. Move code to handle NFS to symlink_nfs. Fix + formatting. Slightly restructure code. + * path.h (class path_conv): Add fs_is_afs method. + (symlink_worker): Declare here. + * security.h: Define privilege constants as unsigned int instead of as + unsigned long. + * syscalls.cc (mknod_worker): Set third parameter in symlink_worker + call to WSYM_lnk. + * winsup.h (symlink_worker): Drop declaration here. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwin64.din (_setjmp): Export. + (_longjmp): Export. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details. + +2013-04-22 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/queue.h: Delete in favor of more complete newlib file. + +2013-04-22 Corinna Vinschen <corinna@vinschen.de> + + Adapt to changes in newlib's sys/cdefs.h: + * include/sys/sysinfo.h (struct sysinfo): Rename __unused member to __f. + * libc/fts.c (__FBSDID): Drop definition. + * regex/regexec.c (__unused): Drop definition. + +2013-04-22 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 19. + +2013-04-16 Corinna Vinschen <corinna@vinschen.de> + + * glob.cc: Include winsup.h before anything else. + +2013-04-12 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Drop PC_KEEP_HANDLE flag for + unrecognized reparse points as well. Reorganize code and comments + handling reparse points for better readability. + +2013-04-11 Corinna Vinschen <corinna@vinschen.de> + + * hires.h (hires_ns::nsecs): Declare with bool parameter. + * times.cc (hires_ns::nsecs): Take bool parameter. If set to true, + don't use prime value (== return system wide absolute value). + +2013-04-08 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygtls.h (_cygtls::reset_signal_arrived): Actually reset the + signal_arrived event. + (_cygtls::handle_SIGCONT): Declare new function. + * cygwait.cc (is_cw_sig_handle): Delete. + (is_cw_sig_cont): New convenience define. + (cygwait): Clear signal if is_cw_sig_cont and we got a SIGCONT. + * cygwait.h (cw_wait_mask): Add cw_sig_cont. + * exceptions.cc (sig_handle_tty_stop): Tighten "incyg" region. Use + cw_sig_cont param for cygwait. Don't zero signal here outside of lock. + (sigpacket::setup_handler): Don't check for in_forkee since we will now + never get here in that state. + (_cygtls::handle_SIGCONT): Define new function. + (sigpacket::process): Call handle_SIGCONT early to deal with SIGCONT. + Nuke continue_now handling. Allow SIGKILL to kill a suspended process. + Delete a couple of now-unneeded labels. + (_cygtls::call_signal_handler): Reorganize setting of incyg within + lock. + * sigproc.cc (pending_signals): Simplify. + (pending_signals::clear): New method. + (_cygtls::remove_wq): Reorganize to always close wq.thread_ev if it + exists to avoid handle leaks. + (sig_clear): Simplify by just calling sigq.clear(). + (sig_dispatch_pending): Always call sigq.pending even in signal thread + to force another loop in wait_sig. + (sig_send): Remove a "goto out" just before out: label. + (pending_signals::add): Simplify. + (pending_signals::del): Delete. + (pending_signals::next): Delete. + (wait_sig): Define variable q to be the start of the signal queue. + Just iterate through sigq queue, deleting processed or zeroed signals. + Only set clearwait when the current signal is SIGCHLD. + * sigproc.h: Add a comment about an unused enum. + +2013-04-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (get_inet_addr): Handle abstract AF_LOCAL socket. + (fhandler_socket::recv_internal): Create abstract socket name for + AF_LOCAL datagram sockets. Explain why we do that. + +2013-04-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygheap.cc (init_cygheap::find_tls): Add a comment. + * dcrt0.cc (parent_sigmask): Delete. + (dll_crt0_1): Use spawn_info->moreinfo->sigmask rather than saved + parent signal mask. + * thread.cc (pthread::thread_init_wrapper): Add comment stressing the + importance of maintaining ordering of statements. + +2013-04-05 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (is_mmapped_region): Call LIST_UNLOCK on premature return. + +2013-04-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_loadavg): Raise too small buffer size + to avoid overwriting unrelated cygheap memory. + +2013-04-03 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (class suffix_scan): Add member namelen. + (suffix_scan::name_len): New method. + (suffix_scan::has): Store namelen since we have it already anyway. + Add a bit of explanation and a FIXME to comment. + (suffix_scan::next): Never attach extra .lnk suffix if resulting + filename length exceeds NAME_LEN. + (symlink_info::check): Bail out immediately with ENAMETOOLONG if + filename length exceeds NAME_LEN. + +2013-03-31 Christopher Faylor <me.cygwin2013@cgf.cx> + + * child_info.h (cygheap_exec_info::sigmask): Declare new field. + * cygheap.cc (init_cygheap::find_tls): Rename threadlist_ix -> ix. + Only take one pass through thread list, looking for eligible threads to + signal. Set a new param indicating that function has found a sigwait* + mask. + * cygheap.h (init_cygheap::find_tls): Reflect new parameter. + * dcrt0.cc (parent_sigmask): New variable. + (child_info_spawn::handle_spawn): Save parent's signal mask here. + (dll_crt0_1): Restore parent's signal mask to tls sigmask as + appropriate. Call sig_dispatch_pending to flush signal queue when we + can finally do something with signals. + * exceptions.cc (sigpacket::process): Avoid attempting to handle + signals if we haven't finished initializing. Rely on the fact that + find_tls will do mask checking and don't do it again. Delete ill-named + 'dummy' variable. + * sigproc.cc (cygheap_exec_info::alloc): Save calling thread's signal + mask in new sigmask field. + (wait_sig): Try to debug when WFSO fails and DEBUGGING is defined. + * thread.cc (pthread::set_tls_self_pointer): Make this a true automatic + method rather than inexplicably relying on a thread parameter. + (pthread::thread_init_wrapper): Accommodate set_tls_self_pointer change + to non-static. Initialize sigmask before setting tid or suffer signal + races. + * thread.h (pthread::set_tls_self_pointer): Make non-static, delete + parameter. + +2013-03-29 Corinna Vinschen <corinna@vinschen.de> + + * cygthread.cc (cygthread::terminate_thread): Only try to free + thread stack on systems not freeing it by themselves. + * wincap.h (wincaps::terminate_thread_frees_stack): New element. + * wincap.cc: Implement above element throughout. + +2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx> + + * pinfo.h (pinfo::status_exit): Rename from former static function in + pinfo.cc. + (pinfo::operator == (char *)): Remove unused operator. + * pinfo.cc (pinfo::status_exit): Move this function info pinfo class. + Use progname from the pinfo rather than myself. Be defensive when + inspecting procinfo. + +2013-03-29 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (wait_sig): Avoid uninitialized use of nb when retrying. + Consolidate two error messages into one. + +2013-03-28 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (pending_signals::retry): Declare new element. + (pending_signals::pending): Force an additional loop through wait_sig + by setting retry whenever this function is called. + (wait_sig): Reorganize to wait for SIGHOLD at bottom. Always add + signal to pending queue and work on whole queue rather than just the + one signal. Loop when sigq.retry is set. Fix long-broken check for + SIGCHLD after queued signals. + +2013-03-28 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (exception::handle): Generalize comment. + +2013-03-09 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygtls.h (_cygtls::signal_debugger): Change argument type. + (_cygtls::copy_context): Delete declaration. + * exceptions.cc (exception::handle): Don't call copy_context() here. + Move signal_handler call earlier and always call it. + (_cygtls::copy_context): Delete definition. + (_cygtls::signal_debugger): Move copy_context logic here. Suspend + thread receiving signal before gathering context information. + +2013-03-08 Christopher Faylor <me.cygwin2013@cgf.cx> + + * spawn.cc (child_info_spawn::worker): Save and restore my_wr_proc_pipe + around non-execing operations to avoid handle leak seen in + http://cygwin.com/ml/cygwin/2013-03/msg00152.html . + +2013-03-07 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/un.h (UNIX_PATH_MAX): Rename from UNIX_PATH_LEN to + follow Linux. + * fhandler_socket.cc: Change UNIX_PATH_LEN to UNIX_PATH_MAX throughout. + (fhandler_socket::recv_internal): Don't return prematurely in case of + successful return. For AF_LOCAL sockets, overwrite returned AF_INET + name with AF_LOCAL name. + +2013-03-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Fix check for AF_LOCAL + filename length to allow non-NUL terminated strings within namelen + bytes. Copy over sun_path to local array sun_path to have a + NUL-terminated string for subsequent function calls. Move path_conv + check before OS bind call to not bind the socket before being sure + the file doesn't exist. Add and fix comments. + +2013-03-06 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_names): Add trailing NULL element to avoid potential + SEGV in format_proc_filesystems. + +2013-03-01 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (exception::handle): Eliminate buggy recursed variable; + just check if we're exiting. + +2013-02-26 Corinna Vinschen <corinna@vinschen.de> + + * include/pthread.h (pthread_atfork): Add missing declaration. + +2013-02-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/error.h (error_message_count): Declare as dllimport. + (error_one_per_line): Ditto. + (error_print_progname): Ditto. + +2013-02-08 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + (class child_info_fork): Drop extraneous semicolon. + +2013-02-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Fix error code for + empty filename. + +2013-02-04 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::bind): Fix length check of + AF_LOCAL filename so it never accesses memory beyond namelen. Also + make sure filename is NUL-terminated. + +2013-01-31 Christopher Faylor <me.cygwin2013@cgf.cx> + + * DevNotes: Add entry cgf-000022. + * cygtls.h (_cygtls::func): Define as a sa_sigaction style function. + * exceptions.cc (sig_handle_tty_stop): Ditto. + (_cygtls::interrupt_setup): Fix coercion to accommodate 'func' change. + (ctrl_c_handler): Use tty kill_pgrp to send a signal. + (sigpacket::process): Don't process sigflush here. + (_cygtls::call_signal_handler): Reorganize to avoid a race. Always + call sa_sigaction style function. + * fhandler_termios.cc (is_flush_sig): Define new function. + (tty_min::kill_pgrp): Handle tty flush when signal detected. + (fhandler_termios::bg_check): Be slightly more paranoid about checking + for valid tty. + (fhandler_termios::sigflush): Don't flush unless tty owner. + * fhandler_tty.cc (fhandler_pty_slave::ioctl): Use tty kill_pgrp to + send signal. + (fhandler_pty_master::ioctl): Ditto. + * signal.cc (killsys): Delete definition. + * sigproc.h (killsys): Delete declaration. + * include/cygwin/signal.h (siginfo_t): Simplify union/struct nesting + slightly. Implement mechanism to allow cygwin data passing. + +2013-01-23 Christopher Faylor <me.cygwin2013@cgf.cx> + + * miscfuncs.cc (__import_address): Check if malloc field points + directly at 'malloc'. + +2013-01-23 Christopher Faylor <me.cygwin2013@cgf.cx> + + * miscfuncs.cc (__import_address): On second thought, the chance that + this pointer could be NULL is very low so don't bother checking for it. + +2013-01-23 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (exception::handle): Make attempt to recursively dump + stack fatal. + +2013-01-22 Christopher Faylor <me.cygwin2013@cgf.cx> + + * miscfuncs.cc (__import_address): Avoid NULL explicitly. + +2013-01-22 Christopher Faylor <me.cygwin2013@cgf.cx> + + * miscfuncs.cc (__import_address): Avoid treating random instructions + as import jump. + * malloc_wrapper.cc (malloc_init): Remove comment about 64-bit. + +2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Comment assumption. + * exceptions.cc (sigpacket::setup_handler): Avoid sending signals + during fork processing. + +2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dcrt0.cc (dll_crt0_1): Flag that we are working "incyg". Handle any + signals (presumably exiting signals) which may have come in while we + are in the process of setting up. + +2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx> + + * update-copyright: Recognize configure.ac scripts too. + +2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygerrno.h (__reg3): Define. + * cygmalloc.h (__reg3): Ditto. + +2013-01-21 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygerrno.h: Conditionally define __regN for cygserver. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * malloc_wrapper.cc (malloc_init): Re-add inadvertently dropped comment + which explains what's going on with the use_internal calculation. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + Throughout, update copyrights to reflect dates which correspond to + main-branch checkins. Regularize copyright format. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + Throughout, change __attribute__ ((regparm (N))) to just __regN. + Throughout, (mainly in fhandler*) start fixing gcc 4.7.2 mismatch + between regparm definitions and declarations. + * gendef: Define some functions to take @ declaration to accommodate + _regN defines which use __stdcall. + * gentls_offsets: Define __regN macros as empty. + * autoload.cc (wsock_init): Remove unneeded regparm attribute. + * winsup.h (__reg1): Define. + (__reg2): Define. + (__reg3): Define. + + * advapi32.cc (DuplicateTokenEx): Coerce some initializers to avoid + warnings from gcc 4.7.2. + * exceptions.cc (status_info): Declare struct to use NTSTATUS. + (cygwin_exception::dump_exception): Coerce e->ExceptionCode to + NTSTATUS. + * fhandler_clipboard.cc (cygnativeformat): Redefine as UINT to avoid + gcc 4.7.2 warnings. + (fhandler_dev_clipboard::read): Ditto. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * update-copyright (update_maybe): Accommodate perl-style copyright + comments. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * update-copyright: Silently skip nonexistent files. Display filename + on update. Don't update non-Red Hat copyrights. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * update-copyright: Update standard copyright information based on cvs + log and current sandbox status. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * malloc_wrapper.cc: Change 'use_internal_malloc' to 'use_internal' + throughout. + (export_malloc_called): Delete. + (internal_malloc_determined): New variable. + (malloc_init): Control calculation of internal/external malloc based on + 'internal_malloc_determined'. Use import_address() to determine if + malloc in user_data is ours or not. + * miscfuncs.cc (thread_wrapper): Make static. + (__import_address): Define new function. + * miscfuncs.h (import_address): New define. + (__import_address): Declare new function. + +2013-01-20 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (sig_dispatch_pending): Add correct regparm attributes to + match declaration. + (pid_exists): Ditto. + (proc_subproc): Ditto. + (sig_clear): Ditto. + (sig_send): Ditto. + (checkstate): Ditto. + +2013-01-19 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Remove ill-conceived NFS workaround from + 2013-01-10 for self-inflicted NFS server problem. + +2013-01-19 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (ctrl_c_handler): Remove special-case handler for + "cygwin_finished_initializing". + * sigproc.cc (exit_thread): Undefine ExitThread earlier to avoid + recursion on error return. + +2013-01-18 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Map ERROR_LOCK_VIOLATION to EBUSY. + +2013-01-18 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc (handler_disk_file::msync): Add call to FlushFileBuffers + to implement MS_SYNC. + +2013-01-17 Christopher Faylor <me.cygwin2013@cgf.cx> + + * mmap.cc (handler_disk_file::msync): Retry up to 99 times if + FlushViewOFile fails with ERROR_LOCK_VIOLATION. + +2013-01-16 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (no_signals_available): Finally remove this macro + entirely. + (exit_thread): Ensure process lock is released on error exit. + (sig_send): Simplify "its_me" test. Remove no_signals_available tests. + +2013-01-16 Christopher Faylor <me.cygwin2013@cgf.cx> + + * pthread.cc (pthread_exit): Add kludge to accommodate noreturn attribute. + +2013-01-14 Antti Kantee <pooka@iki.fi> + + * include/pthread.h (pthread_exit): Mark as "noreturn". + +2013-01-14 Christopher Faylor <me.cygwin2013@cgf.cx> + + * exceptions.cc (signal_exit): Move captive process termination... + (_cygtls::interrupt_setup): ...into here. + (sigpacket::process): Simplify setting of handler when have_execed. + (_cygtls::interrupt_setup): Don't call proc_subproc when we've execed. + * globals.cc (exit_states): Delete unneeded ES_EXEC_EXIT. + * pinfo.cc (pinfo::exit): Change debugging output. Call proc_terminate + rather than the now-obsolete sigproc_terminate. Don't set exit_state + to ES_EXEC_EXIT. Set exit_state to ES_FINAL later. + * sigproc.cc (sigproc_terminate): Delete function. + (wait_sig): Don't call proc_subproc if have_execed. + * sigproc.h (sigproc_terminate): Delete declaration. + * sync.h (lock_process::lock_process): Don't set exit_state to + ES_PROCESS_LOCKED. + (lock_process::operator LONG): Define. + +2013-01-11 Christopher Faylor <me.cygwin2013@cgf.cx> + + * DevNotes: Add entry cgf-000021. + * select.cc (select): Unconditionally return when a signal is detected. + (select_stuff::wait): Ditto. + +2013-01-11 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (rename): Drop handling paths > 32757 chars, emit EINVAL + instead, thus simplifying code allocating and filling pfri. Drop size + and use constant expression in NtSetInformationFile call. Add comments. + Drop redundant test for fs_serial_number and change comment accordingly. + +2013-01-11 Thomas Wolff <towo@towo.net> + + * fhandler.h (class dev_console): Flag for expanded control sequence. + * fhandler_console.cc (char_command): Supporting cursor style modes. + +2013-01-10 Corinna Vinschen <corinna@vinschen.de> + + * path.h (path_conv::fs_type): New method. + * syscalls.cc (rename): Check for cross-device situation before + touching anything. Explain why. Workaround NFS bug in call to + NtSetInformationFile(FileRenameInformation). + +2013-01-09 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h: Fix copyright. + * exceptions.cc: Drop comment explaining removed variable. + +2013-01-09 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (main_thread_sinit): New inline function. Fix and explain + a stdio initialization issue. + (dll_crt0_1): Call main_thread_sinit rather than __sinit. + +2013-01-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * thread.cc (pthread_rwlock::lookup_reader): Remove parameter: always + assume that we're looking for the current thread. + (pthread_rwlock::tryrdlock): Eliminate self variable. Accommodate + change in lookup_reader(). + (pthread_rwlock::unlock): Ditto. + (pthread_rwlock::rdlock): Ditto. Move add_reader call after writer + tests to more closely mimic old behavior. + (pthread_rwlock::wrlock): Accommodate change in lookup_reader(). + * thread.h ((pthread_rwlock::lookup_reader): Eliminate argument. + +2013-01-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * thread.cc (pthread_rwlock::add_reader): Perform new operation here + and return pointer to allocated RWLOCK_READER structure. + (pthread_rwlock::rdlock): Reorganize to reflect new add_reader + functionality. + (pthread_rwlock::tryrdlock): Ditto. Remove unneeded call to + lookup_reader(). + * thread.h (pthread_rwlock::RWLOCK_READER::RWLOCK_READER): New + constructor. + (pthread_rwlock::add_reader): Reflect new functionality. + +2013-01-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * globals.cc (exit_states): Renumber so that ES_EXIT_STARTING is first, + as intended. + * sigproc.cc (wait_sig): Only stop accepting signals after + exit_state > ES_EXIT_STARTING. + +2013-01-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (exit_thread): Set thread signal mask so that no signals + are sent to an exiting thread. + +2013-01-02 Christopher Faylor <me.cygwin2013@cgf.cx> + + * sigproc.cc (no_signals_available): Remove exit_state test since + signals are available in a limited fashion when exiting. + (sig_dispatch_pending): Ditto. + (sig_send): Ditto. + (exit_thread): Rearrange to avoid an unnecessary DuplicateProcess when + exiting. + (wait_sig): Allow special signals when exiting. + +2013-01-02 Christopher Faylor <me.cygwin2013@cgf.cx> + + * DevNotes: Add entry cgf-000020, relating to previous checkin. + +2013-01-02 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygtls.h (_cygtls::signal_exit): Delete from class. + * exception.h (cygwin_exception): New class. + (cygwin_exception::dumpstack): Declare new function. + (cygwin_exception::context): Ditto. + (cygwin_exception::dump_exception): Ditto. + * exceptions.cc (cygwin_exception::dump_exception): Move into + cygwin_exception class. Accommodate new variable names. + (cygwin_exception::dumpstack): Ditto stackdump -> dumpstack. + (exception::handle): Move andreas processing earlier. Defer signal + processing decisions to the signal thread where they belong. Pass + exception information to sig_send via new siginfo_t si_cyg field. + (ctrl_c_handler): Wait for SIGHUP signal to be processed since it could + cause a process exit and we don't want races with thread exit lock. + (signal_exit): Move back here from sigproc.cc. Modify arguments and + remove from sigpacket class. Decide when to dump core based on signal + type. + (sigpacket::process): Handle exiting signals in context of threads + rather than in the signal thread. Signal debugger on non-Windows + signals. Remove setup_signal_exit call. + * sigproc.cc (no_signals_available): Remove argument. + (signal_exit_code): Delete. + (close_my_readsig): Ditto. + (_cygtls::signal_exit): Move to exceptions.cc. + (sigproc_terminate): Don't attempt to terminate signal thread. + (setup_signal_exit): Delete. + (exit_thread): Use new si_cyg entry in siginfo_t. + (sig_send): Just use empty initializer for si. Accommodate change in + no_signals_available argument. + (wait_sig): Remove attempt to "go asynchronous" on process exit. + Delete __SIGEXIT handling. Don't ever exit. + * sigproc.h: Remove __SIGEXIT from signal enum. Renumber. + * include/cygwin/signal.h (siginfo_t): Add si_cyg entry. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2014 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2014 new file mode 100644 index 000000000..7feccf499 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2014 @@ -0,0 +1,2745 @@ +2014-12-18 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * common.din (__fbufsize, __flbf, __fpending, __freadable, __freading, + __fsetlocking, __fwritable, __fwriting, clearerr_unlocked, + feof_unlocked, ferror_unlocked, fflush_unlocked, fgetc_unlocked, + fgets_unlocked, fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, + fputc_unlocked, fputs_unlocked, fputwc_unlocked, fputws_unlocked, + fread_unlocked, fwrite_unlocked, getwc_unlocked, getwchar_unlocked, + putwc_unlocked, putwchar_unlocked): Export. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2014-12-16 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (find_fast_cwd): Point to problem reporting web site rather + than to mailing list. + +2014-12-16 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (warn_msdos): Slightly reformat. + (find_fast_cwd): Change warning message to urge an update before + reporting the problem. + +2014-12-10 Corinna Vinschen <corinna@vinschen.de> + + * winver.rc (LegalCopyright): Fix belatedly (uh-oh). + +2014-12-08 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (regopt): Remove function. + (environ_init): Drop undocumented feature to read application-specific + environment variables from the registry. + * include/cygwin/version.h (CYGWIN_INFO_PROGRAM_OPTIONS_NAME): Remove. + +2014-12-05 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (build_env): Remove loquacious debug statements. + +2014-12-05 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * common.din (__bsd_qsort_r): Add. + (qsort_r): Add. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (create_lock_in_parent): Make lf_obj handle inheritable. + Explain why. + (lockf_t::create_lock_obj): Use FALSE, rather than 0 for BOOL argument. + (lockf_t::del_lock_obj): Check if NtSetEvent succeeded and print system + message if not. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (fetch_windows_home): New function fetching Windows-compliant + home directory. Include longish comment to explain what we're doing. + (cygheap_pwdgrp::get_home): Take additional sid parameter. In + NSS_SCHEME_WINDOWS case, call fetch_windows_home to create home + directory. + (pwdgrp::fetch_account_from_windows): Call cygheap_pwdgrp::get_home + with additional sid argument. + * cygheap.h (cygheap_pwdgrp::get_home): Align declaration to above + change. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::ontherange): Fix order of fallbacks creating + HOMEDRIVE/HOMEPATH values to be Windows-compliant. Add comments. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CreateProfile): Import. + (LoadUserProfileW): Import. + * registry.cc (get_registry_hive_path): Move to sec_auth.cc. + (load_registry_hive): Remove. + * registry.h (get_registry_hive_path): Drop declaration. + (load_registry_hive): Ditto. + * sec_auth.cc (get_user_profile_directory): Moved from registry.cc and + renamed. Take third parameter with buffer length. + (load_user_profile): New function taking over for load_registry_hive. + Use official functions to load profile. If profile is missing, create + it on Vista and later. + * security.h (get_user_profile_directory): Declare. + (load_user_profile): Declare. + * syscalls.cc (seteuid32): Replace call to load_registry_hive with call + to load_user_profile. + * uinfo.cc (cygheap_user::env_userprofile): Replace call to + get_registry_hive_path with call to get_user_profile_directory. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (fetch_from_description): Make static. + (fetch_from_path): Ditto. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CreateEnvironmentBlock): Import. + (DestroyEnvironmentBlock): Import. + * environ.cc (env_compare): New static bsearch comparison function. + (build_env): Add parameter taking a user token. If token is non-NULL, + fetch user's default Windows environment and merge it into the resulting + environment. Explain what we do in preceeding comment. + * environ,h (build_env): Align prototype to above change. + * external.cc (create_winenv): Call build_env with NULL token. + * spawn.cc (child_info_spawn::worker): When spawning new process under + another user account, call build_env with new token to allow merging + user's default Windows environment. + * winlean.h (_USERENV_): Define to override dllimport. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (child_info_spawn::worker): Fix formatting. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (str2lsa): Remove. + (str2buf2lsa): Remove. + (lsaauth): Call RtlInitAnsiString instead of str2lsa and str2buf2lsa. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::init_installation_root): Fix typo in + comment. + +2014-12-02 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (IdnToAscii): Use simpler, equivalent LoadDLLfuncEx. + (IdnToUnicode): Ditto. + +2014-12-01 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincap_minimal): Remove. + (wincaps): Drop has_physical_mem_access. + (wincap_10): New global wincaps to support Windows 10. + (wincapc::init): Use wincap_10 for version >= 6.4 and as default. + * wincap.h (wincaps::has_physical_mem_access): remove. + +2014-11-28 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::init_tls_list): Accommodate threadlist + having a new type threadlist_t *. Convert commented out code into an + #if 0. Create thread mutex. Explain why. + (init_cygheap::remove_tls): Drop timeout value. Always wait infinitely + for tls_sentry. Return mutex HANDLE of just deleted threadlist entry. + (init_cygheap::find_tls): New implementation taking tls pointer as + search parameter. Return threadlist_t *. + (init_cygheap::find_tls): Return threadlist_t *. Define ix as auto + variable. Drop exception handling since crash must be made impossible + due to correct synchronization. Return with locked mutex. + * cygheap.h (struct threadlist_t): Define. + (struct init_cygheap): Convert threadlist to threadlist_t type. + (init_cygheap::remove_tls): Align declaration to above change. + (init_cygheap::find_tls): Ditto. + (init_cygheap::unlock_tls): Define. + * cygtls.cc (_cygtls::remove): Unlock and close mutex when finishing. + * exceptions.cc (sigpacket::process): Lock _cygtls area of thread before + accessing it. + * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. + * sigproc.cc (sig_send): Ditto. + * thread.cc (pthread::exit): Ditto. Add comment. + (pthread::cancel): Ditto. + +2014-11-28 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::find_tls): Add comment. + * cygtls.cc (well_known_dlls): Rephrase comment. + (bloda_detect): New function. + (_cygtls::call2): Call init_thread and bloda_detect for non-pthread + threads only. + (_cygtls::remove): Move remove_tls and remove_wq calls up to run first. + * miscfuncs.cc (struct pthread_wrapper_arg): Rename from struct + thread_wrapper_arg. + (pthread_wrapper): Rename from thread_wrapper and drop "static". Fix + comment. Drop call to _cygtls::remove. Call api_fatal rather than + ExitThread. Explain why. + * miscfuncs.h (pthread_wrapper): Declare pthread_wrapper. + * thread.cc (pthread::exit): Add a FIXME comment. Call _cygtls::remove + before calling ExitThread. + +2014-11-27 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_info::init): Take bool argument and allow to + initialize mount table in two steps, system and user, depending on + bool value. + * mount.h (class mount_info): Align declaration of init function to + above change. + * shared.cc (user_info::initialize): Initialize mount table in two + steps to allow internal_getpwsid to create valid POSIX paths from + DOS paths given in AD. Add comments. + * uinfo.cc (cygheap_pwdgrp::get_home): Allow DOS paths in + NSS_SCHEME_FREEATTR attributes. + (cygheap_pwdgrp::get_shell): Ditto. + +2014-11-27 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::find_tls): Allow to keep loop going after + access to threadlist[ix] faulted. In case of an exception, remove + threadlist[ix] from threadlist only. Add comment. + +2014-11-26 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (install): Add install-ldif target. + (install-ldif): New target to install cygwin.ldif. + * cygheap.h (class cygheap_pwdgrp): Rename pfx_t to nss_pfx_t. Add + PFX to enum value. Add nss_scheme_method enum and nss_scheme_t + structure. Add home_scheme, shell_scheme and gecos_scheme members. + (NSS_SCHEME_MAX): Define. + (cygheap_pwdgrp::get_home): Declare. + (cygheap_pwdgrp::get_shell): Declare. + (cygheap_pwdgrp::get_gecos): Declare. + * cygwin.ldif: New file. + * ldap.cc (std_user_attr): New array, just defining the standard + attributes. + (group_attr): Add cygwinUnixGid. + (user_attr): Convert to macro pointing to cygheap->pg.ldap_user_attr. + (cygheap_pwdgrp::init_ldap_user_attr): New method. + (cyg_ldap::fetch_ad_account): Call cygheap_pwdgrp::init_ldap_user_attr + if user_attr initialization is required. Fix comment. + (cyg_ldap::get_string_attribute): Implement taking attribute name + as argument. + * ldap.h: Drop unused macros. + (cyg_ldap::get_gecos): Remove. + (cyg_ldap::get_home): Remove. + (cyg_ldap::get_shell): Remove. + (cyg_ldap::get_string_attribute): Declare name argument variant public. + * uinfo.cc (cygheap_user::ontherange): Fix indentation. + (cygheap_pwdgrp::init): Initialize new home_scheme, shell_scheme and + gecos_scheme members. Align comment. + (NSS_NCMP): Define comparison macro. + (NSS_CMP): Ditto. + (cygheap_pwdgrp::nss_init_line): Use aforementioned macros throughout. + Fix comment handling. Add db_home, db_shell and db_gecos handling. + (fetch_from_description): New function to fetch XML-style attributes + from (description) string. + (fetch_from_path): New function to evaluate path string with wildcards. + (cygheap_pwdgrp::get_home): New methods to fetch pw_dir value. + (cygheap_pwdgrp::get_shell): Ditto for pw_shell. + (cygheap_pwdgrp::get_gecos): Ditto for pw_gecos. + (colon_to_semicolon): Move up. + (pwdgrp::fetch_account_from_windows): Convert home, shell, gecos + variables to char*. Drop statement breaking extended group info. + Fetch home, shell and gecos values using new methods. Use + fetch_from_description calls to fetch UNIX id and primary groups from + SAM comment field. Accommodate uxid being a char* now. Accommodate + the fact that extended info is malloc'ed, rather then alloca'ed. + Create linebuf content as multibyte string. Create line buffer by + just calling cstrdup. + +2014-11-25 Corinna Vinschen <corinna@vinschen.de> + + * include/fcntl.h: Move all open flags (except O_NDELAY) to newlib's + sys/_default_fcntl.h. + +2014-11-25 Corinna Vinschen <corinna@vinschen.de> + + * binmode.c (cygwin_premain0): Don't use underscore'd variants of the + open flags. + * textmode.c (cygwin_premain0): Ditto. + +2014-11-21 Corinna Vinschen <corinna@vinschen.de> + + * init.cc (dll_entry): Revert previous patch. This requires another + solution. + * miscfuncs.cc (thread_wrapper): Ditto. + * sigproc.cc (exit_thread): Disable sending a signal for synchronization + with process exit. Explain why. Keep code in for later inspection, + should the problem show up again. + (sig_send): Use "tls", rather than "tid" as name for _cygtls arg. + +2014-11-20 Corinna Vinschen <corinna@vinschen.de> + + * init.cc (dll_entry): Call _my_tls.remove with INFINITE wait period + to avoid SEGVs and subsequent hangs in _cygtls::find_tls. + * miscfuncs.cc (thread_wrapper): Ditto. + +2014-11-20 Iuliu Rus <rus.iuliu@gmail.com> + + * net.cc (fdsock): Change default values for socket buffers on 32 bit + to fix performance on 10Gb networks. + +2014-11-17 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Allow fetching of + NT SERVICE accounts by name. Always prepend domain to NT SERVICE + accounts. Add U-domain\username string to pw_gecos for predefined + builtin accounts as well. + +2014-11-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_termios.cc (fhandler_termios::line_edit): Fix fatal typo in + bytes_read pointer checks. + +2014-11-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_termios::line_edit): Add parameter to return + written bytes. + * fhandler_termios.cc (fhandler_termios::tcinit): Fix formatting. + (fhandler_termios::line_edit): Return bytes actually written. Write + in 32 byte chunks in non-canonical mode to reduce number of WriteFile + calls. Don't just eat unwritten bytes in case of an error condition. + Especially, don't report them back to the caller as written. + * fhandler_tty.cc (fhandler_pty_slave::read): Disable code reducing + the number of bytes read from the pipe to vmin. Add comment. + (fhandler_pty_master::write): Convert ret to ssize_t type. Just call + line_edit once, not in a loop once for each byte. Return bytes written + as returned by line_edit. + +2014-11-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 34. + +2014-11-12 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_pwdgrp): Remove constants NSS_FILES and NSS_DB. + Use NSS_SRC_FILES and NSS_SRC_DB throughout instead. + (cygheap_pwdgrp::nss_pwd_src): New inline method. + (cygheap_pwdgrp::nss_grp_src): Ditto. + * external.cc (cygwin_internal): Add CW_GETNSS_PWD_SRC and + CW_GETNSS_GRP_SRC cases. + * uinfo.cc: Use NSS_SRC_FILES and NSS_SRC_DB throughout. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GETNSS_PWD_SRC + and CW_GETNSS_GRP_SRC. + (NSS_SRC_FILES): Define. + (NSS_SRC_DB): Define. + +2014-11-07 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (cygwin__cxa_atexit): Fetch correct DSO handle value + by searching dll list. Explain why. + +2014-11-06 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (cygwin_atexit): Change preceeding comment to reflect + API version numbers. + * external.cc (cygwin_internal): disable setting cxx_malloc on 64 bit. + Add CW_FIXED_ATEXIT case. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_FIXED_ATEXIT. + * lib/atexit.c (atexit): Test running Cygwin version by checking + return value of cygwin_internal (CW_FIXED_ATEXIT). + +2014-11-05 Corinna Vinschen <corinna@vinschen.de> + + * lib/atexit.c (atexit): Check for being linked into the executable. + If so, call __cxa_atexit with NULL DSO handle. Explain why. + * lib/dso_handle.c: New file providing fallback __dso_handle. + +2014-11-05 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (NEW_FUNCTIONS): Add atexit to be not exported. + * lib/atexit.c (atexit): New, statically linkable version of atexit. + * dcrt0.cc (cygwin_atexit): Add comment to mark this function as old + entry point. Indiscriminately check for DSO of function pointer for + all functions, if checking for DSO of return address fails on x86_64. + Change comment accordingly. + +2014-11-05 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (NEW_FUNCTIONS): Define target-independent. Add target + dependent stuff afterwards. Globally define timezone and all xdr + symbols as non-exported from libcygwin.a. + +2014-11-03 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc: Fix formatting. + +2014-10-30 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::ontherange): Don't mention /etc/passwd. + +2014-10-29 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::init_installation_root): Create content of + installation_dir as non-prefixed path, if possible. + +2014-10-29 Corinna Vinschen <corinna@vinschen.de> + + * common.din (__cxa_atexit): Define as cygwin__cxa_atexit. + * dcrt0.cc (cygwin__cxa_atexit): New function. Explain what we do. + +2014-10-28 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (dos_file_warning): Set to false by default. + * path.cc (warn_msdos): Make static. Drop test for dos_file_warning. + (path_conv::check): Check for dos_file_warning here to avoid a function + call in the default case. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (cygwin_atexit): Add workaround for broken atexit calls + in __gcc_register_frame of DLLs built with gcc-4.8.3-3. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (dlopen): Drop patch accommodating SetDllDiretory from + 2014-10-14. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_fixup_in_child): Drop call to set_dll_dir. + (init_cygheap::init_installation_root): Set installation_dir_len. + (setup_cygheap): Drop call to set_dll_dir. + * cygheap.h (struct init_cygheap): Add installation_dir_len member. + (init_cygheap::set_dll_dir): Remove. + * environ.cc (win_env::add_cache): Use stpcpy for speed. + (posify_maybe): Use tmp_pathbuf buffer instead of stack. + (raise_envblock): New function to resize Windows environment block. + (build_env): Fix indentation. Call raise_envblock function. Check if + $PATH exists and is non-empty. If not, add PATH variable with Cygwin + installation directory as content to Windows environment. Explain why. + + * uinfo.cc (cygheap_pwdgrp::_nss_init): Fill UNICODE_STRING members + on the fly. Drop call to RtlInitUnicodeString. + (pwdgrp::check_file): Ditto. + +2014-10-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::af_local_connect): Drop + setting connect_state to connect_credxchg. + (fhandler_socket::af_local_accept): Ditto. + (fhandler_socket::recv_internal): Drop ill-advised connect_state check. + Add comment so as not to repeat the exercise. + * fhandler.h (enum conn_state): Drop now unneeded connect_credxchg + state. + +2014-10-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_cygdrive): Fix symlink path if cygdrive + is "/". + +2014-10-24 Corinna Vinschen <corinna@vinschen.de> + + * gendef (sigdelayed): 64 bit only: Fix seh_pushreg statements in + prologue. + +2014-10-24 Kai Tietz <corinna@vinschen.de> + Corinna Vinschen <corinna@vinschen.de> + + * gendef (sigdelayed): 64 bit only: Push CPU flags before aligning + stack to avoid changing flag values. + +2014-10-22 Yaakov Selkowitz <yselkowi@redhat.com> + + * common.din (stime): Export. + * times.cc (stime): New function. + * include/cygwin/time.h (stime): Declare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2014-10-21 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_user_groups): Remove experimental exception handler + added 2014-09-05. + (get_user_local_groups): Ditto. + +2014-10-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_serial.cc: Revert debug code accidentally checked in on + 2014-08-18. + +2014-10-20 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check): Set error from status code if opening + the parent directory failed, but keep special case for root dirs. + +2014-10-17 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cygheap_fixup_in_child): Call set_dll_dir. + (init_cygheap::init_installation_root): Just memmove contents of + installation_root instead of calling GetModuleFileNameW again. + Copy installation_root to installation_dir before stripping of + "bin" dir. Don't call SetDllDirectory here. Explain what we do. + (setup_cygheap): New function taking over initial cygheap setup + from memory_init. Additionally call set_dll_dir. + * cygheap.h (struct init_cygheap): Add installation_dir member. + (init_cygheap::set_dll_dir): Define. + (setup_cygheap): Declare. + * dcrt0.cc: Throughout drop parameter from memory_init call. + (dll_crt0_0): Call setup_cygheap prior to memory_init. + * dlfcn.cc (dlopen): Change comment to point to the right function. + * shared.cc (memory_init): Drop parameter. Drop cygheap setup. + * shared_info.h (memory_init): Change declaration accordingly. + +2014-10-17 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (__try): Define __l_endtry as block-local label in 32 bit + case as well. + +2014-10-17 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Add quotactl.o. + * common.din (quotactl): Export. + * ntdll.h: Define FILE_FS_CONTROL_INFORMATION::FileSystemControlFlags + flag values. + (struct _FILE_FS_CONTROL_INFORMATION): Define. + (struct _FILE_GET_QUOTA_INFORMATION): Define. + (typedef struct _FILE_QUOTA_INFORMATION): Define. + (NtQueryObject): Use PVOID rather than VOID*. + (NtQueryVolumeInformationFile): Ditto. + (NtQueryQuotaInformationFile): Declare. + (NtSetQuotaInformationFile): Declare. + (NtSetVolumeInformationFile): Declare. + * quotactl.cc: New file implementing quotactl(). + * include/sys/mount.h (BLOCK_SIZE): Define. + (BLOCK_SIZE_BITS): Define. + * include/sys/quota.h: New header. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2014-10-16 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_OFILES): Rearrange with one file per line. + +2014-10-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_partitions): Extend output to print + the windows mount points the device is mounted on. + +2014-10-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::connect): Don't change state + on WSAEALREADY error. Change comment accordingly. + +2014-10-14 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (init_cygheap::init_installation_root): Install Cygwin's + installation dir as DLL search path, instead of ".". + * cygheap.h (class cwdstuff): Add parameter names in function + declarations for readability. + (cwdstuff::get): Add inline implementation fetching the CWD as wide char + string. + * dlfcn.cc (dlopen): Add searching for dependent DLLs in DLL + installation dir or CWD, if all else failed. + Add comment to explain scenarios this is accommodating. + +2014-10-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::connect): Init connect_state to + connect_pending only on unconnected socket. Set connect_state to + connected on WSAEISCONN error. Set connect_state to connect_failed + on any other error except WSAEWOULDBLOCK if connect is still pending. + Add lots of comment to explain why all of the above. + +2014-10-13 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_setsockopt): Drop redundant test for AF_LOCAL and + SOCK_STREAM in SO_PEERCRED case, as in the original patch. + +2014-10-12 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (gfpod_helper): Only check for POSIX dir separator, same as + in get_full_path_of_dll. + +2014-10-12 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (set_dl_error): Drop useless __stdcall. + (check_path_access): Ditto. Drop FE_CWD from call to find_exec. + (gfpod_helper): Call path_conv::check for all paths containing a dir + separator to more closely follow the Linux search algorithm. + (get_full_path_of_dll): Drop useless __stdcall. + (dlopen): Simplify RTLD_NOLOAD case by calling GetModuleHandleEx + instead of GetModuleHandle/LoadLibrary. + +2014-10-11 Christian Franke <franke@computer.org> + + Add setsockopt(sd, SOL_SOCKET, SO_PEERCRED, NULL, 0) to disable + initial handshake on AF_LOCAL sockets. + * fhandler.h (class fhandler_socket): Add no_getpeereid status flag. + (fhandler_socket::af_local_set_no_getpeereid): New prototype. + * fhandler_socket.cc (fhandler_socket::af_local_connect): Skip handshake + if no_getpeereid is set. Add debug output. + (fhandler_socket::af_local_accept): Likewise. + (fhandler_socket::af_local_set_no_getpeereid): New function. + (fhandler_socket::af_local_copy): Copy no_getpeereid. + (fhandler_socket::getpeereid): Fail if no_getpeereid is set. + * net.cc (cygwin_setsockopt): Add SO_PEERCRED for AF_LOCAL/SOCK_STREAM + sockets. Add comment to explain why we need it. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2014-10-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::af_local_connect): Drop outdated + comment. + (fhandler_socket::evaluate_events): Only set connect_state and call + af_local_connect if connect_state is connect_pending. Explain why. + Drop redundant test for socket family and type. + (fhandler_socket::connect): Extend comment. + +2014-10-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::evaluate_events): Handle + connect_state and af_local_connect connect call here, once, independent + of FD_CONNECT being requested. Add comment to explain why. + (fhandler_socket::connect): Drop connect_state handling and calling + af_local_connect. Move remaining AF_LOCAL stuff prior to calling + ::connect and explain why. Simplify error case. + * poll.cc (poll): Handle connect state independently of POLLOUT being + requested for the descriptor to allow setting POLLIN if connect failed. + Add comment. + * select.cc (set_bits): Drop connect_state and AF_LOCAL handling here. + +2014-10-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::evaluate_events): Slightly + rearrange code. Rephrase a comment. + +2014-10-10 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (dlopen): Disable old 32 bit code on 64 bit. + * dcrt0.cc (check_sanity_and_sync): Ditto. + * dll_init.cc (dll_dllcrt0_1): Fix typo in comment. + +2014-10-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsys.cc (fhandler_procsys::readdir): Just test + ObjectTypeName for object types rather than calling lstat to avoid + performance hit. + * globals.cc (ro_u_natdir): Define. + (ro_u_natsyml): Define. + (ro_u_natdev): Define. + +2014-10-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Set d_type + for virtual directories. + +2014-10-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (fhandler_proc::readdir): Set dirent d_type. + * fhandler_process.cc (fhandler_process::readdir): Ditto. + * fhandler_procnet.cc (fhandler_procnet::readdir): Ditto. + * fhandler_procsys.cc (fhandler_procsys::readdir): Ditto. + * fhandler_procsysvipc.cc (fhandler_procsysvipc::readdir): Ditto. + * fhandler_virtual.h (virt_ftype_to_dtype): Define new inline function + to generate dirent d_type from virtual_ftype_t. + +2014-10-08 Corinna Vinschen <corinna@vinschen.de> + + * common.din (ffsl): Export. + (ffsll): Export. + * syscalls.cc (ffs): Implement using GCC intrinsic. + (ffsl): Ditto. + (ffsll): Ditto. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2014-10-08 Christian Franke <franke@computer.org> + + * syscalls.cc (ffs): Fix crash of ffs (0x80000000) on 64 bit. + +2014-10-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (format_process_statm): Fix output of dirty + pages. Add linefeed. + +2014-09-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (proc_tab): Add entry for cygdrive symlink. + (format_proc_cygdrive): New function to implement /proc/cygdrive. + +2014-09-05 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (class exception): Remove unnecessary #ifdef. + * uinfo.cc (client_request_pwdgrp::client_request_pwdgrp): Fix length + counter to include trailing NUL. + + * sec_auth.cc (get_user_groups): Add experimental exception handler. + (get_user_local_groups): Ditto. + +2014-09-05 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Handle APPLICATION + PACKAGE AUTHORITY SIDs. + * winlean.h (DNLEN): Raise to 31. Explain why. + +2014-09-03 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (aclcheck32): Check for required default entries as well. + Enable check for missing CLASS_OBJ entries, now that setfacl creates + them. + +2014-09-02 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (aclsort32): Set errno to EINVAL if aclcheck32 failed. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Disallow user accounts + as groups. Add comment. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_pwdgrp::init): Fix comment. Rearrange code for + style. + (cygheap_pwdgrp::nss_init_line): Disable db_prefix and db_separator + settings. Add comment. + (pwdgrp::fetch_account_from_windows): Drop outdated comment. Fix code + fetching primary group gid of group setting in SAM description field. + Change comment accordingly. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Disallow creating an + entry for "NULL SID". + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Add comment. Handle NULL ACE for SUID, SGID, + and VTX bits. Create owner, group, other and NULL entries in the same + way and in the same order as alloc_sd. + (getacl): Skip NULL ACE. + +2014-08-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::facl): Drop CLASS_OBJ entry. + * fhandler_disk_file.cc (fhandler_disk_file::facl): Ditto in noacl case. + * sec_acl.cc (getacl): Compute useful fake CLASS_OBJ and DEF_CLASS_OBJ + permission bits based on how these values are generated on Linux. + Add comments to explain what the code is doing. + * security.cc (get_attribute_from_acl): Compute group permission based + on the actual primary group permissions and all secondary user and group + ACCESS_ALLOWED_ACEs to emulate Linux' behaviour more closely. + (check_access): Fix typos im comment. + * include/cygwin/acl.h (MIN_ACL_ENTRIES): Redefine as 3. + +2014-08-28 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Try the + FileFsSizeInformation information class on filesystems choking on + FileFsFullSizeInformation (I see you Netapp!) + +2014-08-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_pty_slave::fch_open_handles): Add bool parameter + to declaration. + * fhandler_tty.cc (fhandler_pty_slave::fch_open_handles): Add bool + parameter "chown". Only request WRITE_OWNER access when opening pty + synchronization objects if "chown" is set. + (fhandler_pty_slave::fchmod): Call fch_open_handles with new bool + parameter set to false. + (fhandler_pty_slave::fchown): Call fch_open_handles with new bool + parameter set to true. + * kernel32.cc (CreateFileMappingW): Fix default standard rights for + file mappings from READ_CONTROL to STANDARD_RIGHTS_REQUIRED to allow + changing the DACL (fixes "access denied" error in pinfo::set_acl). + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Change debug + output to print mode bits in octal. + * security.cc (alloc_sd): Ditto. + (set_file_attribute): Ditto. + +2014-08-27 Corinna Vinschen <corinna@vinschen.de> + + * ntea.cc (read_ea): Change left-over return to __leave. Fix + condition to close handle. Call NtClose rather than CloseHandle. + (write_ea): Fix condition to close handle. Call NtClose rather than + CloseHandle. + * security.cc (get_file_sd): Call pc.init_reopen_attr if a valid + incoming handle was given, pc.get_object_attr otherwise. + (set_file_sd): Ditto. + +2014-08-26 Corinna Vinschen <corinna@vinschen.de> + + * path.h (path_conv::init_reopen_attr): Change from void to returning + POBJECT_ATTRIBUTES. Take OBJECT_ATTRIBUTES reference as argument, not + pointer. + * fhandler_disk_file.cc: Throughout accommodate above change. + * syscalls.cc: Ditto. + * ntea.cc (read_ea): Don't set hdl to NULL if it's already NULL. Set + attr with pc.init_reopen_attr before trying to reopen file. + (write_ea): Ditto. + * security.cc (get_file_sd): Use pc.init_reopen_attr rather than + pc.get_object_attr when trying to reopen file. + (set_file_sd): Ditto. + +2014-08-25 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (san::leave/x86_64): Implement. + * cygtls.h (class tls_pathbuf): Move counter variables into a union. + Add 64 bit element _counters covering both counter variables to + optimize save and restore operations. + (class san/x86_64): Only store single 64 bit value. + (san::san/x86_64): Implement. + (san::leave/x86_64): Only declare here, as returns_twice function. + Explain why. + (class san/i686): Change type of _c_cnt and _w_cnt to uint32_t. + (__try/x86_64): Move definition of __sebastian after the first memory + barrier. Drop __sebastian.setup call. + +2014-08-25 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::remove): Revert previous patch. + * cygtls.h (struct _local_storage): Move pathbufs back here. + (class san/x86_64): Revert class. Save and restore pathbufs counters + only. + (class san/i686): Revert saving and restoring pathbufs counters. + (__try/x86_64): Add a san variable and call it's setup method. + (__except/x86_64): Call san::leave to restore pathbufs counters. + * gendef (_sigbe): Revert previous change. + * thread.cc (verifyable_object_state): Remove gcc 4.7 workaround in + forward declaration as well. + * tls_pbuf.cc (tls_pbuf): Revert previous change. + * tls_pbuf.h (class tmp_pathbuf): Accommodate reverting pathbufs to + locals structure. + * tlsoffsets.h: Regenerate. + * tlsoffsets64.h: Regenerate. + +2014-08-21 Corinna Vinschen <corinna@vinschen.de> + + * Throughout, use __try/__except/__endtry blocks, rather than myfault + handler. + * cygtls.cc (_cygtls::remove): Accommodate the fact that pathbufs + has been moved from _local_storage to _cygtls. + * cygtls.h (class tls_pathbuf): Add comment to hint to gendef usage + of counters. Change type of counters to uint32_t for clarity. + Remove _cygtls as friend class. + (struct _local_storage): Move pathbufs from here... + (struct _cygtls): ...to here, allowing to access it from _sigbe. + (class san): Only define on 32 bit. Remove errno, _c_cnt and _w_cnt + members. + (san::setup): Drop parameter. Don't initialize removed members. + (san::leave): Don't set removed members. + (class myfault): Only define on 32 bit. + (myfault::faulted): Only keep implementation not taking any parameter. + Drop argument in call to sebastian.setup. + (__try/__leave/__except/__endtry): Implement to support real SEH. For + now stick to SJLJ on 32 bit. + * dcrt0.cc (dll_crt0_0): Drop 64 bit call to + exception::install_myfault_handler. + * exception.h (exception_handler): Define with EXCEPTION_DISPOSITION + as return type. + (PDISPATCHER_CONTEXT): Define as void * on 32 bit. Define as pointer + to _DISPATCHER_CONTEXT on 64 bit. + (class exception): Define separately for 32 and 64 bit. + (exception::myfault): Add handler for myfault SEH handling on 64 bit. + (exception::exception): Fix mangled method name to account for change + in type of last parameter. + (exception::install_myfault_handler): Remove. + * exceptions.cc (exception::myfault_handle): Remove. + (exception::myfault): New SEH handler for 64 bit. + * gendef (_sigbe): Set tls_pathbuf counters to 0 explicitely when + returning to the caller. + * ntdll.h: Move a comment to a better place. + (struct _SCOPE_TABLE): Define on 64 bit. + * thread.cc (verifyable_object_isvalid): Remove gcc 4.7 workaround. + * tls_pbuf.cc (tls_pbuf): Fix to accommodate new place of pathbufs. + (tls_pathbuf::destroy): Change type of loop variables to uint32_t. + * tls_pbuf.h (class tmp_pathbuf): Change type of buffer counters to + uint32_t. Accommodate new place of pathbufs. + * tlsoffsets.h: Regenerate. + * tlsoffsets64.h: Regenerate. + +2014-08-21 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (__import_address): Cover the first dereference to imp + under the fault handler. + +2014-08-21 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (if_freenameindex): Don't catch a SEGV from free to fail + loudly on double free. + +2014-08-21 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (rmdir): Don't skip deleting fh in the ENOTEMPTY case. + +2014-08-20 Corinna Vinschen <corinna@vinschen.de> + + * tls_pbuf.h (tmp_pathbuf::tmp_pathbuf): Convert to inline method. + (tmp_pathbuf::~tmp_pathbuf): Ditto. + * tls_pbuf.cc (tmp_pathbuf::tmp_pathbuf): Remove here. + (tmp_pathbuf::~tmp_pathbuf): Ditto. + +2014-08-19 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (dirfd): Per POSIX, return EINVAL on invalid directory stream. + (telldir): Per POSIX, return -1 and set errno to EBADF, rather than + just returning 0, on invalid directory stream. + * signal.cc (sigwaitinfo): Return -1, not EFAULT, when SEGV was catched. + +2014-08-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (enum conn_state): Add "connect_credxchg" state. + (class fhandler_socket): Grant another bit to connect_state flag. + * fhandler_socket.cc (fhandler_socket::af_local_connect): Rearrange + variable definition. Set connect_state to connect_credxchg. + (fhandler_socket::af_local_accept): Ditto. + (fhandler_socket::recv_internal): Accept connect_credxchg on connection + oriented AF_LOCAL sockets as well to allow the credential exchange. + Extend comment to explain. + +2014-08-19 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Replace WNet[...]A with WNet[...]W imports. + * dcrt0.cc (initial_env): Drop strlwr calls. Call strcasestr instead. + * fhandler_netdrive.cc: Throughout, convert to calling WNet UNICODE + functions. Use tmp_pathbuf rather than alloca. Replace call to + strlwr with call to RtlDowncaseUnicodeString. + +2014-08-19 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_serial::is_tty): Reinstantiate. + +2014-08-18 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (strlwr): Rename from cygwin_strlwr. Drop __stdcall + decoration. + (strupr): Rename from cygwin_strupr. Drop __stdcall decoration. + * string.h (strlwr): Remove override macro. Simply declare. + (strupr): Ditto. + +2014-08-18 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::init_std_file_from_handle): Mention that console + handles are kernel objects since Windows 8. + * fhandler.h (enum conn_state): Add "listener" state. + (class fhandler_socket): Drop listener status flag. + (fhandler_socket::lseek): Return -1 and errno ESPIPE. + (fhandler_serial::lseek): Ditto. + (fhandler_serial::is_tty): Remove. + * fhandler_socket.cc (fhandler_socket::listen): Set connect_state to + listener. Add comment. + (fhandler_socket::accept4): Explicitely check if the socket is listening + and fail with EINVAL, if not. Explain why we have to do that. + (fhandler_socket::recv_internal): Explicitely check if the socket is + connected if it's a stream socket. Explain why we have to do that. + (fhandler_socket::getpeereid): Drop now redundant test. + +2014-08-15 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (_GNU_SOURCE): Define. Explain why. + * configure.ac: Convert to new AC_INIT style. + * configure: Regenerate. + +2014-08-15 Corinna Vinschen <corinna@vinschen.de> + + * cygerrno.h (seterrno): Define as (always) inline function. + * errno.cc (seterrno): Remove. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.sgml: Remove. + * dtable.sgml: Move into ../doc/misc-funcs.xml. + * external.sgml: Ditto. + * stackdump.sgml: Ditto. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * security.sgml: Move to ../doc dir and rename to logon-funcs.xml. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * path.sgml: Move to ../doc dir and rename to path.xml. + * posix.sgml: Move to ../doc dir and rename to posix.xml. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * dlmalloc.c: Remove unused file. + * dlmalloc.h: Ditto. + * malloc.cc: Update to Doug Lea's malloc version 2.8.6. + +2014-08-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 33. + (CYGWIN_VERSION_API_MINOR): Bump to reflect intermediate 1.7.32 release. + +2014-08-11 Corinna Vinschen <corinna@vinschen.de> + + * cpuid.h: Add missing copyright header. Fix formatting. Use uint32_t + instead of unsigned throughout. Change functions to static inline and + always inline. + (cpuid): Add parameter to set ecx, allowing to request extended CPUID + info. + * fhandler_proc.cc (format_proc_cpuinfo): Use uint32_t instead of + unsigned throughout. Add fake decimal places to MHz info. Handle more + feature flags. + * fhandler_random.cc (fhandler_dev_random::write): Allow up to 4K + input to add entropy. + * syscalls.cc: Drop including cpuid.h. + +2014-08-07 Yaakov Selkowitz <yselkowi@redhat.com> + + * common.din (__cxa_finalize): Export. + * dcrt0.cc (cygwin_atexit): Use d->handle with __cxa_atexit. + * dll_init.cc (dll_list::detach): Use d->handle with __cxa_finalize. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Use 274 for + __cxa_finalize as well. + +2014-08-04 Anthony Heading <anthony@ajrh.net> + + * include/sys/file.h: Add extern "C". + +2014-08-04 Corinna Vinschen <corinna@vinschen.de> + + * common.din (__cxa_atexit): Export. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump to 274. + +2014-08-04 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Drop "plus_prepended" + as naming style. Drop enum name_style_t, use a boolean + "fully_qualified_name" value instead. Rework function to drop + "plus_prepended" handling througout and default to "name only" style + as replacement. + +2014-07-31 Eric Blake <eblake@redhat.com> + + * include/pthread.h: Decorate attribute names with __, for + namespace safety. + * include/cygwin/core_dump.h: Likewise. + * include/cygwin/cygwin_dll.h: Likewise. + * include/sys/cygwin.h: Likewise. + * include/sys/strace.h: Likewise. + +2014-07-30 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix comment. + +2014-07-29 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class cygheap_domain_info): Remove lowest_tdo_posix_offset. + * ldap.cc (cyg_ldap::fetch_posix_offset_for_domain): Return UINT32_MAX + in case of error. + * security.h (PRIMARY_POSIX_OFFSET): Define. + (NOACCESS_POSIX_OFFSET): Define. + (UNUSABLE_POSIX_OFFSET): Define. + * uinfo.cc (cygheap_domain_info::init): Drop initializing + lowest_tdo_posix_offset. + (pwdgrp::fetch_account_from_file): Set PosixOffset to either + UNUSABLE_POSIX_OFFSET or NOACCESS_POSIX_OFFSET in case we don't get a + sensible offset from AD. Explain why. Drop setting ch + lowest_tdo_posix_offset. + (pwdgrp::fetch_account_from_windows): Replace constant 0x100000 with + PRIMARY_POSIX_OFFSET throughout. + +2014-07-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::send_internal): Fix value of + out_len when tweaking the last buffer so out_len is correct in a + subsequent if expression. + +2014-07-21 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::init_mainthread): Initialize thread mutex to + type PTHREAD_MUTEX_RECURSIVE, just as for any other thread. + +2014-07-21 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 32. + +2014-07-21 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc: Fix typo in comment. + +2014-07-16 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::create): Handle stackaddr as upper bound address. + Add comment. + (pthread_attr_setstack): Store upper bound address in stackaddr. + Explain why. + (pthread_attr_getstack): Handle stackaddr as upper bound address. + Add comment. + (pthread_attr_setstackaddr): Add comment. + (pthread_attr_getstackaddr): Add comment. + (pthread_attr_getstacksize): Return default stacksize if stacksize has + not been set by the application, just as on Linux. Add comment. + (pthread_getattr_np): Store upper bound address in stackaddr. Explain + why. + * include/pthread.h: Remove outdated comment. + (pthread_attr_getstackaddr): Mark as deprecated, as on Linux. + (pthread_attr_setstackaddr): Ditto. + +2014-07-15 Christopher Faylor <me.cygwin2014@cgf.cx> + + * sigproc.cc (sigproc_init): Set aside more buffer space for signal + pipes. + (sig_send): Retry WriteFiles which fail when there is no error but + packbytes have not been sent. + +2014-07-15 Christopher Faylor <me.cygwin2014@cgf.cx> + + * sigproc.cc (send_sig): Don't report an error if WriteFile succeeds. + +2014-07-14 Christopher Faylor <me.cygwin2014@cgf.cx> + + * sigproc.cc (send_sig): Fix bad format in diagnostic output. + +2014-07-14 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_domain_info::init): Correctly set + lowest_tdo_posix_offset to UNIX_POSIX_OFFSET. + (fetch_posix_offset): Redesign to fake a POSIX offset in all cases + where we can't fetch a non-0 POSIX offset from our primary domain. + +2014-07-14 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * thread.cc (pthread_mutex::pthread_mutex): Change default type + to PTHREAD_MUTEX_NORMAL. + (pthread_mutex::unlock): Return EPERM if the mutex has no owner and + the mutex type is PTHREAD_MUTEX_ERRORCHECK, as on Linux. + (pthread_mutexattr::pthread_mutexattr): Ditto. + (pthread_mutex_unlock): Do not fail if mutex is a normal mutex + initializer. + * include/pthread.h (PTHREAD_MUTEX_INITIALIZER): Redefine as + PTHREAD_NORMAL_MUTEX_INITIALIZER_NP. + +2014-07-09 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::create): Use PTHREAD_DEFAULT_STACKSIZE stacksize + if attr.stacksize is 0. + (pthread_attr::pthread_attr): Initialize stacksize to 0 to align more + closely to Linux. + (pthread_attr_getstack): Fix incorrect stackaddr computation. Return + stackaddr just like pthread_attr_getstackaddr. Remove slightly off + comment. + (pthread_attr_getstackaddr): Remove slightly off comment. + (pthread_getattr_np): Return stackaddr and stacksize based on the full + allocated stackarea. + +2014-07-09 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (exception::myfault_handle): Rephrase comment. + +2014-07-09 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (exception::myfault_handle): Fix typo in comment. + +2014-07-07 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (exception::myfault_handle): Disable handling + STATUS_STACK_OVERFLOW. Explain why. + +2014-07-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::send_internal): Improve loop to + write streams in chunks of wmem() bytes to raise performance when + writing small buffers. Rename variables and add comments to help + understanding the code in years to come. + +2014-07-07 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (pg_ent::enumerate_ad): Revert to simply skipping a domain + if opening the connection to the domain fails. + +2014-07-07 Pierre Humblet <Pierre.Humblet@ieee.org> + Corinna Vinschen <corinna@vinschen.de> + + * libc/minires.c (minires_dprintf): Change "Minires" to "Resolv" to + differ from external minres lib. + (res_nquerydomain): Fix off-by-one in domain concatenation. Add debug + output. + +2014-07-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Add debug + output. + +2014-06-25 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Fix order of SERVICE_REQUEST_TIMEOUT. + +2014-06-25 Corinna Vinschen <corinna@vinschen.de> + + * errno.cc (errmap): Handle Windows error codes ERROR_CANCELLED, + ERROR_CONNECTION_REFUSED, ERROR_DEV_NOT_EXIST, ERROR_DS_GENERIC_ERROR, + ERROR_NOT_ENOUGH_QUOTA, ERROR_SERVICE_REQUEST_TIMEOUT, ERROR_TIMEOUT, + ERROR_UNEXP_NET_ERR. + * ldap.cc (cyg_ldap::map_ldaperr_to_errno): Drop explicit LDAP_TIMEOUT + handling. + +2014-06-25 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (cyg_ldap::map_ldaperr_to_errno): Explicitely map LDAP_TIMEOUT + to EIO. + +2014-06-25 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (ldap_search_sW): Replace ldap_search_stW. + (LdapMapErrorToWin32): Import. + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Accommodate + change to cyg_ldap::open. + * ldap.cc (CYG_LDAP_TIMEOUT): Remove. + (CYG_LDAP_ENUM_TIMEOUT): Remove. + (def_tv): Remove. + (enum_tv): Remove. + (cyg_ldap::map_ldaperr_to_errno): New method to map LDAP error codes to + POSIX errno codes. Explicitly map LDAP_NO_RESULTS_RETURNED to ENMFILE. + (cyg_ldap::wait): Ditto. + (struct cyg_ldap_init): New struct. + (cyg_ldap::connect_ssl): Return ULONG. Drop setting LDAP_OPT_TIMELIMIT. + Add call to ldap_search_sW to fetch root DSE. + (cyg_ldap::connect_non_ssl): Ditto. + (ldap_init_thr): New static thread function. + (cyg_ldap::connect): New method to call connect_ssl/connect_non_ssl in + an interruptible cygthread. + (struct cyg_ldap_search): New struct. + (cyg_ldap::search_s): New method to perform generic synchronous search. + (ldap_search_thr): New static thread function. + (cyg_ldap::search): New method to call search_s in an interruptible + cygthread. + (struct cyg_ldap_next_page): New struct. + (cyg_ldap::next_page_s): New method to perform generic synchronous + paged search. + (ldap_next_page_thr): New static thread function. + (cyg_ldap::next_page): New method to call next_page_s in an + interruptible cygthread. + (cyg_ldap::open): Return POSIX errno. Call connect method. + (cyg_ldap::fetch_ad_account): Call search method rather than + ldap_search_stW. + (cyg_ldap::enumerate_ad_accounts): Return POSIX errno. Use infinite + timeout in call to ldap_search_init_pageW. + (cyg_ldap::next_account): Return POSIX errno. Call next_page method + rather than ldap_get_next_page_s. + (cyg_ldap::fetch_posix_offset_for_domain): Call search method rather + than ldap_search_stW. + (cyg_ldap::fetch_unix_sid_from_ad): Ditto. + (cyg_ldap::fetch_unix_name_from_rfc2307): Ditto. + * ldap.h (class cyg_ldap): Accommodate aforementioned changes. + * passwd.cc (pg_ent::enumerate_ad): Ditto. Break search if one of + cyg_ldap::enumerate_ad_accounts or cldap.next_account returns with + an error code other than ENMFILE. + * sec_helper.cc (cygpsid::get_id): Accommodate change to cyg_ldap::open. + * uinfo.cc (fetch_posix_offset): Ditto. + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (find_exec): Initialize err (CID 60111). + * strace.cc (strace::activate): Fix potential buffer overrun (CID 59938) + * syscalls.cc (popen): Close parent pipe descriptor via fclosing fp on + error to avoid resource leak (CID 59981). + * thread.cc (pthread::exit): Avoid accessing cygtls member after + deleting "this" (CID 60217). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (start_thread_socket): Delete si on early return in case of + an error (CID 59967). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * regex/regcomp.c (computematchjumps): Free local memory in case of + error (CID 59975). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Define dir in the outermost scope to avoid + accessing out-of-scope value (CID 60027). Always initialize attr to + upath (CID 60113). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * malloc_wrapper.cc (mallinfo): Initialize m if external malloc is used, + too (CID 60120). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzload): Fix leaking memory (CID 60001). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (try_to_debug): Free environment pointer when not used + anymore (CID 59968). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getaddrinfo): Fix value of hint->ai_addrlen on 64 bit. + Explain why. + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (regopt): Allocate small local buffer to avoid copying + twice. Fixes resource leak (CID 60012). Add comment. + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (dll_list::alloc): Fix buffer overrun (CID 59940). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (insert_file): Fix resource leaks (CIDs 59987, 59988). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (CYG_LDAP_TIMEOUT): Set to 5 secs. + (CYG_LDAP_ENUM_TIMEOUT): New timeout value for enumeration only. Set + to 60 secs. + (CYG_LDAP_ENUM_PAGESIZE): Define as number of entries per single + search page. Set to 100. Use throughout. + (def_tv): Rename from tv. Use throughout. + (enum_tv): New variable. Use in call to ldap_get_next_page_s. + +2014-06-17 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (CYG_LDAP_TIMEOUT): Define as timeout value. Set to 30 secs + for now. Use throughout. + * uinfo.cc (colon_to_semicolon): New local function. + (pwdgrp::fetch_account_from_windows): Convert all colons in AD gecos + entry to semicolons. + +2014-06-17 David Stacey <drstacey@tiscali.co.uk> + + * libc/rexec.cc (cygwin_rexec): Make ahostbuf static to avoid returning + an out-of-scope address. + +2014-06-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::evaluate_events): Call + WSASetLastError after setsockopt. Explain why. + +2014-06-16 Denis Excoffier <cygwin@Denis-Excoffier.org> + + * grp.cc (getgrouplist): Fix setting ngroups to make sure to return + the right value. + +2014-06-05 Christopher Faylor <me.cygwin2014@cgf.cx> + + * timer.cc (timer_tracker::cancel): Demote api_fatal to system_printf, + printing more details about odd failure condition. + +2014-05-23 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (ldap_memfreeW): Remove. + (ldap_msgfree): Import. + * ldap.cc: Throughout, use ldap_msgfree to free LDAPMessage memory, + rather than ldap_memfreeW. + (cyg_ldap::next_account): Immediately abandon search when quiting from + search. + +2014-05-22 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (ldap_abandon): Remove. + (ldap_count_entries): Import. + (ldap_get_next_page_s): Import. + (ldap_result): Remove. + (ldap_searchW): Remove. + (ldap_search_abandon_page): Import. + (ldap_search_init_pageW): Import. + * ldap.cc (cyg_ldap::close): Use ldap_search_abandon_page to abandon + search. Reset srch_id, srch_msg and srch_entry. + (cyg_ldap::enumerate_ad_accounts): Use paged search to overcome server + side search result set restriction. + (cyg_ldap::next_account): Ditto. + * ldap.h (class cyg_ldap): Add members srch_id, srch_msg and srch_entry. + Remove member msg_id. + (cyg_ldap::cyg_ldap): Change initialization accordingly. + +2014-05-22 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_server_groups): Call get_user_local_groups only if + get_logon_server succeeded. + +2014-05-22 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (cyg_ldap::fetch_ad_account): Take additional domain string + parameter. Convert into likely rootDSE string if not NULL, and use in + subsequent call to ldap_search_stW. Add comment to explain that this + is not the exactly correct solution. + * ldap.h (cyg_ldap::fetch_ad_account): Change prototype accordingly. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Always use loc_ldap + in call to fetch_posix_offset to make sure we're fetchoinmg the posix + offsets from *our* domain controller. Only set domain variable to + non-NULL if the account is from a trusted domain. Use domain in call + to cyg_ldap::fetch_ad_account. + +2014-05-22 Corinna Vinschen <corinna@vinschen.de> + + * gmon.h: Pull in profile.h. Explain why. + +2014-05-22 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix potential SEGV + referencing NULL pointer. + +2014-05-22 Corinna Vinschen <corinna@vinschen.de> + + * libc/bsdlib.cc (forkpty): Close master and slave if fork fails to + avoid resource leak (CID 59997). + * libc/fts.c: Update to FreeBSD version 1.39 (CID 59947). + * libc/minires.c (minires_get_search): Fix out-of-bounds read from + words array (CID 59937). + +2014-05-20 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (delete_lock_in_parent): Use LIST_FOREACH_SAFE to avoid + dereferencing freed pointer (CID 60224). + +2014-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsysvipc.cc (format_procsysvipc_msg): Rearrange code to + avoid resource leakage (CID 60002). Don't use tmp_pathbuf, explain why. + Fix indentation. + (format_procsysvipc_sem): Ditto. + (format_procsysvipc_shm): Ditto (CID 60003). + +2014-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (get_mem_values): Rearrange code slightly to + avoid resource leakage (CID 59973). + (format_process_stat): Drop temporary variable wcmd and avoid + string copy without length check (CID 60050). + (format_process_status): Ditto (CID 60051). + +2014-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_swaps): Use tmp_pathbuf for filename, + rather than allocating and forgetting to free (CID 59982). + +2014-05-20 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Fix floppy + drive handling broken with 1.7.19. + +2014-05-20 Corinna Vinschen <corinna@vinschen.de> + + * scandir.cc (scandir): Assume namelist is always valid, per POSIX. + (CID 60021). + * sec_auth.cc (cygwin_logon_user): Securely erase password copy. + (lsaprivkeyauth): Avoid trying to dereference data if no key is stored + in the registry (CID 60122). Securely erase passwords after usage. + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * pseudo-reloc.cc (__report_error): Raise size of module name buffer to + PATH_MAX. Fix length in call to GetModuleFileNameW (CID 59947). + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (call_gaa): Fix setting pa_ret pointer in case of an error + from GetAdaptersAddresses (CID 60218). + (get_ifs): Add missing braces in AF_INET6 case which broke netmask + computation. Break out of loop if prefix gets <= 0 (CID 59939). + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 31. + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (handle_to_fn): Fix length parameter in call to + QueryDosDeviceW (CID 59936). + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (pinfo_basic::pinfo_basic): Fix size of progname array in + call to GetModuleFileNameW (CID 59935). + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * smallprintf.cc (__small_vsprintf): Add missing break in 'C' case. + +2014-05-19 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (try_to_debug): Fix size of dbg_cmd (CID 59929). + +2014-05-18 David Stacey <drstacey@tiscali.co.uk> + + * syscalls.cc (getusershell): Fix buffer overrun (Coverity ID 59932). + +2014-05-15 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Use local name buffer instead of + allocated one in CW_CYGNAME_FROM_WINNAME. + +2014-05-15 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump to 273. + +2014-05-15 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Implement CW_CYGNAME_FROM_WINNAME. + Add lengthy comment to explain what we do and why. + * include/sys/cygwin.h (cygwin_getinfo_types): Add + CW_CYGNAME_FROM_WINNAME. + +2014-05-14 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_server_groups): Call get_logon_server only for + non-builtin accounts. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Check incoming + account name for validity in terms of the current name prefixing rules + and refuse invalid names. + +2014-05-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::ioctl): Handle the different + ideas of u_long between Winsock and Cygwin applications on x86_64. + Add long comment. + +2014-05-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * signal.cc (sigprocmask): Fix strace output to include "how". + + * fhandler_console.cc (dev_console::save_restore): Only save current + dwEnd line rather than the one after that. + +2014-05-08 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::init): Fix formatting in debug output. + (struct cyg_USER_INFO_24): Define temporarily. Explain why. + (pwdgrp::fetch_account_from_windows): Handle sane primary group + setting for Microsoft Accounts. Explain why. + * wincap.h (wincaps::has_microsoft_accounts): New element. + * wincap.cc: Implement above element throughout. + +2014-05-08 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (gr_ent::enumerate_caches): Fix copy/paste bug introducing + an endless loop. + +2014-05-07 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (pwdgrp::parse_passwd): Fix an off by one computing the + buffer len. Add comment. + * uinfo.cc (internal_getlogin): Fix typo in comment. + +2014-05-07 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Tweak SID<->uid + conversion to cover S-1-5-113, S-1-5-114, and S-1-5-1000 groups. + +2014-05-07 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (pwdgrp::parse_group): Set grp.len. Drop generating any + gr_mem entries. + (getgrgid_r): Don't try to copy gr_mem entries. Always set gr_mem + to an empty list. + (getgrnam_r): Ditto. + (app_gr): New static struct to store group data propagated to the + calling application via getgrgid/getgrnam. + (getgr_cp): Fill app_gr and return pointer to app_gr.g. + (getgrgid32): Call getgr_cp. + (getgrnam32): Ditto. + * passwd.cc (pwdgrp::parse_passwd): Set res.len. + (app_pw): New static struct to store passwd data propagated to the + calling application via getpwuid/getpwnam. + (getpw_cp): Fill app_pw and return pointer to app_pw.p. + (getpwuid32): Cal getpw_cp. + (getpwnam): Ditto. + * pwdgrp.h (struct pg_pwd): Add len member. + (struct pg_grp): Ditto. + +2014-05-06 Corinna Vinschen <corinna@vinschen.de> + + * security.h (MAX_SUBAUTH_CNT): Drop. Use SID_MAX_SUB_AUTHORITIES + instead throughout. + (MAX_SID_LEN): Drop. Use SECURITY_MAX_SID_SIZE instead throughout. + +2014-05-06 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Drop unused cygsid variable. + * sec_helper.cc (cygpsid::pstring): Use sid_sub_auth_count macro. + (cygsid::get_sid): Use MAX_SUBAUTH_CNT rather than wrong constant 8. + Don't call memcpy to copy subauthorities into SID, use assignment. + (cygsid::getfromstr): Use MAX_SUBAUTH_CNT rather than wrong constant 8. + * security.h (MAX_SUBAUTH_CNT): New definition. Set to 11 to cover + Microsoft Accounts. + (MAX_SID_LEN): Define in terms of SID member sizes and MAX_SUBAUTH_CNT. + (DBGSID): Use MAX_SUBAUTH_CNT to define size of SubAuthority array. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Handle Micosoft + Accounts. Handle them as well known group. Compare domain names + case-insensitive. + * winlean.h (PIPE_REJECT_REMOTE_CLIENTS): Drop temporary definition + since Mingw64 catched up. + (DNLEN): Redefine as 16. Explain why. + +2014-05-05 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_getsockopt): Rearrange code slightly and handle + TCP_NODELAY just like SO_KEEPALIVE and SO_DONTROUTE. + +2014-05-03 Christopher Faylor <me.cygwin2014@cgf.cx> + + * spawn.cc (av::setup): Eat trailing whitespace on #! script. + +2014-05-02 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler_dsp.cc (ioctl): Use _ioctl for recursive call. + +2014-04-26 Christopher Faylor <me.cygwin2014@cgf.cx> + + * DevNotes: Add entry cgf-000026. + * fhandler.h (fhandler_console::save_top): Save top of screen + coordinates. + * fhandler_console.cc (dev::save_restore): Record top of screen + coordinates. Clear entire buffer when restoring saved buffer and try + to position the cursor on the save relative place on the screen. + +2014-04-25 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (NT_TRANSACTIONAL_ERROR): Cover all status codes up to + STATUS_TRANSACTION_NOT_ENLISTED. + +2014-04-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: On x86_64, define u_long as __ms_u_long before + including the windows headers. Explain why. + (get_inet_addr): Convert ANY address to LOOPBACK address. Explain why. + (fhandler_socket::evaluate_events): Forcibly set SO_ERROR socket option + in case a connection attempt failed. Explain why. + (fhandler_socket::ioctl): Drop x86_64 re-definition of u_long here. + * fhandler_procnet.cc: On x86_64, define u_long as __ms_u_long before + including the windows headers. Explain why. + * net.cc: Ditto. + +2014-04-23 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (check_iovec): Allow 0 as valid iovcnt value. + +2014-04-22 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (user_attr): Remove "uid" attribute. + * ldap.h (LDAP_USER_NAME_ATTR): Remove. Change other attribute index + values as required. + (cyg_ldap::get_user_name): Remove inline function. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Remove code to handle + Cygwin username different from Windows username. + (pwdgrp::add_account_from_cygserver): Remove unnecessary cast. + +2014-04-18 Corinna Vinschen <corinna@vinschen.de> + + * winf.cc (linebuf::fromargv): Temporarily revert patch from 2014-01-24. + +2014-04-18 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (TP_NUM_C_BUFS): Raise to 50 to allow SYMLOOP_MAX recursions + path_conv <-> normalize_posix_path, plus a bit of buffer. + (TP_NUM_W_BUFS): Ditto. + (class san): Change type of _c_cnt and _w_cnt to unsigned. + * path.cc (normalize_posix_path): Guard recursion into path_conv + against tmp_pathbuf overflow. Generate normalized path in call to + path_conv. If the path is valid, replace dst with the normalized_path + from path_conv call. Add comment to explain why we're doing this. + * tls_pbuf.cc (tls_pathbuf::destroy): Only free buffers until the + first buffer pointer is NULL. + (tmp_pathbuf::c_get): Simplify error message. + (tmp_pathbuf::w_get): Ditto. + * tls_pbuf.h (class tmp_pathbuf): Change type of c_buf_old and w_buf_old + to unsigned. + (tmp_pathbuf::check_usage): New inline method to check if we have + enough tmp_pathbuf buffers left to call a function using tmp_pathbuf + buffers. + * tlsoffsets.h: Regenerate. + * tlsoffsets64.h: Regenerate. + +2014-04-16 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_setsockopt): Ignore IPV6_TCLASS the same way as IP_TOS. + +2014-04-12 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix gid evaluation + for local accounts. + +2014-04-10 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 30. + +2014-04-09 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (exception::myfault_handle): Only handle the minimum + amount of exceptions the myfault handler was designed for. + +2014-04-08 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in: (Temporarily?) workaround serious ld bug which + truncates symbols in certain computations to 32 bit. See + https://sourceware.org/bugzilla/show_bug.cgi?id=16821 + +2014-04-07 Corinna Vinschen <corinna@vinschen.de> + + * cygserver_ipc.h (ipc_set_proc_info): Add bool parameter to specify + whether or not to send signal_arrived. + * shm.cc (client_request_shm::client_request_shm): Call + ipc_set_proc_info with bool parameter set to true to not send + signal_arrived. + +2014-04-04 Corinna Vinschen <corinna@vinschen.de> + + * ntea.cc (EA_BUFSIZ): Fix comment. + (read_ea): Use tmp_pathbuf for local buffer rather than alloca. + Throughout change ZwQueryEaFile to NtQueryEaFile in comments. + +2014-04-04 Corinna Vinschen <corinna@vinschen.de> + + * ntea.cc (EA_BUFSIZ): Reduce to 64K. Add comment to explain why. + +2014-03-29 Christopher Faylor <me.cygwin2014@cgf.cx> + + * DevNotes: Add entry cgf-000025. + * exceptions.cc (_cygtls::signal_debugger): Reorganize to avoid + contacting the debugger if we have already done so via the exception + handler. Eliminate need for goto. Remove an ifdef in favor of just + allocating a larger buffer. + +2014-03-28 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): Install myfault exception handler on x86_64. + * exception.h (exception_list): Typedef as void on x86_64. + (exception::handler_installed): Remove. + (exception::handle_while_being_debugged): Remove. + (exception::myfault_handle): Declare for x86_64. + (exception::handle): Declare as ordinary exception handler on x86_64 + as well. + (exception::exception): Drop previous code (again). Install + exception::handle as SEH handler. + (exception::install_myfault_handler): New x86_64-only method to + install exception::myfault_handle as VEH handler. Explain why. + (exception::~exception): For x86_64, define frame end label (again). + * exceptions.cc (CYG_EXC_CONTINUE_EXECUTION): Drop definition. + (CYG_EXC_CONTINUE_SEARCH): Ditto. + (exception::myfault_handle): New x86_64-only method, VEH handler to + handle myfault exceptions. + (exception::handle): Define as ordinary exception handler on x86_64 + as well. Use ExceptionContinueExecution and ExceptionContinueSearch + throughout instead of deleted Cygwin macros. Don't handle myfault + exceptions on x86_64. + +2014-03-28 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (create_token): Initialize lsa handle to NULL, rather than + to INVALID_HANDLE_VALUE. + (lsaauth): Ditto. + (lsaprivkeyauth): Ditto. + * setlsapwd.cc (setlsapwd): Don't initialize lsa handle. + +2014-03-28 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::signal_debugger): Move memcpy to copy context + from incoming siginfo_t to thread_context, too. + +2014-03-27 Corinna Vinschen <corinna@vinschen.de> + + * gendef (_sigbe/x86_64): Fix typo in .seh_proc pseudo-op. + (setjmp/x86_64): Drop storing ExceptionList pointer in jmp_buf->Frame. + Drop comment. Store likely frame in rdx. Jump to __setjmpex. + (__setjmpex): New function providing setjmp functionality. Fetch + jmp_buf->Frame from rdx, like MSVCRT setjmpex. + (__sjfault/x86_64): Store rdx content in jmp_buf->Frame. + (__ljfault/x86_64): Don't restore ExceptionList pointer. + (longjmp/x86_64): Ditto. + +2014-03-19 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler_dsp.cc (fhandler_dev_dsp::ioctl): Actually pass ioctl + argument to _ioctl. + +2014-03-19 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (fhandler_dev_dsp): Remove variable names from + declarations. + (fhandler_dev_dsp::close_audio_in): Make __reg1. + (fhandler_dev_dsp::close_audio_out): Make __reg2. + * fhandler_dsp.cc (fhandler_dev_dsp::close_audio_in): Make __reg1. + (fhandler_dev_dsp::close_audio_out): Make __reg2. + (fhandler_dev_dsp::close): Don't abruptly terminate sound just because + we are exiting. + +2014-03-19 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (exception::handle_while_being_debugged): Declare. + (exception::exception): Install unhandled exception filter. + * exceptions.cc (exception::handle_while_being_debugged): New method. + +2014-03-19 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (pg_ent::enumerate_ad): Ignore primary domain in list of + trusted domains only if all trusted domains are enumerated anyway. + Explain why. + +2014-03-18 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler_dsp.cc (fhandler_dev_dsp::fixup_after_fork): Actually call + _fixup_after_fork rather than looping forever. + (fhandler_dev_dsp::fixup_after_exec): Ditto. + +2014-03-18 Corinna Vinschen <corinna@vinschen.de> + + Partially revert patch from 2014-03-04. + * exception.h (exception::handler_installed): Declare. + (exception::exception): Install vectored exception handler on x86_64. + (exception::~exception): Remove for x86_64. + * exceptions.cc (exception::handler_installed): Define. + +2014-03-17 Christopher Faylor <me.cygwin2014@cgf.cx> + + * sigproc.h (no_thread_exit_protect): New class. + * sigproc.cc (thread_exit): Use no_thread_exit_protect to determine if + we need to coordinate ThreadExit/ExitProcess. + * fhandler_dsp.cc (fhandler_dev_dsp::Audio_out::stop): Use + no_thread_exit_protect to kludge around waiting for waveOutClose as it + waits for a thread that never exits. + (fhandler_dev_dsp::Audio_in::stop): Ditto for waveInClose. + +2014-03-16 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (fhandler_dev_dsp::base): New method. + (fhandler_dev_dsp::_read): Ditto. + (fhandler_dev_dsp::_write): Ditto. + (fhandler_dev_dsp::_ioctl): Ditto. + (fhandler_dev_dsp::_fixup_after_fork): Ditto. + (fhandler_dev_dsp::_fixup_after_exec): Ditto. + * fhandler_dsp.cc (fhandler_dev_dsp::read): Call real function via + base() pointer. + (fhandler_dev_dsp::write): Ditto. + (fhandler_dev_dsp::ioctl): Ditto. + (fhandler_dev_dsp::fixup_after_fork): Ditto. + (fhandler_dev_dsp::fixup_after_exec): Ditto. + (fhandler_dev_dsp::_read): Rename by adding an leading underscore. + (fhandler_dev_dsp::_write): Ditto. + (fhandler_dev_dsp::_ioctl): Ditto. + (fhandler_dev_dsp::_fixup_after_fork): Ditto. + (fhandler_dev_dsp::_fixup_after_exec): Ditto. + +2014-03-12 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (enum cygheap_pwdgrp::cache_t): Remove. + (cygheap_pwdgrp::caching): Convert to bool. + (cygheap_pwdgrp::pwd_cache): Add cygserver member. + (cygheap_pwdgrp::grp_cache): Ditto. + (cygheap_pwdgrp::nss_db_caching): Drop. + (cygheap_pwdgrp::nss_db_full_caching): Drop. + (cygheap_pwdgrp::nss_cygserver_caching): New method. + (cygheap_pwdgrp::nss_disable_cygserver_caching): New method. + * cygserver.h (client_request::request_code_t): Add + CYGSERVER_REQUEST_PWDGRP. + * cygserver_pwdgrp.h: New file. + * cygtls.h (struct _local_storage): Remove pwbuf and grbuf members. + * grp.cc (pwdgrp::prep_tls_grbuf): Drop. + (internal_getgrsid): Handle cygserver caching and rearrange to check + the caches first. + (internal_getgrnam): Ditto. + (internal_getgrgid): Ditto. + (gr_ent::enumerate_caches): Handle cygserver cache. + * passwd.cc (pwdgrp::prep_tls_pwbuf): Drop. + (internal_getpwsid): Handle cygserver caching and rearrange to check + the caches first. + (internal_getpwnam): Ditto. + (internal_getpwuid): Ditto. + (pw_ent::enumerate_caches): Handle cygserver cache. + * pwdgrp.h (pwdgrp::add_account_from_cygserver): New method declaration. + (pwdgrp::fetch_account_from_cygserver): New method declaration. + (pwdgrp::prep_tls_pwbuf): Drop declaration. + (pwdgrp::prep_tls_grbuf): Drop declaration. + (pwdgrp::add_user_from_cygserver): New inline methods. + (pwdgrp::add_group_from_cygserver): New inline methods. + * tlsoffsets.h: Regenerate. + * tlsoffsets64.h: Regenerate. + * uinfo.cc (internal_getlogin): Call internal_getgroups if cygserver + caching is not available. + (cygheap_pwdgrp::init): Initialize pwd_cache.cygserver and + grp_cache.cygserver. Set caching to true. + (cygheap_pwdgrp::nss_init_line): Drop db_cache handling entirely. + (pwdgrp::add_account_from_windows): Drop no caching handling. + (client_request_pwdgrp::client_request_pwdgrp): New method. + (pwdgrp::fetch_account_from_cygserver): New method. + (pwdgrp::add_account_from_cygserver): New method. + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix formatting. + * include/sys/cygwin.h: Ditto. + +2014-03-12 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Avoid crash on + non-domain member machines if an unknown SID comes in. + +2014-03-12 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h (IPV6_JOIN_GROUP): Revert. + (IPV6_LEAVE_GROUP): Ditto. + +2014-03-10 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (dev_console::b): Redefine as CONSOLE_SCREEN_BUFFER_INFO + for use with older OS. + * fhandler_console.cc (dev_console::fillin): Ditto for + GetConsoleScreenBufferInfo. + +2014-03-10 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler_console.cc (dev_console::save_restore): Save entire line of + current cursor position. + +2014-03-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler_console.cc (fhandler_console::save_restore): Save only until + last written row and, because of this, don't bother trying to restore + the screen buffer size. Set cursor position after refilling buffer. + (fhandler_console::write): Use absolute paths when saving/restoring + cursor position or suffer odd problems after a saved screen is + restored. + +2014-03-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (fhandler_console::dwBufferSize): Delete. + (fhandler_console::dwCursorPosition): Ditto. + (fhandler_console::wAttributes): Ditto. + (fhandler_console::b): New field encompassing previously disparate + screen buffer info. + (fhandler_console::save_bufsize): Rename from savebufsiz + (fhandler_console::save_buf): Rename sfrom savebuf. + (fhandler_console::save_cursor): New field. + (fhandler_console::save_restore): New function. + (fhandler_console::con): Rename from dev_state. + (fhandler_console::focus_aware): Accommodate name change. + * fhandler_console.cc: Use 'b' field of dev_console throughout instead + of disparate names. Accommodate dev_state -> con rename. + (dev_state:save_restore): New function. Attempt to save the entire + screen buffer rather than just the visible part. Clear the buffer when + saving, like Linux. + (fhandler_console::char_command): Use con.save_restore() for + Save/restore screen sequence. + +2014-03-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * sigproc.cc (_cygtls::remove_wq): Reset thread_ev inside of lock. Set + to NULL when done. + +2014-03-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler_console.cc (fhandler_console::char_command): Properly use + calculated value rather than directly using dev_state.args[0]. + +2014-03-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * dir.cc (opendir): Propagate any errno from build_fh_name. + +2014-03-07 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h (pwdgrp::is_passwd): New inline method. + (pwdgrp::is_group): New inline method. + (add_account_from_windows): Drop group argument from declaration. + (fetch_account_from_windows): Ditto. + (check_file): Ditto. + (add_user_from_windows): Call add_account_from_windows accordingly. + (add_group_from_windows): Ditto. + * uinfo.cc (pwdgrp::add_account_from_windows): Drop group argument. + Use is_group method instead. + (pwdgrp::check_file): Ditto. + (pwdgrp::fetch_account_from_windows): Ditto. + * grp.cc: Accommodate aforementioned changes. + * passwd.cc: Ditto. + +2014-03-06 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (pg_ent::enumerate_builtin): Convert pwd_builtins and + grp_builtins to array of cygpsid pointers. Replace SID strings with + pointers to well known SIDs. + * sec_helper.cc (well_known_local_service_sid): Define. + (well_known_network_service_sid): Define. + (trusted_installer_sid): Define. + * security.h (well_known_local_service_sid): Declare. + (well_known_network_service_sid): Declare. + (trusted_installer_sid): Declare. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Throughout set acc_type + to SidTypeUnknown if LookupAccountXXX function failed. Create + simplified passwd entry for non-user accounts, except for LocalSystem. + Add comment. + +2014-03-06 Corinna Vinschen <corinna@vinschen.de> + + * setlsapwd.cc (setlsapwd): Use RtlSecureZeroMemory to delete password + from memory. + +2014-03-05 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (rediscover_thread): Remove. + (cyg_ldap::open): Remove code to rediscover DC. It just won't do the + right thing. + (cyg_ldap::enumerate_ad_accounts): Change to be self-sufficient (no + explicit open call required). Enumerate on a DC of the domain itself + instead of relying on delegation. Remove ill-advised code trying to + generate rootdse from domain name. + * passwd.cc (pg_ent::enumerate_ad): Drop explicit call to + cyg_ldap::open. + +2014-03-05 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h (__TM_GMTOFF): Define. + (__TM_ZONE): Define. + +2014-03-05 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc: Define TM_GMTOFF and TM_ZONE based on __TM_GMTOFF and + __TM_ZONE being defined. Throughout, write to these struct tm members + only if CYGWIN_VERSION_CHECK_FOR_EXTRA_TM_MEMBERS is true. + * libc/strptime.cc: Ditto. + * include/cygwin/version.h (CYGWIN_VERSION_CHECK_FOR_EXTRA_TM_MEMBERS): + Define. + (CYGWIN_VERSION_API_MINOR): Bump to 272. + +2014-03-04 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (exception::handler_installed): Remove. + (exception::exception): Remove old code. Manually install SEH handler + instead. + (exception::~exception): For x86_64, define frame end label. + * exceptions.cc (exception::handler_installed): Remove. + +2014-03-03 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (exception::exception): Install vectored exception + handler rather than vectored continue handler. + +2014-03-03 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (cygpsid::get_id): Move Samba SID->uid/gid mapping + from get_sids_info here. + (get_sids_info): Vice versa. + * security.cc (convert_samba_sd): New static function to map a Samba + security descriptor to a security descriptor with UNIX users and groups + converted to Windows SIDs per RFC 2307 mapping. + (check_file_access): Call convert_samba_sd on Samba security + descriptors. + +2014-02-28 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Only fetch extended + user info if we're creating a passwd entry. Add comment. + +2014-02-28 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_user::sid): Return reference to cygpsid rather + than PSID. + (cygheap_user::saved_sid): Ditto. + (cygheap_pwdgrp::cache_t): New type. + (cygheap_pwdgrp::caching): Convert to cache_t. + (cygheap_pwdgrp::nss_db_caching): Change accordingly. + (cygheap_pwdgrp::nss_db_full_caching): New inline method. + * grp.cc (internal_getgroups): Reinvent. Take cyg_ldap pointer as + third parameter and use throughout. + (getgroups32): Call internal_getgroups. + * pwdgrp.h (internal_getgroups): Declare. + * uinfo.cc (internal_getlogin): Partial rewrite to accommodate having + no connection to the DC. Give primary group from user token more + weight. Generate group entries for all groups in the user token if + caching is set to NSS_FULL_CACHING. + (cygheap_pwdgrp::init): Initialize caching to NSS_FULL_CACHING. + (cygheap_pwdgrp::nss_init_line): Handle "db_cache: full". + (pwdgrp::add_account_from_windows): Fix group handling in non-caching + mode. + (pwdgrp::fetch_account_from_windows): Default primary group for the + current user to primary group from user token. Check for primary + domain first after LookupAccountSid failed. + +2014-02-27 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CheckTokenMembership): Import. + * external.cc (cygwin_internal): Call get_uid/get_gid instead of get_id. + * grp.cc (internal_getgrsid): Take additional cyg_ldap pointer. + Forward to pwdgrp::add_group_from_windows. + (internal_getgrnam): Ditto. + (internal_getgrgid): Ditto. + (gr_ent::enumerate_local): Drop ugid_caching bool from call to + pwdgrp::fetch_account_from_windows. + (getgroups32): Rename from internal_getgroups and drop getgroups32 stub. + Drop srchsid parameter and code handling it. Add local cyg_ldap + instance and forward to internal_getgrXXX. + (getgroups): Call getgroups32. + (get_groups): Add local cyg_ldap instance and forward to + internal_getgrXXX. + (getgrouplist): Ditto. + (setgroups32): Ditto. + * ldap.cc (cyg_ldap::open): Don't call close. Return true if connection + is already open. + (cyg_ldap::remap_uid): Forward this to internal_getpwsid. + (cyg_ldap::remap_gid): Forward this to internal_getgrsid. + * passwd.cc (internal_getpwsid): Take additional cyg_ldap pointer. + Forward to pwdgrp::add_user_from_windows. + (internal_getpwnam): Ditto. + (internal_getpwuid): Ditto. + (pg_ent::enumerate_builtin): Drop ugid_caching bool from call to + pwdgrp::fetch_account_from_windows. + (pg_ent::enumerate_sam): Ditto. + (pg_ent::enumerate_ad): Ditto. Forward local cldap instead. + * pwdgrp.h (internal_getpwsid): Align declaration to above change. + (internal_getpwnam): Ditto. + (internal_getpwuid): Ditto. + (internal_getgrsid): Ditto. + (internal_getgrgid): Ditto. + (internal_getgrnam): Ditto. + (internal_getgroups): Drop declaration. + (pwdgrp::add_account_from_windows): Align declaration to below change. + (pwdgrp::add_user_from_windows): Ditto. + (pwdgrp::add_group_from_windows): Ditto. + * sec_acl.cc (setacl): Add local cyg_ldap instance and forward to + internal_getpwuid and internal_getgrgid. + (getacl): Add local cyg_ldap instance and forward to cygpsid::get_id. + (aclfromtext32): Add local cyg_ldap instance and forward to + internal_getpwnam and internal_getgrnam. + * sec_helper.cc (cygpsid::get_id): Take additional cyg_ldap pointer. + Forward to internal_getgrsid and internal_getpwsid. + (get_sids_info): Drop ldap_open. Forward local cldap to + internal_getpwsid and internal_getgrXXX. Call CheckTokenMembership + rather than internal_getgroups. + * security.h (cygpsid::get_id): Add cyg_ldap pointer, drop default + parameter. + (cygpsid::get_uid): Add cyg_ldap pointer. Call get_id accordingly. + (cygpsid::get_gid): Ditto. + * uinfo.cc (internal_getlogin): Add local cyg_ldap instance and forward + to internal_getpwXXX and internal_getgrXXX calls. + (pwdgrp::add_account_from_windows): Take additional cyg_ldap pointer. + Forward to pwdgrp::fetch_account_from_windows. + (fetch_posix_offset): Drop ldap_open argument and handling. Get + cyg_ldap instance as pointer. + (pwdgrp::fetch_account_from_windows): Take additional cyg_ldap pointer. + Use it if it's not NULL, local instance otherwise. Drop ldap_open. + Drop fetching extended group arguments from AD for speed. + +2014-02-27 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (find_fast_cwd_pointer): Fix preceeding comment. + +2014-02-25 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (fhandler_console::scroll_buffer_screen): New function. + * fhandler_console.cc (fhandler_console::scroll_buffer_screen): New function. + (fhandler_console::char_command): Use scroll_buffer_screen as appropriate. + (dev_console::scroll_buffer): Remove if 0'ed block. + +2014-02-22 Christopher Faylor <me.cygwin2014@cgf.cx> + + * dev_console::scroll_buffer): Reinstate clipping region. + +2014-02-22 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (dev_console::is_fullscreen): Delete. + (dev_console::scroll_window): Return bool indicating success. + (dev_console::scroll_screen): New function. + (dev_console::clear_screen): New function. + (fhandler_console::clear_screen): Make __reg3. + (fhandler_console::cursor_set): Ditto. + (fhandler_console::cursor_get): Ditto. + (fhandler_console::cursor_rel): Ditto. + * fhandler_console.cc (dev_console::scroll_buffer): Adapt from + fhandler_console. + (fhandler_console::scroll_buffer): Use dev_console function. + (dev_console::is_fullscreen): Delete. + (dev_console::scroll_window): Return true if we cleared the screen. + Shrink/grow buffer first before scrolling to ensure that there is + sufficient space after scrolling. + (fhandler_console::clear_screen): Make reg3, use dev_console function. + (dev_console::clear_screen): New function adapted from + fhandler_console. + (fhandler_console::cursor_set): Make __reg3. + (fhandler_console::cursor_rel): Ditto. + (fhandler_console::cursor_get): Ditto. + (fhandler_console::write): Fix "reverse index". + +2014-02-22 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Add cases for CW_GETNSSSEP, + CW_GETPWSID and CW_GETGRSID. + * grp.cc (internal_getgrsid_from_db): New function. + * passwd.cc (internal_getpwsid_from_db): New function. + (pg_ent::setent): Add special case for call from mkpasswd/mkgroup. + * pwdgrp.h (internal_getpwsid_from_db): Declare. + (internal_getgrsid_from_db): Declare. + (enum nss_enum_t): Move to include/sys/cygwin.h. + (class pg_ent): Add comment. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix typo in comment. + Change "UNIX" to "Unix" in domain name. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GETNSSSEP, + CW_GETPWSID and CW_GETGRSID. + (enum nss_enum_t): Define here. + +2014-02-21 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h (pwdgrp::fetch_account_from_windows): Add bool parameter + to declaration, set to true by default. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Add bool parameter + "ugid_caching". Only add account to ugid_cache if set to true. + * grp.cc (gr_ent::enumerate_local): Call fetch_account_from_windows + with ugid_caching parameter set to false. + * passwd.cc (pg_ent::enumerate_builtin): Ditto. + (pg_ent::enumerate_sam): Ditto. + (pg_ent::enumerate_ad): Ditto. + +2014-02-20 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (getgrouplist): Fix previous fix so ret is only set to ngroups + if ngroups isn't too small. + +2014-02-20 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (get_groups): Don't add gid to list if it's ILLEGAL_GID. + (getgrouplist): Return number of groups, just like glibc. + +2014-02-19 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (pg_ent::setent): Initialize cygheap domain info. + * sec_auth.cc (get_logon_server): Ditto. + +2014-02-18 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (cygwin_internal): Handle new CW_SETENT, CW_GETENT and + CW_ENDENT info types. + * grp.cc (setgrent_filtered): New function, called from cygwin_internal. + (getgrent_filtered): Ditto. + (endgrent_filtered): Ditto. + * passwd.cc (pg_ent::setent): Set state explicitely to from_cache. + (pg_ent::getent): Handle the fact that a DC has no SAM and enumerating + local accounts is equivalent to enumerating domain accounts. + (setpwent_filtered): New function, called from cygwin_internal. + (getpwent_filtered): Ditto. + (endpwent_filtered): Ditto. + * pwdgrp.h (setpwent_filtered): Declare. + (getgrent_filtered): Ditto. + (endgrent_filtered): Ditto. + (setpwent_filtered): Ditto. + (getpwent_filtered): Ditto. + (endpwent_filtered): Ditto. + * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_SETENT, CW_GETENT, + and CW_ENDENT. + +2014-02-18 Corinna Vinschen <corinna@vinschen.de> + + * setlsapwd.cc (setlsapwd): Fix conditional expression after breaking + it on 2014-01-23. + +2014-02-17 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (ldap_abandon): Import. + (ldap_result): Import. + (ldap_searchW): Import. + (NetGroupEnum): Import. + (NetLocalGroupEnum): Import. + (NetUserEnum): Import. + * cygheap.h (class cygheap_pwdgrp): Add members enums and enum_tdoms. + (cygheap_pwdgrp::nss_db_enums): New inline method. + (cygheap_pwdgrp::nss_db_enum_tdoms): Ditto. + * cygtls.h (struct _local_storage): Drop unused members pw_pos and + grp_pos. + * grp.cc (grent): New static variable of class gr_ent. + (gr_ent::enumerate_caches): New method. + (gr_ent::enumerate_local): New method. + (gr_ent::getgrent): New method. + (setgrent): Call gr_ent method. + (getgrent32): Ditto. + (endgrent): Ditto. + * ldap.cc (sid_attr): Rename from nfs_attr. + (cyg_ldap::close): Abandon still running asynchronous search. + (cyg_ldap::fetch_ad_account): Reduce filter buffer size. + (cyg_ldap::enumerate_ad_accounts): New method. + (cyg_ldap::next_account): New method. + (cyg_ldap::fetch_posix_offset_for_domain): Reduce filter buffer size. + (cyg_ldap::fetch_unix_sid_from_ad): Ditto. Fix return value in case + no value has been read. + (cyg_ldap::fetch_unix_name_from_rfc2307): Reduce filter buffer size. + * ldap.h (class cyg_ldap): Add msg_id member. + (cyg_ldap::enumerate_ad_accounts): Declare. + (cyg_ldap::next_account): Declare: + * passwd.cc (pwent): New static variable of class pw_ent. + (pg_ent::clear_cache): New method. + (pg_ent::setent): New method. + (pg_ent::getent): New method. + (pg_ent::endent): New method. + (pg_ent::enumerate_file): New method. + (pg_ent::enumerate_builtin): New method. + (pg_ent::enumerate_sam): New method. + (pg_ent::enumerate_ad): New method. + (pw_ent::enumerate_caches): New method. + (pw_ent::enumerate_local): New method. + (pw_ent::getpwent): New method. + (setpwent): Call pw_ent method. + (getpwent): Ditto. + (endpwent): Ditto. + * pwdgrp.h (class pwdgrp): Define pg_ent, pw_ent and gr_ent as friend + classes. + (pwdgrp::add_account_post_fetch): Declare with extra bool parameter. + (pwdgrp::file_attr): New inline method. + (enum nss_enum_t): Define. + (class pg_ent): Define. + (class pw_ent): Define. + (class gr_ent): Define. + * tlsoffsets.h: Regenerate. + * tlsoffsets64.h: Ditto. + * uinfo.cc (cygheap_pwdgrp::init): Initialize enums and enum_tdoms. + (cygheap_pwdgrp::nss_init_line): Fix typo in preceeding comment. + Handle new "db_enum" keyword. + (pwdgrp::add_account_post_fetch): Take additional `bool lock' parameter + and acquire pglock before adding element to array if lock is true. + (pwdgrp::add_account_from_file): Call add_account_post_fetch with lock + set to true. + (pwdgrp::add_account_from_windows): Ditto in case of caching. + (pwdgrp::fetch_account_from_windows): Handle builtin aliases only + known to the domain controller. Only call NetLocalGroupGetInfo for + aliases. + +2014-02-16 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.h (NT_readline::close): New function to close handle. + (NT_readline::~NT_readline): Call close. + * sec_auth.cc (verify_token): Use constructor to initialize tok_usersid. + * security.h (cygsid::cygsid): Add copy constructor taking cygsid as + source. + +2014-02-16 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_1): Call initial_setlocale before fetching + current user information. + +2014-02-15 Christopher Faylor <me.cygwin2014@cgf.cx> + + * DevNotes: Add entry cgf-000024. + * fhandler.h (dev_console::state): Remove trailing underscore. + (dev_console::args): Ditto. + (dev_console::nargs): Ditto. + (dev_console::info): Eliminate subclass. + (dev_console::dwEnd): New field. + (dev_console::scroll_window): New function. + (dev_console::is_fullscreen): Ditto. + (dev_console::fillin): Rename from fillin_info. + (fhandler_console::scroll_buffer): Rename from scroll_screen. + * fhandler_console.cc: Throughout s/dev_state\.info/dev_state/g. + Accommodate other name changes. + (dev_console::fillin): Accommodate rename. Notice max x/y written to. + Forgo memset if GetConsoleScreenBufferInfo fails. + (fhandler_console::scroll_buffer): Accommodate rename. Don't treat y + coordinate of zero as top of screen. + (dev_console::is_fullscreen): New function. + (dev_console::scroll_window): Ditto. + (fhandler_console::clear_screen): Just scroll the screen when clearing + the screen in a state where the screen buffer is bigger than the + screen. + (fhandler_console::char_command): Try harder to get 'S' and 'T' working + in the presence of a screen buffer. Use temporary 'n' variable rather + than dev_state.args[0]. Use GNU ?: shortcut method. + +2014-02-14 Christopher Faylor <me.cygwin2014@cgf.cx> + + * pinfo.cc (winpids::add): Always copy pinfo structure when winpid. + Fill out dwProcessId explicitly to handle exec from a windows process. + (winpids::enum_processes): Reorganize to iterate over known cygwin pids + when !winpid. Simplify logic. Don't do duplicate detection for + winpid. + +2014-02-14 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Default to /bin/bash + as login shell. + +2014-02-13 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (cyg_ldap::fetch_posix_offset_for_domain): If domain name + has no dot, it's a Netbios name. Change the search filter expression + accordingly and filter by flatName. Add comment. + * uinfo.cc (cygheap_domain_info::init): Gracefully handle NULL + DnsDomainName and DomainSid members in DS_DOMAIN_TRUSTSW structure. + Add comment. Fix comment preceeding fetching the mapping server + from registry. + (pwdgrp::fetch_account_from_file): Convert str to a local array. + (fetch_posix_offset): New static function. + (pwdgrp::fetch_account_from_windows): Add debug output in case + LookupAccountSidW fails. Simplify code by calling fetch_posix_offset + where appropriate. If LookupAccountSidW fails, check if the SID is + one of the known trusted domains. If so, create a more informative + account entry. + +2014-02-12 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_pwdgrp::nss_init_line): Explicitely ignore a colon + as separator char. + +2014-02-11 Christopher Faylor <me.cygwin2014@cgf.cx> + + * winsup.h: Turn off previous workaround but leave a comment. + +2014-02-11 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (rediscover_thread): Give argument a useful name. + * miscfuncs.cc (NT_readline::init): It's a really bad idea trying to + print a pointer to a PUNICODE_STRING as PUNICODE_STRING. Fix it. + * uinfo.cc (cygheap_domain_info::init): Print status codes as hex + values in debug output. + +2014-02-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (NetLocalGroupGetInfo): Replace NetGroupGetInfo. + * cygheap.h (class cygheap_ugid_cache): Move ugid_cache_t type here + and rename. + (struct init_cygheap): Add cygheap_ugid_cache member "ugid_cache". + * pwdgrp.h (class ugid_cache_t): Remove here. + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Accommodate + move of ugid_cache to cygheap. + * sec_helper.cc (get_sids_info): Ditto. + * uinfo.cc (ugid_cache): Remove. + (pwdgrp::fetch_account_from_windows): Define id_val globally. + Move SidTypeAlias handling into SidTypeUser/SidTypeGroup branch since + aliases are handled like groups in SAM. Accommodate move of ugid_cache + to cygheap. Consolidate code reading SAM comments into a single branch + for both, SidTypeUser and SidTypeAlias. For SidTypeAlias, fix thinko + and call NetLocalGroupGetInfo rather than NetGroupGetInfo. Simplify + code setting Cygwin primary group for SAM accounts. Add code to handle + UNIX uid/gid from SAM comment. + +2014-02-11 Christopher Faylor <me.cygwin2014@cgf.cx> + + * winsup.h (Interlocked*): Use intrinsic versions of Interlocked + functions. + + * cygwin.sc.in: More closely emulate default pe/i386 linker script. + +2014-02-10 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_domain_info::init): Drop accidentally leftover if + statement. + +2014-02-10 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_domain_info::init): Fix handling of account domain + on donmain controllers. Explain why. + +2014-02-10 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (cwcsdup): Change parameter to correct PWCSTR. + (cwcsdup1): Ditto. + * cygheap_malloc.h: Change declarations accordingly. + +2014-02-10 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Add code to allow + setting the primary group from the SAM comment field. + +2014-02-10 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (child_info_spawn::handle_spawn): Call fixup_lockf_after_exec + with additional argument to specify if the process has been execed + or spawned. + * flock.cc (fixup_lockf_after_exec): Take bool parameter to handle + exec and spawn differently. In case of spawn, just give up POSIX + locks in favor of the still running parent. Add comments to explain. + +2014-02-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * environ.cc (strbrk): Properly deal with environment variable sans + quote. + +2014-02-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * environ.cc (strbrk): New function. + (parse_options): Use strbrk to parse CYGWIN environment variable. + +2014-02-09 Corinna Vinschen <corinna@vinschen.de> + + Introduce reading passwd/group entries from SAM/AD. Introduce + /etc/nsswitch.conf file to configure it. + * Makefile.in (DLL_OFILES): Add ldap.o. + * autoload.cc: Import ldap functions from wldap32.dll. + (DsEnumerateDomainTrustsW): Import. + (NetGroupGetInfo): Import. + * cygheap.h (class cygheap_domain_info): New class to keep global + domain info. + (class cygheap_pwdgrp): New class to keep passwd/group caches and + configuration info from /etc/nssswitch.conf. + (struct init_cygheap): Add cygheap_domain_info member "dom" and + cygheap_pwdgrp member "pg". + * cygtls.h (struct _local_storage): Remove unused member "res". + Rearrange slightly, Add members pwbuf and grbuf to implement non-caching + passwd/group fetching from SAM/AD. Make pw_pos and pw_pos unsigned. + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Add RFC 2307 + uid/gid mapping. + * fhandler_process.cc: Drop including pwdgrp.h. + * fhandler_procsysvipc.cc: Ditto. + * fhandler_registry.cc (fhandler_registry::fstat): Set key uid/gid + to ILLEGAL_UID/ILLEGAL_GID rather than UNKNOWN_UID/UNKNOWN_GID. + * grp.cc (group_buf): Drop. + (gr): Drop. + (pwdgrp::parse_group): Fill pg_grp. + (pwdgrp::read_group): Remove. + (pwdgrp::init_grp): New method. + (pwdgrp::prep_tls_grbuf): New method. + (pwdgrp::find_group): New methods. + (internal_getgrsid): Convert to call new pwdgrp methods. + (internal_getgrnam): Ditto. + (internal_getgrgid): Ditto. + (getgrgid_r): Drop 2nd parameter from internal_getgrgid call. + (getgrgid32): Ditto. + (getgrnam_r): Ditto for internal_getgrnam. + (getgrnam32): Ditto. + (getgrent32): Convert to call new pwdgrp methods. + (internal_getgrent): Remove. + (internal_getgroups): Simplify, especially drop calls to + internal_getgrent. + * ldap.cc: New file implementing cyg_ldap class for LDAP access to AD + and RFC 2307 server. + * ldap.h: New header, declaring cyg_ldap class. + * passwd.cc (passwd_buf): Drop. + (pr): Drop. + (pwdgrp::parse_passwd): Fill pg_pwd. + (pwdgrp::read_passwd): Remove. + (pwdgrp::init_pwd): New method. + (pwdgrp::prep_tls_pwbuf): New method. + (find_user): New methods. + (internal_getpwsid): Convert to call new pwdgrp methods. + (internal_getpwnam): Ditto. + (internal_getpwuid): Ditto. + (getpwuid32): Drop 2nd parameter from internal_getpwuid call. + (getpwuid_r): Ditto. + (getpwnam): Ditto for internal_getpwnam. + (getpwnam_r): Ditto. + (getpwent): Convert to call new pwdgrp methods. + * path.cc (class etc): Remove all methods. + * path.h (class etc): Drop. + * pinfo.cc (pinfo_basic::pinfo_basic): Set gid to ILLEGAL_GID rather + than UNKNOWN_GID. + (pinfo_init): Ditto. + * pwdgrp.h (internal_getpwnam): Drop 2nd parameter from declaration. + (internal_getpwuid): Ditto. + (internal_getgrgid): Ditto. + (internal_getgrnam): Ditto. + (internal_getgrent): Drop declaration. + (enum fetch_user_arg_type_t): New type. + (struct fetch_user_arg_t): New type. + (struct pg_pwd): New type. + (struct pg_grp): New type. + (class pwdgrp): Rework to provide functions for file and db requests + and caching. + (class ugid_cache_t): New class to provide RFC 2307 uid map caching. + (ugid_cache): Declare. + * sec_acl.cc: Drop including pwdgrp.h. + * sec_auth.cc: Drop including dsgetdc.h and pwdgrp.h. + (get_logon_server): Convert third parameter to ULONG flags argument + to allow arbitrary flags values in DsGetDcNameW call and change calls + to this function throughout. Use cached account domain name rather + than calling GetComputerNameW. + (get_unix_group_sidlist): Remove. + (get_server_groups): Drop call to get_unix_group_sidlist. + (verify_token): Rework token group check without calling + internal_getgrent. + * sec_helper.cc (cygpsid::pstring): New methods, like string() but + return pointer to end of string. + (cygsid::getfromstr): Add wide character implementation. + (get_sids_info): Add RFC 2307 uid/gid mapping for Samba shares. + * security.cc: Drop including pwdgrp.h. + * security.h (DEFAULT_UID): Remove. + (UNKNOWN_UID): Remove. + (UNKNOWN_GID): Remove. + (uinfo_init): Move here from winsup.h. + (ILLEGAL_UID): Ditto. + (ILLEGAL_GID): Ditto. + (UNIX_POSIX_OFFSET): Define. Add lengthy comment. + (UNIX_POSIX_MASK): Ditto. + (MAP_UNIX_TO_CYGWIN_ID): Ditto. + (ILLEGAL_UID16): Move here from winsup.h. + (ILLEGAL_GID16): Ditto. + (uid16touid32): Ditto. + (gid16togid32): Ditto. + (sid_id_auth): New convenience macro for SID component access. + (sid_sub_auth_count): Ditto. + (sid_sub_auth): Ditto. + (sid_sub_auth_rid): Ditto. + (cygpsid::pstring): Declare. + (cygsid::getfromstr): Declare wide character variant. + (cygsid::operator=): Ditto. + (cygsid::operator*=): Ditto. + (get_logon_server): Change declaration according to source code. + * setlsapwd.cc (setlsapwd): Drop 2nd parameter from internal_getpwnam + call. + * shared.cc (memory_init): Call cygheap->pg.init in first process. + * syscalls.cc: Drop including pwdgrp.h. + * tlsoffsets.h: Regenerate. + * tlsoffsets64.h: Ditto. + * uinfo.cc (internal_getlogin): Drop gratuitious internal_getpwuid + call. Fix debug output. Overwrite user gid in border case of a + missing passwd file while a group file exists. + (pwdgrp::add_line): Allocate memory on cygheap. + (pwdgrp::load): Remove. + (ugid_cache): Define. + (cygheap_pwdgrp::init): New method. + (cygheap_pwdgrp::nss_init_line): New method. + (cygheap_pwdgrp::_nss_init): New method. + (cygheap_domain_info::init): New method. + (logon_sid): Define. + (get_logon_sid): New function. + (pwdgrp::add_account_post_fetch): New method. + (pwdgrp::add_account_from_file): New methods. + (pwdgrp::add_account_from_windows): New methods. + (pwdgrp::check_file): New method. + (pwdgrp::fetch_account_from_line): New method. + (pwdgrp::fetch_account_from_file): New method. + (pwdgrp::fetch_account_from_windows): New method. + * winsup.h: Move aforementioned macros and declarations to security.h. + +2014-02-09 Christopher Faylor <me.cygwin2014@cgf.cx> + + * sigproc.cc (sig_send): Don't bother with an error message if we are + exiting. + +2014-02-08 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.h (class NT_readline): New class to implement line-wise + reading from file using native NT functions. + * miscfuncs.cc (NT_readline::init): New method. + (NT_readline::fgets): New method. + * mount.cc (mount_info::from_fstab): Utilize NT_readline to read + fstab files. + +2014-02-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchown): Fix typo in + comment. + * mount.cc (mount_info::from_fstab): Use tmp_pathbuf rather than + stack for big local buffer. + * net.cc (cygwin_gethostname): Call GetComputerNameExA rather than + GetComputerNameA if gethostname failed. + * shared.cc (user_info::initialize): Fix formatting. + +2014-02-06 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/file.h: Define flock and accompanying macros if not + already defined in sys/_default_fcntl.h. + +2014-02-04 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 29. + +2014-01-30 Corinna Vinschen <corinna@vinschen.de> + + * dir.cc (opendir): Call set_unique_id only with valid fh. + +2014-01-30 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (cltype): Add cl_buf_beg, cl_buf_end. + * fhandler_console.cc (dev_console::console_attrs::set_cl_x): Honor + buffer locations. + (dev_console::console_attrs::set_cl_y): Ditto. + (fhandler_console::write): On reset, use absolute positioning to go to + beginning of buffer. Clear entire buffer. + +2014-01-27 Christopher Faylor <me.cygwin2014@cgf.cx> + + * gendef (_setjmp (x86)): Save FPU control word location in sequential + location. Adjust sigstack save accordingly. + (_longjmp (x86)): Ditto for restore. + +2014-01-27 Corinna Vinschen <corinna@vinschen.de> + + * gendef (sigdelayed (x86_64)): Save and restore FPU control word. + (_sigdelayed (x86)): Ditto. Save and restore XMM registers. Add + comment. + (_setjmp (x86)): Save FPU control word, following FreeBSD here. + (_longjmp (x86)): Restore FPU control word. + +2014-01-24 Christopher Faylor <me.cygwin2014@cgf.cx> + + * winf.cc (linebuf::fromargv): Treat '=' as a special character. + +2014-01-23 Corinna Vinschen <corinna@vinschen.de> + + * security.h (open_local_policy): Remove declaration. + (lsa_open_policy): Declare. + (lsa_close_policy): Declare. + * sec_auth.cc (lsa_open_policy): Rename from open_local_policy. Take + server name as parameter. Return NULL in case of error, rather than + INVALID_HANDLE_VALUE. + (lsa_close_policy): Rename from close_local_policy. Make externally + available. Get handle by value. + (create_token): Convert call to open_local_policy/close_local_policy + according to aforementioned changes. + (lsaauth): Ditto. + (lsaprivkeyauth): Ditto. + * setlsapwd.cc (setlsapwd): Ditto. + +2014-01-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (etc::test_file_change): In case of NtQueryFullAttributesFile + returning an error, only return true if file actually exists. + +2014-01-20 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/in6.h (struct ipv6_rt_hdr): Define. + * include/cygwin/socket.h: Fix formatting. + (IP_UNICAST_IF): Define. + (IPV6_JOIN_GROUP): Remove Windowism. + (IPV6_LEAVE_GROUP): Ditto. + (IPV6_UNICAST_IF): Define. + (IPV6_TCLASS): Ditto. + (IPV6_RECVTCLASS): Ditto. + +2014-01-18 Corinna Vinschen <corinna@vinschen.de> + + * include/netinet/ip6.h: New file, copied from FreeBSD vebatim. + +2014-01-17 Christopher Faylor <me.cygwin2014@cgf.cx> + + * dtable.h (dtable::lock): Revert static. + (dtable::unlock): Ditto. + +2014-01-17 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (setpassent): Align to BSD definition. + +2014-01-17 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (popen): Introduce Glibc 'e' flag to allow thread-safe + opening of the pipe with O_CLOEXEC flag. Simplify FD_CLOEXEC handling. + +2014-01-17 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/file.h (LOCK_SH): Drop definition in favor of new + definitions in newlib. + (LOCK_EX): Ditto. + (LOCK_NB): Ditto. + (LOCK_UN): Ditto. + (flock): Ditto. + (F_OK): Drop. Already correctly defined in unistd.h. + (X_OK): Ditto. + (W_OK): Ditto. + (R_OK): Ditto. + +2014-01-17 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h (_STDIO_BSD_SEMANTICS): Define as 1. + +2014-01-16 Christopher Faylor <me.cygwin2014@cgf.cx> + + * dtable.h (dtable::lock): Make static. + (dtable::unlock): Ditto. + +2014-01-08 Christopher Faylor <me.cygwin2014@cgf.cx> + + * exception.h (cygwin_exception::open_stackdumpfile): Move old + function into class. + (cygwin_exception::h): New member. + (cygwin_exception::cygwin_exception): Initialize h to NULL. + * exceptions.cc (cygwin_exception::open_stackdumpfile): Move into + cygwin_exception class. Use 'h' class member. + (cygwin_exception::dumpstack): Close stack dump file handle if opened. + +2014-01-04 Christopher Faylor <me.cygwin2014@cgf.cx> + + * fhandler.h (cltype): New enum. + (dev_console::console_attrs): Define struct name. + (dev_console::console_attrs::set_cl_x): New function. + (dev_console::console_attrs::set_cl_y): New function. + (fhandler_console::clear_screen): Redefine input params. + * fhandler_console.cc: Throughout, reflect change in arguments to + fhandler_console::clear_screeen. + (fhandler_console::mouse_aware): Simplify logic slightly. + (fhandler_console::scroll_screen): Remove hopefully obsolete win95 + code. + (dev_console::console_attrs::set_cl_x): New function. + (dev_console::console_attrs::set_cl_y): New function. + (fhandler_console::clear_screen): Redefine input params. Calculate + position based on enum value. + (region_split): Change arguments. Simplify. + (ReadConsoleOutputWrapper): Remove coord argument since we now always + use 0, 0. Send extra arguments to region_split. diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2015 b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2015 new file mode 100644 index 000000000..546df2489 --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog-2015 @@ -0,0 +1,2260 @@ +2015-12-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only request + query_write_dac rather than query_write_control access when writing + an ACL. Fix a comment. + +2015-12-24 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (__aclcalcmask): New function to recalculate ACL masks. + (aclsort32): Honor calclass argument. + +2015-12-24 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (aclfromtext32): Return missing aclcnt parameter. + +2015-12-24 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (acltotext32): Use tmp_pathbuf rather than stack buffer. + (aclfromtext32): Ditto. + +2015-12-24 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc: Cosmetic changes. + +2015-12-18 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_cp_wcstombs): Delete and move functionality into + sys_wcstombs. + * wchar.h (sys_cp_wcstombs): Drop declaration. + * fhandler_console.cc (dev_console::con_to_str): Call sys_wcstombs. + +2015-12-16 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (pwdgrp::parse_group): Only copy the SID if it's valid. + * passwd.cc (pwdgrp::parse_passwd): Ditto. + +2015-12-14 Sebastian Huber <sebastian.huber@embedded-brains.de> + + * include/cygwin/signal.h (sigset_t): Move defintition to newlib. + +2015-12-11 Ken Brown <kbrown@cornell.edu> + + * fhandler_disk_file.cc (fhandler_base::fstat_helper): Align + regparm attribute to declaration in fhandler.h. + +2015-12-10 Corinna Vinschen <corinna@vinschen.de> + + * path.h (class path_conv_handle): Use FILE_ALL_INFORMATION instead of + FILE_NETWORK_OPEN_INFORMATION. Use definitions from ntdll.h since it's + included anyway. + (path_conv_handle::fai): Change name from fnoi. + (path_conv::fai): Ditto. + (file_get_fai): Change name from file_get_fnoi. Drop second parameter. + * path.cc (file_get_fai): Ditto. Fetch FileAllInformation rather than + FileNetworkOpenInformation. Convert STATUS_BUFFER_OVERFLOW to + STATUS_SUCCESS. Remove workaround to fetch FileBasicInformation and + FileStandardInformation on filesystems with broken + FileNetworkOpenInformation handling. + (symlink_info::check): Accommodate above changes. In case of using + the NtQueryDirectoryFile fallback, fetch FileIdBothDirectoryInformation + to get inode number as well. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop outdated + comment. Accommodate change to using FileAllInformation. Drop + extra function calls to fetch NumberOfLinks and IndexNumber. Set ino + directly from IndexNumber stored in pc.fai(). Drop second argument + from call to fstat_helper. + (fhandler_base::fstat_by_name): Drop second argument from call to + fstat_helper. + (fhandler_base::fstat_helper): Drop second parameter. Accommodate + the fact that we access a FILE_ALL_INFORMATION structure now. + (fhandler_base::open_fs): Set ino directly from IndexNumber stored in + pc.fai(). + * fhandler.h (fhandler_base::fstat_helper): Fix declaration accrdingly. + +2015-12-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (path_conv::ndisk_links): Drop unused method. + (fhandler_base::fstat_helper): Drop unused call to ndisk_links. + +2015-12-10 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (path_conv::get_ino_by_handle): Rename fai to + fii for clearness. + (fhandler_disk_file::readdir): Ditto. + +2015-12-09 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Revert IndexNumber to FileId + since it's actually right here. + * fhandler_disk_file.cc: Accommodate above change. + +2015-12-08 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::setcancelstate): Remove unnecessary locking. + (pthread::setcanceltype): Ditto. + +2015-12-08 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (FILE_ID_BOTH_DIR_INFORMATION): Rename FileId to IndexNumber + to align with Microsoft naming scheme. + (FILE_INTERNAL_INFORMATION): Ditto. + * fhandler_disk_file.cc: Rename FileId to IndexNumber throughout. + * syscalls.cc: Ditto. + +2015-12-07 Johannes Schindelin <johannes.schindelin@gmx.de> + + * mount.cc (mount_info::from_fstab_line): Support mounting the current + user's temp folder as /tmp/. This is particularly useful a feature + when Cygwin's own files are write-protected. + +2015-12-07 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/select.h: Move select(2) macros from newlib's sys/types.h + here. Rename howmany to _howmany to unclutter namespace. Move file to + newlib. + * libc/rexex.cc: Add declaration for cygwin_gethostname. + * poll.cc: Include sys/param.h and locale select.h. + * select.h (cygwin_select): Declare. + * uname.cc: Declare cygwin_gethostname. + * winsup.h: Drop declarations of cygwin_select and cygwin_gethostname. + +2015-12-07 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc: Semi-revert commit 12743c2d5d2721f3a80b4d7671a349be03c1f520. + (dll_crt0_0): Drop setting wow64_needs_stack_adjustment on 64 bit. + (_dll_crt0): Split out 64 bit code again and always create new main + thread stack, unless forked off from the non main thread in the parent. + Call create_new_main_thread_stack with parent stack commitsize if + started from the parent's main thread. + Only call child_info_fork::alloc_stack for the latter case on 64 bit. + Slightly rearrange moving rsp and rbp to new stack and document how. + Revert 32 bit wow64 handling to its former self. + * miscfunc.cc (create_new_main_thread_stack): Take a commitsize + parameter and use it if it's not 0. Don't set _main_tls here, it's + done in the caller _dll_crt0 anyway. Return stackbase - 16 bytes, + rather than stacklimit (which was very wrong anyway). + * miscfuncs.h (create_new_main_thread_stack): Accommodate declaration + to aforementioned change. + * wincap.h (wincaps::has_3264_stack_broken): Remove element. + * wincap.cc: Ditto, throughout. + * wow64.cc: Semi-revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520 + but keep architecture-agnostic type changes intact. Fix formatting. + * wow64.h: Revert to pre-12743c2d5d2721f3a80b4d7671a349be03c1f520. + +2015-12-06 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/cygwin.h (CCP_PROC_CYGDRIVE): New flag. + * mount.cc (mount_info::cygdrive_posix_path): Take flag values rather + than just a trailing_slash_p bool. Emit /proc/cygdrive path if + CCP_PROC_CYGDRIVE flag is given. + (mount_info::conv_to_posix_path): Take flag values rather than just + a keep_rel_p bool. Rename _p variables. Print flag value as hex in + debug_printf. Call cygdrive_posix_path with flag values. + * mount.h (mount_info::cygdrive_posix_path): Accommodate above change + in declaration. + (mount_info::conv_to_posix_path): Ditto. + * fhandler_process.cc (format_process_exename): Accommodate change to + mount_info::conv_to_posix_path. + * path.cc (cygwin_conv_path): Ditto. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (dll_crt0_0): On 64 bit, set wow64_needs_stack_adjustment + if not started from a 64 bit process. + (_dll_crt0): Enable wow64_needs_stack_adjustment branch on 64 bit + as well. Remove 64 bit only code. Introduce CREATE_STACK and + FIX_STACK macros to conditionalize the code. Rearrange and + partially rewrite comments. + * wincap.h (wincaps::has_3264_stack_broken): New element. + * wincap.cc: Implement above element throughout. + (wincapc::init): Set has_3264_stack_broken to false on 32 bit. + * wow64.cc: Enable functionality on 64 bit architecture, except for + wow64_revert_to_original_stack. Enhance comments to explain. + (wow64_eval_expected_main_stack): Make 64 bit clean. + (wow64_test_for_64bit_parent): Ditto. + * wow64.h: Export wow64_revert_to_original_stack on 32 bit only, + everything else on all architectures. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (thread_info::thread_info): Accommodate the fact + that TEBs take two pages. + (thread_info::fill_if_match): Rewrite the method for post W10 1511 TEB + detection. + (format_process_maps): Add a state member to region. Fix the code + to handle PEB/TEB region since W10 1511. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (heap_info::fill_if_match): Return NULL, not 0. + (thread_info::fill_if_match): Ditto. + (thread_info::fill_if_match): New method to extract TEB info from + PEB/TEB region since W10 1511. + (format_process_maps): Drop outdated FIXME comment. Add code to handle + PEB/TEB region since W10 1511. + * mmap.cc (posix_madvise): Align comment to new W10 1511 version. + * wincap.h (wincaps::has_new_pebteb_region): New element. + * wincap.cc: Implement above element throughout. + (wincap_10_1511): New global wincaps to support Windows 10 since 1511. + (wincapc::init): Use wincap_10_1511 for W10 builds >= 10586. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + x86_64 only: + * dcrt0.cc (_dll_crt0): Always move stack to pthread stack area. + Explain why. + * miscfuncs.cc (create_new_main_thread_stack): New function to create + OS-like stack for main thread in pthread stack area. + * miscfuncs.cc (create_new_main_thread_stack): Declare. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (child_info_fork::alloc_stack): Fix formatting. + * fork.cc (frok::parent): Fix formatting. + (child_copy): Change type of res to BOOL. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + * crt0.cc (dll_crt0_1): Always restore the TEB stack info. Especially + restore DeallocationStack. Fix comment. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (child_info_fork::alloc_stack): Don't set stackaddr to 0. + +2015-12-03 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (struct child_info): Add member from_main. + * fork.cc (frok::child): Check from_main rather than stackaddr. + (frok::parent): Set ch.from_main if running in the main thread. + +2015-12-02 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Align to below change. + (class child_info_fork): Rename stacktop to stacklimit. Rename + stackbottom to stackbase. Accommodate name change throughout Cygwin. + Rephrase comments to be clearer. + +2015-12-02 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (_tlsbase): Remove. Replace throughout with + NtCurrentTeb()->Tib.StackBase. + (_tlstop): Remove. Replace throughout with + NtCurrentTeb()->Tib.StackLimit. + * dcrt0.cc (child_info_fork::alloc_stack): Move definition of local + teb variable up to be used throughout. + * include/cygwin/config.h (__getreent): Use inline function on both + architectures. + +2015-11-29 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Only create 1-5-32-x + SIDs from ids for x <= 999. + +2015-11-29 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (get_posix_access): In case owner SID == group SID, when + encountering the group entry, change the value of `id' accordingly. + Explain why. + +2015-11-28 Corinna Vinschen <corinna@vinschen.de> + + * gendef (sigdelayed): Save and restore content of the MXCSR register + on x86_64. + +2015-11-27 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (_cygtls::wait_signal_arrived): Renamed from + set_signal_arrived. + (_cygtls::set_signal_arrived): New function signalling signal_arrived. + (_cygtls::reset_signal_arrived): Don't reset will_wait_for_signal. + (_cygtls::unwait_signal_arrived): New function only resetting + will_wait_for_signal. + (class wait_signal_arrived): Rename from set_signal_arrived. + Accommodate name change throughout Cygwin. + (wait_signal_arrived::~wait_signal_arrived): Call + _cygtls::unwait_signal_arrived. Add comment. + * cygserver_ipc.h (ipc_set_proc_info): Fetch signal_arrived handle + via call to _cygtls::get_signal_arrived. + * exceptions.cc (_cygtls::interrupt_setup): Signal signal_arrived via + call to _cygtls::set_signal_arrived. + (_cygtls::handle_SIGCONT): Ditto. + * fhandler_socket.cc (fhandler_socket::wait_for_events): Generate + WSAEVENT array prior to entering wait loop. Add cancel event object + if available. Remove calls to pthread_testcancel and just call + pthread::static_cancel_self if the cancel event object is signalled. + +2015-11-26 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_native): Fix index when looking for colon in path. + +2015-11-21 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (setlocaleinfo): New macro calling __setlocaleinfo. + (__setlocaleinfo): New function to set a locale-specific character + to an explicit wchar_t value. + (__set_lc_numeric_from_win): Handle fa_IR and ps_AF locales to return + same decimal point and thousands separator characters as on Linux. + (__set_lc_monetary_from_win): Ditto for monetary characters. + +2015-11-20 Corinna Vinschen <corinna@vinschen.de> + + * common.din (strtold): Drop redirection to _strtold. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (get_posix_access): Skip merging permissions if current + user has rwx permissions anywa, or if the sum of all group and other + permissions is less than or equal to the user's permissions. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (get_posix_access): Fix computation of effective user + permissions to handle current user, not only the file owner. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_slave::open): Add S_IFCHR flag + in call to create_object_sd_from_attribute. + (fhandler_pty_slave::fstat): Ditto in call to get_object_attribute. + (fhandler_pty_slave::fchmod): Add an orig_mode flag and ditto for + both calls. + (fhandler_pty_master::setup): Ditto in call to + create_object_sd_from_attribute. + * security.cc (get_object_attribute): Never add S_IFCHR to mode + here. Let the caller decide. + (create_object_sd_from_attribute): Ditto. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * security.h (authz_get_user_attribute): Declare bool. + * sec_helper.cc (authz_ctx::get_user_attribute): Make bool method. + Set S_IxOTH bits in returned attributes rather than S_IxUSR bits. + (authz_get_user_attribute): Make bool function. + * sec_acl.cc (get_posix_access): Introduce cygsid array to keep + track of all SIDs in the ACL. Move AuthZ calls into !new_style + permission post processing. When not using AuthZ, use + CheckTokenMembership to collect group permissions. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Disable + deviation from POSIX 1003.1e in terms of GROUP_OBJ/CLASS_OBJ + permissions. Follow POSIX 1003.1e again. Keep old code in + for future reference. + * sec_acl.cc: Accommodate changes in ACE creation in leading + comment. + (set_posix_access): Fix user deny ACE creation. Split group + deny ACE creation into two steps, one to reflect CLASS_OBJ, + the other to reflect OTHER_OBJ. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (getacl): Use Authz to fetch correct user permissions. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (AuthzAccessCheck): Import. + (AuthzFreeContext): Import. + (AuthzInitializeContextFromSid): Import. + (AuthzInitializeContextFromToken): Import. + (AuthzInitializeResourceManager): Import. + * sec_helper.cc (get_sids_info): Remove. + (class authz_ctx_cache_entry): New class. + (class authz_ctx_cache): New class. + (class authz_ctx): New class. + (authz_get_user_attribute): New function. + * security.h (get_sids_info): Drop prototype. + (authz_get_user_attribute): Add prototype. + * winlean.h (_AUTHZ_): Define. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (get_posix_access): Fix class_perm in !new_style case. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + Reapply POSIX ACL changes. + + * sec_acl.cc (get_posix_access): Check for Cygwin "standard" ACL. + Apply umask, if so. Align comments. + * security.cc (set_created_file_access): Fix permission masking by + incoming requested file mode. + + * sec_acl.cc (set_posix_access): Apply mask only in terms of execute bit + for SYSTEM and Admins group. + + * sec_acl.cc (set_posix_access): Don't create DENY ACEs for USER and + GROUP entries if they are the same as USER_OBJ or GROUP_OBJ. + + * fhandler.h (fhandler_pty_slave::facl): Add prototype. + * fhandler_tty.cc (fhandler_pty_slave::facl): New method. + (fhandler_pty_slave::fchown): Fix uid/gid handling. + * sec_acl.cc (set_posix_access): Drop superfluous class_idx variable. + Simplify and move around code in a few places. To improve ACL + readability, add r/w permissions to Admins ACE appended to pty ACL. + Add comment to explain Windows ACE Mask filtering being in the way of + creating a real CLASS_OBJ. + (get_posix_access): Fake CLASS_OBJ for ptys. Explain why. + * security.cc (get_object_attribute): Add S_IFCHR flag to attributes + when calling get_posix_access. + + * sec_acl.cc (set_posix_access): Move merging group perms into owner + perms in case of owner == group after mask has been computed. Take + mask into account when doing so to avoid unnecessary ACCESS_DENIED_ACE. + + * sec_acl.cc (get_posix_access): Only set saw_group_obj flag if we saw + the ACCESS_ALLOWED_ACE. + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Deliberatly + set GROUP_OBJ and CLASS_OBJ perms to new group perms. Add comment + to explain why. + * security.cc (set_created_file_access): Ditto. + + * sec_acl.cc (set_posix_access): Replace previous patch. Return + EINVAL if uid and/or guid is invalid and not backed by an actual + Windows account. + + * sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL. + + * sec_acl.cc (set_posix_access): Handle files with owner == group. + Rephrase switch statement checking against unfiltered a_type value. + (get_posix_access): Handle files with owner == group. + + * sec_acl.cc (get_posix_access): Don't use GROUP_OBJ access to fix up + CLASS_OBJ mask on old-style ACLs. Fix a comment. + + * sec_acl.cc (set_posix_access): Always make sure Admins have + WRITE_DAC and WRITE_OWNER permissions. + * security.h (create_object_sd_from_attribute): Drop handle parameter + from prototype. + * security.cc (create_object_sd_from_attribute): Drop handle parameter. + Just create the standard POSIXy security descriptor. + (set_object_attribute): Accommodate dropped paramter in call to + create_object_sd_from_attribute. + * fhandler_tty.cc: Ditto, throughout. + + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix typo in + mask computation. + + * fhandler.cc (fhandler_base::open_with_arch): Call open with mode + not umasked. + (fhandler_base::open): Explicitely umask mode on NFS here. Call new + set_created_file_access rather than set_file_attribute. + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Reimplement + setting permissions on filesystems supporting ACLs using the new + set_posix_access call. + (fhandler_disk_file::fchown): Ditto. + (fhandler_disk_file::mkdir): Call new set_created_file_access rather + than set_file_attribute. + * fhandler_socket.cc (fhandler_socket::bind): Don't umask here. Add + WRITE_OWNER access to allow writing group in case of SGID bit set. + Call new set_created_file_access rather than set_file_attribute. + * path.cc (symlink_worker): Call new set_created_file_access rather + than set_file_attribute. + * sec_acl.cc (searchace): Un-staticize. + (set_posix_access): New, complementary functionality to + get_posix_access. + (setacl): Implement in terms of get_posix_access/set_posix_access. + (get_posix_access): Add handling for just created files requiring + their first Cygwin ACL. Fix new_style recognition. Handle SGID + bit. For old-style ACLs, ignore SYSTEM and Administrators when + computing the {DEF_}CLASS_OBJ perms. + * security.cc (get_file_sd): Revamp comment. Change and (hopefully) + speed up inheritance processing for just created files. + (alloc_sd): Remove. + (set_security_attribute): Call set_posix_access instead of alloc_sd. + (get_object_attribute): Fix return value. + (create_object_sd_from_attribute): Call set_posix_access instead of + alloc_sd. + (set_file_attribute): Remove. + (set_created_file_access): New function implemented in terms of + get_posix_access/set_posix_access. + * security.h (set_file_attribute): Remove prototype. + (set_created_file_access): Add prototype. + (searchace): Ditto. + (set_posix_access): Ditto. + * syscalls.cc (open): Call open_with_arch with mode not umasked. + + * sec_acl.cc: Change preceeding comment explaining new-style ACLs. + Describe how to generate deny ACEs in more detail. Accommodate the + fact that a NULL deny ACE is used for {DEF_}CLASS_OBJ, rather than + a special Cygwin ACE. Improve further comments. + (CYG_ACE_NEW_STYLE): Define. + (get_posix_access): Change from Cygwin ACE to NULL deny ACE. Fix + CLASS_OBJ handling to generate CLASS_OBJ and DEF_CLASS_OBJ from a single + NULL deny ACE if the inheritance flags say so. + * sec_helper.cc (well_known_cygwin_sid): Remove. + * security.h (well_known_cygwin_sid): Drop declaration. + + * sec_acl.cc (CYG_ACE_ISBITS_TO_WIN): Fix typo. + (get_posix_access): Rename index variable from i to idx. Define only + once at top level. + + * security.cc (add_access_allowed_ace): Drop unused parameter "offset". + Accommodate throughout. + (add_access_denied_ace): Ditto. + * sec_acl.cc: Accommodate above change throughout. + * security.h (add_access_allowed_ace): Adjust prototype to above change. + (add_access_denied_ace): Ditto. + + * sec_acl.cc (get_posix_access): Handle multiple ACEs for the + owner and primary group of the file. Handle the default primary + group ACE as DEF_GROUP_OBJ entry if the directory has the S_ISGID bit + set. Add comments. Minor code rearrangements. + + Preliminary read side implementation of new permission handling. + * acl.h (MAX_ACL_ENTRIES): Raise to 2730. Add comment to explain. + * sec_acl.cc: Add leading comment to explain new ACL style. + Add definitions and macros to use for bits in new Cygwin ACL. + (DENY_RWX): New mask value for all temporary deny bits. + (getace): Add bool parameter to decide when leaving all bits intact, + rather than filtering them per the already set bits. + (get_posix_access): New function, taking over functionality to read + POSIX ACL from SECURITY_DESCRIPTOR. + (getacl): Just call get_posix_access. + * sec_helper.cc (well_known_cygwin_sid): Define. + * security.cc (get_attribute_from_acl): Remove. + (get_info_from_sd): Remove. + (get_reg_sd): Call get_posix_access instead of get_info_from_sd. + (get_file_attribute): Ditto. + (get_object_attribute): Ditto. + * security.h (well_known_cygwin_sid): Declare. + (get_posix_access): Add prototype. + + * Throughout, use simpler ACE macros from Windows' accctrl.h. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2004. + (CYGWIN_VERSION_API_MINOR): Reset to 0. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * collate.h (__collate_load_error): Convert to extern declaration. + * globals.cc (__collate_load_error): Define and initialize here. + * libc/fnmatch.c: Update to latest from FreeBSD. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_native): Don't generate native symlink targeting + Cygwin special file. Inform the caller. + (symlink_worker): Don;t bail out in WSYM_nativestrict case if the + target is a Cygwin special file. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: Regenerate. + +2015-11-17 Yaakov Selkowitz <yselkowi@redhat.com> + + * common.din (rpmatch): Export. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2015-11-12 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (lockf_t::create_lock_obj): Correctly recreate lock object + attributes anew in each loop. + +2015-11-12 Corinna Vinschen <corinna@vinschen.de> + + * init.cc (munge_threadfunc): Don't call NtQueryInformationThread with + ThreadQuerySetWin32StartAddress info class on XP 64 and Server 2003 64. + It crashes. + +2015-11-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 1. + +2015-11-05 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (fs_info::update): Fake a serial number on filesystems not + providing one. + +2015-11-05 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc (fcntl64): Don't lock fd table when performing locking. + * flock.cc (flock): Ditto. + (lockf): Ditto. + +2015-11-05 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (pending_signals::clear): Yet another fix to fix the fix. + Actually iterate over the list of pending signals even if there's a + signal which doesn't have to be cleared. Other than that, revert loop + to it's former self as a while loop. + +2015-11-04 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc (ro_u_prlfs): Add trailing NUL. Explain why. + * mount.cc (fs_info::update): Add a comment to explain PrlSF. + * path.h (path_conv::fs_is_prlfs): Add for symmetry. + +2015-11-03 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (pending_signals::clear): Fix previous fix resulting in + yet another endless loop. + +2015-11-02 Corinna Vinschen <corinna@vinschen.de> + + * include/netinet/ip.h (MAX_IPOPTLEN): Define. + +2015-11-02 Corinna Vinschen <corinna@vinschen.de> + + * sigproc.cc (class pending_signals): Drop sigproc_init friendship. + (pending_signals::clear): Fix implementation to avoid subsequent + endless loop in wait_sig. Improve comment. + +2015-11-02 Corinna Vinschen <corinna@vinschen.de> + + * mount.h (enum fs_info_type): Add prlfs (Parallels Desktop FS). + (class fs_info): Add has_broken_fnoi flag. Implement prlfs FS flag. + * mount.cc (fs_info::update): Handle PrlFS. Fill new has_broken_fnoi + flag with life. + (fs_names): Add prlfs. + * globals.cc (ro_u_prlfs): Define. + * path.h (path_conv::has_broken_fnoi): New method. + * path.cc (symlink_info::check): Call file_get_fnoi utilizing new + has_broken_fnoi filesystem flag. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Ditto. + +2015-10-30 Corinna Vinschen <corinna@vinschen.de> + + * nlsfuncs.cc (__get_lcid_from_locale): Handle LocaleNameToLCID + returning LOCALE_CUSTOM_UNSPECIFIED instead of failing in case of + an unsupported locale on Windows 10. + +2015-10-30 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (sigpacket::process): Avoid potentially double unlocking + the TLS mutex. + +2015-10-30 Corinna Vinschen <corinna@vinschen.d> + + * signal.cc (sigwait): Fix return value to reflect errno in case of + error according to POSIX. Never return EINTR. + * thread.cc (pthread_kill): Return errno if sig_send failed. + +2015-10-29 Qian Hong <qhong@codeweavers.com> + + * init.cc (munge_threadfunc): Check that we're actually replacing + the correct original function address on the stack. + * ntdll.h (enum _THREADINFOCLASS): Add ThreadQuerySetWin32StartAddress. + +2015-08-21 Jon Turney <jon.turney@dronecode.org.uk> + + * cygwin-cxx.h: Remove execute permissions. + * fenv.cc: Ditto. + * how-startup-shutdown-works.txt: Ditto. + * include/arpa/nameser.h: Ditto. + * include/arpa/nameser_compat.h: Ditto. + * include/fenv.h: Ditto. + * include/resolv.h: Ditto. + * libstdcxx_wrapper.cc: Ditto. + +2015-10-23 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::remove): Call remove_pending_sigs. + * cygtls.h (_cygtls::remove_pending_sigs): Declare. + * sigproc.cc (pending_signals::clear): Define new method taking a + _cygtls pointer argument. Drop pending signals for that thread. + (_cygtls::remove_pending_sigs): Call pending_signals::clear for this + thread. + +2015-10-22 Corinna Vinschen <corinna@vinschen.de> + + * common.din (aligned_alloc): Export. + (at_quick_exit): Export. + (quick_exit): Export. + +2015-10-22 Corinna Vinschen <corinna@vinschen.de> + + * sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing + subauthorities. + +2015-10-22 Corinna Vinschen <corinna@vinschen.de> + + * strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes + without trailing NUL as the documentation implies. Throughout Cygwin, + fix usage to align to this pattern. + * fhandler_process.cc (format_process_winexename): Drop trailing NUL + and LF from output. + +2015-10-21 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread_getattr_np): Fix memory leak, remove usage of + malloc for small local buffer. + +2015-10-21 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (symlink_info::check_reparse_point): Don't generate an EIO + error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT. + +2015-09-23 Evgeny Grin <k2k@yandex.ru> + + * fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler + warning in -O3 case. + (fhandler_socket::connect): Ditto. + * regex/regcomp.c (singleton): Ditto. + +2015-09-08 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (lockf_t::create_lock_obj_attr): Add buffer parameter. + Call _everyone_sd with buffer argument from caller rather than + everyone_sd with locally allocated stack buffer. + (lockf_t::create_lock_obj): Call create_lock_obj_attr only once + outside the loop and with additional buffer argument. + (lockf_t::open_lock_obj): Call create_lock_obj_attr with additional + buffer argument. + +2015-08-29 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_cpuinfo): Fetch cache information + from new cache functions in sysconf.cc, get_cpu_cache_intel and + get_cpu_cache_amd. + * sysconf.cc (__nt_query_system): New local helper. + (get_nproc_values): Utilize __nt_query_system on pre-Windows 7 systems. + Use GetLogicalProcessorInformationEx otherwise to handle more than + 64 CPUs. Only handle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN. + (get_phys_pages): New helper to handle _SC_PHYS_PAGES. + (cpuid2_cache_descriptor): New array to map Intel CPUID 2 descriptor + values to cache type, cache size, associativity and linesize. + (cpuid2_cache_desc_compar): Comparision function for bsearch over + cpuid2_cache_descriptor. + (get_cpu_cache_intel_cpuid2): New function to fetch cache info from + Intel CPUID 2. + (get_cpu_cache_intel_cpuid4): Ditto from Intel CPUID 4. + (get_cpu_cache_intel): New function as CPU-specific entry point. + (assoc): New array to map associativity values from AMD CPUID + 0x80000006. + (get_cpu_cache_amd): New function to fetch cache info from AMD CPUIDs + 0x80000005 and 0x80000006. + (get_cpu_cache): New function to fetch cache info. + (sca): Call get_phys_pages if _SC_PHYS_PAGES is requested. Call + get_cpu_cache for new _SC_* cache requests. + (SC_MAX): Set to _SC_LEVEL4_CACHE_LINESIZE. + (get_phys_pages(void)): Call get_phys_pages(int). + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2015-08-27 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (DiscardVirtualMemory): Import. + (PrefetchVirtualMemory): Import. + * mmap.cc (posix_madvise): Actually implement POSIX_MADV_WILLNEED + utilizing PrefetchVirtualMemory and POSIX_MADV_DONTNEED utilizing + DiscardVirtualMemory on systems supporting them. + * wincap.h (wincaps::has_broken_prefetchvm): New element. + * wincap.cc: Implement above element throughout. + (wincapc::init): Make sure has_broken_prefetchvm is only true on + W10 under WOW64. + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2003. + (CYGWIN_VERSION_API_MINOR): Reset to 0. + +2015-08-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_cpuinfo): Only fetch group relations, + we don't need anything else. + +2015-08-25 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (_WIN32_WINNT): Set to 0x0a00 for Windows 10. + (WINVER): Ditto. Remove outdated comment. + +2015-08-25 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (std_dll_init): Revert using full paths to system DLLs. + +2015-08-25 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (noload): i686 only: Save and restore $edx when calling + SetLastError to avoid clobbering return address stating with Windows 7. + +2015-08-25 Corinna Vinschen <corinna@vinschen.de> + + * mmap.cc: Fix a few comments. + +2015-08-24 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (PROCESSINFOCLASS): Define ProcessDebugFlags. + * sigproc.cc (child_info::child_info): Only propagate _CI_STRACED to + child if strace is actually tracing child processes. + +2015-08-24 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 2. + +2015-08-18 Corinna Vinschen <corinna@vinschen.de> + + * netdb.cc (parse_services_line): Convert port number to network byte + order. + +2015-08-18 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc: Drop including ucontext.h. + +2015-08-17 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgrfull): Drop asking caches. Explain why. + (internal_getgroups): In case we're not utilizing the Windows account + DBs, don't call LsaLookupSids but iterate over the group SIDs in the + token and call internal_getgrsid for each of them. Explain why. + +2015-08-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Rearrange + to fall back to myself uid/gid in case we don't utilize Windows + account DBs, just as prior to 1.7.34. + * sec_helper.cc (cygpsid::get_id): Disable Samba user/group mapping per + RFC2307 if we're not utilizing Windows account DBs. + * security.cc (convert_samba_sd): Revert previous patch. + +2015-08-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_cpuinfo): Handle AMDs providing + extended topology info in CPUID leaf 0x8000001e. Fix handling of + AMD CPUs providing extended legacy core info in CPUID leaf 0x80000008. + +2015-08-17 Orgad Shaneh <orgads@gmail.com> + + * mkglobals_h: Handle CRLF earlier. + +2015-08-17 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_cpuinfo): Print cpb and eff_freq_ro + power management flags. + +2015-08-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base_overlapped::raw_write): When performing + nonblocking I/O, copy user space data into own buffer. Add longish + comment to explain why. + * fhandler.h (fhandler_base_overlapped::atomic_write_buf): New member. + (fhandler_base_overlapped::fhandler_base_overlapped): Initialize + atomic_write_buf. + (fhandler_base_overlapped::fhandler_base_overlapped): New destructor, + free'ing atomic_write_buf. + (fhandler_base_overlapped::copyto): Set atomic_write_buf to NULL in + copied fhandler. + +2015-08-14 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (convert_samba_sd): Fix copy/paste error in previous + patch. + +2015-08-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Only try + to map user and group info per RFC2307 if account info is fetched + from Windows account DB. + * security.cc (convert_samba_sd): Ditto. + +2015-08-14 Corinna Vinschen <corinna@vinschen.de> + + * security,cc (get_attribute_from_acl): Merge all group perms into + user perms if user is member of group. + +2015-08-13 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (GetLogicalProcessorInformationEx): Import. + (SetThreadGroupAffinity): Import. + * fhandler_proc.cc (add_size): New macro. + (get_msb): New inline function. + (mask_bits): Ditto. + (format_proc_cpuinfo): Drop handling of old CPUs. Check if we're + running on a OS version supporting porcessor groups. If so, use + SetThreadGroupAffinity to set thread affinity. Improve cache info + to include 3rd level cache on Intel CPUs. Improve multi core info. + * wincap.h (wincaps::has_processor_groups): New element. + * wincap.cc: Implement above element throughout. + +2015-08-10 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc: Fix comment preceeding x86_64 memset and friends. + +2015-08-10 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::ontherange): Revert previous patch. + +2015-08-03 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 1. + +2015-07-29 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (memset): x86_64 only: Implement in assembler. + (memmove,memcpy): x86_64 only: Ditto. + (wmemmove,wmemcpy): x86_64 only: Ditto. + +2015-07-29 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h: Include cygtls_padsize.h and define CYGTLS_PADSIZE there. + * cygtls_padsize.h: New file. Define CYGTLS_PADSIZE. + * environ.cc (parse_options): Fix NULL pointer access. + * init.cc (threadfunc_fe): Do not force stack align on x86_64. + +2015-07-23 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (__cont_link_context): x86_64: align stack and reserve + shadow space for subsequent function calls, otherwise suffer potential + buffer overflow. + +2015-07-23 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (cygheap_user::ontherange): Ignore $HOME if it's not + starting with a slash (aka, absolute POSIX Path). + +2015-07-21 Corinna Vinschen <corinna@vinschen.de> + + * common.din (siglongjmp): Export. + (sigsetjmp): Export. + * gendef: Change formatting of some comments. + (sigsetjmp): Implement. + (siglongjmp): Implement. + (__setjmpex): x86_64 only: Drop entry point. + (setjmp): x86_64 only: Store tls stackptr in Frame now, store MXCSR + and FPUCW registers in Spare, as MSVCRT does. + (longjmp): x86_64 only: Restore tls stackptr from Frame now, restore + MXCSR and FPUCW registers from Spare. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2015-07-19 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/signal.h (MINSIGSTKSZ): Define as 8K, unconditionally. + (SIGSTKSZ): Define as 32K, unconditionally. + +2015-07-19 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (initial_env): Reduce size of local path buffers to + PATH_MAX. Allocate debugger_command from process heap. + (init_windows_system_directory): Very early initialize new global + variable global_progname. + * dll_init.cc (dll_list::alloc): Make path buffer static. Explain why. + (dll_list::populate_deps): Use tmp_pathbuf for local path buffer. + * exceptions.cc (debugger_command): Convert to PWCHAR. + (error_start_init): Allocate debugger_command and fill with wide char + strings. Only allocate if NULL. + (try_to_debug): Just check if debugger_command is a NULL pointer to + return. Drop conversion from char to WCHAR and drop local variable + dbg_cmd. + * globals.cc (global_progname): New global variable to store Windows + application path. + * pinfo.cc (pinfo_basic::pinfo_basic): Just copy progname over from + global_progname. + (pinfo::status_exit): Let path_conv create the POSIX path to + avoid local buffer. + * pseudo_reloc.cc (__report_error): Utilize global_progname, drop local + buffer. + * smallprint.cc (__small_vsprintf): Just utilize global_progname for + %P format specifier. + (__small_vswprintf): Ditto. + * strace.cc (PROTECT): Change to reflect x being a pointer. Reformat. + (CHECK): Ditto. Reformat. + (strace::activate): Utilize global_progname, drop local buffer. + Fix formatting. + (strace::vsprntf): Reduce size of local progname buffer to NAME_MAX. + Copy and, if necessary, convert only the last path component to + progname. + (strace_buf_guard): New muto. + (buf): New static pointer. + (strace::vprntf): Use buf under strace_buf_guard lock only. Allocate + buffer space for buf on Windows heap. + * wow64.cc (wow64_respawn_process): Utilize global_progname, drop + local path buffer. + +2015-07-18 Corinna Vinschen <corinna@vinschen.de> + + * gendef: Remove unused 64 bit versions of __sjfault and __ljfault. + +2015-07-18 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (makecontext): Rearrange order of initialization and + document at great length. + +2015-07-17 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (__unwind_single_frame): Define empty macro on i686. + (_cygtls::call_signal_handler): Try to make sure signal context makes + sense in case we're generating context here. Add comment to explain. + +2015-07-17 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (getcontext/x86_64): Drop comment on RtlCaptureContext. + (swapcontext/x86_64): Fix comment yet again. + (getcontext/i686): Move comment from x86_64 getcontext, slightly + rearranged, to preceeding comment. + +2015-07-17 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (__unwind_single_frame): Move up in file to be + accessible from other places. Move comment to getcontext. + (stack_info::walk): Call __unwind_single_frame in 64 bit case. Fix + preceeding comment. + (myfault_altstack_handler): Call __unwind_single_frame. + (getcontext): Give comment from __unwind_single_frame a new home. + (swapcontext): Fix comment. + +2015-07-17 Corinna Vinschen <corinna@vinschen.de> + + * common.din (getcontext): Export. + (makecontext): Export. + (setcontext): Export. + (swapcontext): Export. + * exceptions.cc (__unwind_single_frame): New static functions, 64 bit + only. + (setcontext): New function. + (getcontext): New function. + (swapcontext): New function. + (__cont_link_context): New function. + (makecontext): New function. + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2002. + (CYGWIN_VERSION_API_MINOR): Bump. + * include/ucontext.h (getcontext): Add prototype. + (setcontext): Ditto. + (swapcontext): Ditto. + (makecontext): Ditto. + * ntdll.h (NtContinue): Ditto. + +2015-07-17 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Document the + fact that we forgot to bump for sigaltstack and sethostname. + +2015-07-13 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (exception::handle): Reenable code only disabled for + debug purposes. + +2015-07-07 Corinna Vinschen <corinna@vinschen.de> + + x86_64 only: + * cygtls.cc (san::leave): Restore _my_tls.andreas. + * cygtls.h (class san): Add _clemente as in 32 bit case. Add ret and + frame members. + (san::san): Handle _my_tls.andreas as on 32 bit. Take parameter and + write it to new member ret. Store current stack pointer in frame. + (san::~san): New destructor to restore _my_tls.andreas. + (__try): Use __l_except address as parameter to san::san. + * dcrt0.cc (dll_crt0_0): Add myfault_altstack_handler as vectored + continuation handler. + * exception.h (myfault_altstack_handler): Declare. + * exceptions.cc (myfault_altstack_handler): New function. Explain what + it's good for. + +2015-07-07 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (CURR_CHILD_INFO_MAGIC): Update. + (child_info_fork::alloc_stack_hard_way): Drop declaration. + * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Fold into + child_info_fork::alloc_stack. + (getstack): Remove. + (child_info_fork::alloc_stack): Simplify check for application-provided + stack in "hard way" code. Don't call getstack for each page, just + reallocate stack immediately as required. + +2015-07-07 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (frok::parent): Simplify code propagating stack setup to + child process. Tweak comments. + +2015-07-06 Yaakov Selkowitz <yselkowi@redhat.com> + + * path.cc: Rework basename redefinition handling. Explain why. + +2015-07-05 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (CYGWIN_GUARD): Remove. + (child_info_fork::alloc_stack_hard_way): Align stack commit to changes + of thread stack setup in CygwinCreateThread. + +2015-07-05 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (struct pthread_wrapper_arg): Add member guardsize. + (pthread_wrapper): Set thread stack guarantee according to guardsize. + Tweak assembler code so that $rax/$eax is not required by GCC to + prepare the wrapper_arg value. + (CygwinCreateThread): Fix deadzone handling. Drop setting a "POSIX" + guardpage (aka page w/ PAGE_NOACCESS). Always use Windows guard + pages instead. On post-XP systems (providing SetThreadStackGuarantee) + always set up stack Windows like with reserved/commited areas and + movable guard pages. Only on XP set up stack fully commited if the + guardpage size is not the default system guardpage size. + Fill out pthread_wrapper_arg::guardsize. Improve comments. + * resource.cc: Implement RSTACK_LIMIT Linux-like. + (DEFAULT_STACKSIZE): New macro. + (DEFAULT_STACKGUARD): Ditto. + (rlimit_stack_guard): New muto. + (rlimit_stack): New global variable holding current RSTACK_LIMIT values. + (__set_rlimit_stack): Set rlimit_stack under lock. + (__get_rlimit_stack): Initialize rlimit_stack from executable header + and return rlimit_stack values under lock. + (get_rlimit_stack): Filtering function to return useful default + stacksize from rlimit_stack.rlim_cur value. + (getrlimit): Call __get_rlimit_stack in RLIMIT_STACK case. + (setrlimit): Call __set_rlimit_stack in RLIMIT_STACK case. + * thread.cc (pthread::create): Fetch default stacksize calling + get_rlimit_stack. + (pthread_attr::pthread_attr): Fetch default guardsize calling + wincap.def_guard_page_size. + (pthread_attr_getstacksize): Fetch default stacksize calling + get_rlimit_stack. + * thread.h (PTHREAD_DEFAULT_STACKSIZE): Remove. + (PTHREAD_DEFAULT_GUARDSIZE): Remove. + (get_rlimit_stack): Declare. + +2015-07-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (heap_info::heap_info): Disable fetching heap info + on 64 bit XP/2003. Explain why. + * wincap.h (wincaps::has_broken_rtl_query_process_debug_information): + New element. + * wincap.cc: Implement above element throughout. + +2015-07-04 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (SetThreadStackGuarantee): Import. + * cygtls.h (struct _cygtls): Replace thread_context with a ucontext_t + called context. + * exceptions.cc (exception::handle): Exit from process via signal_exit + in case sig_send returns from handling a stack overflow SIGSEGV. + Explain why. + (dumpstack_overflow_wrapper): Thread wrapper to create a stackdump + from another thread. + (signal_exit): Fix argument list to reflect three-arg signal handler. + In case we have to create a stackdump for a stack overflow condition, + do so from a separate thread. Explain why. + (sigpacket::process): Don't run signal_exit on alternate stack. + (altstack_wrapper): Wrapper function to do stack correction when + calling the signal handler on an alternate stack to handle a stack + overflow. Make sure to have lots of comments. + (_cygtls::call_signal_handler): Drop local context variable to reduce + stack pressure. Use this->context instead. Change inline assembler + to call altstack_wrapper. + (_cygtls::signal_debugger): Accommodate aforementioned change to + struct _cygtls. + * tlsoffset.h: Regenerate. + * tlsoffset64.h: Regenerate. + * wincap.h (wincaps::def_guard_pages): New element. + (wincaps::has_set_thread_stack_guarantee): Ditto. + * wincap.cc: Implement above elements throughout. + +2015-07-01 Corinna Vinschen <corinna@vinschen.de> + + * fork.cc (frok::parent): Set stacktop value based on requested stack + pointer value in child. Explain why. + +2015-06-30 Corinna Vinschen <corinna@vinschen.de> + + * signal.cc (sigaltstack): Add comment. + +2015-06-27 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::call_signal_handler): Drop manipulating + thread's ss_flags here. It's not safe against longjmp. + * signal.cc (sigaltstack): Check if we're running on the alternate + stack and set ss_flags returned in oss to SS_ONSTACK. + +2015-06-26 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/signal.h: Revert to define MINSIGSTKSZ and SIGSTKSZ + here with bigger values to allow _cygtls to reside on signal stack, + should it turn out to be required at one point. + +2015-06-26 Corinna Vinschen <corinna@vinschen.de> + + * resource.cc (getrlimit): Fix values returned by RLIMIT_STACK. + Explain why this had to be changed. + +2015-06-23 Ken Brown <kbrown@cornell.edu> + + * include/cygwin/signal.h (SIGEV_*): Add macros. + +2015-06-22 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::call_signal_handler): Drop pushing a register + on the original stack, it confuses GCC. Rearrange the assembler code + so that $rax/$eax is not used by GCC to prepare an argument value. + Use $rax/$eax without saving. Drop clearing $rbp/$epb. + +2015-06-21 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::call_signal_handler): Drop subtracting 16 + bytes from the alternate stack, it's not necessary. Safe all clobbered + registers. Safe one on the orignal stack, the others on the alternate + stack on both platforms. + +2015-06-20 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::call_signal_handler): Implement alternate + signal stack handling. + * signal.cc (sigaltstack): Add fault handler. + * include/cygwin/signal.h: Remove definitions of MINSIGSTKSZ + and SIGSTKSZ here. + +2015-06-19 Corinna Vinschen <corinna@vinschen.de> + + * common.din (sigaltstack): Export. + * cygtls.cc (_cygtls::init_thread): Initialize altstack. + * cygtls.h (__tlsstack_t): Rename from __stack_t to distinguish + more clearly from stack_t. Accommodate throughout. + (_cygtls): Add altstack member. + * exceptions.cc (exception::handle): Set SIGSEGV handler to SIG_DFL + if we encounter a stack overflow, and no alternate stack has been + defined. + * include/cygwin/signal.h (MINSIGSTKSZ): Define + (SIGSTKSZ): Define. + (SA_ONSTACK): Define. + * signal.cc (sigaltstack): New function. + * tlsoffset.h: Regenerate. + * tlsoffset64.h: Ditto. + +2015-06-19 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc: Minor formatting fixes. + +2015-06-18 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (install-man): Exclude release subdir from search paths. + +2015-06-17 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (sethostname): New function. + * common.din (sethostname): Export + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2001. + (CYGWIN_VERSION_DLL_MINOR): Set to 0. + +2015-06-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (LOCK_EVENTS): Don't enter critical section with + invalid mutex handle since then socket has been closed. + (UNLOCK_EVENTS): Close critical section. + (fhandler_socket::evaluate_events): Handle calling connect on shutdown + socket. + (fhandler_socket::wait_for_events): Try for pthread_testcancel in case + of WAIT_FAILED. Try to come up with a better errno in case we waited + on an invalid handle. + (fhandler_socket::release_events): Change wsock_mtx and wsock_evt to + NULL under lock to avoid accessing invalid handle. + +2015-06-15 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (errmap): Handle more Winsock error codes. + +2015-06-15 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::call_signal_handler): Disable enforcing + SA_RESTART in non-main threads to allow returning with EINTR from + system calls. + +2015-06-11 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 5. + +2015-06-08 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (_pinfo::cwd): Initialize s to avoid comiler warning. + (_pinfo::cmdline): Ditto. + +2015-06-08 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (_pinfo::root): Fake default root for native processes. + (open_commune_proc_parms): New helper function to access process + parameter block. + (_pinfo::cwd): Fetch missing cwd for native processes from processes + parameter block. + (_pinfo::cmdline): Ditto for command line. + +2015-06-08 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (_pinfo::commune_request): Don't try to send commune + requests to non-Cygwin processes. + +2015-06-08 Takashi Yano <takashi.yano@nifty.ne.jp> + + * fhandler_tty.cc (fhandler_pty_slave::write): Move causing of SIGHUP + into fhandler_pty_master::close(). + (fhandler_pty_slave::read): Ditto. + (fhandler_pty_master::close): Ditto. + +2015-06-08 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 4. + +2015-06-02 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 3. + +2015-05-28 Takashi Yano <takashi.yano@nifty.ne.jp> + Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_common::close): Don't close output_mutex + here. Move into callers. + (fhandler_pty_master::close): Use NtQueryObject instead of PeekNamedPipe + to detect closing the last master handle. + +2015-05-27 Takashi Yano <takashi.yano@nifty.ne.jp> + + * net.cc: Define _NETIOAPI_H_ to accomodate newer w32api. + +2015-05-03 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 2. + +2015-04-30 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 1. + +2015-04-30 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (convert_samba_sd): Fix accidental dropping of all + non-Unix User, non-Unix Group accounts. + +2015-04-27 Corinna Vinschen <corinna@vinschen.de> + + * include/asm/types.h: Add __s64 and __u64 types. + +2015-04-23 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (path_conv::set_nt_native_path): New function. + * path.h (path_conv::set_nt_native_path): Add prototype. + * syscall.cc (try_to_bin): Handle moving files to the recycler + accessed via a local virtual drive (subst). Fix a problem renaming + the file to the unique replacement name on Samba. Align comment. + +2015-04-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_slave::fch_close_handles): Don't close + handles not opened via fhandler_pty_slave::fch_open_handles. + +2015-04-22 Takashi Yano <takashi.yano@nifty.ne.jp> + + * fhandler.h (class fhandler_base): Add virtual function + get_io_handle_cyg() to get handle from which OPOST-processed output is + read on PTY master. + (class fhandler_pty_slave): Add variable output_handle_cyg to store a + handle to which OPOST-processed output is written. Add two functions, + i.e., set_output_handle_cyg() and get_output_handle_cyg(), regarding + variable output_handle_cyg. Now, output_handle is used only by native + windows program. The data before OPOST-processing is written to + output_handle and OPOST-processing is applied in the master-side. For a + cygwin process, OPOST-processing is applied in the slave-side, and the + data after OPOST-processing is written to output_handle_cyg. + (class fhandler_pty_master): Add two variables, i.e., io_handle_cyg and + to_master_cyg, to store handles of a pipe through which OPOST-processed + output passes. Add pty_master_fwd_thread and function + pty_master_fwd_thread() for a thread which applies OPOST-processing + and forwards data from io_handle to to_master_cyg. Add function + get_io_handle_cyg() regarding variable io_handle_cyg. Now, the pipe + between io_handle and to_master are used only by native windows program + for applying OPOST-processing in the master-side. For a cygwin process, + the pipe between io_handle_cyg and to_master_cyg is used for passing + through the data which is applied OPOST-processing in the slave-side. + * fhandler_tty.cc (struct pipe_reply): Add member to_master_cyg. + (fhandler_pty_master::process_slave_output): Read slave output from + io_handle_cyg rather than io_handle. + (fhandler_pty_slave::fhandler_pty_salve): Initialize output_handle_cyg. + (fhandler_pty_slave::open): Set output_handle_cyg by duplicating handle + to_master_cyg on PTY master. + (fhandler_pty_slave::close): Close handle output_handle_cyg. + (fhandler_pty_slave::write): Write data to output_handle_cyg rather + than output_handle. + (fhandler_pty_slave::fch_close_handles): Close handle output_handle_cyg. + (fhandler_pty_master::fhandler_pty_master): Initialize io_handle_cyg, + to_master_cyg and master_fwd_thread. + (fhandler_pty_master::cleanup): Clean up to_master_cyg as well. + (fhandler_pty_master::close): Print to_master_cyg as well in debug + message. Terminate master forwarding thread. Close handles + to_master_cyg and io_handle_cyg. + (fhandler_pty_master::ioctl): Use io_handle_cyg rather than to_master. + (fhandler_pty_master::pty_master_thread): Add code for duplicating + handle to_master_cyg. + (fhandler_pty_master::pty_master_fwd_thread): New function for a thread + to forward OPOST-processed data from io_handle to to_master_cyg. This + thread applies OPOST-processing to the output of native windows program. + (::pty_master_fwd_thread): Ditto. + (fhandler_pty_master::setup): Create a new pipe to pass thruegh OPOST- + processed output. Create new thread to forward data from io_handle to + to_master_cyg. Set handle to_master_cyg to tty. Print io_handle_cyg as + well in debug message. Close handles io_handle_cyg and to_master_cyg in + case of error. + (fhandler_pty_master::fixup_after_fork): Set handle to_master_cyg to + tty. Copy handle to_master_cyg from arch->to_master_cyg. + (fhandler_pty_master::fixup_after_exec): Clean up to_master_cyg. + * select.cc: Check handle returned by get_io_handle_cyg() rather than + get_handle(). + * tty.h (class tty): Add variable _to_master_cyg to store a handle to + which OPOST-processed data is written. Add two functions, + to_master_cyg() and set_to_master_cyg(), regarding _to_master_cyg. + +2015-04-22 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (basename): Undefine basename before defining function to + avoid type collision with prototype in string.h. + +2015-04-21 Corinna Vinschen <corinna@vinschen.de> + + * include/libgen.h: Remove in favor of newlib version. + +2015-04-17 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Always revert SID + subauth count after checking for known domain. + +2015-04-17 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h: Add comment to explain below change. + (struct pg_pwd): Convert sid member to BYTE array. + (struct pg_grp): Ditto. + * grp.cc (pwdgrp::parse_group): Accommodate above change. + * passwd.cc (pwdgrp::parse_passwd): Ditto. + +2015-04-12 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (shmget): Fetch segment size from server rather than using + size argument to accommodate existing segments. Add comment to explain + why. + +2015-04-10 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2000. + (CYGWIN_VERSION_DLL_MINOR): Set to 0. + +2015-04-04 Jon TURNEY <jon.turney@dronecode.org.uk> + + * exceptions.cc (call_signal_handler): Set mcontext.cr2 to the + faulting address. + +2015-04-02 Jon TURNEY <jon.turney@dronecode.org.uk> + + * exceptions.cc (call_signal_handler): Only bother to construct + the ucontext for signal handlers with SA_SIGINFO set. Set + mcontext.oldmask. + +2015-04-04 Jon TURNEY <jon.turney@dronecode.org.uk> + + * exceptions.cc (call_signal_handler): Zero initialize context and set + context flags, as RlCaptureContext doesn't. + +2015-04-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_dsp.cc (fhandler_dev_dsp::open): Call open_null. + +2015-04-08 Corinna Vinschen <corinna@vinschen.de> + + * pwdgrp.h (sidfromuid): New inline function. + (sidfromgid): Ditto. + * fhandler_disk_file.cc (fhandler_disk_file::fchown): Use sidfromuid. + * quotactl.cc (quotactl): Use sidfromuid and sidfromgid. + +2015-04-08 Corinna Vinschen <corinna@vinschen.de> + + * include/cyggwin/acl.h (struct __acl16): Move from here... + * sec_acl.cc: ...to here. + +2015-04-07 Corinna Vinschen <corinna@vinschen.de> + + * tty.h (class tty): Remove unused 32/64 bit interoperability + considerations. + +2015-04-07 Corinna Vinschen <corinna@vinschen.de> + + * tty.h (NTTYS): Raise to 128. + * devices.in: Change pty, ptym, and cons expressions accordingly. + * devices.cc: Regenerate. + +2015-04-04 Jon TURNEY <jon.turney@dronecode.org.uk> + + * Makefile.in : Remove setting -fomit-frame-pointer for compiling + various files, it is already the default. Set + -fno-omit-frame-pointer for exceptions.cc on x86. + +2015-04-03 Takashi Yano <takashi.yano@nifty.ne.jp> + + * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of + "readlen" not to use "bytes_in_pipe" value directly. + +2015-04-02 Jon TURNEY <jon.turney@dronecode.org.uk> + + * include/cygwin/signal.h (struct __mcontext): 16-byte align. + * include/sys/ucontext.h (ucontext_t): Ditto. + +2015-04-01 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h. + * include/stdint.h: Drop in favor of newlib version. + * include/inttypes.h: Ditto. + +2015-04-01 Jon TURNEY <jon.turney@dronecode.org.uk> + + * include/sys/ucontext.h : New header. + * include/ucontext.h : Ditto. + * exceptions.cc (call_signal_handler): Provide ucontext_t + parameter to signal handler function. + +2015-04-01 Jon TURNEY <jon.turney@dronecode.org.uk> + + * external.cc (cygwin_internal): Add operation to retrieve a copy + of the EXCEPTION_RECORD from a siginfo_t *. + * include/sys/cygwin.h (cygwin_getinfo_types): Ditto. + * exception.h (cygwin_exception): Add exception_record accessor. + +2015-04-01 Jon TURNEY <jon.turney@dronecode.org.uk> + + * include/cygwin/signal.h : Rename struct ucontext to struct + __mcontext. Fix layout differences from the Win32 API CONTEXT + type. Remove unused member _internal. Rename member which + corresponds to ContextFlags. Add cr2 member. + +2015-04-01 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Handle negative domain index to avoid + crashes. + +2015-03-31 Renato Silva <br.renatosilva@gmail.com> + + * net.cc (cygwin_gethostname): Fix buffer size error handling. + +2015-03-31 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Don't allow fully + qualified Windows account names (domain\user or user@domain). + +2015-03-31 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzset_unlocked): Export as _tzset_unlocked. + +2015-03-30 Yaakov Selkowitz <yselkowi@redhat.com> + + * common.din (__gnu_basename): Export. + * path.cc (__gnu_basename): New function. + +2015-03-30 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_domain_info::add_domain): Add prototype. + * uinfo.cc (cygheap_domain_info::add_domain): New method. + (pwdgrp::fetch_account_from_windows): Try to add domain explicitely + if it was not in the original list of trusted domains and go ahead + rather than bailing out. Add comment to explain why. + +2015-03-30 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT. + * exceptions.cc (_cygtls::signal_debugger): Use sizeof (CONTEXT) for + size of CONTEXT copied for GDB's digestion. + * include/cygwin/signal.h: Add a preliminary comment. + +2015-03-25 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/termios.h: Add CMIN and CTIME. + * fhandler_termios.cc (fhandler_termios::tcinit): Use CMIN and CTIME. + +2015-03-25 Takashi Yano <takashi.yano@nifty.ne.jp> + + * tty.h (class tty_min): Remove variable "write_error" to which any + errors are not currently set at anywhere. + (class tty): Add variable "column" for handling ONOCR. + * tty.cc (tty::init): Add initialization code for variable "column". + * fhandler.h (class fhandler_pty_master): Remove variable "need_nl" + which is not necessary any more. "need_nl" was needed by OPOST process + in fhandler_pty_master::process_slave_output(). + (class fhandler_pty_common): Add function process_opost_output() for + handling post processing for OPOST in write process. + * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Count + TIOCPKT control byte into length to be read in TIOCPKT mode. Move + post processing for OPOST to write process. Remove code related to + variable "write_error". Return with EIO error if slave is already + closed. + (fhandler_pty_master::fhandler_pty_master): Remove initialization + code for variable "need_nl". + (fhandler_pty_common::process_opost_output): Add this function for + handling of OPOST in write process. Add code to avoid blocking in + non-blocking mode when output is suspended by ^S. + (fhandler_pty_slave::write): Call fhandler_pty_common:: + process_opost_output() instead of WriteFile(). Remove code related to + variable "write_error". + (fhandler_pty_master::doecho): Call fhandler_pty_common:: + process_opost_output() instead of WriteFile(). + * select.cc (peek_pipe): Remove code related to variable "need_nl". + +2015-03-24 Corinna Vinschen <corinna@vinschen.de> + + Per glibc BZ #15366: + * inttypes.h: Drop __STDC_FORMAT_MACROS consideration. + * stdint.h: Drop __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS + consideration. + +2015-03-23 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/_types.h: Drop unused file. + +2015-03-18 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (pwdgrp::parse_group): Call cygsid::getfromgr_passwd. + * passwd.cc (pwdgrp::parse_passwd): Call cygsid::getfrompw_gecos. + * pwdgrp.h (cygsid::getfrompw): Implement as inline method here, + accessing pg_pwd's sid member directly. + (cygsid::getfromgr): Implement as inline method here, accessing + pg_grp's sid member directly. + * sec_auth.cc (extract_nt_dom_user): Call cygsid::getfrompw_gecos. + Explain why. + * sec_helper.cc (cygsid::getfrompw): Drop implementation. + (cygsid::getfromgr): Ditto. + * security.h (cygsid::getfrompw_gecos): Implement former getfrompw + inline here. + (cygsid::getfromgr_passwd): Implement former getfromgr inline here. + +2015-03-18 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_server_groups): Drop unused passwd argument. Adjust + calls throughout. + (get_initgroups_sidlist): Ditto. + (get_setgroups_sidlist): Ditto. + (create_token): Ditto. + (lsaauth): Ditto. + * security.h (create_token): Adjust prototype to above change. + (lsaauth): Ditto. + (get_server_groups): Ditto. + * grp.cc (get_groups): Adjust call to get_server_groups. + * syscalls.cc (seteuid32): Adjust calls to lsaauth and create_token. + +2015-03-17 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Drop unused timeout parameter. + * pwdgrp.h (internal_getgroups): Ditto in prototype. + * uinfo.cc (internal_getlogin): Ditto in usage. + +2015-03-17 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (find_exec): Fix a name change in case of a symlink which + can be opened as is. + +2015-03-12 Jon TURNEY <jon.turney@dronecode.org.uk> + + * exceptions.cc (stack_info): Add sigstackptr member. + (walk): Unwind sigstackptr inside _sigbe and sigdelayed. + * gendef (_sigdelayed_end): Add symbol to mark end of sigdelayed. + +2015-03-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/sys_time.h: Remove. Definitions moved to newlib's + sys/time.h. + +2015-03-13 Alexey Pavlov <alexpux@gmail.com> + + * net.cc (in6addr_any): Remove redundant braces. + (in6addr_loopback): Ditto. + +2015-03-12 Alexey Pavlov <alexpux@gmail.com> + + * include/cygwin/version.h: Fix typo. + +2015-03-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: Drop defining _BSDTYPES_DEFINED before including + winsup.h. + +2015-03-12 Takashi Yano <takashi.yano@nifty.ne.jp> + + * fhandler_tty.cc (fhandler_pty_master::close): Add code to make slave + detect closure of master. Fix typo in error message. + +2015-03-11 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/types.h: Include <sys/_timespec.h> + +2015-03-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (CreateEnvironmentBlock): Make loading non-fatal. + +2015-03-11 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (std_dll_init): Fix condition for breaking from DLL + loading loop. + +2015-03-10 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * include/stdint.h: Fix __x86_64__ conditional. + +2015-03-05 Corinna Vinschen <corinna@vinschen.de> + + * tty.h (tty::set_master_ctl_closed): Rename from set_master_closed. + (tty::is_master_closed): Drop method. + * fhandler_tty.cc (fhandler_pty_slave::open): Remove code prematurely + bailing out if master control thread is not running. + (fhandler_pty_slave::read): Don't generate SIGHUP if master control + thread is not running. + (fhandler_pty_master::close): Rearrange code to avoid stopping master + control thread twice in multi-threaded scenarios. + +2015-03-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (fhandler_base::get_echo_handle): New virtual method. + (class fhandler_pty_master): Add echo_r and echo_w handles constituting + read and write side of new echo pipe. + * select.cc (peek_pipe): On pty masters, check additionally if input + from the echo pipe is available. + * fhandler_tty.cc (fhandler_pty_master::doecho): Drop output_mutex + locking. Write output to echo pipe. + (fhandler_pty_master::process_slave_output): Check if input is available + in echo pipe and prefer to read from it, if so. + (fhandler_pty_slave::write): Drop output_mutex locking. + (fhandler_pty_master::fhandler_pty_master): Initialize echo pipe + handles to NULL. + (fhandler_pty_master::close): Close and NULL echo pipe handles. + (fhandler_pty_master::setup): Create echo pipe, close in case of error. + +2015-03-04 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 36. + +2015-03-03 Corinna Vinschen <corinna@vinschen.de> + + * msg.cc: Throughout, drop raising SIGSYS if cygserver is not running. + * sem.cc: Ditto. + * shm.cc: Ditto. + +2015-03-03 Corinna Vinschen <corinna@vinschen.de> + + * common.din (issetugid): Export. + * glob.cc (issetugid): Drop macro. + * sec_auth.cc (issetugid): New exported function. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2015-03-02 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (get_attribute_from_acl): Don't spill Everyone permissions + into group permissions if owner SID == group SID. + (alloc_sd): Add parenthesis for clarity. + +2015-02-28 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::add_line): Return NULL if parsing a line failed. + (pwdgrp::add_account_post_fetch): Check return value from add_line and + return NULL if add_line returns NULL. + +2015-02-27 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): For directories, mark inherited ACEs + inheritable to better follow POSIX 1003.1e rules. + +2015-02-27 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (getacl): Add mask even if all group and secondary account + permissions are 0. + +2015-02-27 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Drop redundant test + for SidTypeUser. + +2015-02-27 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Fix bug which leads to ACE duplication in + case owner SID == group SID. + (getacl): Reverse order of SID test against group or owner sid to + prefer owner attributes over group attributes. Disable setting group + permissions equivalent to owner permissions if owner == group. Add + comment to explain why. Fix indentation. + * security.cc (get_attribute_from_acl): Change type of local variables + containing permission to mode_t. Apply deny mask to group if group SID + == owner SID to avoid Everyone permissions to spill over into group + permissions. Disable setting group permissions equivalent to owner + permissions if owner == group. Add comment to explain why. + * uinfo.cc (pwdgrp::fetch_account_from_windows): Allow user SID as + group account if user is a "Microsoft Account". Explain why. Drop + workaround enforcing primary group "Users" for "Microsoft Accounts". + +2015-02-26 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (cyg_ldap::wait): Call cygwait with cw_infinite timeout value + and with cw_sig_restart instead of cw_sig_eintr. Drop useless + _my_tls.call_signal_handler call. Return EIO if cygwait failed. + +2015-02-26 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_mutex_lock): Revert unneeded call to signal handler. + +2015-02-26 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc (ipc_mutex_lock): Add bool parameter to influence if + cygwait should be in EINTR or in restart mode. Call signal handler + if in EINTR mode. + (mq_getattr): Call ipc_mutex_lock in restart mode. + (mq_setattr): Ditto. + (mq_notify): Ditto. + (_mq_send): Call ipc_mutex_lock in EINTR mode. + (_mq_receive): Ditto. + +2015-02-26 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_termios.cc (fhandler_termios::line_edit): Fix condition + for writing remaining bytes in readahead buffer in non-canonical mode. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Always grant default owner entry + STANDARD_RIGHTS_ALL and FILE_WRITE_ATTRIBUTES access, too. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tape.cc (fhandler_dev_tape::_lock): Add cw_sig_restart to + cygwait call. + * thread.cc (pthread_mutex::lock): Ditto. + (semaphore::_timedwait): Fix formatting. + (semaphore::_wait): Ditto. + * thread.h (fast_mutex::lock): Ditto. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Don't apply temporary workaround for chmod + to DEF_USER_OBJ, DEF_GROUP_OBJ, and DEF_OTHER_OBJ ACEs. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_slave::read): Having no input is not an + error condition for tcflush. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Fix comment style. Remove code unused for + years. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * security.cc (alloc_sd): Add temporary workaround which disallows + any secondary user to have more permissions than the primary group + in calls to chmod. Add comment to explain why. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (client_request_pwdgrp::client_request_pwdgrp): Add missing + break in switch statement. + +2015-02-24 Corinna Vinschen <corinna@vinschen.de> + + * ldap.h: Remove index macros. + (class cyg_ldap): Remove members srch_msg and srch_entry. + (cyg_ldap::get_string_attribute): Remove private method taking index + argument. + (cyg_ldap::get_num_attribute): Ditto. Add method taking attribute name. + (cyg_ldap::get_primary_gid): Adjust to aforementioned change. + (cyg_ldap::get_unix_uid): Ditto. + (cyg_ldap::get_unix_gid): Ditto. + * ldap.cc: Throughout, use msg and entry in place of srch_msg and + srch_entry. + (std_user_attr): Add sAMAccountName and objectSid. + (group_attr): Ditto. + (cyg_ldap::close): Drop handling of srch_msg and srch_entry. + (cyg_ldap::get_string_attribute): Move earlier in file. + (cyg_ldap::get_num_attribute): Ditto. + (cyg_ldap::enumerate_ad_accounts): Add comments for clarity. + Use group_attr or user_attr rather than sid_attr to fetch all desired + attributes for an account right away. + (cyg_ldap::next_account): Store found SID in last_fetched_sid to + skip calls to fetch_ad_account from fetch_account_from_windows. + (cyg_ldap::get_string_attribute): Remove method taking index argument. + (cyg_ldap::get_num_attribute): Ditto. + * pwdgrp.h (class pg_ent): Fix formatting. Add member dom. + * passwd.cc (pg_ent::enumerate_ad): Store current flat domain name + in dom. Construct fetch_acc_t argument from LDAP attributes and + call fetch_account_from_windows with that. + * userinfo.h (enum fetch_user_arg_type_t): Rename FULL_grp_arg to + FULL_acc_arg. Change throughout. + (struct fetch_acc_t): Rename from fetch_full_grp_t. Change throughout. + (struct fetch_user_arg_t): Rename full_grp to full_acc. Change + throughout. + +2015-02-24 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_base): Add was_nonblocking status flag. + * fhandler.cc (fhandler_base::set_flags): Set was_nonblocking if the + O_NONBLOCK flag has been specified. + (fhandler_base_overlapped::close): Check for was_nonblocking instead + of for is_nonblocking. Explain why. + (fhandler_base::set_nonblocking): Set was_nonblocking if noblocking + mode gets enabled. + +2015-02-24 Ken Brown <kbrown@cornell.edu> + + * include/sys/socket.h (sockatmark): Add prototype. + +2015-02-23 Corinna Vinschen <corinna@vinschen.de> + + * userinfo.h (struct fetch_full_grp_t): Define only when building + Cygwin itself. + (struct fetch_user_arg_t): Ditto. + +2015-02-23 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (LsaLookupSids): Import. + * cygserver_pwdgrp.h: Include userinfo.h. Drop workaround defining + fetch_user_arg_type_t locally. + * grp.cc (internal_getgrsid_cachedonly): New function. + (internal_getgrfull): Ditto. + (internal_getgroups): Rearrange function. Center around fetching all + cached group info first, calling LsaLookupSids on all so far non-cached + groups second. Pass all available info to new internal_getgrfull call. + * pwdgrp.h: Include userinfo.h. Move definitions of + fetch_user_arg_type_t and fetch_user_arg_t there. + (pwdgrp::add_group_from_windows): Declare with getting full group info. + Called from internal_getgrfull. + * uinfo.cc (pwdgrp::add_group_from_windows): Define. + (pwdgrp::fetch_account_from_line): Add default case. + (pwdgrp::fetch_account_from_file): Ditto. + (pwdgrp::fetch_account_from_windows): Handle FULL_grp_arg. + (client_request_pwdgrp::client_request_pwdgrp): Add default case. + * userinfo.h: New header. + (enum fetch_user_arg_type_t): Add FULL_grp_arg. + (struct fetch_full_grp_t): New datatype. + +2015-02-23 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Check for group attributes and + Everyone sid before calling internal_getgrsid. + +2015-02-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwait.h (enum cw_wait_mask): Add cw_sig_restart. Add comments + to explain the meaning of the possible values. + * cygwait.cc (is_cw_sig_restart): Define. + (is_cw_sig_handle): Check for cw_sig_restart as well. + (cygwait): Restart always if cw_sig_restart is set. + * thread.cc (pthread::join): Call cygwait with cw_sig_restart flag + to avoid having to handle signals at all. + +2015-02-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwait.cc (cygwait): Move setting res to WAIT_SIGNALED to clarify + when WAIT_SIGNALED is returned to the caller. + +2015-02-23 Corinna Vinschen <corinna@vinschen.de> + + * winsup.h (SIGTOMASK): Add cast to sigset_t to avoid int overflow. + +2015-02-20 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Take additional timeout_ns parameter. + Restrict fetching group account entries from user token groups by + timeout_ns 100ns-intervals. Add preceding comment to explain why. + * pwdgrp.h (internal_getgroups): Align prototype. + * times.cc (GetTickCount_ns): New function. + * uinfo.cc (internal_getlogin): Call internal_getgroups wih 300ms + timeout. + * winsup.h (GetTickCount_ns): Declare. + +2015-02-19 Jon TURNEY <jon.turney@dronecode.org.uk> + + * Makefile.in (sigfe.o): Use CFLAGS. + +2015-02-19 Jon TURNEY <jon.turney@dronecode.org.uk> + + * include/cygwin/stdlib.h (initstate, random, setstate, srandom): + Check if __XSI_VISIBLE is set by sys/cdefs.h, rather than testing + for _XOPEN_SOURCE directly, to work correctly when _GNU_SOURCE is + set. + +2015-02-19 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Always grant owner FILE_WRITE_ATTRIBUTES access. + +2015-02-18 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (struct cyg_ldap_search): Add scope member. + (cyg_ldap::search_s): Add parameter scope. Use as LDAP search scope + instead of fixed LDAP_SCOPE_SUBTREE scope. + (ldap_search_thr): Call cyg_ldap::search_s with scope from argument. + (cyg_ldap::search): Add parameter scope and fill in to cyg_ldap_search. + (cyg_ldap::fetch_ad_account): Call search with LDAP_SCOPE_SUBTREE scope. + (cyg_ldap::fetch_posix_offset_for_domain): Call search with + LDAP_SCOPE_ONELEVEL scope. + (cyg_ldap::fetch_unix_sid_from_ad): Call search with LDAP_SCOPE_SUBTREE + scope. + (cyg_ldap::fetch_unix_name_from_rfc2307): Ditto. + * ldap.h (cyg_ldap::search): Align prototype to above change. + (cyg_ldap::search_s): Ditto. + +2015-02-18 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc: Macro-ize filter expressions. Use throughout to compute + required filter buffer size if filter is a local buffer. + +2015-02-17 Corinna Vinschen <corinna@vinschen.de> + + * ldap.cc (cyg_ldap::fetch_posix_offset_for_domain): Drop stray + system_printf. + +2015-02-17 Corinna Vinschen <corinna@vinschen.de> + + * ldap.h (class cyg_ldap): Rename rootdse to def_context. Change + throughout. + * ldap.cc (cyg_ldap::open): Fix debug output. + (cyg_ldap::fetch_ad_account): Rename rdse to base. Restrict LDAP + query to users and groups only. + (cyg_ldap::enumerate_ad_accounts): Rearrange filter expression for + user accounts. + (SYSTEM_CONTAINER): New macro. + (cyg_ldap::fetch_posix_offset_for_domain): Set base in LDAP search + to the "System" container in the default naming context to restrict + the search scope. + (cyg_ldap::fetch_unix_sid_from_ad): Add objectCategory=Person to + search filter for users. + +2015-02-16 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (find_exec): Extend preceeding comment to explain more + detailed what's going on in this function. Overwrite potential symlink + target with original path. + +2015-02-15 Corinna Vinschen <corinna@vinschen.de> + + * i686.din (__mempcpy): Move symbol export from here... + * common.din (__mempcpy): ... to here. + +2015-02-14 Corinna Vinschen <corinna@vinschen.de> + + * path.h (path_conv): Make path_flags private. Rename known_suffix to + suffix and make private. Rename normalized_path to posix_path and + make privtae. Accommodate name changes throughout in path_conv + methods. + (path_conv::known_suffix): New method. Use throughout instead of + accessing suffix directly. + (path_conv::get_win32): Constify. + (path_conv::get_posix): New method to read posix_path. Use throughout + instead of accessing normalized_path directly. + (path_conv::set_posix): Rename from set_normalized_path. Accommodate + name change throughout. + + * spawn.cc (find_exec): Return POSIX path, not Win32 path. + +2015-02-12 Corinna Vinschen <corinna@vinschen.de> + + * sec_acl.cc (setacl): Introduce bool array "invalid" to note the + invalidation of incoming acl entries while iterating over them. + +2015-02-12 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_pwdgrp::get_home): Add dnsdomain parameter to + declaration in ldap-related method. + (cygheap_pwdgrp::get_shell): Ditto. + (cygheap_pwdgrp::get_gecos): Ditto. + * ldap.cc (cyg_ldap::open): Use NO_ERROR instead of 0. + (cyg_ldap::close): Reset last_fetched_sid. + (cyg_ldap::fetch_ad_account): Return immediately if sid is the same as + last_fetched_sid. Open LDAP connection from here. Move initialization + of rdse after open call. Set last_fetched_sid if LDAP call was + successful. + * ldap.h (class cyg_ldap): Add member last_fetched_sid. + (cyg_ldap::cyg_ldap): Initialize last_fetched_sid. + (cyg_ldap::is_open): New inline method. + * uinfo.cc (cygheap_pwdgrp::init): Drop initialization of db_home, + db_shell and db_gecos with "cygwin desc", thus only using the fallback + by default. + (fetch_windows_home): Add parameter dnsdomain. Call + cyg_ldap::fetch_ad_account if required. + (fetch_from_path): Add parameter dnsdomain. Call fetch_windows_home + accordingly. + (cygheap_pwdgrp::get_home): Accomodate call to fetch_windows_home. + Add dnsdomain parameter in ldap-related method. Call + cyg_ldap::fetch_ad_account if required. + (cygheap_pwdgrp::get_shell): Ditto. + (cygheap_pwdgrp::get_gecos): Ditto. + (pwdgrp::fetch_account_from_windows): Drop cyg_ldap::open call prior to + cyg_ldap::fetch_ad_account call. Set is_current_user to true if we're + handling the current user account. Make sure to perform the LDAP calls + only for users, and only if required. + +2015-02-11 Corinna Vinschen <corinna@vinschen.de> + + * flock.cc (fhandler_base::lock): Convert accidental system_printf to + debug_printf in case of non-matching file modes. Clear up debug output. + +2015-02-11 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (check_path_access): Drop FE_NATIVE from find_exec call. + (gfpod_helper): Drop equality sign from environment variable name + in call to check_path_access. + * exec.cc (execlp): Drop equality sign from environment variable name + in call to find_exec. + (execvp): Ditto. + (execvpe): Ditto. + * path.h (enum fe_types): Drop FE_NATIVE. + (find_exec): Rename third paramter in declaration from search. Drop + equality sign from default value. + * spawn.cc (perhaps_suffix): Add PC_POSIX to path_conv::check call. + (find_exec): Simplify function. Iterate over POSIX pathlist rather + than Windows pathlist. Drop handling of FE_NATIVE flag. Always fill + posix path of incoming path_conv buf, unless FE_NNF flag is given. + (av::setup): Drop equality sign from environment variable name + in call to find_exec. Call unshift with normalized_path. + * winf.cc (av::unshift): Drop conv parameter and code converting + Windows to POSIX path. + * winf.h (av::unshift): Accommodate prototype. + +2015-02-10 Corinna Vinschen <corinna@vinschen.de> + + * syscalls.cc (fhandler_base::stat_fixup): Generate unique inode number + for /dev/tty under all circumstances. Add to comment. + +2015-02-06 Corinna Vinschen <corinna@vinschen.de> + + * common.din: Export cabsl, cimagl, creall, finitel, hypotl, sqrtl. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2015-02-06 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 35. + +2015-02-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_proc.cc (format_proc_cpuinfo): Enable multi-core fields + on Intel CPUs. + +2015-02-04 Corinna Vinschen <corinna@vinschen.de> + + * common.din (wcstold): Export. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2015-02-03 Corinna Vinschen <corinna@vinschen.de> + + * mkvers.sh: Automate generating the copyright date in the version + resource. + * winver.rc: Ditto. + +2015-01-28 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (VERSION_OFILES): New variable containing object files + with version information. Use throughout. + (clean): Drop winver_stamp. + (version.cc winver.o): Drop empty rule. + (winver_stamp): Convert to rule targeting version.cc and winver.o + directly. Drop touching winver_stamp. Fix typo. + +2015-01-24 Corinna Vinschen <corinna@vinschen.de> + + * uname.cc (uname): Shorten "WOW64" to "WOW" to account for the new + Windows 10 OS version "10.0" starting with preview build 9926. + +2015-01-23 Pierre A. Humblet <pierre@phumblet.no-ip.org> + + * net.cc (cygwin_inet_pton): Declare. + (gethostby_specials): New function. + (gethostby_helper): Change returned addrtype in 4-to-6 case. + (gethostbyname2): Call gethostby_specials. + +2015-01-22 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.h (class fhandler_process): Add fd_type member. + * fhandler_process.cc (process_tab): Fix indentation. + (fhandler_process::exists): Rely on format_process_fd returning file + type in fd_type. + (struct process_fd_t): Add fd_type member. + (fhandler_process::fill_filebuf): Allow format_process_fd to set + this->fd_type member. + (format_process_fd): Fix path evaluation to allow recognizing trailing + path components. Fix check for file descriptor path component. Return + virt_symlink in fd_type if no trailing path compenents exist, return + virt_fsdir otherwise and copy full resulting path into destbuf. + * path.cc (path_conv::check): If /proc/$PID/fd symlink has trailing + path components, reparse resulting path as if it's the incoming path. + Add comment to wail over the outdated and hackish check method, and to + explain what we do here. + +2015-01-21 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Allow fetching gid, + home, shell and gecos info from NT4 domain. + +2015-01-21 Corinna Vinschen <corinna@vinschen.de> + + * sec_auth.cc (get_logon_server): Constify domain parameter. + * security.h (get_logon_server): Same in prototype. + +2015-01-20 Corinna Vinschen <corinna@vinschen.de> + + * common.din (sockatmark): Export. + * net.cc (sockatmark): New function. + * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. + +2015-01-19 Corinna Vinschen <corinna@vinschen.de> + + * cygserver_ipc.h (ipc_retval): Add default constructor. + (class thread): struct->class. Add prototypes for new private methods + dup_signal_arrived and close_signal_arrived. Implement constructor and + destructor. + +2015-01-16 Marco Atzeri <marco.atzeri@gmail.com> + Corinna Vinschen <corinna@vinschen.de> + + * gendef: Export _sigbe on 64 bit as well. + * malloc_wrapper.cc (free): In malloc_printf, call caller_return_address + instead of __builtin_return_address. + (malloc): Ditto. + (realloc): Ditto. + (calloc): Ditto. + * miscfuncs.cc (__caller_return_address): New function. + * miscfuncs.h (caller_return_address): New macro calling + __caller_return_address. + (__caller_return_address): Add prototype. + +2015-01-14 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (fetch_windows_home): Disable fetching from homeDrive or + usri3_home_dir_drive. Add comment. + +2015-01-14 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (renv_arr): Drop variables not usually in a Windows + environment and all variables being uppercase anyway. But keep + TMP and TEMP for paranoia. + +2015-01-14 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (build_env): When merging the user's Windows environment, + explicitely skip the variables needing conversion to avoid collisions. + Extend comment to explain. + +2015-01-13 Corinna Vinschen <corinna@vinschen.de> + + * uinfo.cc (pwdgrp::fetch_account_from_windows): Drop code from + 2014-11-17, always prepending domain to NT SERVICE accounts when + searching by name. Fix test expression to allow fully qualified + names for NT SERVICE accounts. Extend comment to explain a bit. + +2015-01-12 Pierre A. Humblet <pierre@phumblet.no-ip.org> + + * minires-os-if.c (cygwin_query): Change questions into answers. + +2015-01-08 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (cygheap_pwdgrp::get_shell): Add sid to argument list. + (cygheap_pwdgrp::get_gecos): Ditto. + * uinfo.cc (fetch_windows_home): Accept cyg_ldap and PUSER_INFO_3 + arguments, and fetch db home dir values right here. + (fetch_from_path): Accept cyg_ldap, PUSER_INFO_3 pointers and sid + arguments. Add '%H' format specifier to fetch Windows home dir in + POSIX notation. + (cygheap_pwdgrp::get_home): Accommodate changes to fetch_windows_home + and fetch_from_path. + (cygheap_pwdgrp::get_shell): Ditto. + (cygheap_pwdgrp::get_gecos): Ditto. + (pwdgrp::fetch_account_from_windows): Accommodate sid argument to + cygheap_pwdgrp::get_shell and cygheap_pwdgrp::get_gecos. + +2015-01-08 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/socket.h (struct cmsghdr): Redefine cmsg_len as type + size_t. Add comment to explain why. + +2015-01-08 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (__cygwin_gettzoffset): New function for access from + newlib. + (__cygwin_gettzname): Ditto. + +2015-01-07 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc (tzload): Fix loading latest timezone offsets into + tzinfo from zoneinfo files. Add comment to explain what we do. + (tzparse): Add more comments to explain in case of loading timezone + offset from other sources. + diff --git a/winsup/CVSChangeLogs.old/cygwin/ChangeLog.64bit b/winsup/CVSChangeLogs.old/cygwin/ChangeLog.64bit new file mode 100644 index 000000000..3d91c9a4c --- /dev/null +++ b/winsup/CVSChangeLogs.old/cygwin/ChangeLog.64bit @@ -0,0 +1,1877 @@ +2013-04-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * include/stdint.h (INTPTR_MAX): Fix missing parenthesis. + +2013-04-13 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_slave::write): Change type of towrite to + ssize_t. + (fhandler_pty_slave::read): Ditto for totalread. + +2013-04-13 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (fdsock): Raise send/recv buffer sizes for x86_64. Extend + comment. + (cygwin_setsockopt): Fix condition and syscall_printf. + +2013-04-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Fix typo in + debug_printf. + (fhandler_base_overlapped::raw_read): Handle size difference between + DWORD and {s}size_t platform-independently. + (fhandler_base_overlapped::raw_write): Ditto. Fix typo in comment. + +2013-04-10 Corinna Vinschen <corinna@vinschen.de> + + * Reinstantiate ptmalloc3. + * configure.ac (MALLOC_OFILES): Drop here. + * configure: Regenerate. + * Makefile.in (MALLOC_OFILES): Set to fixed value here. + * cygmalloc.h (HAVE_MORECORE): Define. + * malloc.cc (init_user_mstate): Don't disable MORECORE if building + with ONLY_MSPACES. + +2013-04-09 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (MINIMAL_WIN_NTFS_FLAGS): Fix comment. + +2013-04-08 Corinna Vinschen <corinna@vinschen.de> + + * Throughout fix -Wextra warnings. Ignore regex files and gmon.c. + +2013-04-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::send_internal): Change type of + local variable res to ssize_t. + * net.cc (cygwin_sendto): Fix local variable res, containing return + value, to be ssize_t as well. + (cygwin_recvfrom): Ditto. + (cygwin_recv): Ditto. + (cygwin_send): Ditto. + (cygwin_recvmsg): Ditto. + (cygwin_sendmsg): Ditto. + * syscalls.cc (write): Ditto. + (writev): Ditto. + * pipe.cc (fhandler_pipe::open): Fix type when reading handle value to + accommodate 32 bit compiler. + +2013-04-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Use %lu as + format specifier to match HANDLE size. + * net.cc (cygwin_sendto): Fix return type to be ssize_t. Change + syscall_printf return type format specifier to %lR. + (cygwin_recvfrom): Ditto. + (cygwin_recv): Ditto. + (cygwin_send): Ditto. + (cygwin_recvmsg): Ditto. + (cygwin_sendmsg): Ditto. + * smallprint.cc (__small_vsprintf): Handle `l' for %R, too. + (__small_vswprintf): Ditto. + * syscalls.cc (read): Change syscall_printf return type format specifier + to %lR. + (readv): Ditto. + (pread): Ditto. + (write): Ditto. + (writev): Ditto. + (pwrite): Ditto. + (lseek64): Enhance comment. + +2013-04-08 Corinna Vinschen <corinna@vinschen.de> + + * pipe.cc (fhandler_pipe::open): Fix format specifier and type when + reading handle value. + (fhandler_pipe::get_proc_fd_name): Use same format specifier as in + fhandler_pipe::open. + +2013-04-06 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (_csbrk): Move down in file, right in front of _cmalloc. + +2013-04-04 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct _cmalloc_entry): Define b as unsigned rather than + DWORD. + (NBUCKETS): Define here as constant value. + (struct init_cygheap): Add bucket_val member. Define size of bucket_val + and buckets using NBUCKETS. + * cygheap.cc (NBUCKETS): Drop definition here. + (cygheap_init): Initialize cygheap->bucket_val. Add comment to explain + what we do and why. + (_cmalloc): Simplify bit bucket search using cygheap->bucket_val. Drop + local variable sz. Fetch size of block from cygheap->bucket_val. + (_cfree): Define b as unsigned. + (_crealloc): Fetch size of block from cygheap->bucket_val. + +2013-04-02 ÐлекÑей Павлов <alexpux@gmail.com> + + * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Add missed + ampersand. + +2013-03-30 Corinna Vinschen <corinna@vinschen.de> + + * lc_msg.h: Regenerate from F18 glibc 2.16-28. In the first place this + fixes fi_FI and adds ta_LK (new in Windows 8). + * nlsfuncs.cc (LocaleNameToLCID): Drop unneeded declaration. + +2013-03-29 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Drop old comment. + * hookapi.cc (PEHeaderFromHModule): Return PIMAGE_NT_HEADERS. + (rvadelta): Convert to function and merge in rvadelta_get. + (remap): New function to have code for remapping big executables + only once. + (find_first_notloaded_dll): Simplify. Don't handle different + architecture at all. Call remap. + (hook_or_detect_cygwin): Ditto. + +2013-03-28 Kai Tietz <ktietz@redhat.com> + + * include/cygwin/config.h (___getreent): Harden against aggressive + compiler optimization. + +2013-03-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwin64.din: Reinstantiate definition of __srget and __srget_r. + +2013-03-28 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in ($(LIB_NAME)): Make sure to rebuild when cygwin.def file + has been changed. + * cygwin64.din: Remove more underscored symbols. + (getdelim): Add missing define in favor of unneeded __getline. + (getline): Ditto. + +2013-03-27 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_console.cc + (fhandler_console::create_invisible_console_workaround): Fix comment. + * wincap.cc: Throughout, remove unused has_console_handle_problem + wincapc members. + * wincap.h (struct wincaps): Remove has_console_handle_problem. + +2013-03-27 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (cygwin_gethostbyname): Revert accidental checkin of change + added for debugging. + +2013-03-27 Corinna Vinschen <corinna@vinschen.de> + + * net.cc (struct win64_servent): Define for x86_64. Explain why. + (WIN_SERVENT): Define for all targets. + (dup_ent): Use WIN_SERVENT to access critical servent members + throughout. + +2013-03-27 Corinna Vinschen <corinna@vinschen.de> + + * sysconf.cc (sca): Change build environment values according to + architecture. + (csa): Ditto. + +2013-03-27 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (STATUS_NETWORK_OPEN_RESTRICTION): Define. + (STATUS_SYMLINK_CLASS_DISABLED): Define. + * path.cc (symlink_info::check): Handle STATUS_NETWORK_OPEN_RESTRICTION + and STATUS_SYMLINK_CLASS_DISABLED status codes. Explain why. + +2013-03-22 Kai Tietz <ktietz@redhat.com> + + * gendef: Use pause instead of calling yield throughout in x86_64 code. + +2013-03-20 Ken Brown <kbrown@cornell.edu> + + * include/sys/resource.h (RLIM_INFINITY): Define wordsize agnostic. + +2013-03-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * lib/_cygwin_crt0_common.cc: Fix mangled operator new names for x86_64. + +2013-03-19 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (stack_info::init): Don't attempt to dereference NULL + framep. + (exception::handle): On x86_64, if Rbp is NULL, use Rsp as frame + pointer. + +2013-03-19 Corinna Vinschen <corinna@vinschen.de> + + * gendef (sigdelayed): Make sure to align the stack since sigdelayed + can be called with or without aligned stack. Save and restore all + CPU registers. + +2013-03-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in: Fix comment. + * dcrt0.cc (child_info_fork::handle_fork): Revert patch from 2013-03-15. + +2013-03-17 Corinna Vinschen <corinna@vinschen.de> + + * cygwin64.din (strlwr): Export. + +2013-03-15 Corinna Vinschen <corinna@vinschen.de> + + * Revert previous patch. For some reason perl doesn't like it. + +2013-03-15 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (CYGTLS_PADSIZE): Reduce to 8000 on x86_64. + * tlsoffsets64.h: Regenerate. + +2013-03-15 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (child_info_fork::handle_fork): Call + _pei386_runtime_relocator first thing, before copying parent data and + bss segment. Tweak comment to explain why. + +2013-03-15 Corinna Vinschen <corinna@vinschen.de> + + * gendef (_sigfe): 16-byte align xmm0 storage and use movdqa. + (_sigbe): Fix alignment before calling yield. Use movdqa to save and + restore xmm0. + (sigdelayed): Use movdqa to save and restore xmm0. + (_ZN7_cygtls4lockEv): Change absolute values to hex. + (stabilize_sig_stack): Ditto. + (setjmp): Add comment to explain usage of movdqu. + (__sjfault): Ditto. + (__ljfault): Ditto. + (longjmp): Ditto. Access return value using 32 bit opcodes only. + * miscfuncs.cc (thread_wrapper): Don't attempt to copy exception + handler list on x86_64. + +2013-03-15 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (.#dllname_info): Call _std_dll_init on x86_64 bit, too. + (INIT_WRAPPER): Change to accommodate the change of the init functions + from sysv_abit to ms_abi. Fix preceeding comment accordingly. Add + SEH information and comments. + (std_dll_init): Drop leading underscore on x86_64. Drop sysv_abi + comment. + (wsock_init): Ditto. + (LoadDLLprime): Drop surrounding ifdef to accommodate above underscore + juggling. + +2013-03-15 Corinna Vinschen <corinna@vinschen.de> + + * gendef (_sigfe): Save float arguments as well before calling yield. + (_sigbe): Move saving %rax from prologue to just before the yield call. + Save %xmm0 register, too. + (sigdelayed): Add comment. Save %xmm0 register, too, before calling + yield. + +2013-03-14 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_tty.cc (fhandler_pty_master::setup): Add + PIPE_REJECT_REMOTE_CLIENTS to pipe mode on systems supporting it. Add + FILE_FLAG_FIRST_PIPE_INSTANCE to pipe open mode. + * pipe.cc (fhandler_pipe::create): Ditto. Fix subsequent comment + accordingly. + * wincap.h (wincaps::has_pipe_reject_remote_clients): New element. + * wincap.cc: Implement above element throughout. + * winlean.h (PIPE_REJECT_REMOTE_CLIENTS): Temporarily define until + Mingw64 headers define it. + +2013-03-14 Corinna Vinschen <corinna@vinschen.de> + + Remove more old cruft. Remove Windows NT4 and 2000 from comments + throughout, unless it still makes sense. + * dlfcn.cc (dlopen): Drop W2K-only code to make loaded DLL persistent. + * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Drop code + trying to use information from NtQueryVolumeInformationFile. + * fhandler_socket.cc (fhandler_socket::close): Drop code snippet + disabled since 2008. + * mount.cc (MINIMAL_WIN_NTFS_FLAGS): Add flag values set on all + NTFS since Windows XP. + (get_volume_path_names_for_volume_name): Remove. + (dos_drive_mappings::dos_drive_mappings): Call Win32 function + GetVolumePathNamesForVolumeNameW directly. + * path.cc (file_get_fnoi): Drop test for NT4-only return code. + * sched.cc: Add FIXME to global comment. Reformat comments throughout. + * spawn.cc (child_info_spawn::worker): Just call official IsProcessInJob + function rather than to test undocumented TEB member. + * winlean.h: Drop Mingw32-related defines. + * include/limits.h (PTHREAD_KEYS_MAX): Raise value to reflect minimum + value available on XP and later. + +2013-03-13 Corinna Vinschen <corinna@vinschen.de> + + * Revert to old malloc. + * mmap.cc (MMAP_STORAGE_LOW): Set higher. Add comment. + (MMAP_STORAGE_HIGH): Add comment. + (class mmap_allocator): Change comment. Add mmap_current_low member. + (mmap_allocator::mmap_allocator): Define default constructor. + (mmap_allocator::alloc): Change to a round-robin mechanism. Add or + change comments accordingly. + +2013-03-13 Kai Tietz <ktietz@redhat.com> + Corinna Vinschen <corinna@vinschen.de> + + * gendef (_sigfe): Save arguments before calling yield so they don't + get clobbered. Explain why. + +2013-03-12 Ken Brown <kbrown@cornell.edu> + + * include/a.out.h: Fix up for x86_64. + +2013-03-12 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (rnarg): Fix cast to print negative values correctly. + +2013-03-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::raw_read): Replace accidentally left in + Win32 error codes with equivalent status codes. + +2013-03-11 Corinna Vinschen <corinna@vinschen.de> + + * cygmalloc.h: Include regparm.h rather than defining __reg{1,2,3} here. + * ptmalloc3.cc (__malloc_initialized): Define as type LONG on Cygwin + and include windows.h. + (ptmalloc_init): Set __malloc_initialized on Cygwin using + InterlockedCompareExchange and carefully check for concurrency + situation. + +2013-03-11 Corinna Vinschen <corinna@vinschen.de> + + * gendef: Add SEH information to sigfe entry points, as well as to + _sigfe and _sigbe. + +2013-03-07 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (heap_init): Fix setting reserved_size value when using + ptmalloc3 to avoid too much pagefile pressure at fork time. + +2013-03-05 Corinna Vinschen <corinna@vinschen.de> + + For x86_64 target: + * dll_init.cc (dll::init): Don't set p.envptr. + (update_envptrs): Disable entirely. + * dll_init.h (struct per_module): Disable envptr. + * environ.h (update_envptrs): Change to empty macro. + +2013-03-05 Corinna Vinschen <corinna@vinschen.de> + + For x86_64 target: + * Makefile.in (COMMON_CFLAGS): Add -mcmodel=small to create smaller + footprint. + * cygwin64.din (__cygwin_environ): Drop export. Only export environ + as alias to __cygwin_environ. + * dcrt0.cc (dll_crt0_1): Call main with __cygwin_environ as parameter. + (_dll_crt0): Don't set main_environ. + (cygwin_dll_init): Don't create local variable envp and don't set + user_data->envptr. + * dll_init.cc (dll_list::alloc): Don't assert. + * dll_init.h (per_module::operator =): Don't set envptr. + * environ.cc (cur_environ): Disable. + * environ.h (main_environ): Don't define. + (cur_environ): Change to macro. + * globals.cc (main_environ): Don't initialize. + (struct per_process): Drop envptr. + * perprocess.h (SIZEOF_PER_PROCESS): Set to 41*8 to accommodate size + change of struct per_process. + * include/sys/cygwin.h (struct per_process): Drop envptr. + * lib/_cygwin_crt0_common.cc (environ): Drop declaration. + (_cygwin_crt0_common): Don't set u->envptr. + +2013-03-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygwin64.din: Fix mangled operator new names for size_t==long. + * libstdcxx_wrapper.cc: Ditto for x86_64. + +2013-03-01 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (AttachConsole): Remove. + (GetModuleHandleExW): Remove. + (GetSystemWow64DirectoryW): Remove. + (GetVolumePathNamesForVolumeNameW): Remove. + * exceptions.cc (cygwin_stackdump): Always call RtlCaptureContext. + (exception::handle): Drop accidentally left in debugging statement. + Always call RtlCaptureContext. + (sigpacket::process): Always call RtlCaptureContext for current thread. + * fhandler_disk_file.cc (fstatvfs): Drop code using + FileFsSizeInformation. + (struct __DIR_cache): Remove comment. + (fhandler_disk_file::rewinddir): Drop W2K-only code. + * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Don't + check for old OS. Extend a comment. + * fhandler_mem.cc (fhandler_dev_mem::open): Drop NT4 and W2K from + debug output. + * fhandler_proc.cc (format_proc_partitions): Drop Pre-XP considerations. + * fhandler_procnet.cc (fhandler_procnet::exists): Ditto. + (fhandler_procnet::readdir): Ditto. + (format_procnet_ifinet6): Ditto. + * fhandler_socket.cc (fhandler_socket::recvmsg): Ditto. + * fhandler_tape.cc (mtinfo_drive::get_status): Ditto. + * init.cc (dll_entry): Drop W2K-only code. + * net.cc (get_ifs): Rename from get_xp_ifs. + (get_2k_ifs): Remove. + (getifaddrs): Always call get_ifs. + (get_ifconf): Ditto. + (if_nametoindex): Drop Pre-XP considerations. + (load_ipv6_funcs): Ditto. Fix preceeding comment. + * sec_auth.cc (lsaauth): Drop code handling fake_login_sid. + * sec_helper.cc (fake_logon_sid): Remove. + (set_cygwin_privileges): Fix uncommented statement to drop pre-XP + considerations. + * security.h (fake_logon_sid): Drop declaration. + * shared.cc (shared_info::init_obcaseinsensitive): Drop W2K-only code. + * wincap.cc: Throughout, remove setting all deprecated wincapc members. + (wincap_minimal): Set to wincap_xpsp2. + (wincap_2000): Remove. + (wincap_2000sp4): Remove. + (wincap_xp): Remove. + (wincap_xpsp1): Remove. + (wincapc::init): Drop OS 5.0 and pre-SP2 XP. + * wincap.h (struct wincaps): Remove the following members: + has_create_global_privilege, has_ioctl_storage_get_media_types_ex, + has_disk_ex_ioctls, has_buggy_restart_scan, needs_logon_sid_in_sid_list, + has_gaa_prefixes, has_recvmsg, has_stack_size_param_is_a_reservation, + kernel_is_always_casesensitive, has_rtl_capture_context. + +2013-03-01 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (rtl_unwind): Convert to macro doing nothing on x86_64. + (exception::handle): Drop creating frame variable on x86_64. + * wincap.cc (wincap_2000sp4): Set has_rtl_capture_context to false. + +2013-03-01 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.h (struct header_t): Revert msglen to simple member. + Drop accessor methods. + * cygserver_ipc.h (struct proc): Drop enforced 4 byte struct packing. + Remove members for 64<->32 bit IPC. Revert to original member order. + (ipc_set_proc_info): Remove 64<->32 handling. + (conv_timespec32_to_timespec): Delete. + (conv_timespec_to_timespec32): Delete. + * pinfo.h (struct win_heap_info): Remove. + * shm.cc (fixup_shms_after_fork): Revert parent initialization. + * winlean.h: Remove _TYPE64_CLR and _TYPE64_SET macros. Remove + usage throughout code. + * include/cygwin/ipc.h: Drop 64<->32 bit helper structures. + * include/cygwin/msg.h: Ditto. Drop enforced 4 byte struct packing. + * include/cygwin/sem.h: Ditto. + * include/cygwin/shm.h: Ditto. + * include/cygwin/sysproto.h: Drop enforced 4 byte struct packing. + +2013-02-28 Corinna Vinschen <corinna@vinschen.de> + + * pseudo-reloc.cc (do_pseudo_reloc): Add test to check for invalid 32 + bit relocation in 64 bit code. Only test when building without + optimization. + +2013-02-28 Corinna Vinschen <corinna@vinschen.de> + + * exceptions.cc (_cygtls::signal_debugger): Raise size of sigmsg buffer + on x86_64. + * tlsoffsets64.h: Regenerate. + +2013-02-27 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/signal.h (struct ucontext): Add missing fields from + Windows CONTEXT definition. Define oldmask as 64 bit type. + +-- post-ptmalloc3 tag + +2013-02-27 Corinna Vinschen <corinna@vinschen.de> + + * configure.ac (MALLOC_OFILES): Add ptmalloc3.o. + * configure: Regenerate. + * cygmalloc.h: Declare pt* functions rather than dl* functions. + (mmap64): Declare. + (mmap): Define as mmap64. + (__malloc_lock): Drop macro. + (__malloc_unlock): Ditto. + (MSPACES): Define. + (ONLY_MSPACES): Define. + * debug.h: Include malloc.h rather than otherwise unused dlmalloc.h. + * fork.cc (frok::parent): Drop malloc locking since that's performed + by malloc_atfork now. + * heap.cc (heap_init): Accommodate the fact that there's a chance + that no heap space has been allocated at fork time. + * malloc-private.h: New file from ptmalloc3, having malloc-machine.h + and malloc-2.8.3.h folded in. + * malloc.cc: Replaced by new file from ptmalloc3. + * malloc_wrapper.cc: Throughout, remove malloc locks and call pt* + functions rather than dl* functions. + * pinfo.cc (winpids::set): Drop malloc locking. + * ptmalloc3.cc: New file from ptmalloc3. + +-- pre-ptmalloc3 tag + +2013-02-26 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (_except_list): Don't define on x86_64. + (class exception): Don't define members el and save on x86_64. + (exception::~exception): Don't define on x86_64. + * exceptions.cc (signal_exit): Fix typo in condition. + +2013-02-25 Corinna Vinschen <corinna@vinschen.de> + + * cygwin64.din: Remove all deprecated cygwin32_foo and cygwin_foo + path conversion functions. + * path.cc: Disable aforementioned functions on x86_64. + * include/sys/cygwin.h: Don't declare aforementioned functions on + x86_64. + +2013-02-25 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (class exception): Add handler_installed member. + Change parameters to handle method to match high-level exception + handler calls. + (exception::exception): On x86_64, install exception handler only + once. Explain what we do. + * exceptions.cc (_AFMT): Change to only 11 digits on x86_64. + (cygwin_exception::dump_exception): Print Rip with only 11 digits. + Print 64 bit registers with 0-padding. + (class stack_info): Add members c and hist on x86_64. + (stack_info::init): Take PCONTEXT rather than bool as third parameter. + Tweak code accordingly. Initialize c and hist on x86_64. + (stack_info::walk): Add implementation for x86_64. Drop unneeded + #ifndef in 32 bit code. + (cygwin_exception::dumpstack): Call thestack.init with context as + parameter. Change header output for x86_64. + (cygwin_stackdump): Prefer RtlCaptureContext over GetThreadContext. + (CYG_EXC_CONTINUE_EXECUTION): Define generic definition matching all + platforms. + (CYG_EXC_CONTINUE_SEARCH): Ditto. + (exception::handler_installed): Define here. + (exception::handle): Define according to declaration in exception.h. + Create 32 bit parameters as local variable on 64 bit. Change all + return statements to use generic definitions. Simplify setting framep + on x86_64. Disable setting frame-based exception handler on x86_64. + Fix formatting of klog output for x86_64. + (signal_exit): Create context for cygwin_exception creation. + (sigpacket::process): Prefer RtlCaptureContext over GetThreadContext. + * wincap.h (wincaps::has_rtl_capture_context): New element. + * wincap.cc: Implement above element throughout. + +2013-02-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + Corinna Vinschen <corinna@vinschen.de> + + * cygwin.din (_get_osfhandle): Make main export. Define get_osfhandle + from here. + * cygwin64.din (_get_osfhandle): Rename from get_osfhandle. + (_setmode): Rename from setmode. + * include/io.h: Ditto. Define unprefixed names with preprocessor + macros for backwards source compatibility. + (access): Remove. + * syscalls.cc (_setmode): Rename from setmode. + (cygwin_setmode): Call _setmode. + (_get_osfhandle): Rename from get_osfhandle. + +2013-02-11 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (target_cpu): Define. Check for target_cpu rather than + target_alias for conditional compilation issues. + (toolopts): Change --target into --cpu option and use $target_cpu as + argument. + ($(DEF_FILE)): Call gendef with $(target_cpu) as argument, rather than + with $(target_alias). + * gendef: Accommodate change from --target to --cpu option. + * mkimport: Ditto. + * speclib: Ditto. + +2013-02-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cygserver_ipc (class ipc_retval): Add ssize_t member to anonymous + union. + (ipc_retval::operator =): Add ssize_t variant for x86_64. + * fhandler_floppy.cc (fhandler_dev_floppy::raw_write): Change return + type to ssize_t to match fhandler.h. + * fhandler_socket.cc (fhandler_socket::readv): Ditto. + (fhandler_socket::write): Ditto. + (fhandler_socket::writev): Ditto. + (fhandler_socket::sendmsg): Ditto. + +2013-02-18 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc: Add comment. + +2013-02-18 Corinna Vinschen <corinna@vinschen.de> + + * localtime.cc: Throughout, pull up to latest code from NetBSD. + +2013-02-18 Corinna Vinschen <corinna@vinschen.de> + + * fhandler.cc (fhandler_base::raw_read): Rearrange code to use + NtReadFile and to fix problem using pointer to wrongly sized variable + on x86_64. + (fhandler_base::read): Drop redundant code. + * fhandler_disk_file.cc (fhandler_disk_file::pread): Fix function + to not read the information twice. Handle STATUS_END_OF_FILE. + +2013-02-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in (libcygwin.a): Move --target flag from here... + (toolopts): to here, to be used by both mkimport and speclib. + * speclib: Omit leading underscore in symbol names on x86_64. + +2013-02-17 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in (.gnu_debuglink_overlay): Drop "64" in dbg file name. + +2013-02-16 Corinna Vinschen <corinna@vinschen.de> + + * nfs.h: Make sure packing of NFS fattr3 struct is 4 byte. + (struct nfs_timestruc_t): Define. + (struct fattr3): Define timestamps as type struct nfs_timestruc_t. + * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Copy + each timestruc_t component separately to accommodate different size. + +2013-02-15 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (toollibdir): Remove. Revert to using tooldir instead. + * configure.ac (DLL_NAME): Set to cygwin1.dll in x86_64 case, too. + * configure: Regenerate. + * cygwin.sc.in (SEARCH_DIR): Align to 32 bit search dir, use lib, rather + than lib64. + * cygwin64.din (LIBRARY): Set name to cygwin1.dll. + * fhandler_process.cc (struct heap_info): Drop win_heap_info class + and revert code to former heap_info implementation. + (format_process_maps): Define heaps back to heap_info + * hookapi.cc (hook_or_detect_cygwin): Add shortcut so the code does + not search executable for being a Cygwin executable, if the architecture + is not matching the current Cygwin. Always use for "cygwin1.dll". + * pinfo.cc (commune_process): Drop PICOM_HEAP_INFO code. + (_pinfo::commune_request): Ditto. + (_pinfo::win_heap_info): Remove. + * pinfo.h (enum picom): Remove PICOM_HEAP_INFO. + +2013-02-14 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (two_addr_t): Use __uint64_t as type for the i686 + version, analogue to __uint128_t for x86_64. + (INIT_WRAPPER): New x86_64 macro to install a sysv_abi function wrapper + for the DLL init functions. Add long comment to explain why this is + necessary. Create wrapper for std_dll_init and wsock_init. + (std_dll_init): Rename with leading underscore on x86_64 and take + calling function as argument. Disable overwriting return address on + stack for x86_64. + (wsock_init): Ditto. + +2013-02-13 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (toollibdir): Define build and target dependent. + (install-libs): Use $(toollibdir) rather than $(tooldir)/lib. + (uninstall-libs): Ditto. + (uninstall-man): Use $(DESTDIR)$(mandir) as in install-man, rather + than $(tooldir)/man. + +2013-02-12 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (eval_start_address): Move heap to 0x6:00000000. Change + comment to explain why. + * mmap.cc (MMAP_STORAGE_LOW): Accommodate above change. + +2013-02-12 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_floppy.cc (fhandler_dev_floppy::open): Cast second parameter + in roundup2 to same size as first parameter to make sure mask size is + correct. + * fhandler_process.cc (format_process_maps): Ditto. + * fhandler_raw.cc (fhandler_dev_raw::dup): Ditto. + * hookapi.cc (find_first_notloaded_dll): Add cast. + * spawn.cc (av::fixup): Ditto. + * wincap.h: Add comment to explain the following change. + (wincapc::page_size): Return size_t. + (wincapc::allocation_granularity): Ditto. + + * mmap.cc: Throughout, accommodate the fact that AT_ROUND_TO_PAGE isn't + support on 64 bit at all. + (class mmap_allocator): New class to allocate mmap slots on x86_64. + (mmap_alloc): Define global instant of mmap_allocator. + (mmap64): Call mmap_alloc.alloc on x86_64. + +2013-02-11 Corinna Vinschen <corinna@vinschen.de> + + * gendef (longjmp): Fix indirect addressing in x86_64 setjmp. + +2013-02-11 Corinna Vinschen <corinna@vinschen.de> + + * cygwin64.din: Add missing symbols. + * mkimport: Make sure to use and test against platform dependent + "imp" prefix. + +2013-02-09 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in (.rdata): Add .rdata_cygwin_nocopy subsection. + (.cygheap): Raise size to 3 Megs on x86_64. + * dcrt0.cc (dll_crt0_0): Drop call to init_global_security. + * dtable.cc (std_consts): Drop NO_COPY. + * errno.cc (errmap): Drop NO_COPY, constify instead. + (_sys_errlist): Drop NO_COPY. + * fhandler_clipboard.cc (CYGWIN_NATIVE): Ditto. + * fhandler_console.cc (keytable): Drop NO_COPY, constify instead. + * grp.cc (null_ptr): Make NO_COPY_RO. + * heap.cc (eval_start_address): Fix comment. + * localtime.cc (wildabbr): Make NO_COPY_RO. + (gmt): Ditto. + * miscfuncs.cc (case_folded_lower): Drop NO_COPY. + (case_folded_upper): Ditto. + (isalpha_array): Ditto. + (nice_to_winprio): Ditto for priority. + (class thread_allocator): New class to allocate thread stack on x86_64. + (thr_alloc): Define global NO_COPY instant of thread_allocator. + (CygwinCreateThread): Call thr_alloc.alloc on x86_64 to reserve stack. + * net.cc (errmap): Drop NO_COPY, constify instead. + (host_errmap): Ditto. + * netdb.cc (SPACE): Drop NO_COPY. + * sec_helper.cc (null_sdp): Static NO_COPY_RO definition of null SD. + (sec_none): Define NO_COPY_RO, define content statically. + (sec_none_nih): Ditto. + (sec_all): Ditto. + (sec_all_nih): Ditto. + (get_null_sd): Remove. + (init_global_security): Remove. + * security.cc (file_mapping): Define NO_COPY_RO. + (check_registry_access): Ditto for reg_mapping. + * spawn.cc (exe_suffixes): Drop NO_COPY, constify instead. + (dll_suffixes): Drop unused, disabled definition and comment. + * strsig.cc (sys_sigabbrev): Drop NO_COPY_INIT. + (sys_siglist): Ditto. + * syscalls.cc (def_shells): Drop NO_COPY. + * winsup.h (NO_COPY_RO): Define to place variable in + .rdata_cygwin_nocopy section. + (init_global_security): Drop declaration. + +2013-02-09 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (win_heap_info::~win_heap_info): Only try to free + heap_vm_chunks if it's not NULL. + * pinfo.h (struct commune_result): Change type of n to DWORD. + * pinfo.cc (_pinfo::commune_request): Change type of n to DWORD to + fix subsequent sizeof test after reading from commune pipe on x86_64. + Raise read timeout to match write timeout. + +2013-02-09 Corinna Vinschen <corinna@vinschen.de> + + * cygserver_ipc.h (ipc_retval::operator =): Disable size_t variant + on x86_64 since type is identical to vm_offset_t. + +2013-02-08 Corinna Vinschen <corinna@vinschen.de> + + * regparm.h: New file to define platform dependent regparm attributes. + Define all of them empty if __CYGMAGIC__ is defined. + * cygerrno.h: Include regparm.h instead of defining _reg[123] here. + * winsup.h: Ditto. + * cygmagic: Define __CYGMAGIC__ to help generate same result on all + platforms. + +2013-02-08 Corinna Vinschen <corinna@vinschen.de> + + * cygwin64.din (BASE): Set to 0x180040000. + (_fe_dfl_env): Remove useless symbol. + (_fe_nomask_env): Remove useless symbol. + (exit): Add missing symbol. + (setmode): Ditto. + * gendef (longjmp): Convert all displacements to hex for readability. + Change all movaps instructions to movdqu to accommodate unaligned + access to 128 bit values. + +2013-02-05 Corinna Vinschen <corinna@vinschen.de> + + * pseudo-reloc.cc (do_pseudo_reloc): Enable 64 bit code for x86_64 + Cygwin. + +2013-02-05 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (RtlFillMemory): Declare. + (RtlCopyMemory): Declare. + (memset): Just call RtlFillMemory. + (memcpy): Just call RtlCopyMemory. + * mmap.cc (class mmap_record): Drop enforced packing. Reorder members + to allow tight packing on 32 as well as on 64 bit. + * include/sys/dirent.h: Don't enforced structure packing on x86_64. + (__DIRENT_COOKIE): Use different value on 64 bit. + +2013-02-04 Corinna Vinschen <corinna@vinschen.de> + + * gendef (fefunc): Fix incorrect pc-relative jmp instruction. + (_sigfe): Fix offset to return address on stack. Add and fix comments. + (_sigbe): Fix stack alignment when creating spill area for call to + yield. Add and fix comments. + (sigdelayed): Add fake push to make sure stack is aligned correctly. + Use fake stack alignment on exit to store return address and call ret, + rather than jmp. Fix comments. + (_cygtls::lock): Only create and destroy spill area when really calling + yield. + +2013-02-04 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (LoadDLLfuncEx3): Adjust address computation required + by latest change to the 64 bit code. + * cygmalloc.h (MALLOC_ALIGNMENT): Set to 16 on x86_64. + * cygtls.h: Set struct alignment to 8 on x86_64. Move inclusion of + other header files outside of alignment-enforced code area. Drop + inclusion of security.h entirely. + (_cygtls::get_signal_arrived): Use NULL SECURITY_ATTRIBUTES rather than + &sec_none_nih. + * gendef (_cygtls::lock): Fix stack alignment. + * heap.cc (page_const): Change type to ptrdiff_t, otherwise negation + operator in pround creates broken bitmask. + * shared.cc (page_const): Add cast to ptrdiff_t. + * tlsoffsets64.h: Regenerate. + +2013-01-30 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in ($(LIB_NAME)): Add --target option to mkimport call. + * gendef: Drop -w option. Make callto sigfe function pc-relative + on x86_64. + * miscfuncs.cc (__import_address): Drop comment and misguide attempt + to handle absolute addressing in x86_64 mode. + * mkimport: Add --target option. Handle x86_64 target, especially + create pc-relative jmp calls. + +2013-01-29 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h: Cleanup x86_64 related comment. + (_tlsbase): Change return type to PVOID. + (_tlstop): Ditto. + (_my_tls): Accommodate above change. + * dcrt0.cc (child_info_fork::alloc_stack): Revert previous patch, but + keep cast to PVOID. + (dll_crt0_1): Ditto. + * exception.h: Define _exception_list as _EXCEPTION_REGISTRATION_RECORD + on x86_64. + (_except_list): Define in terms of NtCurrentTeb() on x86_64. + * miscfuncs.cc (__import_address): Handle 32 bit absolute addressing + in IAT on x86_64. + * include/cygwin/config.h (___getreent): New inline function on + x86_64. Define __getreent in terms of ___getreent on x86_64. Fix + comment accordingly. + +2013-01-29 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (_tlsbase): Temporary workaround for GCC bug. + (_tlsbase): Ditto. + * cygwin64.din: Set BASE temporariliy to address < 32 bit to workaround + GDB bug. + * dcrt0.cc (child_info_fork::alloc_stack): Temporary workaround for GCC + bug. + (dll_crt0_1): Ditto. + * miscfuncs.cc (memset): Temporary workaround missing MSABI function in + newlib. + (memcpy): Ditto. + * include/cygwin/config.h (__getreent): Drop definition for x86_64 to + workaround GCC bug. + +2013-01-29 Corinna Vinschen <corinna@vinschen.de> + + * winbase.h (ilockcmpexch): Define always. + (InterlockedCompareExchange): Ditto. + (ilockcmpexch64): Define for x86_64. + (InterlockedCompareExchange64): Ditto. + (InterlockedCompareExchangePointer): Define in terms of + InterlockedCompareExchange64 on x86_64. + +2013-01-29 Kai Tietz <ktietz@redhat.com> + + * cygwin.sc.in: Fix ctors and dtors filler and zero-terminator for + 64 bit. + +2013-01-29 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (TEST_DLL_NAME): Fix to use correct name per target. + * gendef (fefunc): Resurrect accidentally dropped 32 bit code. + +2013-01-29 Corinna Vinschen <corinna@vinschen.de> + + * heap.cc (eval_start_address): Change address and comment for 64 bit. + (eval_initial_heap_size): Change return type to SIZE_T. Use different + values for 64 bit. + +2013-01-28 Corinna Vinschen <corinna@vinschen.de> + + * gendef: Add missing setjmp/longjmp functionality, still untested. + +2013-01-25 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in: Accommodate extra .text, .pdata, and .xdata section on + 64 bit. + * cygwin64.din: Set BASE to 0x200040000 to start shared sections at + 0x200000000. + * gendef: Second cut 64 bit assembler functionality, still untested. + +2013-01-25 Kai Tietz <ktietz@redhat.com> + + * autoload.cc (LoadDLLfuncEx3): Adjust assembler for x64 to avoid + relocations. + (noload): Likewise. + +2013-01-23 Corinna Vinschen <corinna@vinschen.de> + + * gendef: First cut 64 bit assembler functionality, untested. + +2013-01-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (speclib): Exclude main symbol. + (NEW_FUNCTIONS): Set to empty for x86_64. + ($(DEF_FILE)): Call gendef with target_alias as additional parameter. + * configure.ac (DLL_ENTRY): Drop leading underscore for x86_64. + * configure: Regenerate. + * cygwin.sc.in: Drop _SYM usage for __data_start__, __data_end__, + __bss_start__, and __bss_end__. + * cygwin64.din: Remove all fast-call math function entry points. + (_alloca): Define as __alloca. + (_dll_crt0): Drop 32 bit stdcall specifier. + (dll_entry): Ditto. + (dll_noncygwin_dllcrt0): Remove. + (getpwduid): Remove. + (lacl): Remove. + * dcrt0.cc (dll_data_start): Define for x86_64. + (dll_data_end): Ditto. + (dll_bss_start): Ditto. + (dll_bss_end): Ditto. + * gendef: Handle new target argument. Handle 64 bit target. + Add preliminiary empty function definitions for 64 bit to allow linking. + * winsup.h: Define linker data and bss section symbols with + additional underscore for x86_64. + * lib/_cygwin_crt0_common.cc (__image_base__): Define for 64 bit and + map to _image_base__ via macro. + (_cygwin_crt0_common): Fix setting data and bss section borders on + x86_64. + +2013-01-21 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (__import_address): Fix address computation for 64 bit. + +2013-01-19 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (_cygwin_exit_return): Define to allow usage of same C + symbol name independent of target. + * perprocess.h (SIZEOF_PER_PROCESS): Define for x86_64. + * include/sys/cygwin.h (struct per_process): Tweak definition for + x86_64. + +2013-01-18 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h (__SYMBOL_PREFIX): Define. + (_SYMSTR): Define. + * child_info.h (spawn_info): Use _SYMSTR macro to define assembler + symbol. + (fork_info): Ditto. + * libstdcxx_wrapper.cc: Ditto, throughout. + * winsup.h (dll_crt0): Ditto. + * include/cygwin/time.h (daylight): Ditto. + (timezone): Ditto. + * lib/_cygwin_crt0_common.cc: Ditto, throughout. + +2013-01-17 Corinna Vinschen <corinna@vinschen.de> + + * child_info.h (spawn_info): Define asm symbol without leading + underscore for x86_64. + (fork_info): Ditto. + * cygwin.sc.in (__CONCAT1): Define. + (__CONCAT): Define. + (_SYM): Define. + (_data_start__): Define using _SYM macro to accommodate multiple + platforms. + (_data_end__): Ditto. + (_bss_start__): Ditto. + (_bss_end__): Ditto. + (_cygheap_start): Ditto. + (_cygheap_end): Ditto. + +2013-01-09 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/config.h (_tlsbase): Define for x86_64. + +2012-12-14 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in (.gnu_debuglink_overlay): Accommodate longer dbg file + name on 64 bit. + +2012-12-13 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.h (enum picom): Add PICOM_HEAP_INFO. + (_pinfo::win_heap_info): Declare. + (struct win_heap_info): Rename from heap_info and define here. Change + to accommodate 64 bit. + * fhandler_process.cc (struct win_heap_info): Just implement here. + (win_heap_info::gen_heap_info): New method. + (format_process_maps): Accommodate above changes. Add FIXME comment + to explain 32->64 bit problem with VirtualQueryEx. + * pinfo.cc (commune_process): Handle PICOM_HEAP_INFO. + (_pinfo::commune_request): Ditto. + (_pinfo::win_heap_info): New method. + +2012-12-13 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc.in (OUTPUT_FORMAT): Fix typo in 64 bit code. + * spawn.cc (av::fixup): Drop '!!' to keep argument to set_cygexec a + void *. + +2012-12-11 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (TLSOFFSETS_H): Let configure fill in. Change all + occurence of tlsoffsets.h to $(TLSOFFSETS_H). + $(srcdir)/$(TLSOFFSETS_H): Add @CONFIG_DIR@ as parameter to + gentls_offsets so the script knows the target CPU. + * configure.ac (TLSOFFSETS_H): Set according to target. + * configure: Regenerate. + * gentls_offsets: Handle x86_64 as target. Add FIXME comment. Unlink + all temporary files. + * tlsoffsets64.h: New file. + +2012-12-11 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (DLL_NAME): Let configure fill in. + (DIN_FILE): Ditto. Change all occurence of cygwin.din to $(DIN_FILE). + * configure.ac (DLL_NAME): Set according to target. + (DIN_FILE): Ditto. + * configure: Regenerate. + * cygwin64.din: New file. + +2012-12-10 Corinna Vinschen <corinna@vinschen.de> + + * posix_ipc.cc: Enforce 4 byte alignment on all structs used in the + message queue file. + (struct mq_fattr): Fixed size mq_attr structure as stored in file. + (struct mq_hdr): Change to have same size on 32 and 64 bit. Add + mqh_magic to allow check for old message queue file. + (struct msg_hdr): Change to have same size on 32 and 64 bit. Change + type of mqh_attr to struct mq_fattr. + (struct mq_info): Change to have same size on 32 and 64 bit. + (mq_open): Add check for maximum mq_maxmsg and mq_msgsize values which + still fit into 32 bit values. Set mqh_magic in file to MQI_MAGIC. + Check mqh_magic value on existing file to detect old message queue file. + (mq_getattr): Change type of local attr variable to struct mq_fattr. + (mq_setattr): Ditto. + (_mq_send): Ditto. + (_mq_receive): Ditto. + (mq_close): Ditto. + +2012-12-10 Corinna Vinschen <corinna@vinschen.de> + + * hookapi.cc (hook_or_detect_cygwin): Only check for one cygwin DLL + file name depending on executable target type. Return value indicating + executable target type. Change comment accordingly. + * path.h (enum path_types): Add FIXME comment to definition of + PATH_OPEN. Add PATH_64BITEXEC. + (iscygexec32): New method. + (iscygexec64): New method. + (set_cygexec): Implement additionally with void * parameter to be able + to set PATH_64BITEXEC if required. + +2012-12-10 Corinna Vinschen <corinna@vinschen.de> + + * Throughout, fix format string of debug printf and api_fatal calls + to work in 32 and 64 bit environment, as well as to honor signedness. + Use %y instead of 0x%x. + * fhandler.h (class fhandler_dev_mem): Change type of mem_size from + DWORD to SIZE_T. + * fhandler_mem.cc: Throughout, cast mem_size in comparisons to make + GCC happy. + * fhandler_process.cc (format_process_maps): Change type of ret_len + to SIZE_T. + (get_mem_values): Ditto for n and length. + * mmap.cc (MapView): Ditto for commitsize and viewsize. + (class mmap_record): Ditto for len. Use SIZE_T througout for memory + size in method args and return types. + * ntdll.h (NtLockVirtualMemory): Fix type of memory size parameters + to SIZE_T. + (NtMapViewOfSection): Ditto. + (NtQueryVirtualMemory): Ditto. + (NtUnlockVirtualMemory): Ditto. + (RtlFreeHeap): Change type of first parameter to HANDLE. + * shm.cc (shmat): Change type of viewsize to SIZE_T. + * timer.cc (timer_thread): Change type of sleep_ms to LONG. + (ualarm): Drop casts to unsigned int in timer value computation. + +2012-12-06 Corinna Vinschen <corinna@vinschen.de> + + * cygserver_ipc.h (conv_timespec32_to_timespec): Implement here. + (conv_timespec_to_timespec32): Ditto. + * include/cygwin/ipc.h (struct _ts32): Define here. + * include/cygwin/msg.h: Enforce 4 byte alignment on all structs. + (struct _ts32): Move definition to include/cygwin/ipc.h. + (struct _msqid_ds32): Drop member comments. + * include/cygwin/sem.h: Enforce 4 byte alignment on all structs. + (struct _semid_ds32): Define on 64 bit in _KERNEL mode. + * include/cygwin/shm.h: Enforce 4 byte alignment on all structs. + (struct _shmid_ds32): Define on 64 bit in _KERNEL mode. + (struct shminfo): Enhance coment on shmall member. + (struct shm_info): Convert type of all members to int32_t. + * include/cygwin/sysproto.h (struct semctl_args): Change definition to + use the same structure on 32 and 64 bit. + (struct semop_args): Ditto. + (struct shmat_args): Ditto. + (struct shmctl_args): Ditto. + (struct shmdt_args): Ditto. + (struct shmget_args): Ditto. + +2012-12-05 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.h (struct client_request::header_t): Change definition of + msglen to use the same structure on 32 and 64 bit. Add read and write + accessors. Change type of error_code to int. + (class client_request): Align accessor methods to above change. + * cygserver_ipc.h (ipc_set_proc_info): Use _TYPE64_CLR macros. + * winlean.h (_TYPE64_CLR): New macro. + (_TYPE64_SET): Ditto. + * include/cygwin/msg.h (struct _ts32): Define on 64 bit in _KERNEL mode. + (struct _msqid_ds32): Ditto. Add comment to explain why. + * include/cygwin/sysproto.h: Enforce 4 byte alignment on all structs. + (struct msgctl_args): Change definition to use the same structure on + 32 and 64 bit. + (struct msgrcv_args): Ditto. + (struct msgsnd_args): Ditto. + +2012-12-05 Corinna Vinschen <corinna@vinschen.de> + + * shm.cc (fixup_shms_after_fork): Fix initialization of local variable + parent. + +2012-12-04 Corinna Vinschen <corinna@vinschen.de> + + * winlean.h (_TYPE64): Define. + * cygserver_ipc.h (struct proc): Rearrange to use same structure on + 32 and 64 bit. Add member is_64bit. + (ipc_set_proc_info): Change accordingly. + +2012-12-04 Kai Tietz <ktietz@redhat.com> + + * child_info.h (child_info): Re-type magic to DWORD. + +2012-12-03 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (CYGTLS_PADSIZE): Change comment noting alignment has to + be 16 bytes on x86_64. + +2012-12-03 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add rule to build cygwin.sc dynamically using the + target compiler. + * cygwin.sc.in: Rename from cygwin.sc. Make OUTPUT_FORMAT and + SEARCH_DIR dependent on target CPU. Add extra alignment and .xdata + section on x86_64. Keep up with latest dwarf debug section changes. + +2012-11-29 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (thread_wrapper): Use PVOID instead of VOID *. + Fix stack alignment before calling VirtualFree. Fix comments. + +2012-11-28 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc (wsock_init): Drop vendor info debug printout. It's + undefined since Wsock version 2. + +2012-11-28 Corinna Vinschen <corinna@vinschen.de> + + * autoload.cc: Extend leading comment to describe the 64 bit + implementation as well. + (LoadDLLprime): Define for x86_64. + (LoadDLLfuncEx3): Ditto. + (dll_func_load): Ditto. + (struct dll_info): Use target-agnostic type for load_state. + (struct func_info): Add func_addr member on x86_64. + (two_addr_t): New type to be twice the size of an address on either + target. + (union retchain): Use target-agnostic type for low and high, + use two_addr_t as type for ll member. + (std_dll_init): Define as SYSV ABI function on x86_64. Explain why. + Change return type to two_addr_t. Add casts as necessary. Convert + assembler code to tweak return address into C code. + (wsock_init): Ditto. Drop leading underscore in LoadDLLprime + macro call on x86_64. + (GetAdaptersAddresses): Define using LoadDLLfunc since it's not called + on pre-XP anyway. + (AttachConsole): Don't define on x86_64. + (GetModuleHandleExW): Ditto. + (GetSystemWow64DirectoryW): Ditto. + (GetVolumePathNamesForVolumeNameW): Ditto. + +2012-11-22 Corinna Vinschen <corinna@vinschen.de> + + * include/sys/strace.h: Include sys/types.h for pid_t. + +2012-11-16 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (CYGTLS_PADSIZE): Define for 64 bit. Add FIXME comment. + * profil.c: Replace usage of network types with types as documented + in Linux, throughout. + (get_thrpc): Fix access to instruction pointer for x86_64. + * profil.h: Include stdin.t.h. Replace usage of network types with + types as documented in Linux, throughout. + * config/x86_64/profile.h (mcount): Use unsigned long rather than + __uintptr_t. + +2012-11-16 Corinna Vinschen <corinna@vinschen.de> + + * cygmalloc.h (dlmalloc): Change unsigned in declaration to size_t. + (dlrealloc): Ditto. + * wait.cc (wait4): Cast second parameter in proc_subproc call to + uintptr_t. + +2012-11-16 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (verifyable_object_isvalid): Temporarily define as + non-inline on x86_64 to workaround compiler bug. + +2012-11-16 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_netdrive.cc: Use UINT32_MAX rather than UINT_MAX to make + absolutely clear that we mean the 32 bit maximum. + * fhandler_socket.cc: Ditto. + * pinfo.cc: Ditto with INT32_MAX. + * select.cc (fd_mask): Drop gratuitious definition. + (sizeof_fd_set): Cast to size_t. + * shared.cc (pround): Cast to ptrdiff_t. + * strace.cc (strace::activate): Fix format string. + (strace::write_childpid): Take pid_t as parameter. + * include/sys/strace.h (strace::write_childpid): Change declaration + accordingly. + * sync.cc (muto::init): Cast in call to InterlockedExchangePointer to + make compiler happy. + * sync.h (class muto): De-const name. + * syslog.cc (try_connect_syslogd): Take size_t as third argument. + (vsyslog): Convert len to size_t. + * thread.cc: Use {U}INT32_MAX rather than {U}LONG_MAX. Througout change + types used in Windows calls to matching Windows types. + (pthread::cancel): Fix access to instruction pointer for x86_64. + (pthread_attr_getstack): Cast to ptrdiff_t for pointer arithmetic. + * thread.h: Throughout convert 'long' types to uint32_t or LONG. + +2012-11-16 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/acl.h (struct __acl32): Drop. Use struct acl or + aclent_t throughout instead. + * sec_acl.cc (aclcheck32): Mark currently unused variables as unused. + (lacl32): Disable on x86_64. + (acl): Alias to acl32 on x86_64. + (facl): Alias to facl32 on x86_64. + (aclcheck): Alias to aclcheck32 on x86_64. + (aclsort): Alias to aclsort32 on x86_64. + (acltomode): Alias to acltomode32 on x86_64. + (aclfrommode): Alias to aclfrommode32 on x86_64. + (acltopbits): Alias to acltopbits32 on x86_64. + (aclfrompbits): Alias to aclfrompbits32 on x86_64. + (acltotext): Alias to acltotext32 on x86_64. + (aclfromtext): Alias to aclfromtext32 on x86_64. + * resource.cc (getrlimit): Use correct cast to rlim_t rather than DWORD. + * sched.cc (sched_setparam): Drop ThreadPriority and all code setting + it. + +2012-11-15 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (format_process_stat): Add comment to explain + the WOW64 problems concerning the BasePriority value. Fix format + string in __small_sprintf call. + * ntdll.h: Mark more native structures as tested on 64 bit. + (enum _EVENT_TYPE): Drop definition. + (enum _TIMER_TYPE): Ditto. + (enum _SECTION_INHERIT): Drop __MINGW64_VERSION_MAJOR guard. + +2012-11-14 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h: Mark more native structures as tested on 64 bit. + (struct _FILE_BOTH_DIR_INFORMATION): Rename from + _FILE_BOTH_DIRECTORY_INFORMATION as per WDK documentation. + * fhandler_disk_file.cc: Accommodate aforementioned structure name + change. + * path.cc: Ditto. + +2012-11-13 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class fcwd_access_t): Remove wrong alignment attribute from + Buffer member of FAST_CWD_OLD structure. Add comment that everything + has been tested. + * ntdll.h: Mark more native structures as tested on 64 bit. + +2012-11-12 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (class fcwd_access_t): Add alignment attribute to Buffer + member of FAST_CWD_* structures to work on 64 bit. + * path.cc (symlink_info::check_shortcut): Add cast to avoid compiler + warning. + (cygwin_conv_path_list): Drop ununsed variable. + (peek32): Define with int32_t cast on 64 bit to allow easier fetching + of instruction pointer relative addresses. + (find_fast_cwd_pointer): Add new implementation for x86_64. + Tweak a comment in 32 bit version. + +2012-11-12 Corinna Vinschen <corinna@vinschen.de> + + * dlfcn.cc (dlopen): Change cast to accommodate type change in ntdll.h + * fhandler_process.cc (thread_info::thread_info): Change type of local + variable size to ULONG to match NtQuerySystemInformation call. + Add cast to avoid compiler warnings. + (get_process_state): Add cast to avoid compiler warnings. Accommodate + name change of NextEntryOffset member of PSYSTEM_PROCESS_INFORMATION + structure. + * mmap.cc: Add casts to avoid compiler warnings. + (mlock): Change type of local variables min and max to match + GetProcessWorkingSetSize call. + * nlsfuncs.cc (__collate_range_cmp): Add casts to avoid compiler + warnings. + * ntdll.h: Drop accommodations for Mingw32. Fix a couple of formatting + glitches. Add a comment to all structures explicitely tested on 64 bit. + (SYSTEM_INFORMATION_CLASS): Change SystemProcessesAndThreadsInformation + to SystemProcessInformation and SystemProcessorTimes to + SystemProcessorPerformanceInformation to match MSDN. + (SYSTEM_BASIC_INFORMATION): Fix member types to match 64 bit. + (SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION): Rename from + SYSTEM_PROCESSOR_TIMES to use official name from MSDN. Accommodate + throughout. Drop unneeded align attribute. + (VM_COUNTERS): Fix member types to match 64 bit. + (SYSTEM_PROCESS_INFORMATION): Rename from SYSTEM_PROCESSES to use + official name from MSDN. Fix member types to match 64 bit. Change + member names to match MSDN and Mingw64. Accommodate throughout. + (IO_STATUS_BLOCK): Change to use MSDN definition. + (SYSTEM_TIMEOFDAY_INFORMATION): Rename from + SYSTEM_TIME_OF_DAY_INFORMATION to use official name from MSDN. + Accommodate throughout. Add Reserved1 area per MSDN. + (LDR_DATA_TABLE_ENTRY): Add comment for future reference. Change + type of LoadCount to USHORT. + (PEB_LDR_DATA): Change type of Initialized to BOOLEAN. Add comment for + future reference. + (PEB): Fix member types to match 64 bit. + (GDI_TEB_BATCH): New type. + (TEB): Fix member types to match 64 bit. + (PROCESS_BASIC_INFORMATION): Ditto. + (MEMORY_WORKING_SET_LIST): Ditto. + (SharedUserData): Change comment to note the fact that the address + is valid on 32 and 64 bit. + * pinfo.cc (winpids::enum_processes): Add cast to avoid compiler + warnings. + * select.cc (pipe_data_available): Add braces in initalization of an + IO_STATUS_BLOCK to match new definition. + * wincap.h (class wincapc): Change type of wow64 to ULONG_PTR to match + MSDN description. + (wincapc::is_wow64): Convert return value explicitely to bool. + * wow64.cc (wow64_test_for_64bit_parent): Change type of wow64 to + ULONG_PTR to match MSDN description. Add a cast to avoid compiler + warning. + * regex/engine.c: Avoid compiler warnings about unused and potentially + uninitialized variables. + * regex/regcomp.c: Ditto. Drop unnecessary definition of LCID. + +2012-11-11 Corinna Vinschen <corinna@vinschen.de> + + * pinfo.cc (_pinfo::commune_request): Accommodate the fact that LONG_MAX + does not match sizeof LONG. + +2012-11-09 Corinna Vinschen <corinna@vinschen.de> + + * miscfuncs.cc (case_folded_lower): Change to unsigned char to avoid + compiler warnings. + (case_folded_upper): Ditto. + (thread_wrapper): Add assembler code for x86_64. + * winsup.h (case_folded_lower): Change to unsigned char. + (case_folded_upper): Ditto. + (cyg_tolower): Add cast to avoid compiler warnings. + (cyg_toupper): Add cast to avoid compiler warnings. + +2012-11-08 Corinna Vinschen <corinna@vinschen.de> + + * tty.h (class tty): Store from_master and to_master HANDLEs in + unions to make sure the storage is 64 bit compatible. Add comment to + explain why. + (from_master): Convert to read accessor method. + (to_master): Ditto. + (set_from_master): New method to store HANDLE value 64 bit clean. + (set_to_master): Ditto. + * fhandler_tty.cc: Fix debug printfs to work in 64 bit mode as well. + Change usage of from_master and to_master throughout to accommodate + aforementioned change. + * fhandler_termios.cc (fhandler_termios::ioctl): Add cast to avoid + compiler warning. + +2012-11-08 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct user_heap_info): Change type of chunk to SIZE_T. + Remove unused slop member. + * fork.cc (fork): Rename esp to stackp. Add 64 bit asm expression to + fetch stack pointer. + (child_copy): Use platform independent types. + * heap.cc (eval_start_address): Add comment. Disable 3GB code on 64 bit. + (eval_initial_heap_size): Use platform independent types. Fix debug + printf format strings. + (sbrk): Add comment. Change argument type according to newlib + definition. Use platform independent types. Drop unneeded else and + move comment to the right spot. + * hookapi.cc (PEHeaderFromHModule): Return PVOID. Add comment to + explain why. Add bool parameter to return if target executable is + 64 bit or not. + (rvadelta_get): New inline function to fetch section address platform + independent. + (rvadelta32, rvadelta64): Platform dependent wrappers. + (rvadelta): Change to macro calling the platform dependent rvadelta + wrappers. + (putmem): Define platform dependent THUNK_FUNC_TYPE and use throughout. + (RedirectIAT): Add comment. + (get_export): Add comment. + (find_first_notloaded_dll): Allow to fetch information in a platform + and target independent way. + (hook_or_detect_cygwin): Ditto. Recognize the cyg64win1.dll file name + as well. + * kernel32.cc (CreateFileMappingW): Cast to avoid compiler warning. + + * fhandler.h (class fhandler_dev_tape): Replace mt_evt with an + OVERLAPPED structure ov. + * mtinfo.h (class mtinfo_part): Define members as int32_t rather than + long. Change member function declarations accordingly. + (class mtinfo_drive): Ditto. Store OVERLAPPED pointer rather than + holding the full structure. Add comment to explain why. + * fhandler_tape.cc: Accommodate above changes throughout. + +2012-11-08 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc (fhandler_socket::ioctl): Don't use __ms_u_long + directly. Rather only use it on 64 bit. Add comment to explain the + problem. + +2012-11-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_socket.cc: Throughout, fix casts to work on 64 bit. Move + calls to pthread_testcancel to upper syscall level for consistency. + Move read, readv, write, and writev methods to keep together with + equivalent recv and send methods. + (fhandler_socket::read): Compute WSAMSG buffer on 64 bit to overcome + type restriction of WSABUF len member. + (fhandler_socket::recvfrom): Ditto. + (fhandler_socket::write): Ditto. + (fhandler_socket::sendto): Ditto. + (fhandler_socket::sendmsg): Restructure for readability. + * net.cc (cygwin_sendto): Call pthread_testcancel here. + (cygwin_recvfrom): Ditto. + (cygwin_connect): Ditto. + (cygwin_accept): Ditto. + (cygwin_recv): Ditto. + (cygwin_send): Ditto. + (cygwin_recvmsg): Ditto. + (cygwin_sendmsg): Ditto. + +2012-11-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc (heap_info::heap_info): Add comment to explain a + TODO item. + +2012-11-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsysvipc.cc (format_procsysvipc_msg): Fix printf format + string for 32 bit as well. + +2012-11-07 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_procsysvipc.cc (format_procsysvipc_msg): Fix printf format + string for 64 bit. + * fhandler_registry.cc (fhandler_registry::readdir): Fix cast. + * fhandler_serial.cc (ibuf): Avoid compiler warning. + * include/cygwin/ipc.h: Include stdint.h. + * include/cygwin/msg.h (msgqnum_t): Define as uint32_t. + (msglen_t): Ditto. + (struct msginfo): Convert all long members to int32_t. + (struct msg_info): Ditto. + * include/cygwin/sem.h (struct seminfo): Ditto. + * include/cygwin/shm.h (shmatt_t): Define as uint32_t. + (struct shmid_ds): Define shm_segsz as uint32_t. + (struct shminfo): Convert all long members to int32_t. + +2012-11-06 Corinna Vinschen <corinna@vinschen.de> + + * ntdll.h (PDI_WOW64_MODULES): Define. + (struct _DEBUG_BUFFER): Fix definition to work on 32 and 64 bit. + (struct _DEBUG_HEAP_INFORMATION): Ditto. + (struct _DEBUG_HEAP_BLOCK): Ditto. + +2012-11-05 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_process.cc: Fix debug printf calls to be type safe. + Add casts to avoid compiler warnings. + (get_mem_values): Avoid using ULONG_MAX since it's NOT matching + ULONG on 64 bit. + * fhandler_procnet.cc (fhandler_procnet::open): Fix syscall_printf call + to be type safe. + (format_procnet_ifinet6): Add cast to avoid compiler warnings. + * ntdll.h (struct _DEBUG_HEAP_BLOCK): Change Address to ULONG_PTR. + + * include/bits/wordsize.h: Fix __WORDSIZE definition for x86_64. + Add __WORDSIZE_COMPAT32 as on Linux. + * include/inttypes.h: Include bits/wordsize.h. Use __WORDSIZE check + where appropriate. + * include/limits.h: Include bits/wordsize.h. + (CHAR_BIT): Change definition to rely on default + compiler definition. + (LONG_BIT): Ditto. + (WORD_BIT): Ditto. + (__LONG_MAX__): Use __WORDSIZE check. + (RTSIG_MAX): Ditto. + * include/stdint.h: Include bits/wordsize.h. Use __WORDSIZE check + where appropriate. + * include/cygwin/signal.h: Ditto. + * include/cygwin/types.h: Ditto. + + * include/asm/byteorder.h (__ntohl): Use bswap instruction, available + since i486. + (__ntohs): Fix constraint to work on 64 bit CPU as well. + +2012-11-05 Corinna Vinschen <corinna@vinschen.de> + + * cpuid.h (can_set_flag): Implement for x86_64. + * fhandler.h (class fhandler_dev_raw): Define devbuf members taking + numerical values as DWORD, rather than size_t. + * fhandler_dsp.cc: Fix debug printf calls to be type safe. + (waveOut_callback): Align parameter types to latest MSDN description. + (waveIn_callback): Ditto. + (fhandler_dev_dsp::Audio_out::start): Change casts in call to + waveOutOpen according to MSDN. + (fhandler_dev_dsp::Audio_out::parsewav): Fix a cast. + (fhandler_dev_dsp::Audio_in::start): Change casts in call to + waveInOpen according to MSDN. + * fhandler_floppy.cc: Fix debug printf calls to be type safe. + (fhandler_dev_floppy::ioctl): Add casts to be on the safe side. + * fhandler_proc.cc: Fix debug printf calls to be type safe. + +2012-10-31 Corinna Vinschen <corinna@vinschen.de> + + * cygthread.cc: Fix usage of %p in debug printfs, throughout. + * dcrt0.cc: Ditto. + * dtable.cc: Ditto. + * errno.cc: Ditto. + * exceptions.cc: Ditto. + * fhandler.cc: Ditto. + * fhandler_console.cc: Ditto. + * fhandler_disk_file.cc: Ditto. + + * fhandler_clipboard.cc (cygnativeformat): Define as UINT. + (fhandler_dev_clipboard::read): Ditto for local format variable. + Use casts to compare off_t with size_t value. + * fhandler_console.cc (fhandler_console::ioctl): Avoid compiler + warnings. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Fix cast. + * include/sys/dirent.h (struct __DIR): Define __d_internal as uintptr_t, + rather than unsigned int. + +2012-10-30 Corinna Vinschen <corinna@vinschen.de> + + * fcntl.cc (fcntl64): Make arg an intptr_t. Add comment to explain a + potential type problem. Fix syscall_printf. + (_fcntl): Make arg an intptr_t. + * fhandler.cc (fhandler_base::fcntl): Ditto. + * fhandler_socket.cc (fhandler_socket::fcntl): Ditto. + * fhandler.h: Align declarations. + +2012-10-30 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc: Use %y rather than 0x%x. + * exceptions.cc: Ditto. + +2012-10-30 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (__small_vsprintf): Add 'y' and 'Y' conversion. + Add description to comment. + (__small_vswprintf): Align behaviour to __small_vsprintf. + +2012-10-30 Corinna Vinschen <corinna@vinschen.de> + + * external.cc (get_cygdrive_info): Return uintptr_t rather than DWORD. + (check_ntsec): Return bool. + (cygwin_internal): Return uintptr_t. Accommodate throughout. + * include/sys/cygwin.h (cygwin_internal): Align declaration. + +2012-10-30 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/signal.h (NSIG): Define differently for x86_64 and + i686. Change FIXME comment accordingly. + (SIGRTMAX): Define in terms of NSIG. + * include/limits.h (RTSIG_MAX): Define for x86_64. + * strsig.cc (__signals_common): Hold all signals available on both + platforms. + (__signals): Define differently for x86_64 and i686. + +2012-10-30 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc: Fix debug printf to be type-safe. + * dtable.cc: Ditto. + +2012-10-26 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.cc (_cygtls::remove): Fix debug printf to be type-safe. + * dcrt0.cc: Ditto, throughout. + * include/sys/cygwin.h (struct per_process): Define magic_biscuit, + dll_major and dll_minor as uint32_t. + +2012-10-26 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.h (struct init_cygheap): Define sthreads as uint32_t. + +2012-10-26 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc: Fix debug printfs to work in 64 bit mode as well, + throughout. + (nthreads): Define as uint32_t to make always 4 byte. Accommodate + throughout. + (threadlist_ix): Ditto. + +2012-10-26 Corinna Vinschen <corinna@vinschen.de> + + * exception.h (stackdump): Change first parameter to PUINT_PTR. + * exceptions.cc: Define cpu specific macros _GR, _AFMT and _ADDR. + Use throughout to avoid ifdef's. Fix debug printfs to work in + 64 bit mode as well, throughout. + (status_info): Define member code as NTSTATUS. Add casts where + necessary throughout. + (dump_exception): Dump all x86_64 registers if building for it. + (class stack_info): Define dummy_frame as PUINT_PTR. + (stack_info::init): Change first parameter to PUINT_PTR. Rename + ebp to framep for CPU independent naming. Drop debp macro. + (stack_info::walk): Rename ebp to framep for CPU independent naming. + Disable WOW64 hack in 64 bit mode. + (stackdump): Change first parameter to PUINT_PTR. Rename ebp to framep + for CPU independent naming. + (_cygtls::inside_kernel): Ignore system_wow64_directory on 64 bit. + (rtl_unwind): Redefine for x86_64 cpu. + (_except_list): Drop redundant definition. + (_cygtls::copy_context): Just use __COPY_CONTEXT_SIZE. + * sigproc.cc (_cygtls::signal_exit): Conditionalize stackdump call per + cpu. + * smallprint.cc (__small_vsprintf): Fix up for 64 bit. Handle 'l' size + modifier in 'd', 'o', 'u', 'x' conversion to print "long" values on a + per cpu base. Add 'O' conversion. Change comment accrdingly. + * include/cygwin/signal.h (struct _uc_fpxreg): Define for 64 bit. + (struct _uc_xmmreg): Ditto. + (struct _fpstate): Ditto. + (struct ucontext): Ditto. + (struct _uc_fpreg): Define for 32 bit. + (struct _fpstate): Use struct _uc_fpreg for _st. Use explicit sized + types. + (struct ucontext): Use explicit sized types. + (__COPY_CONTEXT_SIZE): Cast safely. + (sigset_t): Define as __uint64_t on 64 bit. Add FIXME comment in 32 + bit case. + +2012-10-24 Corinna Vinschen <corinna@vinschen.de> + + * smallprint.cc (rnarg): Make type-safe. + (rnargLL): Ditto. + (__small_vsprintf): Add comment to document meaning of each possible + conversion. Fix 'p' conversion for 64 bit. + +2012-10-23 Corinna Vinschen <corinna@vinschen.de> + + * globals.cc: Redefine _RDATA as "const", if not already defined. + Apply extern "C" linkage to the R/O UNICODE_STRINGs and cygwin_props. + Change comments to explain new method. + * winsup.h (_RDATA): Define as empty string and only if including + globals.h. + (cygwin_finished_initializing): Drop redundant declaration. + +2012-10-23 Corinna Vinschen <corinna@vinschen.de> + + * dtable.cc (dtable::get_debugger_info): Raise size of buf to allow + 64 bit values. Call sprintf in a type-safe manner. + +2012-10-23 Corinna Vinschen <corinna@vinschen.de> + + * dll_init.cc (reserve_at): Use PVOID rather than DWORD as type for + pointer parameters and return type. + (release_at): Ditto. + (dll_list::load_after_fork_impl): Fix format strings. Call reserve_at + without casts to DWORD. + (struct dllcrt0_info): Change type of res to PVOID. + (dll_dllcrt0): Return PVOID rather than int. + (dll_dllcrt0_1): Accommodate type change of dllcrt0_info::res. + (dll_noncygwin_dllcrt0): Disable on 64 bit. Add a cast for 32 bit. + * dll_init.h (struct pefile): Drop 32 bit decoration from Windows + types. + * ntdll.h (struct _DEBUG_HEAP_INFORMATION): Define Base as UINT_PTR. + (struct _DEBUG_MODULE_INFORMATION): Define Reserved and Base as + UINT_PTR. + * winsup.h (dll_dllcrt0): Declare as PVOID. + (dll_noncygwin_dllcrt0): Don't declare on 64 bit. + * include/cygwin/cygwin_dll.h (cygwin_attach_dll): Declare as PVOID. + (cygwin_detach_dll): Declare with PVOID parameter. + (dll_index): Declare as PVOID. + (_cygwin_dll_entry): Accommodate type change of dll_index. + * lib/crt0.h (dll_dllcrt0): Declare as PVOID. + * lib/cygwin_attach_dll.c (cygwin_attach_dll): Define PVOID. + +2012-10-23 Corinna Vinschen <corinna@vinschen.de> + + * dcrt0.cc (init_windows_system_directory): Disable setting + system_wow64_directory{_length} on 64 bit. + (dll_crt0_0): Disable WOW64-specific code on 64 bit. + (_dll_crt0): Ditto. + * globals.cc (system_wow64_directory): Don't define on 64 bit. + (system_wow64_directory_length): Ditto. + * wincap.cc (wincapc::init): On 64 bit, always set wow64 to 0 and + related bool values to false. + * wow64.cc: Disable entire code on 64 bit. + * wow64.h: Ditto. + +2012-10-23 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (__stack_t): Define as uintptr_t. + * dcrt0.cc (child_info_fork::alloc_stack): Conditionalize assembler + code on a per-CPU base. Rename esp to stackp. + (get_cygwin_startup_info): Cast pointers to uintptr_t in + multiple_cygwin_problem call. Minor formatting change. + (_dll_crt0): Conditionalize assembler code on a per-CPU base. + (multiple_cygwin_problem): Change parameters from unsigned to uintptr_t. + * winsup.h (multiple_cygwin_problem): Change declaration accordingly. + * pinfo.h (pinfo::reattach): Cast 2nd argument in proc_subproc call + to uintptr_t. + (pinfo::remember): Ditto. + * sigproc.cc (proc_subproc): Change 2nd parameter to uintptr_t to allow + pointer values. + * sigproc.h (proc_subproc): Change declaration accordingly. + * include/sys/cygwin.h (per_process_overwrite): Use offsetof to compute + value. + +2012-10-23 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (N0): Remove. + (N): Ditto. + (to_cmalloc): Use offsetof to compute value. + (tocygheap): Use offsetof to compute value. + +2012-10-22 Corinna Vinschen <corinna@vinschen.de> + + * cygtls.h (_tlsbase): Define for __x86_64__. + (_tlstop): Ditto. + * exception.h (exception_list): Ditto. + +2012-10-22 Corinna Vinschen <corinna@vinschen.de> + + * cygheap.cc (to_cmalloc): Fix pointer cast. + (nextpage): Ditto. Base definition on roundup2. + (allocsize): Cast to SIZE_T. + (_csbrk): Drop granmask. Define adjsbs SIZE_T as 2nd parameter to + VirtualAlloc. + (tocygheap): Fix pointer cast. + +2012-10-18 Corinna Vinschen <corinna@vinschen.de> + + Avoid various type ambiguity problems showing up in the 64 bit case: + * cygheap.h (cygheap_user::set_sid): Convert to void. + (cygheap_user::set_saved_sid): Ditto. + * devices.h (struct device): Drop operator int& and DWORD& entirely. + Throughout, use dev_t or fh_devices instead. + * devices.cc: Regenerate. + * fhandler.h (class fhandler_base): Convert _refcnt member to LONG. + (fhandler_base::inc_refcnt): Return LONG. + (fhandler_base::dec_refcnt): Ditto. + (fhandler_base::get_major): Return _major_t. + (fhandler_base::get_minor): Return _minor_t. + (fhandler_base::get_unit): Delete. Throughout, use get_minor instead + of get_unit. + (fhandler_socket::get_socket): Use SOCKET rather than int. Only define + if __INSIDE_CYGWIN_NET__ is defined. + (fhandler_pty_slave::get_unit): Drop declaration. + * fhandler_procnet.cc: Include Windows headers early. + * fhandler_socket.cc: Ditto. + * fhandler_tty.cc (fhandler_pty_slave::get_unit): Remove. + * path.h (path_conv::get_device): Rename from get_devn and change return + type to dev_t. Accommodate throughout. + (path_conv::get_unitn): Remove unused method. + * pinfo.h (class pinfo): Drop operator== for int case. + (pinfo::operator!): Define. + * poll.cc: Don't define __INSIDE_CYGWIN_NET__. + * syscalls.cc (getpgid): Replace use of pinfo::operator== with + pinfo::operator!. + * tty.h (tty_min::setntty): Convert 2nd parameter to _minor_t. + * tty.h (tty_min::getntty): Change return type to dev_t. + (tty_min::get_minor): Rename from get_unit. Change return type to + _minor_t. + +2012-08-16 Corinna Vinschen <corinna@vinschen.de> + + * include/mntent.h: Don't include paths.h and don't define macros if + _NOMNTENT_MACROS is set. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * advapi32.cc (DuplicateTokenEx): Make ?: expression type-safe. + * ntdll.h (KAFFINITY): Don't define if building with Mingw64 headers. + * thread.cc: Throughout drop casts in calls to Interlocked functions. + * thread.h (class fast_mutex): Ditto. Define lock_counter as LONG. + (class pthread_mutex): Define lock_counter as LONG. + (struct MTinterface): Define threadcount as LONG. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add AC_NO_EXECUTABLES to allow bootstrap. + Add x86_64 to allowed cpu types. + * configure: Regenerate. + * config/x86_64/profile.h: New file. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (semaphore::_fixup_after_fork): Fix Win32 error output in + api_fatal call. + +2012-08-14 Corinna Vinschen <corinna@vinschen.de> + + * mkvers.sh: Drop reference to w32api includes. + +2012-08-13 Corinna Vinschen <corinna@vinschen.de> + + * include/cygwin/stat.h (struct __stat64): Drop entirely in favor of + struct stat. Accommodate throughout Cygwin. + * include/cygwin/types.h: Throughout, drop current, internal types + used since Cygwin 1.5 with the base type they have been used for. + Throughout, define types based on bitsize-specific types where + appropriate. Accommodate throughout Cygwin. + * include/sys/cygwin.h: Drop __uid32_t and __gid32_t in favor of + uid_t and gid_t. Define uid/gid types based on bitsize-specific types. + (struct external_pinfo): Accommodate above change. + * cygtls.h (struct _local_storage): Drop unused members grp and + namearray, + * tlsoffsets.h: Regenerate. + * devices.h (_dev_t): Drop definition. Use dev_t throughout instead. + * devices.cc: Regenerate. + + Probably temporary patch to drop unneeded functionality on x86_64: + * fcntl.cc (_fcntl): Alias to fcntl64 on x86_64. + * glob.cc (CYGWIN_gl_stat): Simplify on x86_64. + * grp.cc (grp32togrp16): Don't define on x86_64. + (getgrgid): Alias to getgrgid32 on x86_64. + (getgrnam): Alias to getgrnam32 on x86_64. + (getgrent): Alias to getgrent32 on x86_64. + (getgroups): Alias to getgroups32 on x86_64. + (initgroups): Alias to initgroups32 on x86_64. + (setgroups): Alias to setgroups32 on x86_64. + * mmap.cc (mmap): Alias to mmap64 on x86_64. + * passwd.cc (getpwuid): Alias to getpwuid32 on x86_64. + (getpwuid_r): Alias to getpwuid_r32 on x86_64. + (getpwduid): Don't define on x86_64. + * syscalls.cc (lseek): Alias to lseek64 on x86_64. + (_lseek): Alias to lseek64 on x86_64. + (chown): Alias to chown32 on x86_64. + (lchown): Alias to lchown32 on x86_64. + (fchown): Alias to fchown32 on x86_64. + (stat64_to_stat32): Don't define on x86_64. + (fstat): Alias to fstat64 on x86_64. + (_fstat_r): Alias to _fstat64_r on x86_64. + (stat): Alias to stat64 on x86_64. + (_stat_r): Alias to _stat64_r on x86_64. + (lstat): Alias to lstat64 on x86_64. + (ftruncate): Alias to ftruncate64 on x86_64. + (truncate): Alias to truncate64 on x86_64. + (seteuid): Alias to seteuid32 on x86_64. + (setuid): Alias to setuid32 on x86_64. + (setreuid): Alias to setreuid32 on x86_64. + (setegid): Alias to setegid32 on x86_64. + (setgid): Alias to setgid32 on x86_64. + (setregid): Alias to setregid32 on x86_64. + * uinfo.cc (getuid): Alias to getuid32 on x86_64. + (getgid): Alias to getgid32 on x86_64. + (geteuid): Alias to geteuid32 on x86_64. + (getegid): Alias to getegid32 on x86_64. + * winsup.h (ILLEGAL_UID16): Don't define on x86_64. + (ILLEGAL_GID16): Ditto. + (uid16touid32): Don't declare on x86_64. + (gid16togid32): Don't declare on x86_64. + +2012-08-13 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (TEST_DLL_NAME): Use -nostdlib flag unconditionally. + +2012-08-10 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.sc: Add default w32api search dirs. + * Makefile.in (DLL_IMPORTS); Just use -l syntax. + (TEST_DLL_NAME): Drop DLL_IMPORTS dependency. + diff --git a/winsup/CVSChangeLogs.old/doc/ChangeLog-2015 b/winsup/CVSChangeLogs.old/doc/ChangeLog-2015 new file mode 100644 index 000000000..0f8877b69 --- /dev/null +++ b/winsup/CVSChangeLogs.old/doc/ChangeLog-2015 @@ -0,0 +1,3165 @@ +2015-12-21 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (setfacl): Rename --substitute to --set. + * new-features.xml (ov-new2.4): Rephrase setfacl changes. + +2015-12-07 Johannes Schindelin <johannes.schindelin@gmx.de> + + * pathnames.xml: Document the new usertemp file system type. + +2015-12-06 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.4): Document cygpath -U option. + * utils.xml (cygpath): Ditto. + * path.xml (func-cygwin-path): Add CCP_PROC_CYGDRIVE description. + +2015-11-25 David Macek <david.macek.0@gmail.com> + + * faq-using.xml: Add MacType to the BLODA. Fix formatting. + +2015-11-24 David Macek <david.macek.0@gmail.com> + + * pathnames.xml: Add a section describing peculiarities of how Cygwin + creates NTFS symlinks. + +2015-11-24 David Macek <david.macek.0@gmail.com> + + * faq-using.xml: Add Forefront TMG to the BLODA. + +2015-11-21 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.4): Document fa_IR and ps_AF locale fixes. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.4): Add new ACL changes. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (setfacl): Accommodate -b/-k change. + * new-features.xml (ov-new2.4): Add setfacl -b/-k change. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (setfacl): Show new option output. + (getfacl): Show new option output. + +2015-11-17 Yaakov Selkowitz <yselkowi@redhat.com> + + * new-features.xml (ov-new2.4): New section. Document rpmatch. + * posix.xml (std-bsd): Add rpmatch. + +2015-11-02 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.3): Document Parallels Desktop FS support. + +2015-10-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.3): Document strftime %s addition. + +2015-10-22 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-iso): New section. + (std-deprec): Rearrange title text. + * new-features.xml (ov-new2.3): Document aligned_alloc, at_quick_exit, + quick_exit. + +2015-10-06 Ken Brown <kbrown@cornell.edu> + + * faq-using.xml (faq.using.same-with-permissions): New entry. + +2015-09-07 Brian Inglis <Brian.Inglis@SystematicSw.ab.ca> + + * faq-using.xml (faq.using.man): Replace makewhatis with mandb. + +2015-08-29 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.3): Document sysconf cache addition. + +2015-08-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.3): New section, document posix_madvise + POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED change. + +2015-08-18 Jon Turney <jon.turney@dronecode.org.uk> + + * faq-using.xml (faq.using.bloda): Add Lavasoft Web Companion to + BLODA list. + +2015-08-03 Jon Turney <jon.turney@dronecode.org.uk> + + * faq-programming.xml: Improve debugging-cygwin answer. + +2015-07-21 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.2): Document sigsetjmp, siglongjmp. + +2015-07-17 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.2): Add new section. Document getcontext, + setcontext, makecontext, swapcontext. + * posix.xml (std-deprec): Add getcontext, setcontext, makecontext, + swapcontext. + +2015-07-05 Jon Turney <jon.turney@dronecode.org.uk> + + * configure.ac: Add check for DOCBOOK2XTEXI + * configure: Regenerate. + * Makefile.in (DOCBOOK2XTEXI): Use. + +2015-06-22 Jon Turney <jon.turney@dronecode.org.uk> + + * README: Update. + +2015-06-22 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (FAQ_SOURCES): Remove and generate with xidepend. + +2015-06-22 Jon Turney <jon.turney@dronecode.org.uk> + + * utils.xml: Remove 'Usage' prefix from synopses. + +2015-06-22 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (intro2man.stamp): Add. + * intro.xml: New file. + +2015-06-22 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (install-info, cygwin-ug-net.info) + (cygwin-api.info): Add. + * cygwin-ug-net.xml: Add texinfo-node. + * cygwin-api.xml: Ditto. + * ntsec.xml (db_home): Add texinfo-node for titles containing a + ':' which are the targets of an xref. + +2015-06-20 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.1): Add alterante signal stack info. + * posix.xml (std-susv4): Move sigaltstack here. + +2015-06-19 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (install-man): Fix command to create man3 install + directory. + +2015-06-17 Jon Turney <jon.turney@dronecode.org.uk> + + * man.xsl: New file. + * Makefile.in (utils2man.stamp, api2man.stamp): Use it. + +2015-06-17 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (api2man.stamp): Add rules to build and install + manpages for cygwin-api. + +2015-06-17 Jon Turney <jon.turney@dronecode.org.uk> + + * cygwin-api.xml: Move introductory paragraph here. + * logon-funcs.xml: Convert from using a sect2 element to using a + refentry element for each function. + * misc-funcs.xml: Ditto. + * path.xml: Ditto. + +2015-06-17 Jon Turney <jon.turney@dronecode.org.uk> + + * fo.xsl: Render funcsynopsis elements as ANSI style function + prototypes. + * html.xsl: Ditto. + +2015-06-17 Jon Turney <jon.turney@dronecode.org.uk> + + * html.xsl: Renamed from cygwin.xsl. + +2015-06-17 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-bsd): Add sethostname. + +2015-06-17 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new): Rename from ov-new1.7. + (ov-new2.1): Add new section. Document sethostname. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (install-man, utils2man.stamp): Add rules to build + and install manpages for utils. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * utils.xml : Convert from using a sect2 element to using a + refentry element for each utility program. + * cygwin.xsl: Customize autotoc to include refentries. + * fo.xsl: Ditto. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (cygwin-ug-net/cygwin-ug-net-nochunks.html.gz): + Ensure cygwin-ug-net directory exists. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * xidepend: Write a Makefile fragment defining variables + containing all the XIncluded sources, rather than a dependency on + those sources. + * Makefile.in: Use that variable to express the dependency. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (cygwin-ug-net/cygwin-ug-net.pdf) + (cygwin-api/cygwin-api.pdf): Use fo.xsl to customized DocBook + XML->PDF conversion. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * cygwin-ug-net.xml: Remove incorrect unused date. + * utils.xml : Remove .exe suffix inconsistently added in a few + places. Tidy up some trailing whitespace. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * xidepend: Fix to handle relative pathnames. + +2015-06-12 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in (.PHONY): Remove tarball target. + +2015-06-04 Jon Turney <jon.turney@dronecode.org.uk> + + * Makefile.in: Remove ancient unused rules to make a documentation + tarball. + +2015-06-01 Jon Turney <jon.turney@dronecode.org.uk> + + * ov-ex-unix.xml: Remove unhelpful mention of and inaccurate size + estimate for installing everything. + * ov-ex-win.xml: Ditto. + +2015-04-27 Mike DePaulo <mikedep333@gmail.com> + + * cygserver.xml (install-cygserver): Add new section. How to install + Cygserver. + +2015-04-10 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new2.0): Rename from ov-new1.7.36 and change + version number to 2.0. + +2015-04-02 David A. Wheeler <dwheeler@dwheeler.com> + + * faq-setup.xml: Document how Cygwin secures installation and + update against man-in-the-middle (MITM) attacks. Note that + setup embeds a public key to check the signature of setup.ini, + and that setup.ini includes SHA-512 cryptographic hashes. + +2015-03-31 Jon TURNEY <jon.turney@dronecode.org.uk> + + * misc-funcs.xml (cygwin_internal): Correct return type. + +2015-03-31 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.36): Add new section. Document GNU + basename. + +2015-03-30 Yaakov Selkowitz <yselkowi@redhat.com> + + * posix.xml (std-gnu): Add basename. + (std-notes): Add note about two forms of basename. + +2015-03-13 Jon TURNEY <jon.turney@dronecode.org.uk> + + * Makefile.in (prefix): Define. + +2015-03-12 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml (ntsec-mapping-nsswitch-desc): Fix typo. + (ntsec-mapping-samba): Ditto. + +2015-03-12 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml (ntsec-mapping-passwdinfo): Drop the word "Note" from + a note. + (ntsec-mapping-nsswitch): Fix typo. + +2015-03-10 Corinna Vinschen <corinna@vinschen.de> + + * faq-programming.xml: Accommodate switch of Cygwin repo to GIT. + * setup-net.xml: Ditto. + +2015-03-04 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-bsd): Add issetugid. + +2015-03-03 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.35): Add SIGSYS change. + +2015-03-03 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.35): Add new section. + +2015-02-28 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (getfacl): Adjust options to option nmame change. + +2015-02-25 Warren Young <warren@etr-usa.com> + + * faq-using.xml (faq.using.ssh-pubkey-stops-working): More + improvements to the chgrp None hack to account for domains + and non-English versions of Windows. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml (ntsec-mapping): Match the description of the default + values for db_home, db_shell, and db_gecos to the latest changes. + +2015-02-24 Warren Young <warren@etr-usa.com> + + * faq-using.xml (faq.using.ssh-pubkey-stops-working): Added the + chgrp None ~/.ssh/* fix for SSH key failure in Cygwin 1.7.34+. + +2015-02-17 Warren Young <warren@etr-usa.com> + + * faq-using.xml (faq.using.startup-slow): Applied Andrey Repin's + improvements <anrdaemon@yandex.ru>, plus made a few minor ones + of my own. + +2015-02-16 Corinna Vinschen <corinna@vinschen.de> + + * setup-files.xml (setup-files): Drop hint to set HOME in Windows + environment. + * setup-env.xml (setup-env-ov): Discourage setting HOME in the Windows + environment. + +2015-02-15 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-gnu): Add missing __mempcpy. + +2015-02-12 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml: Throughout fix references to the Cygwin version number. + +2015-02-11 Warren Young <warren@etr-usa.com> + + * faq-using.xml (faq.using.startup-slow): New entry. + +2015-02-06 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-susv4): Move cabsl, cimagl, creall, hypotl, sqrtl here + from std-notimpl. Add finitel. + +2015-02-04 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-susv4): Move wcstold here from std-notimpl. + +2015-02-04 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.34): Add wcstold. + +2015-02-04 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.ssh-pubkey-stops-working): New entry. + (faq.using.same-with-rhosts): Ditto. + +2015-02-03 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (regtool): Clarify save action. Add description for + restore action. + * new-features.xml (ov-new1.7.34): Add regtool restore. + +2015-02-03 Corinna Vinschen <corinna@vinschen.de> + + * Throughout, replace http with https as far as cygwin.com and + sourceware.org URLs are concerned. + * Throughout, simplify ulink expressions if the visible text is the + URL anyway. + * faq-programming.xml (faq.programming.dll-relocatable): Remove. + * faq-setup.xml (faq.setup.name-with-space): Change for 1.7.34. + (faq.setup.home): Ditto. + * faq-using.xml (faq.using.printing): Clarify old links and availability + of a2ps and file. + (faq.using.xemacs): Drop outdated version info and pointers to native + XEmacs. + (faq.using.ntemacs): Remove. + * faq-what.xml (faq.what.what): Rephrase to reflect reality. + (faq.what.supported): Ditto. + (faq.what.who): Rephrase slightly. + * legal.xml: Bump copyright. + * setup-net.xml (internet-setup): Fix references to setup executables. + +2015-01-23 Pierre A. Humblet <phumblet@phumblet.no-ip.org> + Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.34): Add extension of gethostbyname2. + Add sockatmark. + +2015-01-20 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-susv4): Move sockatmark here from std-notimpl. + +2015-01-14 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml (ntsec-mapping-nsswitch-passwd): Document /path %H wildcard. + (ntsec-mapping-nsswitch-home): Disable text explaining how the home + directory is fetched from the homeDrive attribute. + +2015-01-14 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.xml (cygwinenv-removed-options): Accommodate list of + always uppercased Windows variables to latest change. + +2014-12-18 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * ntsec.xml (ntsec-logonuser): Fix spelling of pw_passwd field. + +2014-12-18 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * new-features.xml (ov-new1.7.34): Document Solaris stdio_ext.h + functions and BSD/GNU unlocked stdio extensions. + * posix.xml (std-bsd): Add BSD unlocked stdio extensions. + (std-gnu): Add GNU unlocked stdio extensions. + (std-solaris): Add stdio_ext.h functions. + +2014-12-15 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.34): Add setfacl -k option. + * utils.xml (setfacl): Ditto. + +2014-12-10 Michael DePaulo <mikedep333@gmail.com> + + * ntsec.xml (ntsec-mapping-samba): Clarify Samba file server setup. + +2014-12-10 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.bloda): Add Lenovo RapidBoot Shield to + BLODA list. + +2014-12-08 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.upgrade-mountpoints): Remove. + * pathnames.xml (pathnames-mount-ex): Remove note about 1.5->1.7 + registry mount point updates. + +2014-12-06 Corinna Vinschen <corinna@vinschen.de> + +2014-12-06 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-solaris): Point to libtirpc for xdr functions. + +2014-12-06 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.xsl (toc.section.depth): Set to 4. + * ntsec.xml: Revamp account mapping documentation to account for the + new db_home, db_shell, db_gecos settings. + +2014-12-05 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * new-features.xml (ov-new1.7.34): Document qsort_r and __bsd_qsort_r. + * posix.xml (std-bsd): Add qsort_r. + (std-gnu): Ditto. + (std-notes): Add section for qsort_r. + +2014-12-03 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.34): Add latest changes. + +2014-11-28 Yaakov Selkowitz <yselkowi@redhat.com> + + * Makefile.in (XSLTPROC): Remove. + (cygwin-ug-net/cygwin-ug-net.pdf): Build with xmlto pdf. + (cygwin-api/cygwin-api.pdf): Ditto. + (faq/faq.html): Fix extraneous anchor removal. + +2014-11-24 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (passwd): Align to latest changes. + +2014-11-13 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.34): Add new section. + (ov-new1.7.33): Reflect intermediate 1.7.33 release. + +2014-11-07 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (mkgroup): Align to changed usage. + (mkpasswd): Ditto. + +2014-11-07 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (mkpasswd): Change /etc/group to /etc/passwd. + +2014-11-05 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.33): Document xdr and atexit. + +2014-10-30 David Rothenberger <daveroth@acm.org> + + * ntsec.xml: Fix typo. + +2014-10-29 Dave Habermann <dahabermann@dow.com> + + * ntsec.xml (ntsec-mapping-caching): Describe service dependencies + in terms of cygserver. + +2014-10-28 Corinna Vinschen <corinna@vinschen.de> + + * xidepend: Make PDF file dependent on the same input files as the + HTML file of the same name to trigger automatic rebuild of PDFs on + source file changes as well. + +2014-10-28 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.xml: Change default setting of dosfilewarning. + * new-features.xml (ov-new1.7.33): Document aforementioned change. + +2014-10-28 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml: Fix Solaris doc URLs. + +2014-10-28 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml: Try to make an expression less ambiguous. + +2014-10-27 Luke Kendall <luke.kendall@cisra.canon.com.au> + Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml: More language fixes. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.33): Document empty $PATH handling. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.33): Fix paragraph order. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * highlights.xml: Rearrange itemizedlist markup slightly. + * new-features.xml (ov-new1.7.33): Add setfacl -b option. + * utils.xml (setfacl): Ditto. + +2014-10-24 Luke Kendall <luke.kendall@cisra.canon.com.au> + + * ntsec.xml: More language and typo fixes. + +2014-10-23 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml: Fix language. + +2014-10-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Create install targets. + (cygwin-ug-net/cygwin-ug-net.pdf): Create subdir to allow building PDF + even if subdir is missing. + (cygwin-api/cygwin-api.pdf): Ditto. + * configure.ac: Add AC_PROG_INSTALL rule. + * configure: Regenerate. + * new-features.xml (ov-new1.7.33): Add installation of docs. + +2014-10-22 Corinna Vinschen <corinna@vinschen.de> + + * posix.xml (std-gnu): Add ffsl, ffsll, quotactl. + (std-notes): Add restrictions of quotactl. + +2014-10-22 Yaakov Selkowitz <yselkowi@redhat.com> + + * new-features.xml (ov-new1.7.33): Document stime. + * posix.xml (std-deprec): Add stime. + +2014-10-22 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.33): s/Linux/glibc. + +2014-10-22 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.33): Update to current state. + +2014-09-05 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.xml (cygdrive): Add /proc/cygdrive description. + +2014-09-03 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (setfacl): Align documentation to help text in setfacl. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml (ntsec-common): Drop outdated comment about underdeveloped + Solaris ACL API support. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (setfacl): Drop outdated note that default ACEs are not + taken into account. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml: Disable description of db_prefix and db_separator settings. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml (getfacl): Document additional suid/sgid/vtx flag printing. + +2014-08-15 Corinna Vinschen <corinna@vinschen.de> + + * configure.ac: Convert to new AC_INIT style. + * configure: Regenerate. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * cygwin-api.xml: Include misc-funcs.xml. + * misc-funcs.xml: New file. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * cygwin-api.xml: Move chapter tags from path.xml back here. + Include logon-funcs.xml. + * logon-funcs.xml: Moved from ../cygwin here and converted to XML. + * path.xml: Drop chapter tags. Create subsections. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Throughout use parenthesis instead of braces where + appropriate. + (DBXDIRS): Remove. + (XSLTPROC): Define for symmetry. Use throughout. + (clean): Drop removing cygwin-api.xml and doctool.*. + (cygwin-api.xml): Drop rule. + (doctool): Drop rule. + (Makefile.dep): Add dependency to cygwin-api.xml. + * cygwin-api.in.xml: Rename to cygwin-api.xml. Convert includes to + XML XInclude style. + * doctool.c: Remove. + * doctool.txt: Remove. + * faq-programming.xml: Drop reference to local utils.xml file. + * path.xml: Moved from ../cygwin and converted to XML. + * posix.xml: Ditto. + * using.xml: Drop relative path from utils.xml include. + * utils.xml: Moved from ../utils. + +2014-08-13 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.33): Add new section. + (ov-new1.7.32): Reflect intermediate 1.7.32 release. + +2014-08-06 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml (ntsec-mapping): Drop plus-prepended builtin accounts as + default setting. Add short explanation in db_prefix: always mode. + Fix a type. Drop a paragraph with redundant information. + +2014-08-03 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * faq-what.xml (faq.what.who): Remove mention of retired setup + maintainers. Add link to cygwin-pkg-maint. + +2014-07-31 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * faq-what.xml (faq.what.who): CGF has retired. + +2014-07-30 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.xml: Small improvments. + +2014-07-30 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml: (ov-new1.7): Change section title. + +2014-07-30 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml: (ov-new1.7.1): Add new section. Move old 1.7 + sections into section level 3. + +2014-07-30 Corinna Vinschen <corinna@vinschen.de> + + * cygwin.xsl: Allow 3 section levels in TOC. + * new-features.xml: (ov-new1.7.32): Add new section. + * ntsec.xml: Rename top-level section to reflect extension of topics. + Remove old /etc/passwd, /etc/group considerations. Add new sections + explaining Windows to POSIX account mapping. Make setuid sections + third level sections. + * pathnames.xml: Note new method of account mapping for fstab.d/$USER. + * faq-setup.xml: Rework references to /etc/passwd and /etc/group to + reflect changes to account handling. + * faq-using.xml: Ditto. + +2014-07-21 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml: (ov-new1.7.31): Add new section. + +2014-06-26 Corinna Vinschen <corinna@vinschen.de> + + * legal.xml: Fix copyright. + +2014-06-17 Christopher Faylor <me.cygwin2014@cgf.cx> + + * faq-programming.xml: Add gettext-devel to list of packages needed to + build Cygwin. + +2014-04-04 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml: (ov-new1.7.29): Fix incomplete XML tagging. + +2014-03-31 Christopher Faylor <me.cygwin2014@cgf.cx> + + * new-features.xml: (ov-new1.7.29): Add new section. + +2014-01-29 Christopher Faylor <me.cygwin2014@cgf.cx> + + * faq-setup.xml: Minor snapshot instruction rewording. Update + discussion about setup*.exe. + * faq-using.xml: Update information about setup*.exe. + * faq-what.xml: Ditto. + +2014-01-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.28): Add new section. + +2014-01-07 Mark Geisert <mark@maxrnd.com> + + * faq-programming.xml: Update packages needed to build Cygwin. + +2013-12-07 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.27): Add new section. + +2013-11-29 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.26): Fix section ID and title. Add + posix_spawn item. + +2013-11-23 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.26): Add new section. + +2013-11-12 Tom Schutter <t.schutter@comcast.net> + + * faq-setup.xml (faq.setup.uninstall-service): Describe how to unhook + cyglsa DLL from OS before uninstalling. + +2013-11-11 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml: Throughout remove setup.exe, use setup or setup-x86... + instead. + (faq.setup.cli): Reproduce latest --help output. + (faq.setup.noroot): New section. + (faq.setup.setup-fails-on-ts): Remove section. + * setup-net.xml (internet-setup): Mention setup-x86{_64} in first + paragraph. Add note to allow using setup.exe in subsequent paragraphs. + Add paragraph to introduce --no-admin option. + +2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * Makefile.in: Fix problems accessing xidepend when configured with a + (discouraged) relative path to source directory. + +2013-08-23 Christopher Faylor <me.cygwin2013@cgf.cx> + + * new-features.xml (ov-new1.7.25): Change wording. + +2013-08-23 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.25): Add new section. + +2013-08-14 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.24): Add new section. Mention + posix_memalign override. + +2013-07-26 Christopher Faylor <me.cygwin2013@cgf.cx> + + * new-features.xml (ov-new1.7.23): Add new section. Mention wincmdln. + * cygwinenv.xml: Mention wincmdln. + +2013-07-25 Corinna Vinschen <corinna@vinschen.de> + + * gcc.xml (gcc-64): Fix example. + +2013-07-25 Corinna Vinschen <corinna@vinschen.de> + + * gcc.xml (gcc-default: Rename from gcc-cons. Change title. + (gcc-64): New section explaininig differences in programming for + 64 bit Cygwin. + (gcc-gui): Simplify description and aim at UNIX/Linux developers only. + Note that X programming is preferred. Drop example. + +2013-07-21 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.22): Add GetCommandLine and regcomp + changes. + +2013-07-21 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygwin-ug-net/cygwin-ug-net.html): Add dependency to + cygwin.xsl. + (cygwin-api/cygwin-api.html): Ditto. + (cygwin-ug-net/cygwin-ug-net.pdf): Add dependency to fo.xsl. + (cygwin-api/cygwin-api.pdf): Ditto. + (cygwin-api.xml): Drop "." path component from doctool dependency. + Change Makefile to Makefile.in dep. + (doctool): Drop "." path component from target. + +2013-07-20 Warren Young <warren@etr-usa.com> + Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygwin-ug-net/cygwin-ug-net.pdf): Process input via + xsltproc and fop. + (cygwin-api/cygwin-api.pdf): Ditto. + * fo.xsl: New file. + +2013-07-15 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.22): New section. Document dropped + support for /dev/mem, /dev/kmem, /dev/port. + * specialnames.xml (pathnames-posixdevices): Drop description of + /dev/mem, /dev/kmem, /dev/port. + +2013-06-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.21): New section. Document rawmemchr. + +2013-06-19 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.private-cygwin): Drop. + +2013-06-19 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.multiple-copies): Modernize to reflect + installation separation since Cygwin 1.7. + (faq.using.third-party.multiple-copies): Ditto. + +2013-06-17 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.xml: Fix link to FAQ. + +2013-06-05 Corinna Vinschen <corinna@vinschen.de> + + * faq-copyright.xml: Fix link to license. + * faq-using.xml: Ditto. + * faq-what.xml: Ditto. + +2013-06-05 Corinna Vinschen <corinna@vinschen.de> + + * faq-programming.xml: Convert url to refer to new flat faq.html file. + * faq-setup.xml: Ditto. + * faq-using.xml: Ditto. + * highlights.xml: Ditto. + +2013-06-05 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.19): Revert mandatory locking support to + "preliminary". + +2013-06-04 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add rule to rebuild Makefile if Makefile.in changes. + Include Makefile.dep last. + (Makefile.dep): Run xidepend within source dir. Temporarily drop + faq.xml from dependencies. + * xidepend: Fix creating base filename to accommodate VPATH. + +2013-06-04 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.19): Align mandatory locking text to + today's changes. + +2013-06-03 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.19): Add mandatory locking. + +2013-05-23 Warren Young <warren@etr-usa.com> + + * xidepend: New script, generates Makefile.dep from top-level XML + * .cvsignore: Ignoring Makefile.dep output + * Makefile: Creating Makefile.dep if it doesn't exist, including it + if it does, and removing it on 'make clean' + * Wishlist: Knocked autodependency generation off the list + +2013-05-23 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.xml (cygwinenv-implemented-options): Explain new + winsymliks:nativestrict option. Strip out description of symlink types + and refer to new pathnames-symlinks section. + * highlights.xml (ov-hi-files): Rip out most of symlink description and + refer to new pathnames-symlinks section instead. + * new-features.xml (ov-new1.7.19): Add CYGWIN=winsymlinks:nativestrict. + * pathnames.xml (pathnames-symlinks): New section describing symbolic + link handling. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.19): Add arc4random, + arc4random_addrandom, arc4random_buf, arc4random_stir and + arc4random_uniform. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + * new-features.xml (ov-new1.7.19): Add __b64_ntop and __b64_pton. + +2013-05-13 Warren Young <warren@etr-usa.com> + + * cygwin-ug.xml setup.xml: Removed; unused. + * Wishlist: Created, with initial content based on a -patches + mailing list post. + +2013-05-06 Warren Young <warren@etr-usa.com> + + * cygwin-api.in.xml (bookinfo): Reverted XInclude for legal.xml + fragment to a DOCTOOL include. + +2013-05-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * Makefile (FAQ_SOURCES): Use wildcard function to find sources in + srcdir. + +2013-05-01 Warren Young <warren@etr-usa.com> + + * bodysnatcher.pl: Created + * Makefile.in (faq/faq.body): Added target to create this file from + faq/faq.html using new bodysnatcher.pl script. + +2013-05-01 Warren Young <warren@etr-usa.com> + + * cygwin-ug.xml: Renamed from cygwin-ug.in.sgml + (bookinfo) Extracted <bookinfo> section into new ug-info.xml file + * ug-info.xml: Created + * cygwin-ug-net.xml: Renamed from cygwin-ug-net.in.sgml + (bookinfo) Replaced content with XInclude referencing ug-info.xml + * configure.ac: Replaced a *.sgml file reference with *.xml + * cygserver.xml cygwinenv.xml dll.xml effectively.xml filemodes.xml + gcc.xml gdb.xml legal.xml new-features.xml ntsec.xml overview.xml + pathnames.xml programming.xml setup.xml setup-net.xml textbinary.xml + using.xml windres.xml: Renamed from *.sgml. + Added <?xml> and <!DOCTYPE> tags to the top. + * cygserver.sgml cygwinenv.sgml dll.sgml effectively.sgml filemodes.sgml + gcc.sgml gdb.sgml legal.sgml new-features.sgml ntsec.sgml overview.sgml + pathnames.sgml programming.sgml setup.sgml setup-net.sgml textbinary.sgml + using.sgml windres.sgml: Renamed to *.xml + * faq.xml: Renamed from faq-sections.sgml. (Not faq.sgml!) + Replaced FAQ section ENTITY declarations with XIncludes. + Removed all other ENTITY declarations as they just name entities + already defined in the current DocBook stylesheets. + * faq.sgml: Removed without translating to DocBook XML. Obsolete. + * faq-*.xml: Added <?xml> and <!DOCTYPE> tags to the top. + Moved <qandadiv> tags from faq.xml and faq-sections.xml into + individual section files so they individually pass XML validation. + * pathnames.xml: Contained two top-level <sect1> elements, which is + malformed XML. Moved second to new specialnames.xml file. + * specialnames.xml: Created; extracted from pathnames.sgml + * overview2.xml: Broke it up into following three files, and + removed the original. + * ov-ex-win.xml (ov-ex-win): Created; contents extracted from + overview2.sgml + * ov-ex-unix.xml (ov-ex-unix): Ditto + * highlights.xml (highlights): Ditto + * setup2.xml: Broke it up into setup-*.xml. + * setup-env.xml setup-files.xml setup-locale.xml setup-maxmem.xml: + Created; contents extracted from setup2.sgml + +2013-04-24 Corinna Vinschen <corinna@vinschen.de> + + * faq-programming.xml (faq.programming.64bitporting): Fix typo. + +2013-04-24 Corinna Vinschen <corinna@vinschen.de> + + * faq-programming.xml (faq.programming.64bitporting): Extend entry. + (faq.programming.64bitporting-fail): New entry. + (faq.programming.64bitporting-cygwin64): New entry. + +2013-04-24 Corinna Vinschen <corinna@vinschen.de> + Christian Franke <Christian.Franke@t-online.de> + + * faq-programming.xml (faq.programming.64bitporting): Mention the + -Wformat and -Wall gcc options. + +2013-04-24 Corinna Vinschen <corinna@vinschen.de> + + * faq-programming.xml (faq.programming.64bitporting): New FAQ entry. + (faq.programming.objective-c): Include gcc4. + (faq.programming.make-execvp): Drop text discouraging usage of -j. + (faq.programming.undeclared-functions): Drop entry. + (faq.programming.x86-assembly): Ditto. + (faq.programming.djgpp): Ditto. + +2013-04-24 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml (cygwinenv-implemented-options): Change description + for winsymlink option to explain new implementation. + * new-features.sgml (ov-new1.7.19): Add support for native symlinks and + AFS. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * Throughout, eliminate Windows 2000 from the documentation. + * overview.sgml (brief-history): Mention native AMD64 support. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (SGMLDIRS): Accommodate dropping utils_source and + cygwin_source from ../Makefile.common. + * new-features.sgml (ov-new1.7.19): New section. Document dropped + support for pre-XP SP3 and added support for 64 bit Cygwin. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * faq-what.xml (faq.what.supported): Change to accommodate existence + of 64 bit version. + +2013-03-27 Corinna Vinschen <corinna@vinschen.de> + + * faq-what.xml (faq.what.supported): Mention Windows 8 and Server 2012. + Change sentence on native 64 bit version. + +2013-03-06 Anthony Geoghegan <anthony.geoghegan@gmail.com> + + * faq-using.xml: Fix expression and uppercase Samba. + +2013-02-13 Christopher Faylor <me.cygwin2013@cgf.cx> + + * pathnames.sgml: Remove stray '@'. + +2013-02-13 Christopher Faylor <me.cygwin2013@cgf.cx> + + * pathnames.sgml: Clarify '@' processing. + +2013-01-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * faq-programming.xml: Remove reference to "make check". + +2013-01-12 Thomas Wolff <towo@towo.net> + + * new-features.sgml (ov-new1.7.18): Add console enhancements. + +2012-12-20 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (pathnames-at): Drop confusing description on + "embedded double quotes". + +2012-12-14 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.18): Add sparse change. + * pathnames.sgml (mount-table): Document sparse mount option. + +2012-12-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.18): New section. Document cfsetspeed. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.ac: Rename from configure.in. + * configure.in: Delete. + * configure: Regenerate. + +2012-10-24 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add AC_NO_EXECUTABLES. + * configure: Regenerate. + +2012-10-20 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.17): Add section. + +2012-09-03 Christopher Faylor <me.cygwin2012@cgf.cx> + + * faq-what.xml: Fix typos, clarify responsibility slightly. + +2012-08-03 Adam Dinwoodie <Adam.Dinwoodie@metaswitch.com> + + * faq-using.xml (faq.using.man): Make relevance to whatis explicit. + +2012-07-20 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (pathnames-intro): Remove paragraph on UNC paths. + Try to be clearer on POSIX vs. Win32 paths. + (unc-paths): New section. + (cygdrive): Fix a few SGML qualifiers. + * setup-net.sgml: Move ntsec section from here... + * using.sgml: ..to here. + +2012-07-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.16): Document getmntent_r. + +2012-07-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * faq-programming.xml (faq.programming.unix-gui): Update to + reflect the availability of X11 toolkits on Cygwin. + +2012-06-03 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.16): Document ReFS support. + +2012-05-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.16): Document memrchr. + +2012-05-09 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.15): Fix XML syntax. + +2012-05-07 Christopher Faylor <me.cygwin2012@cgf.cx> + + * new-features.sgml (ov-new1.7.15): Fix tag. + +2012-05-06 Christopher Faylor <me.cygwin2012@cgf.cx> + + * cygwinenv.sgml: Add pipe_byte description. + * new-features.sgml (ov-new1.7.15): Add new pipe_byte description for + 1.7.15. + +2012-04-25 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.14): Add mouse reporting mode 1005. + +2012-04-24 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.14): New section. Add new console mouse + reporting modes. + +2012-04-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * configure: Regenerate. + +2012-04-23 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * faq-using.xml (faq.using.emacs, faq.using.xemacs): Change links + from http://cygwin.com/xfree to http://x.cygwin.com. + +2012-04-23 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * faq-programming.xml (faq.programming.objective-c): Update for gcc4. + (faq.programming.win32-api): -mwindows does include -lcomdlg32. + (faq.programming.win32-no-cygwin): Update for removal of -mno-cygwin. + * overview2.sgml (ov-ex-win): Ditto. + +2012-04-05 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.13): Add typeahead description. + +2012-04-05 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.13): New section. Add entry for + mkpasswd/mkgroup change to print TrustedInstaller account. + +2012-04-03 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.12): Fix layout of flock example. + +2012-03-30 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.12): Fix typo. + +2012-03-30 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml (cygwinenv-implemented-options): Add detect_bloda. + * new-features.sgml (ov-new1.7.12): Add list items for the change to + flock and the detect_bloda CYGWIN option. + * overview2.sgml (ov-hi-process-problems): Add a reference to the + detect_bloda CYGWIN option. + +2012-03-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.12): Create. Move mountinfo here. + Add /dev notice. + * pathnames.sgml (pathnames-posixdevices): Rephrase to account for + /dev change in 1.7.12. + +2012-03-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.11): Add mountinfo. + +2012-03-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * faq-programming.xml (faq.programming.make-execvp): Remove obsolete + information about Tcl/Tk. + (faq.programming.dll-relocatable): Ditto. + * faq-using.xml (faq.using.tcl-tk): Rewrite to reflect switch to + X11 Tcl/Tk. + +2012-02-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * faq-using.xml (faq.using.bloda): Fix missing closing parenthesis. + +2012-02-25 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.11): Add two more changes to the list. + +2012-02-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.11): Document pldd. + +2012-02-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.11): New section. Document scandirat. + +2012-02-21 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.bloda): Add AVAST and Citrix Metaframe + Presentation Server. + +2012-02-08 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.sshd-in-domain): Document autoload error + 1114 when loading user32.dll as potential problem when not using + a domain service account. + +2012-02-05 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Fix typo. + +2012-02-05 Corinna Vinschen <corinna@vinschen.de> + + * legal.sgml: Fix copyright. + +2012-02-04 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml: Fix more typos. + * setup-net.sgml: Ditto. + +2012-02-04 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml: Fix typos. + * ntsec.sgml: Ditto. + * pathnames.sgml: Ditto. + * setup2.sgml: Ditto. + * setup-net.sgml: Ditto. + (setup-dir): Drop paragraph on Unix/DOS file mode. + +2012-01-29 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Add tzset. + +2012-01-24 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (mount-table): Rephrase a few expressions for + clearness. + +2012-01-13 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document support for the %m + conversion flag in printf functions. + +2012-01-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document tgmath.h. + +2012-01-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document pthread_sigqueue. + +2012-01-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document get_current_dir_name. + +2011-12-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document getpt. + +2011-12-12 Ken Brown <kbrown@cornell.edu> + + * faq-using.xml: Remove obsolete entry about the standard console + window. + * new-features.sgml: Remove obsolete entry which references cygwin.bat. + * setup-net.sgml: Clarify new shortcut behavior for the "Cygwin + Terminal". + +2011-11-21 Andy Koppe <andy.koppe@gmail.com> + + * faq-using.xml (faq.using.weirdchars): Rewrite. + +2011-11-17 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.converting-paths): Remove reference to + cygwin.bat. + (faq.using.emacs): Drop "CYGWIN=tty" setting. + * pathnames.sgml (pathnames-posixdevices): Align list of device names + with changes in 1.7.10. + * setup2.sgml (setup-env-ov): Drop text which assumes that Cygwin + processes are started in console window. Align wording to lessened + relevance of $CYGWIN. Don't use dropped CYGWIN setting in example. + (setup-locale-how): Put using console and Cygwin.bat file into + perspective. + (setup-locale-problems): Ditto. + +2011-11-08 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document ptsname_r. + +2011-11-05 Jon TURNEY <jon.turney@dronecode.org.uk> + + * faq-using.xml (faq.using.fixing-fork-failures): Add new FAQ. + * overview2.sgml (ov-hi-process-problems): Describe some difficulties + in implementing fork() + +2011-10-28 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document getgrouplist. + +2011-10-10 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.sgml: Change -v to -V, same as in sources. + +2011-08-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document /proc/devices + and /proc/misc. + +2011-08-16 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document new RTLD flags. + +2011-08-12 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document large address awareness + of heap and new way to set the default heap size per executable. + * setup2.sgml (setup-maxmem): Revamp to explain new method of + allocating more heap on a per-executable basis. Drop outdated stuff. + Keep shortened description of heap_chunk_in_mb as note. + +2011-08-04 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.bloda): Add NVIDIA. Change wording slightly. + +2011-08-03 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document new POSIX Clock Selection + option APIs. + +2011-07-20 Andy Koppe <andy.koppe@gmail.com> + + * setup-net.sgml (setup-packages): Reflect removal of Prev button. + Also document Keep button and improve description of Exp button. + +2011-07-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document getconf(1). + +2011-07-15 Christopher Faylor <me.cygwin2011@cgf.cx> + + * cygwinenv.sgml (using-cygwinenv): Clarify how "glob" works. + +2011-06-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml (using-cygwinenv): Move envcache, strip_title, title, + tty, and upcaseenv options to list of obsolete options. + * effectively.sgml (using-console): Remove section. + * new-features.sgml (ov-new1.7.10): Document removed CYGWIN options. + Document removed tty mode. + +2011-05-25 Eric Blake <eblake@redhat.com> + + * new-features.sgml (ov-new1.7.10): Document strerror changes. + +2011-05-25 Corinna Vinschen <corinna@vinschen.de> + + * legal.sgml: Drop an old paragraph. Reactivate copyright note for + documentation. + +2011-05-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document __fpurge. + +2011-05-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document error.h functions. + +2011-05-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document CPU-time clock support. + Move pthread stack management APIs to separate listitem. + +2011-05-15 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document pthread_attr_getguardsize, + pthread_attr_setstack, pthread_attr_setstackaddr and + pthread_attr_setguardsize. + +2011-05-10 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Move "forkchunk:xxx" to the removed options section. + Change text accordingly. + +2011-05-10 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-env-ov): Make sure everybody knows that the + CYGWIN settings are just an example. + +2011-05-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document clock_settime. + +2011-05-06 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document sysinfo. + +2011-05-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document psiginfo, psignal, + and sys_siglist. + +2011-05-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document new pthread APIs. + +2011-05-02 Corinna Vinschen <corinna@vinschen.de> + + Throughout remove NT4 from documentation. + + * new-features.sgml (ov-new1.7.10): Document change in passwd command. + +2011-04-18 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document ppoll. + +2011-04-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document /proc/swaps. + +2011-04-04 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document dropped NT4 support. + +2011-04-04 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document additional information + in /proc/version. + +2011-04-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): Document /proc/sysvipc/. + +2011-04-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.10): /proc/loadavg now shows + current running/total processes count. + +2011-03-29 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.10): Document pthread spinlocks. + +2011-03-28 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.9): Add "new API" paragraph. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.8): Fix typo. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * legal.sgml: Bump date. + * new-features.sgml (ov-new1.7.8): Move dropped NT4 pre-SP4 support + up to be the first paragraph. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.8): Document /proc/sys. + +2011-02-10 Eric Blake <eblake@redhat.com> + + * new-features.sgml (ov-new1.7.8): Document strerror_r fixes. + +2011-02-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.8): Document pthread_yield. + +2011-01-12 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.8): Add "new API" paragraph. + +2011-01-05 Jon TURNEY <jon.turney@dronecode.org.uk> + + * faq-setup.xml (faq.setup.cli): Correct description of -pubkey option + +2010-10-18 Andy Koppe <andy.koppe@gmail.com> + + * setup2.sgml (setup-locale-ov): Document CJK ambiguous width change + for non-Unicode charsets. + * new-features.sgml (ov-new1.7.8): Mention CJK ambiguous width change. + Drop redundant NT4 pre-SP4 support entry. + +2010-10-09 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.8): Document reinstantiation of the + original 1.7 CWD handling. + +2010-10-08 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.8): Document new C99 complex API. + +2010-09-27 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (mount-table): Fix pathnames-mount-ex example. Change + an expression. + +2010-09-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.8): Document dropped NT4 pre-SP4 support. + * faq-what.xml (faq.what.supported): Change accordingly. + * ntsec.sgml (ntsec-mapping): Add 2008 R2. + +2010-09-18 Christopher Faylor <me+cygwin@cgf.cx> + + * overview2.sgml: Remove cheerful paragraph which implied that it was + ok to casually mix Windows and POSIX. Add more words about mixing + POSIX/Windows. + +2010-09-18 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-how): Fix typo. + +2010-09-11 Dave Korn <dave.korn.cygwin@gmail.com> + + * new-features.sgml: Mention fenv support. + +2010-09-06 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.8): Document /proc/sys. + +2010-08-30 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.7): Document change to binmode/textmode + link libs. + * textbinary.sgml (textbin-devel): Ditto. + +2010-08-28 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.7): Document change to avoid DLL + hijacking. + +2010-08-27 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.7): Change to describe partial + reversion to pre-1.7.6 behaviour. + (ov-new1.7.6): Deprecate description of CWD handling. + * pathnames.sgml (pathnames-win32-api): Rewrite to reflect new CWD + behaviour. + +2010-08-19 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.7): New section. + * pathnames.sgml: Throughout, align style of screen elements. + Throughout, make all emphasis elements bold. + (pathnames-win32-api): Rewrite section. + +2010-08-18 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (pathnames-win32-api): Try to use a more clear wording. + +2010-08-13 Corinna Vinschen <corinna@vinschen.de> + + * faq-programming.xml (faq.programming.win32-api): Remove simplicity. + Add note and xrefs to User's Guide chapters explaining restrictions + using the Win32 API. + * new-features.sgml (ov-new1.7.6): Add note about Win CWD. + * overview2.sgml (ov-hi-intro): Add note and xrefs about Win32 API + restrictions. Tone down flexibility. + * pathnames.sgml (pathnames-intro): Add xref to pathnames-win32-api + section. + (pathnames-win32-api): New section describing Win32 CWD restriction. + * setup2.sgml (setup-env-ov): New sub-section. + (setup-env-win32): Ditto, describing Win32 environment restriction. + +2010-08-11 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.6): Document "bind" option. + * pathnames.sgml (mount-table): Add "bind" option with example. + +2010-08-09 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.6): Document POSIX monotonic clock. + +2010-08-09 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.6): Document /proc/filesystems. + +2010-07-26 Andy Koppe <andy.koppe@gmail.com> + + * setup-net.sgml, faq-setup.xml: Rename setup.exe's "Partial" + view to "Pending" + +2010-07-19 Eric Blake <eblake@redhat.com> + + * textbinary.sgml (textbin-devel): Document temp file behavior. + (textbin-issue): Use sed rather than cat as an example of a + default-mode application. + * new-features.sgml (ov-new1.7.6): Document mkostemp[s]. + +2010-06-27 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in: Use "xmlto pdf" instead of docbook2pdf. + Force the dblatex backend, as the default passivetex does not work. + * README: Replace docbook-utils dependency with dblatex. + Update required docbook-xml version. + * faq-programming.xml (building-cygwin): Ditto. + +2010-06-26 Ken Brown <kbrown@cornell.edu> + + * setup-net.sgml: Add a paragraph describing now to avoid unintentional + upgrades. + +2010-04-29 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.6): Add new "dos" and "inode" mount + options. + * pathnames.sgml (mount-table): Ditto. + (pathnames-specialchars): Change description order. Add paragraph + to explain new behaviour in terms of leading spaces and trailing dots + and spaces in pathnames. + +2010-04-28 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.6): Add locale wide-char changes. + +2010-04-22 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.sgml: Note the fact that slave tty/pty handle dispersal is + unsed as of Cygwin 1.7.6. + * new-features.sgml (ov-new1.7.6): New section. Add tty/pty and + setrlimit changes. + +2010-04-11 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin.dsl: Remove comments. + +2010-04-11 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.5): New section. + +2010-04-11 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin-api.in.sgml: Update to DocBook SGML 4.5 DTD. + * cygwin-ug-net.in.sgml: Ditto. + * cygwin-ug.in.sgml: Ditto. + * faq-sections.xml: Ditto. + * faq.xml: Ditto. + +2010-04-01 Charles Wilson <cygwin@cwilson.fastmail.fm> + + * setup-net.sgml: Remove more mentions of rxvt. + +2010-03-31 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwinenv.sgml: Remove/deprecate mention of rxvt. + * effectively.sgml: Ditto. + * faq-using.xml: Ditto. + * setup-net.sgml: Ditto. + +2010-03-29 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.3): New section. + +2010-03-27 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-charsetlist): Add EUC-CN and GB2312. + +2010-03-27 Corinna Vinschen <corinna@vinschen.de> + + * textbinary.sgml: Add missing </para>. + +2010-03-27 Christopher Faylor <me+cygwin@cgf.cx> + + * textbinary.sgml: Remove tr example and just mention u2d and d2u + instead. + +2010-03-25 Christopher Faylor <me+cygwin@cgf.cx> + + * pathnames.sgml: Clarify wording of user-specific fstab files. Fix + typo. + +2010-03-24 Corinna Vinschen <corinna@vinschen.de> + + * legal.sgml: Bump copyright date. + +2010-03-17 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.unicode): Remove old examples. + +2010-03-12 Corinna Vinschen <corinna@vinschen.de> + + * effectively.sgml (using-shortcuts): Match chapter with reality. + +2010-03-11 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.bloda): Add "Credant Guardian Shield". + +2010-03-05 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-env): Add cross reference to using-cygwinenv. + Change description for locale environment variables to comply with + changes in 1.7.2. + +2010-03-02 Charles Wilson <cygwin@cwilson.fastmail.fm> + + * new-features.sgml (ov-new1.7.2): Describe XDR support. + +2010-02-26 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add strptime changes. + +2010-02-26 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add strftime/wcsftime changes. + +2010-02-25 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7.2): Add SIGPWR support. + +2010-02-25 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Move stty erase support into + correct category. Change "console window" to "Windows console". + +2010-02-17 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Accommodate name change of getlocale + to locale. + * setup2.sgml (setup-locale-how): Ditto. + +2010-02-15 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add native DOS path and UNC path + change. + * pathnames.sgml (pathnames-intro): Make the Win32 path text a note + and xref to new pathnames-win32 section. + (cygdrive): Add description how the cygdrive mount flags apply to + UNC paths starting with slashes. + (pathnames-win32): New section describing native path handling. + +2010-02-11 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Rephrase getlocale entry. + +2010-02-10 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add LC_MESSAGES support. + * setup2.sgml (setup-locale-ov): Change "@euro" modifier description. + (setup-locale-missing): Remove. + +2010-02-07 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * new-features.sgml (ov-new1.7-misc): Fix typo. + +2010-02-07 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add support for locales from + /usr/share/locale/locale.alias. + * setup2.sgml (setup-locale-ov): Ditto. + +2010-02-06 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-ov): Align description of working modifiers + to latest changes. + +2010-02-06 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add support for new charsets. + Change text for modifier support. + (setup-locale-charsetlist): Add new GEORGIAN-PS and PT154 charsets + to list of supported charsets. Reorder list for non-ISO, non-CP + charsets alphabetically. + +2010-02-05 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-ov): Add description for "uz_UZ@cyrillic" + and "tt_RU@iqtelif" modifiers. Slightly rephrase locale specifier + description in terms of the modifier string. + +2010-02-05 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add grouping for printf/wprintf. + +2010-02-04 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add multibyte-awareness of regcomp + and regexec. + +2010-02-01 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * README: Update for Cygwin docbook-utils package. + * faq-programming.xml: Ditto. + +2010-01-26 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * faq-api.xml: d2u/u2d are from cygutils, not util-linux. + +2010-01-26 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Skip validation in xmlto step. + +2010-01-26 Christopher Faylor <me+cygwin@cgf.cx> + + * overview.sgml: Clarify language in "A brief history of Cygwin". + +2010-01-26 Thomas Wolff <towo@towo.net> + + * new-features.sgml (ov-new1.7.2): Add console enhancements. + +2010-01-25 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml: Drop references to non-NT systems. + * faq-using.xml: Ditto. + (faq.using.sshd-in-domain): New FAQ entry. + +2010-01-25 Andy Koppe <andy.koppe@gmail.com> + + * faq-using.xml: Fix typos and remove incorrect locale-specific + documentation. + * new-features.sgml: Ditto. + * pathnames.sgml: Ditto. + +2010-01-24 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml: Rework layout to use itemizedlist. Fix typo. + Add two missing entries. + +2010-01-23 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-charsetlist): Add CP932. Change description + for SJIS. + +2010-01-23 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-charsetlist): Add ASCII and TIS-620. Add + various aliases and case differences. + +2010-01-22 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7.2): Add chapter for news in 1.7.2. + * setup2.sgml (setup-locale-ov): Describe how valid locales are + determined by Windows locale support. Change description for modifiers + in locale environment variables. + (setup-locale-how): Describe new charset behaviour. Mention new + getlocale tool to fetch valid locale information from Windows. + (setup-locale-missing): Drop now implemented LC_foo options. + Explain missing LC_MESSAGES in more detail. + +2010-01-17 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale): Mention three character codes per + ISO 639-3. + +2010-01-17 Corinna Vinschen <corinna@vinschen.de> + Andy Koppe <andy.koppe@gmail.com> + + * setup2.sgml (setup-locale): Adapt description to the C using ASCII + change in 1.7.2. + +2010-01-16 Christopher Faylor <me+cygwin@cgf.cx> + + * setup-net.sgml: Remove obsolete assertion. + +2010-01-15 Corinna Vinschen <corinna@vinschen.de> + + Suggested by Frank Fesevur <ffes@users.sourceforge.net>: + * faq-using.xml (faq.using.bloda): Clarify wxvault.dll. + +2010-01-15 Christopher Faylor <me+cygwin@cgf.cx> + + * faq-setup.xml: Add missing setup options. Sort options. + +2010-01-12 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml (cygwinenv-implemented-options): Try to make + compatibility new symlinks vs. old Cygwin clearer. + +2010-01-10 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (mount-table): Add info that posix=0 is default for + the cygdrive prefix. + +2010-01-07 Corinna Vinschen <corinna@vinschen.de> + + * overview.sgml: Fix Red Hat brand name. + +2010-01-04 Christopher Faylor <me+cygwin@cgf.cx> + + * overview.sgml: Fix Red Hat URL. + +2009-12-23 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (mount-table): Add missing slash in pathname. + +2009-12-14 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.mirror): Fix URL to wget. + +2009-12-02 Ken Brown <kbrown@cornell.edu> + + * setup2.sgml (setup-env): Clarify that Windows environment gets + copied over. Add paragraph about TMP, TEMP, and TMPDIR. + +2009-11-18 Corinna Vinschen <corinna@vinschen.de> + + * overview2.sgml (ov-hi-files): Remove reference to root directory when + explaining fstab content. Add paragraph about Extended Attributes. + Discourage chroot. + +2009-11-16 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (pathnames-specialchars): Fix typos. + +2009-11-12 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-os): Mention Windows 7 and 2008 R2. + (ov-new1.7-device): Add API get_avphys_pages, get_nprocs, + get_nprocs_conf, and get_phys_pages. + +2009-10-31 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-misc): Add installation-specific + unique object names description. + +2009-10-28 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * pathnames.sgml: Add limitation of case sensitivity with CreateProcess. + +2009-10-28 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-posix): Mention UTF-8 as "C" default + and the default locale "C.UTF-8". + * setup2.sgml (setup-locale-ov): Ditto. + +2009-10-26 Christopher Faylor <me+cygwin@cgf.cx> + + * faq-setup.xml: Fix clean_setup.pl reference. + +2009-10-26 Christopher Faylor <me+cygwin@cgf.cx> + + * faq-setup.xml: Change clean_setup.pl reference. + +2009-10-15 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.disk-space): Fix URL pointing to + clean_setup.pl script. + +2009-10-09 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (pathnames-specialchars): Add control chars to the + list. Explain backslash exception. + +2009-10-03 Dave Korn <dave.korn.cygwin@gmail.com> + + * faq-using.xml (faq.using.bloda): Add Lenovo IPS Core Service. + +2009-10-02 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-ov): Fix typo in C+charset example. + Rephrase how the locale environment variables are evaluated. + +2009-09-30 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-file): Ctrl-X, not Ctrl-N. + * pathnames.sgml (pathnames-unusual): Ditto. + * setup2.sgml (setup-locale-ov): Change description according to + latest changes. + (setup-locale-how): Rewrite. + (setup-locale-console): Enable section again. Change to reflect + recent changes. + (setup-locale-problems): Change to reflect recent changes. + +2009-09-26 Eric Blake <ebb9@byu.net> + + * new-features.sgml (ov-new1.7-file): Mention fexecve, execvpe. + +2009-09-25 Eric Blake <ebb9@byu.net> + + * new-features.sgml (ov-new1.7-file): Mention eaccess, euidaccess, + canonicalize_file_name, and document change in access semantics. + +2009-09-24 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-problems): Fix charset names of codepages + 936 and 949. + +2009-09-24 Eric Blake <ebb9@byu.net> + + * setup2.sgml (setup-locale-problems): Document how to install + non-default charsets. + +2009-09-21 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-file): Add new hardlink behaviour on + filesystems not supporting hardlinks. + * overview2.sgml (ov-hi-files): Change descripton accordingly. + +2009-08-26 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-posix): Add "KOI8-R" and "KOI8-U" + charsets. + +2009-08-22 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-charsetlist): Add KOI8-R and KOI8-U to list + of supported charsets. + +2009-08-22 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-charsetlist): Add description of + case-insensitivity of charsets. Fix a typo. Add "UTF8" to the list. + +2009-08-12 Dave Korn <dave.korn.cygwin@gmail.com> + + * faq-using.xml (faq.using.bloda): Typofix MacAfee -> McAfee. + +2009-07-23 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.ipv6): Try to clarify OS specific support. + * faq-what.xml (faq.what.supported): Add Windows 7 and 2008 R2. + * new-features.sgml: Add "and later" to rcmd news. + +2009-07-20 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (all): Fix wrong target names. + (cygwin-ug-net/cygwin-ug-net-nochunks.html.gz): Ditto. + (cygwin-ug-net/cygwin-ug-net.pdf): Convert to use docbook2pdf. + (cygwin-api/cygwin-api.pdf): Ditto. + +2009-07-20 Corinna Vinschen <corinna@vinschen.de> + + * faq: Throughout, revert references to User's Guide to default URL. + +2009-07-20 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-misc): Add stdc++ new/delete wrappers. + +2009-07-20 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-posix): Add WCONTINUED, WIFCONTINUED. + +2009-07-20 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-charsetlist): Fix ISO88-59-13 and -15 + codepage numbers. + +2009-07-08 Christopher Faylor <me+cygwin@cgf.cx> + + * pathnames.sgml: Fix typo. + +2009-07-03 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-file): Add fpurge and mkstemps to new + API functions. + +2009-07-01 Christopher Faylor <me+cygwin@cgf.cx> + + Clean up some sources.redhat.com references. + +2009-06-24 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.setup-fails-on-ts): Fix another typo. + +2009-06-24 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.setup-fails-on-ts): Fix typo. + +2009-06-23 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.setup-failes-on-ts): Change rebaseall to + rebase. + +2009-06-23 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.setup-failes-on-ts): New FAQ entry. + +2009-06-19 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-misc): Add new link libs. + * setup2.sgml (setup-locale-ov): Explain locale-specific wcwidth + feature. + +2009-06-12 Ken Brown <kbrown@cornell.edu> + + * faq-using.xml (faq.using.emacs): Update. + +2009-06-04 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml: Add changes to console BS and Space key. + +2009-05-26 Christopher Faylor <me+cygwin@cgf.cx> + + Change explicitely to explicitly throughout. + +2009-05-15 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-console): Disable section for now. + +2009-05-14 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml (faq.setup.upgrade-mountpoints): New entry. + * faq-using.xml (faq.using.directory-structure): Align example to + latest mount output. + * pathnames.sgml (mount-table): Add note about upgrade helper scripts + to create /etc/fstab and /etc/fstab.f/${USER}. + +2009-05-14 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml: Add automounting of /, /usr/bin, and /usr/lib. + * pathnames.sgml (pathnames-intro): Be more verbose about POSIX and + Win32 paths. + (mount-table): Add "auto" flag. Add a paragraph about /usr/bin and + /usr/lib. + (pathnames-mount-ex): Enhance flags output. + +2009-05-13 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me+cygwin@cgf.cx> + + * pathnames.sgml (mount-table): Sort mount options and add override + option. Add description of root mount handling. + +2009-05-13 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml (pathnames-unusual): Talk about using UTF-8 in C + locale. + * setup2.sgml (setup-locale-problems): Ditto. + +2009-05-06 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml: Fix entry explaing how the homedir is evaluated + according to recent change. + +2009-04-07 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-console): New section to explain + console character set setting. + * faq: Throughout, change references to User's Guide to references + to 1.7 User's Guide temporarily. + * faq-setup.html (faq.using.unicode): Rephrase slightly. + (faq.using.weirdchars): New FAQ entry for console charset problems. + +2009-04-06 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml (ov-new1.7-posix): Remove JIS from supported + charsets. + * setup2.sgml (setup-locale-charsetlist): Ditto. + +2009-04-06 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-problems): Change title to be more clear + when referencing this section. + +2009-04-03 Kevin Buettner <kevinb@redhat.com> + + * Various syntactical and semantical fixes throughout. + +2009-04-01 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.symlinkstoppedworking): Rename. + (faq.using.ipv6): New IPv6 FAQ. + * gdb.sgml: Remove incorrect statement about Insight. + +2009-03-31 Corinna Vinschen <corinna@vinschen.de> + + * setup2.sgml (setup-locale-problems): Fix an incomplete sentence. + +2009-03-31 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml (faq.using.unicode): Modernize. + (faq.api.symlinkstoppedworking): Move here from faq-api.xml. + +2009-03-30 Dave Korn <dave.korn.cygwin@gmail.com> + + * faq-using.xml (faq.using.bloda): Update with new entries. + +2009-03-26 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add text to explain new UTF-16 symlinks. + * faq-api.xml: Add FAQ entry "Why do some of my old symlinks don't + work anymore?" + * new-features.sgml: Fix symlink text. Add new UTF-16 symlinks. + * overview2.sgml: Add text about new UTF-16 symlinks and potential + problems with old symlinks. + * pathnames.sgml: Fix typo. + * setup2.sgml: Extend text about problems with symlinks. + +2009-03-26 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml: Replace GB2312 with GBK. + * setup2.sgml: Ditto. + +2009-03-25 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Add a note that ASCII SO handling isn't foolproof + under all circumstances. + +2009-03-25 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml: Add missing GB2312 and eucKR character sets. + * pathnames.sgml: Change "DOS devices" title to "Invalid filenames" + and rephrase that section. + Add section "Filenames with unusual (foreign) characters". + Fix an emphasis. + * setup-net.sgml: Integrate setup-locale section. + * setup2.sgml: Add locale variables to section "Environment Variables". + Add section "Internationalization". + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * new-features.sgml: Add section about chaged (no)winsymlink default. + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Move "codepage:xxx" to the removed options section. + Change text accordingly. + * new-features.sgml: Try to explain new way to define character sets. + +2009-03-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwin-ug-net.in.sgml: Update date. + * cygwinenv.sgml: Fix codepage:utf8 text in terms of setting + environment variables. + * new-features.sgml: New file describing new Cygwin 1.7 features. + Layout is preliminiary only. + * overview.sgml: Insert content of new-features.sgml. + +2009-03-18 Corinna Vinschen <corinna@vinschen.de> + + * overview2.sgml: Remove reference to CYGWIN=binmode. + * textbinary.sgml: Ditto. Rephrase certain paragraphs to match + Cygwin 1.7 behaviour. Add popen(3) and pipe(2) behaviour. Make + quite clear that binmode is preferred. Add *mode.o files to + description for developers. + +2009-03-09 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Try to be more clear explain raw devices. + +2009-03-03 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml: Rework UTF FAQ to accommodate latest setlocale + change in newlib. + +2009-03-03 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Remove reference to managed mountpoints in mount + entry example. + +2009-02-23 Dr. Volker Zell <dr.volker.zell@oracle.com> + + * faq-using.xml: Rework XEmacs FAQ. + +2009-02-14 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml: Fix usage of ampersand in NT emacs script. + +2009-02-14 Jari Aalto <jari.aalto@cante.net> + + * faq-using.xml: Expand Emacs entries. + +2009-02-13 Nahor <nahor.j+gmane@gmail.com> + + * overview.sgml: Fix 1.7 release date. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * cygwin-api.in.sgml: Fix API section layout. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Add a cygdrive section. + +2009-02-13 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Replace "binmode" with new "binary" output of mount. + +2009-02-12 Corinna Vinschen <corinna@vinschen.de> + + * faq-using.xml: First cut on Emacs. + +2009-02-12 Corinna Vinschen <corinna@vinschen.de> + + * faq-setup.xml: Revamp for Cygwin 1.7. + * faq-using.xml: Ditto. + +2009-02-11 Corinna Vinschen <corinna@vinschen.de> + + * faq-programming.xml: Revamp (mostely) for Cygwin 1.7. + * faq-what.xml: Ditto. + +2009-02-11 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (FAQ_SOURCES): Define FAQ sources. + (faq/faq.html): Depend on FAQ sources. + (faq/faq-nochunks.html): Ditto. + * faq-api.xml: Revamp for Cygwin 1.7. + * faq-problems.xml: Remove. + * faq-sections.xml: Accommodate removal of faq-problems.xml. + * faq.xml: Ditto. + +2009-02-03 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Rephrase the "Case sensitive filenames" chapter + slightly. + +2009-01-24 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Add requirement for world-readability of special + /etc files. + +2009-01-24 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Add section about accessing /etc files. + +2009-01-21 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.sgml: Remove the "How to use the Cygserver services" + section. + * cygwinenv.sgml: Move "(no)server" to the removed options section. + * faq-programming.xml: Remove CYGWIN=server requirement for running + the Cygwin testsuite. + * ntsec.sgml: Ditto for using `passwd -R'. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * gcc.sgml: Use 'bash$' as Cygwin prompt throughout. + * gdb.sgml: Ditto. + * pathnames.sgml: Ditto. Fix the @ expansion example. + +2008-12-13 Christopher Faylor <me+cygwin@cgf.cx> + + * pathnames.sgml: Convert some backslashes to slashes. + +2008-12-11 Christian Franke <franke@computer.org> + + * pathnames.sgml: New section for /proc/registry. Document registry + name encoding. + +2008-12-04 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Fix typo. + +2008-12-03 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Revamp parts of the doc for clearness. + +2008-12-02 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Fix a few typos. + +2008-12-02 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.sgml: Fix cross reference to the ntsec documentation. + +2008-12-02 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.sgml: Document new feature to store hidden passwords + for seteuid. + +2008-12-02 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Finishing up changes for 1.7. + +2008-12-01 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Further changes for 1.7. Switch from "NT" to "Windows". + Add preliminary text. Try to be more clear in description. Remove + useless chapters. Finish the permission related chapters. + +2008-11-30 Christopher Faylor <me+cygwin@cgf.cx> + + * faq-using.xml: Remove assertion that lpr doesn't exist. + * faq-what.xml: Remove ancient who's who data. + +2008-11-25 Christopher Faylor <me+cygwin@cgf.cx> + + * overview2.sgml: Reorganize and make minor wording changes. + +2008-11-25 Christopher Faylor <me+cygwin@cgf.cx> + + * overview2.sgml: Clarify unix-specific automatic updates section. + +2008-11-25 Corinna Vinschen <corinna@vinschen.de> + + Suggested by Valerio Bigiani <vbigiani@yahoo.it>: + * overview2.sgml: Add text that no automatic updates are provided. + +2008-11-11 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add description for upcaseenv option. + +2008-09-22 Christopher Faylor <me+cygwin@cgf.cx> + + * setup2.sgml: Clarify heap allocation. + +2008-08-13 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Move description for (cyg,not)exec mount options + from utils.sgml here. Clarify nouser mount points. + +2008-07-18 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Move binmode option to list of removed options. + +2008-07-17 Corinna Vinschen <corinna@vinschen.de> + + * Revamp documentation for Cygwin 1.7, part 1. + +2008-07-01 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Temporarily add ability to generate pdfs. + +2008-06-26 Fred Korz <korz_fred@emc.com> + + * effectively.sgml: Correct subject-verb agreement, missing verb + (typo), preposition and (definite vs indefinite) article use. + +2008-06-19 Christopher Faylor <me+cygwin@cgf.cx> + + * faq-using.xml: Add more words about multiple cygwins. + +2008-04-24 Corinna Vinschen <corinna@vinschen.de> + + * cygwin-api.in.sgml: Add std-susv4 section to Compatibility chapter. + +2008-04-13 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Drop description of "transparent_exe" option. + +2007-29-12 Dave Korn <dave.korn@artimi.com> + + * faq-using.xml (faq.using.bloda): New entry. + (faq.using.firewall, faq.using.anti-virus): Link to faq.using.bloda. + * faq-setup.xml (faq.setup.hang): Likewise link to faq.using.bloda. + +2007-12-16 Christopher Faylor <me+cygwin@cgf.cx> + + * pathnames.xml: Fix a typo. + +2007-09-25 Corinna Vinschen <corinna@vinschen.de> + + * faq-what.xml: Remove paragraph about and link to stoneage old + history.html file. + +2007-08-24 Christopher Faylor <me+cygwin@cgf.cx> + + * dll.sgml: myprog.ca -> myprog.c + +2007-08-12 Christopher Faylor <me+cygwin@cgf.cx> + + * faq-programming.xml: Clarify where to run "make check". + +2007-07-18 Brian Dessent <brian@dessent.net> + + * faq-using.xml (faq.using.console-window): Mention FHS location of + docs and remove outdated reference to ash. + +2007-06-29 Corinna Vinschen <corinna@vinschen.de> + + * cygwin-api.in.sgml: Remove authorgroup and revhistory. + * cygwin-ug.in.sgml: Add Joshua Daniel Franklin to authorgroup. + Remove revhistory. + * legal.sgml: Update dates. + +2007-06-05 Corinna Vinschen <corinna@vinschen.de> + + * cygwin-api.in.sgml: Accommodate new "Compatibility" section layout. + +2006-12-12 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Drop description of "traverse" option. + +2006-08-25 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-setup.xml (faq.setup.uninstall): Mention Safe Mode + requirement for accessing the Security tab in XP Home. + * faq-using.xml (faq.using.chmod): Mention FAT32. + +2006-08-09 Christopher Faylor <cgf@timesys.com> + + * overview2.sgml: Remove inaccurate "full support for windows + pathnames" clause. + +2006-08-01 Christopher Faylor <cgf@timesys.com> + + * cygwinenv.sgml: Document [no]dosfilewarning option. + +2006-07-18 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Change text for the order in which executables + are evaluated. + +2006-06-01 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-setup.xml (faq.setup.automated): New FAQ. + +2006-05-30 Dave Korn <dave.korn@artimi.com> + + * faq-api.xml (faq.api.winsock): Replace references to depracated + Win32_Winsock macro with __USE_W32_WINSOCK, and enlarge on details. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * configure.in: Update to newer autoconf. + (thanks to Steve Ellcey) + * configure: Regenerate. + * aclocal.m4: New file. + +2006-04-04 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-programming.xml (faq.programming.adjusting-heap): + Clarify argument parameter sizes. + * faq-using.xml (faq.using.chmod): + Improve chmod FAQ. + +2006-03-18 Christopher Faylor <cgf@timesys.com> + + * cygwinenv.sgml: Rename fork_retry to proc_retry since it has turned + out to be more general than just fork. + +2006-03-13 Christopher Faylor <cgf@timesys.com> + + * cygwinenv.sgml: Explain about new fork_retry CYGWIN environment + variable setting. + +2006-03-07 Bas van Gompel <cygwin-patch.buzz<at>bavag.tmfweb.nl> + + * cygwinenv.sgml: Add missing </para> at transparent_exe. + +2006-02-05 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Explain transparent_exe option. + +2006-02-01 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-setup.xml (faq.setup.what-packages): + Mention new cygcheck -p option. + +2006-01-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-programming.xml (faq.programming.building-cygwin): + Move cocom to the build requirements. + +2006-01-26 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-programming.xml (faq.programming.building-cygwin): + Simplify instructions, and remove tar usage basics. + +2006-01-26 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-programming.xml (faq.programming.ipc): Add new FAQ about + cygserver and its relation to the "Bad system call" error. + * faq-setup.xml (faq.setup.uninstall-all): Mention postgresql. + * overview2.sgml: Update security info on shared memory. + +2006-01-25 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-programming.xml (faq.programming.building-cygwin): Add + list of packages required for building and exact check instructions. + * faq-setup.xml (faq.setup.uninstall-service): New instructions + on uninstalling a cygwin service. + (faq.setup.uninstall-all): Reference new service uninstall FAQ. + +2006-01-25 Igor Peshansky <pechtcha@cs.nyu.edu> + + * faq-setup.xml (faq.setup.snapshots): Rename DLL using Windows tools. + +2006-01-18 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * Makefile.in : Remove references to old texinfo FAQ. + * calls.texinfo : Remove. + * changes.texinfo : Remove. + * copy.texinfo : Remove. + * faq.texinfo : Remove. + * history.texinfo : Remove. + * how-api.texinfo : Remove. + * how-programming.texinfo : Remove. + * how-resources.texinfo : Remove. + * how-using.texinfo : Remove. + * how.texinfo : Remove. + * install.texinfo : Remove. + * readme.texinfo : Remove. + * relnotes.texinfo : Remove. + * what.texinfo : Remove. + * who.texinfo : Remove. + +2006-01-12 Igor Peshansky <pechtcha@cs.nyu.edu> + + * doctool.c (scan_directory): Ignore "CVS" directories. + * faq-setup.xml (faq.setup.setup): Correct URL typo. + (faq.setup.snapshots): Clarify. + +2005-12-30 Christopher Faylor <cgf@timesys.com> + + * relnotes.texinfo: Remove entry about hyperthreaded processor. + +2005-12-30 Christopher Faylor <cgf@timesys.com> + + * faq-problems.html: Remove entry about hyperthreaded processor. + +2005-12-12 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-programming.xml: Add note about struct stat64. + +2005-12-03 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-setup.xml: Add note about clean_setup.pl. + * faq-using.xml: Remove unnecessary line of elisp. + +2005-10-02 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq-what.xml: Add 2003 and WOW64 to "supported" FAQ. + * faq-programming.xml: Fix cygexec FAQ, building link. + +2005-09-25 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq.xml: Remove copyright section, link to license.html + * faq-sections.xml: Remove copyright section, link to license.html + * faq-programming.xml: Remove confusing reference to Red Hat. + * faq-what.xml: Reword "supported" FAQ. + +2005-09-15 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml (ntea): Add some wording to scare people away + from using this option. + +2005-08-26 Brian Dessent <brian@dessent.net> + + * faq-using.xml: Add 'net use' hint to network shares FAQ. + +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 + +2005-08-17 Christopher Faylor <cgf@timesys.com> + + * textbinary.sgml: Correct incorrect information about ability to + specify text mode in fopen(). + +2005-08-05 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygwin.dsl: Add default DOCTYPE and output filename. + * Makefile: Update to switch FAQ from texinfo to DocBook. + * faq.xml: New file. + * faq-api.xml: New file. + * faq-problems.xml: New file. + * faq-programming.xml: New file. + * faq-resources.xml: New file. + * faq-sections.xml: New file. + * faq-setup.xml: New file. + * faq-using.xml: New file. + * faq-what.xml: New file. + +2005-07-10 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygwinenv.sgml: Update tty section to mention rxvt and xterm. + * how-programming.texinfo: Update GPL section of CVS FAQ. + * how-using.texinfo: Expand FAQ about out of date packages. + * setup-net.sgml: Add troubleshooting setup.exe section. + +2005-07-08 Corinna Vinschen <corinna@vinschen.de> + + * how-using.texinfo: Fix typos. + +2005-06-20 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-resources.texinfo: Update section on cygwin-developers. + * how-using.texinfo: Add FAQ about firewall software. Update + section on mounting and specifically note using managed mounts. + +2005-06-03 Max Kaehn <slothman@electric-cloud.com> + + * how-programming.texinfo: Add "How do I load cygwin1.dll dynamically + from a Visual Studio or MinGW application?" + +2005-05-28 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-using.texinfo : Update the mkdir -p section to reflect + changes in handling network drives. + +2005-05-18 Brian Dessent <brian@dessent.net> + + * install.texinfo ("How do I uninstall..."): Rewrite to cover + removing services, dealing with permissions, and other common + tasks for removing Cygwin completely. + +2005-05-08 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-programming.texinfo: Replace MAKE_MODE entry with FAQ about + execvp errors and cygexec. + +2005-04-20 Brian Dessent <brian@dessent.net> + + * pathnames.sgml (mount-table): Indicate that user-specific + mounts override system-wide. + +2005-04-20 Gerd Spalink <Gerd.Spalink@t-online.de> + + * fhandler-tut.txt: Update description to cygwin 1.5.13 + +2005-04-19 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Mention that check_case is deprecated. + +2005-04-16 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add new words for (no)traverse option. + +2005-03-30 Christopher Faylor <cgf@timesys.com> + + * how-using.texinfo: Add more words to the "multiple DLL" section. + +2005-03-25 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-programming.texinfo: Mention generic-build-script in + packaging FAQ. + +2005-03-19 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-programming.texinfo: Remove incorrect libm.a note. + +2005-03-05 Christopher Faylor <cgf@timesys.com> + + * pathnames.sgml: Clarify binmode/textmode behavior slightly. + * textbinary.sgml: Ditto. + +2005-03-03 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-api.texinfo: Add Pierre's security text. + +2005-02-23 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * README: New file. + +2005-01-31 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add words for (no)traverse option. + +2005-01-29 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * install.texinfo: Update setup.exe snapshot URL. + * ntsec.sgml: Add Pierre's Windows 2003 text. + +2005-01-28 Corinna Vinschen <corinna@vinschen.de> + + * how-using.texinfo: Change text about using shortcuts. + +2005-01-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-api.texinfo: Make snapshot URL an HTML link. + * how-programming.texinfo: Add details about building a + debugging version of the DLL. + * how-using.texinfo: Correct rxvt README location. + * install.texinfo: Add mount -m note to uninstall instructions. + +2005-01-21 Christopher Faylor <cgf@timesys.com> + + * how-programming.texinfo: Remove obsolete w32api instructions and add + some words about unpacking net release .tar.bz2. + +2004-12-30 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * path.sgml: Encode programming example with CDATA. + * overview.sgml: Add notes about SUS, newlib, and ash. + * overview2.sgml: Add notes about /usr/share/doc/Cygwin. + +2004-12-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * Makefile.in: Update to use xmlto. + * cygwin.dsl: Change into DocBook XSL stylesheet for xmlto. + * pathnames.sgml: Correct documentation of mount behavior. + +2004-12-24 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygserver.sgml: Cleanup markup for XML validity. + * cygwin-api.in.sgml: Cleanup markup for XML validity. + * cygwin-ug-net.in.sgml: Cleanup markup for XML validity. + * cygwin-ug.in.sgml: Cleanup markup for XML validity. + * cygwinenv.sgml: Cleanup markup for XML validity. + * dll.sgml: Cleanup markup for XML validity. + * effectively.sgml: Cleanup markup for XML validity. + * filemodes.sgml: Cleanup markup for XML validity. + * legal.sgml: Cleanup markup for XML validity. + * ntsec.sgml: Cleanup markup for XML validity. + * overview.sgml: Cleanup markup for XML validity. + * overview2.sgml: Cleanup markup for XML validity. + * pathnames.sgml: Cleanup markup for XML validity. + * setup-net.sgml: Cleanup markup for XML validity. + * setup2.sgml: Cleanup markup for XML validity. + * textbinary.sgml: Cleanup markup for XML validity. + * utils.sgml: Cleanup markup for XML validity. + +2004-12-02 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygserver.sgml: Cleanup minor markup problem. + * how-resources.texinfo: Add man and info to documentation FAQ. + * how-using.texinfo: Add more detail to Unicode FAQ. + * install.texinfo: Finally apply Pierre's patch from 2003-03-03. + * relnotes.texinfo: Add note about hyperthreading reports. + +2004-09-30 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-using.texinfo: Fix typo. Add note about "Install For All Users" + +2004-09-30 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-programming.texinfo: Add gcj note to WinMain@16 FAQ. + * how-using.texinfo: Add FAQ about network shares and authentication. + * install.texinfo: Add "Where is make" to FAQ subtitle. + +2004-09-24 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: smbntsec is not on by default. + +2004-09-14 Christopher Faylor <cgf@timesys.com> + + * what.texinfo: Fix two typos reported on cygwin list. + +2004-09-02 Corinna Vinschen <corinna@vinschen.de> + + * textbinary.sgml: Change default mode for non-mounted paths to binary. + +2004-07-16 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-resources.texinfo: Update documentation to /usr/share/doc. + * how-using.texinfo: Add paragraph about find -noleaf. + +2004-06-14 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-programming.texinfo: Add section about Visual Studio linking. + +2004-06-13 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * faq.texinfo: Move outdated calls.texinfo to readme.texinfo. + * how-api.texinfo: Fix typos. + * how-programming.texinfo: Fix typos. + * how-resources.texinfo: Fix typos. + * how-using.texinfo: Fix typos. + * install.texinfo: Fix typos. + * readme.texinfo: Move outdated calls.texinfo to readme.texinfo. + +2004-05-21 Brian Ford <ford@vss.fsi.com> + + * pathnames.sgml: Remove /dev/kmem from the supported POSIX + device list. + + * cygwinenv.sgml: Fix typo in check_case description. + +2004-03-30 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * ntsec.sgml: Replace chapter numbers with <link>s, + replace release-numbers in <title>s with descriptions. + +2004-03-30 Ronald Landheer-Cieslak <ronald@landheer.com> + + * ntsec.sgml: Fix typos, correct chapter numbers. + +2004-03-29 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Fix /dev/srX description. + +2004-03-28 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-programming.texinfo: Make list in .lib FAQ enumerative. + +2004-03-28 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * how-programming.texinfo: Add note about gcc .lib linking. + * pathnames.sgml: Mention create_devices.sh for /dev/ creation. + +2004-03-27 Corinna Vinschen <corinna@vinschen.de> + + * cygserver.sgml: New file. + * using.sgml: Include Cygserver docs. + +2004-03-26 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygwinenv.sgml: Add example for CYGWIN=error_start. + * pathnames.sgml: Update list of /dev/ devices. + +2004-02-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * Makefile.in: Fix problem links in faq0.html file. + * what.texinfo: Remove outdated 'recent' history. + +2004-02-19 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygwinenv.sgml: Remove incorrect ^Z information. Add + some tags to server option description. + * textbinary.sgml: Remove incorrect ^Z information. + +2004-02-16 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add server option description. + +2004-02-04 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * Makefile.in: Generate monolithic faq0.html file. + +2004-01-24 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygwinenv.sgml: Cleanup minor markup problems. + * dll.sgml: Cleanup minor markup problems. + * effectively.sgml: Cleanup minor markup problems. + * gcc.sgml: Cleanup minor markup problems. + * ntsec.sgml: Cleanup minor markup problems. + * pathnames.sgml: Cleanup minor markup problems. + * setup-net.sgml: Cleanup minor markup problems. + * textbinary.sgml: Cleanup minor markup problems. + * windres.sgml: Cleanup minor markup problems. + +2004-01-20 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * Makefile.in: Remove unused cygwin-ug and cygwin-api-int + targets from default build. + * how-using.texinfo: Add information about 8-bit character + display to FAQ. + * setup2.sgml: Add information about 8-bit character display + to "Setting up Cygwin". + +2004-01-15 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * setup-net.sgml: Add "internet-setup" id anchor. + * overview.sgml: Update "What is it?" section. Add links to + "Is it free software?" section. Update "Brief History" section. + * overview2.sgml: Rewrite "Expectations for {Windows,Unix}" + as "Quick Start for those more experienced with {Windows,Unix}". + +2004-01-11 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * Makefile.in: Add new target for single-file User's Guide, use new + cygwin.dsl for output. + * cygwin.dsl: New file, DSSSL stylesheet for custom Cygwin output. + * cygwin-api.in.sgml: Update to DocBook SGML 4.2 DTD. + * cygwin-ug-net.in.sgml: Update to DocBook SGML 4.2 DTD. + * cygwin-ug.in.sgml: Update to DocBook SGML 4.2 DTD. + * cygwinenv.sgml: Correct some tags. Add description of default values + to ntsec, export, and error_start items. + * dll.sgml: Add explanation of cyg prefix for DLLs. + * effectively.sgml: Use systemitem tag for names of Cygwin packages. + * how-programming.texinfo: Add example to FAQ entry. + * pathnames.sgml: Add discussion of /proc filesystem. + * setup-net.sgml: Correct some typos and grammar. + +2003-09-01 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Remove description how to mount raw devices and + dicourage it. Desparately try to make usage of raw devices a bit + clearer. + +2003-07-31 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * effectively.sgml: New file, "Using Cygwin Effectively with Windows". + * legal.sgml: Update year in copyright notice. + * using.sgml: Include "Using Cygwin Effectively with Windows" section. + +2003-07-15 Christopher Faylor <cgf@redhat.com> + + * pathnames.sgml: Use correct registry key. Clarify '@' operation. + +2003-07-03 Christopher Faylor <cgf@redhat.com> + + * ntsec.sgml: Reword references to "ntsec patch". + +2003-05-08 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygwin-ug-net.in.sgml: Remove outdated revision information and + author's names. + +2003-04-26 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * gcc.sgml: Remove outdated "WinMainCRTStartup" references. Add a + hellogui.c example. + +2003-03-26 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * setup-net.sgml: Make suggested additions to setup.exe documentation + +2003-03-23 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * setup-net.sgml: Improve setup.exe documentation + +2003-03-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * setup-net.sgml: Document setup.exe + +2003-02-07 Christopher Faylor <cgf@redhat.com> + + * how.texinfo: Add more w32api words. + +2003-02-07 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * ntsec.sgml: Add note on special names for missing user/group. + +2002-12-18 Christopher Faylor <cgf@redhat.com> + + * overview2.sgml: Remove CTRL-Z discussion. + * cygwinenv.sgml: Expand on CYGWIN=binmode. + +2002-11-10 Christopher Faylor <cgf@redhat.com> + + * how-programming.texinfo: Document _WIN32 more fully. + +2002-10-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * ntsec.sgml: Correct some minor grammatical errors. + +2002-10-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * dll.sgml: Simplify dll build instructions. + +2002-09-11 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.html: Add chapter for switching user context w/o password. + +2002-08-29 Christopher Faylor <cgf@redhat.com> + + * how-api.texinfo: Remove a line from the CRLF discussion about lseek + not working. Answer thread safe question more simply. + +2002-08-27 Nicholas Wourms <nwourms@netscape.net> + + * calls.texinfo: Add getc_unlocked, getchar_unlocked, putc_unlocked + and putchar_unlocked. + +2002-08-21 Christopher Faylor <cgf@redhat.com> + + * dll.sgml: Remove indirect reference to older gccs. + +2002-06-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * dll.sgml: Refine dll build instructions. + +2002-08-21 Christopher Faylor <cgf@redhat.com> + + * ntsec.html: Correct some typos. + +2002-07-23 Nicholas Wourms <nwourms@netscape.net> + + * calls.texinfo: Add fcloseall and fcloseall_r. + +2002-06-24 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Clean up text for examples of /etc/passwd and /etc/group. + Add examples with SIDs. Warn about changing them crudely. + +2002-06-21 Christopher Faylor <cgf@redhat.com> + + * what.texinfo: Fix typo. + +2002-06-02 Christopher Faylor <cgf@redhat.com> + + * how-programming.texinfo: Add more words to the "how to build". + +2002-03-01 Christopher Faylor <cgf@redhat.com> + + * overview.sgml: Fix 'more more' typo. + +2002-01-12 Christopher Faylor <cgf@redhat.com> + + * overview.sgml: Fix Red Hat cygwin contract link. + * what.texinfo: Ditto. + +2002-01-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Duh. Actually use bzip2 to create the tarball. Don't + just change the name. + +2002-01-01 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Make .bz2 tarball. + +2001-12-11 Christopher Faylor <cgf@redhat.com> + + * what.texinfo: Clarify XP. + +2001-12-03 Christopher Faylor <cgf@redhat.com> + + Cleanup copyrights and Cygnus'isms throughout. + * setup.sgml: Nuke ancient instructions. + +Tue Oct 16 18:02:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Cleanup raw device text to be more coherent. + +Tue Oct 16 17:14:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Add description for new fixed device paths. + +Fri Sep 7 12:47:47 2001 Michael Schaap <cygwin@mscha.com> + + * how-resources.texinfo: Add some additional words about where to find + documentation. + +Wed Jun 13 13:54:35 2001 Christopher Faylor <cgf@cygnus.com> + + * who.texinfo: Oops. Add a couple of important folk. + +Wed Jun 13 13:45:44 2001 Christopher Faylor <cgf@cygnus.com> + + * who.texinfo: Remove email addresses. Modernize. + +Tue May 29 21:30:07 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Tweak to attempt to accomodate older texi2html. + +Tue May 29 16:24:46 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Accomodate newer versions of docbook and openjade. + +Thu Apr 12 23:52:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add text for `check_case' option. + +Fri Mar 2 12:42:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add text for `winsymlinks' option. + * how-api.texinfo: Add text to explain new symlinks==shortcuts + and the CYGWIN setting `(no)winsymlinks'. + * how-using.texinfo: Add text that Cygwin now treats shortcuts + as symlinks. + +2001-02-07 Eric M. Monsler <emonsler@beamreachnetworks.com> + + * setup2.sgml: Add docs about domain accounts. + +Thu Dec 21 15:03:29 2000 Edward M. Lee <tailbert@yahoo.com> + + * cygwinenv.sgml: Fix typo in <filename>. Add missing </para>. + +Tue Dec 19 21:06:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygwinenv.sgml: Add text for `smbntsec' option. + +Sat Nov 18 23:50:12 2000 Christopher Faylor <cgf@cygnus.com> + + * cygwinenv.sgml: Remove CYGWIN=strace option. Update CYGWIN options. + * setup2.sgml: Remove CYGWIN=strace example. + * how-programming.texinfo: Remove stuff about CYGWIN=strace. + +Thu Oct 26 10:00:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Slight changes. Fix some errors. + +Thu Oct 26 9:35:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Changed the (now incorrect) hint that ntsec only + uses access allowed ACEs. + +Fri Sep 29 23:52:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * pathnames.sgml: Add documentation about raw block special + devices and tape devices to the "POSIX devices" chapter. + +Fri Aug 18 15:51:06 2000 Christopher Faylor <cgf@cygnus.com> + + * fhandler-tut.txt: hinfo -> dtable. + +Thu Jul 20 13:01:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Add description for the new setuid ability + of Cygwin since release 1.1.3. + * overview2.sgml: Add description for new chroot functionality. + * calls.texinfo: Add missing calls. Change comments for + setuid, setgid, seteuid, setegid, chroot. + +Tue May 3 0:25:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * ntsec.sgml: Revisited description of `ntsec' according to + the changes in release 1.1. + * setup.sgml: Include ntsec. + * setup-net.sgml: Ditto. diff --git a/winsup/CVSChangeLogs.old/lsaauth/ChangeLog-2015 b/winsup/CVSChangeLogs.old/lsaauth/ChangeLog-2015 new file mode 100644 index 000000000..81e3ab1aa --- /dev/null +++ b/winsup/CVSChangeLogs.old/lsaauth/ChangeLog-2015 @@ -0,0 +1,170 @@ +2014-08-15 Corinna Vinschen <corinna@vinschen.de> + + * configure.ac: Convert to new AC_INIT style. + * configure: Regenerate. + +2013-12-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * configure.ac: Back out stupid change. + * configure: Regenerate. + +2013-12-03 Christopher Faylor <me.cygwin2013@cgf.cx> + + * configure.ac: Don't require 64-bit compiler for 32-bit builds. + * configure: Regenerate. + +2013-07-29 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cyglsa.dll): Explicitely specify DLL entry point to + harden against gcc function and block reordering optimizations. + (cyglsa64.dll): Ditto. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.ac: Rename from configure.in. + * configure.in: Delete. + * configure: Regenerate. + +2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Use /bin/mkdir to make directories. + +2012-10-24 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add AC_NO_EXECUTABLES. + * configure: Regenerate. + +2012-10-24 Kai Tietz <ktietz70@googlemail.com> + Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * configure.in: Check for MINGW32_CC and MINGW64_CC. + * configure: Regenerate. + * Makefile.in: Use MINGW32_CC and MINGW64_CC to build 32-bit and + 64-bit DLLs. Remove references to mingw and w32api directories. + * cyglsa64.dll: Remove from version control. + * make-64bit-version-with-mingw-w64.sh: Remove. + +2012-05-29 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (LIBS): Re-add advapi32.dll. Explain why. + * make-64bit-version-with-mingw-w64.sh (LIBS): Ditto. + * cyglsa.c: Drop NTDLL function declarations. Use equivalent advapi32 + functions again, throughout. + * cyglsa64.dll: Regenerate. + +2011-05-10 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Don't override CC. + * cyglsa.c: Don't include wchar.h. Declare wcscpy and wcslen instead. + * cyglsa64.dll: Rebuild. + +2011-03-31 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (LIBS): Remove advapi32.dll. + (clean): Remove cyglsa.def. + * cyglsa.c: Drop definitions required for VC++. Don't include ntddk.h. + Declare functions from NTDLL here. Explain why. Use NTDLL functions + in place of ADVAPI32 functions. + * cyglsa64.def: New file. + * cyglsa64.dll: Regenerate. + * make-64bit-version-with-mingw-w64.sh (LIBS): Remove advapi32.dll. + Reference cyglsa64.def instead of mslsa.def. + * make-64bit-version-with-visual-c.bat: Remove. + * mslsa.def: Remove. + +2011-03-31 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * cyglsa.c: Fix compilation with MinGW-w64 toolchains. + * make-64bit-version-with-mingw-w64.sh: New file. + * cyglsa64.dll: Regenerate with MinGW-w64-gc. + +2010-12-10 Illia Bobyr <Illia.Bobyr@ronin-capital.com> + + * cyglsa-config: Unset GREP_OPTIONS when calling grep. + +2010-01-29 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa.c: Include lmcons.h instead of lm.h to make newer WinDDK happy. + (LsaApLogonUserEx): Use CYG_LSA_MAGIC as checksum start value to + decouple from Cygwin release. + * make-64bit-version-with-visual-c.bat: Avoid compiler warning. + * cyglsa64.dll: New build. + +2009-02-23 Sjors Gielen <mailinglist@dazjorz.com> + + * Makefile.in: Add DESTDIR functionality. + +2008-10-12 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Rearrange to avoid -mno-cygwin. + * configure.in: Use mingw front-end from utils directory as compiler + front-end. + * configure: Regenerate. + * cyglsa.c (cyglsa_printf): Rename from 'printf' to avoid a compiler + error. + (print_sid, print_groups, print_privs, print_dacl, print_tokinf, + LsaApLogonUserEx): Ditto. + +2008-08-13 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa-config: Copy the DLL instead of moving. + +2008-07-16 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa-config: Always create a /bin/cyglsa directory and copy the + LSA DLL there. Register this copy in the registry. + +2008-07-15 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa.c: Include ntddk.h again, but only if __MINGW32__ is defined. + * cyglsa64.dll: Regenerate. + * make-64bit-version-with-visual-c.bat: Fix comment. + +2008-07-13 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa.c: Don't include ntddk.h. + (RtlInitEmptyUnicodeString): Use Visual-C compatible "__inline" instead + of "inline". + (uni_alloc): Change second argument to USHORT. + (printf): Move definition of ap to make Visual-C++ happy. + (LsaApLogonUserEx): Compute size of datastructure returned to + LSA on 64 bit systems correctly to avoid heap corruption. + * cyglsa64.dll: Regenerate. + * make-64bit-version-with-visual-c.bat: Accommodate newer Microsoft + toolchains. Add more comment. + * mslsa.def: Export LsaApLogonUserEx instead of LsaApLogonUser. + +2008-07-11 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa.c (LsaApLogonUserEx): Accommodate the fact that authinf->domain + and authinf->username are now of type WCHAR. Change sam_username and + sam_u size to be deifned in terms of MAX_DOMAIN_NAME_LEN instead of + INTERNET_MAX_HOST_NAME_LENGTH. + +2008-07-10 Corinna Vinschen <corinna@vinschen.de> + + * cyglsa.c: Revamp debugging output. + (LsaApInitializePackage): Open debugging output file here. + (LsaApLogonUserEx): Replace LsaApLogonUser. Add debugging output. + Create machine name for accounting. Add (disabled) code to fetch + a token from GetAuthDataForUser/ConvertAuthDataToToken. + * cyglsa.din: Relace LsaApLogonUser with LsaApLogonUserEx. + +2006-11-27 Corinna Vinschen <corinna@vinschen.de> + + Initial release of the Cygwin LSA authentication package. + * ChangeLog: New file. + * Makefile.in: Ditto. + * aclocal.m4: Ditto. + * configure.in: Ditto. + * configure: Ditto. Generated from configure.in. + * cyglsa-config: Ditto. + * cyglsa.c: Ditto. + * cyglsa.din: Ditto. + * cyglsa64.dll: Ditto. + * make-64bit-version-with-visual-c.bat: Ditto. + * mslsa.def: Ditto. diff --git a/winsup/CVSChangeLogs.old/lsaauth/ChangeLog.64bit b/winsup/CVSChangeLogs.old/lsaauth/ChangeLog.64bit new file mode 100644 index 000000000..32ef85710 --- /dev/null +++ b/winsup/CVSChangeLogs.old/lsaauth/ChangeLog.64bit @@ -0,0 +1,13 @@ +2013-02-22 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * configure.ac: Skip check for i686-w64-mingw32-g++ on x86_64. + * configure: Regenerate. + +2013-02-21 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (target_cpu): Define. Check for target_cpu rather than + target_alias for conditional compilation issues. + +2013-02-15 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in: Do not build or install 32bit DLL for 64bit target. diff --git a/winsup/CVSChangeLogs.old/testsuite/ChangeLog-2015 b/winsup/CVSChangeLogs.old/testsuite/ChangeLog-2015 new file mode 100644 index 000000000..2e6ed5404 --- /dev/null +++ b/winsup/CVSChangeLogs.old/testsuite/ChangeLog-2015 @@ -0,0 +1,799 @@ +2015-10-27 Jon Turney <jon.turney@dronecode.org.uk> + + * winsup.api/signal-into-win32-api.c: Remove execute permissions. + +2014-08-15 Corinna Vinschen <corinna@vinschen.de> + + * configure.ac: Convert to new AC_INIT style. + * configure: Regenerate. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.ac: Rename from configure.in. + * configure.in: Delete. + * configure: Regenerate. + +2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Remove old Makefile.common'isms. Don't rely on + in-build tools. + +2012-04-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * configure: Regenerate. + +2011-03-21 Corinna Vinschen <corinna@vinschen.de> + + * libltp/lib/get_high_address.c: Align copyright with upstream. + +2009-11-01 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in: Use utils mingw front-end to generate non-cygwin binary. + +2008-11-26 Christopher Faylor <me+cygwin@cgf.cx> + + * Revert erroneous checkin. + +2006-07-23 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Update copyright. Remove unused stuff. + +2006-07-17 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Simplify a little. + +2006-06-12 Pierre Humblet Pierre.Humblet@ieee.org + + * winsup.api/user_malloc.c: New file. + +2006-05-30 Christopher Faylor <cgf@timesys.com> + + * winsup.api/cygload.h: Increase padding to 32768. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * configure.in: Update to newer autoconf. + (thanks to Steve Ellcey) + * configure: Regenerate. + * aclocal.m4: New file. + +2006-03-23 Christopher Faylor <cgf@timesys.com> + + * winsup.api/checksignal.c (main): Add test for siginterrupt. + +2006-01-02 Christopher Faylor <cgf@timesys.com> + + * cygload/README: Delete. + * cygload/cygload.cc: Move to winsup.api. Add comments from README. + * cygload/cygload.h: Move to winsup.api. + * cygload/cygload.exp: Move to winsup.api. + * Makefile.in: Remove cygload. + * winsup.api/winsup.exp: If a .exp file is detected, run it rather than + using standard compile. + + * winsup.api/resethand.c (main): Use printf to print status or expect + thinks something is wrong. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * winsup.api/resethand.c (main): Remove core dump flag from exit + status. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * winsup.api/resethand.c (main): Coerce argument to pointer to stop gcc + complaint. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * winsup.api/resethand.c: Use SIGSEGV for the signal to test. + +2006-01-01 Christopher Faylor <cgf@timesys.com> + + * winsup.api/resethand.c: New file. + +2005-12-11 Christopher Faylor <cgf@timesys.com> + + * winsup.api/ltp/dup03.c (cleanup): Fix longstanding off-by-one error + when setting array element to -1. + +2005-06-11 Christopher Faylor <cgf@timesys.com> + + * winsup.api/pthread/cancel2.c: Use explicit initializer for mutex. + * winsup.api/pthread/mutex4.c (main): Ditto. + * winsup.api/pthread/mutex5.c: Reflect change in cygwin default mutex type. + * winsup.api/pthread/mutex6d.c: Ditto. + +2005-06-10 Christopher Faylor <cgf@timesys.com> + + * winsup.api/winsup.exp: Remove (temporarily?) -nostdinc from build + since it causes compile failures with gcc 3.4.4. + +2005-06-06 Christopher Faylor <cgf@timesys.com> + + * cygload/cygload.exp: .cpp -> .cc. + +2005-06-06 Max Kaehn <slothman@electric-cloud.com> + + * Makefile.in: Test cygload. + * cygload: New directory. + * cygload/README: New file. + * cygload/Makefile: Ditto. + * cygload/cygload.h: Ditto. + * cygload/cygload.cc: Ditto. + * cygload/cygload.exp: Ditto. + +2005-05-17 Brian Dessent <brian@dessent.net> + + * winsup.api/signal-into-win32-api.c (main): Use 'NULL' instead of '0' + in argument list to avoid compiler warning with gcc4. + * winsup.api/ltp/execle01.c (main): Ditto. + * winsup.api/ltp/execlp01.c (main): Ditto. + * winsup.api/ltp/fcntl07.c (do_exec): Ditto. + * winsup.api/ltp/fcntl07B.c (do_exec): Ditto. + +2005-02-10 Christopher Faylor <cgf@timesys.com> + + * winsup.api/known_bugs.tcl: Remove dup05, fcntl07B, lseek04, select03, + unlink06. + * winsup.api/mmaptest03.c: Make a little more verbose so that it is + easier to figure out where something failed. + +2005-01-09 Christopher Faylor <cgf@timesys.com> + + * cygrun.c (main): Fix exit code so that it reflects UNIX style. + * winsup.api/ltp/fork04.c (setup): Accommodate change in putenv + declaration. + +2004-08-24 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/mmaptest01.c (main): Accomodate 9x memory usage. + +2004-08-24 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/ltp/symlink01.c (do_link): Print inode numbers using %llu + format specifier. + +2004-08-17 Gerd Spalink <Gerd.Spalink@t-online.de> + Pierre Humblet <Pierre.Humblet@ieee.org> + + * devdsp.c: Outputs the names of the main test functions. + (forkrectest): Expect child success. + (forkplaytest): Ditto. + (syncwithchild): Output the child status and the desired value. + (sinegenw): Reduce volume of the beep. + (sinegenb): Ditto. + (dup_test): New test. + +2004-04-13 Gerd Spalink <Gerd.Spalink@t-online.de> + + * winsup.api/devdsp.c (forkrectest): Move synchronization with child + so that test passes also under high CPU load. + (forkplaytest): Ditto. + (abortplaytest): New function to test ioctl code SNDCTL_DSP_RESET. + +2004-04-04 Gerd Spalink <Gerd.Spalink@t-online.de> + + * winsup.api/devdsp.c (ioctltest): Add 2 tests for ioctl codes + SNDCTL_DSP_CHANNELS and SNDCTL_DSP_GETCAPS. + +2004-03-24 Gerd Spalink <Gerd.Spalink@t-online.de> + + * winsup.api/devdsp.c: New file, testing fhandler_dev_dsp code. + * winsup.api/devdsp_okay.h: Ditto. + +2004-03-06 Christopher Faylor <cgf@redhat.com> + + * winsup.api/known_bugs.tcl: Remove mknod01 since mknod now works. + * winsup.api/ltp/mknod01.c: Remove root check when running on cygwin. + +2004-03-04 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/mutex8e.c: New testcase. + * winsup.api/pthread/mutex8n.c: Ditto. + * winsup.api/pthread/mutex8r.c: Ditto. + +2003-12-23 Christopher Faylor <cgf@redhat.com> + + * winsup.api/pthread/rwlock7.c (main): Don't assume that result of rand + operation is non-zero. + +2003-12-01 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/known_bugs.tcl: Remove fcntl09 and fcntl10. These + tests had a compatibility bug. + * winsup.api/ltp/fcntl09.c: Don't use F_RDLCK | F_WRLCK but only + F_WRLCK to set a write lock. + * winsup.api/ltp/fcntl10.c: Ditto. + +2003-11-25 Christopher Faylor <cgf@redhat.com> + + * winsup.api/known_bugs.tcl: Remove lseek10 since mknod now works. + +2003-11-20 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/msgtest.c (main): Revert to use the SIGSYS signal handler. + * winsup.api/semtest.c (main): Ditto. + * winsup.api/shmtest.c (main): Ditto. + +2003-11-19 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/msgtest.c: New file derived from FreeBSD, testing + XSI Message Queue support. + * winsup.api/semtest.c: Ditto, testing XSI Semaphore support. + * winsup.api/shmtest.c: Ditto, testing XSI Shared Memory support. + +2003-07-06 Christopher Faylor <cgf@redhat.com> + + * winsup.api/known_bugs.tcl: Remove gethostid01 from list of known + bugs. + +2003-07-06 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Remove .dat files when cleaning. + +2003-07-06 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Remove .d files when cleaning. + +2003-05-09 Corinna Vinschen <corinna@vinschen.de> + + * libltp/include/test.h: Remove gethostid declaration. + +2003-04-08 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/condvar9.c: Fix test. + +2003-03-27 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/rwlock1.c: Remove pthreads-win32 header. + * winsup.api/pthread/rwlock2.c: Ditto. + * winsup.api/pthread/rwlock3.c: Ditto. + * winsup.api/pthread/rwlock4.c: Ditto. + * winsup.api/pthread/rwlock5.c: Ditto. + * winsup.api/pthread/rwlock6.c: Ditto. + +2003-03-27 Brian Ford <ford@vss.fsi.com> + + * winsup.api/pthread/condvar7.c (mythread): Cast + pthread_mutex_unlock argument of pthread_cleanup_push + to void *, preventing a compiler warning / testsuite failure. + * winsup.api/pthread/condvar9.c (mythread): Likewise. + * winsup.api/pthread/rwlock7.c (main): Use ftime instead of + _ftime. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/rwlock1.c: New test. + * winsup.api/pthread/rwlock2.c: Ditto. + * winsup.api/pthread/rwlock3.c: Ditto. + * winsup.api/pthread/rwlock4.c: Ditto. + * winsup.api/pthread/rwlock5.c: Ditto. + * winsup.api/pthread/rwlock6.c: Ditto. + * winsup.api/pthread/rwlock7.c: Ditto. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/condvar7.c: New test. + * winsup.api/pthread/condvar9.c: Ditto. + +2003-03-18 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/mutex1n.c: New test. + * winsup.api/pthread/mutex6n.c: Ditto. + * winsup.api/pthread/mutex7n.c: Ditto. + +2003-03-09 Christopher Faylor <cgf@redhat.com> + + * winsup.api/winsup.exp: Use -nostdinc when compiling. + * Makefile.in: Specifically search compiler include directory since it + is now stripped via -nostdinc. + +2003-03-09 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/ltp/fork10.c (main): Remove non-portable declaration + of lseek. + +2003-03-09 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Use "cygwin0" rather than "new-cygwin" to denote + in-build-tree version of library or dll. + * config/default.exp: Ditto. + * winsup.api/winsup.exp: Ditto. + +2003-03-07 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/known_bugs.tcl: Remove fsync01, setregid01 and setreuid01 + from list of known bugs. + +2003-02-19 Vaclav Haisman <V.Haisman@sh.cvut.cz> + + * winsup.api/crlf.c: Fix C signed/unsigned compare warning. + * winsup.api/mmaptest01.c: Ditto. + * winsup.api/ltp/chmod01.c: Ditto. + * winsup.api/ltp/fork04.c: Ditto. + * winsup.api/ltp/lseek03.c: Ditto. + * winsup.api/ltp/lseek06.c: Ditto. + * winsup.api/ltp/lseek07.c: Ditto. + * winsup.api/ltp/lseek08.c: Ditto. + * winsup.api/ltp/mmap001.c: Ditto. + * winsup.api/ltp/mmap02.c: Ditto. + * winsup.api/ltp/mmap03.c: Ditto. + * winsup.api/ltp/mmap04.c: Ditto. + * winsup.api/ltp/mmap05.c: Ditto. + * winsup.api/ltp/mmap06.c: Ditto. + * winsup.api/ltp/mmap07.c: Ditto. + * winsup.api/ltp/mmap08.c: Ditto. + * winsup.api/ltp/pipe11.c: Ditto. + * winsup.api/ltp/poll01.c: Ditto. + * winsup.api/ltp/sync02.c: Ditto. + * winsup.api/ltp/times03.c: Ditto. + * winsup.api/ltp/umask03.c: Ditto. + * winsup.api/ltp/getpgid01.c: Remove unused obsolete include. + * winsup.api/ltp/getpgid02.c: Ditto. + +2003-02-08 Christopher Faylor <cgf@redhat.com> + + * winsup.api/winsup.exp (ws_spawn): Tweak slightly to work with tcl + 8.4.1. + +2003-02-07 Christopher Faylor <cgf@redhat.com> + + * libltp/lib/parse_opts.c: Deal with C warnings. + * winsup.api/pthread/cancel12.c: Ditto. + * winsup.api/winsup.exp: Don't use -g3. + +2003-02-04 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/cancel11.c: New test. + * winsup.api/pthread/cancel12.c: Ditto. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Don't filter out -g. Actually pass correct CFLAGS to + site.exp. + * winsup.api/winsup.exp: Use -g flag from CFLAGS. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Turn off all optimizations. + * libltp/lib/parse_opts.c (TEST_VALID_ENO): Move define outside of + conditional. + (TEST_ERRNO): Ditto. + (btime): Ditto. + (etime): Ditto. + (tmptime): Ditto. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * libltp/include/usctest.h: Add externs to some variables that need it. + * winsup.api/ltp/mmap05.c (main): Make file_content volatile to avoid + optimization glitch. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * winsup.api/mmaptest03.c (main): Mark variables as volatile to avoid + optimization induced problems. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * Makefile (check): Add cygrun.exe dependency. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + Perform more C warning fixup on all C source files and headers. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * libltp/include/test.h: Fix C warnings. + * winsup.api/checksignal.c: Ditto. + * winsup.api/crlf.c: Ditto. + * winsup.api/devzero.c: Ditto. + * winsup.api/iospeed.c: Ditto. + * winsup.api/mmaptest01.c: Ditto. + * winsup.api/mmaptest02.c: Ditto. + * winsup.api/mmaptest03.c: Ditto. + * winsup.api/mmaptest04.c: Ditto. + * winsup.api/nullgetcwd.c: Ditto. + * winsup.api/sigchld.c: Ditto. + * winsup.api/signal-into-win32-api.c: Ditto. + * winsup.api/systemcall.c: Ditto. + * winsup.api/waitpid.c: Ditto. + * winsup.api/pthread/mainthreadexits.c: Ditto. + * winsup.api/pthread/test.h: Ditto. + * winsup.api/pthread/threadidafterfork.c: Ditto. + + * Makefile.in: Remove cygrun.exe from RUNTIME since it is built here + now. + +2003-01-23 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Use ALL_CFLAGS to build test programs so that correct + libraries and other options are used. + +2003-01-22 Corinna Vinschen <corinna@vinschen.de> + + * cygrun.c: Move here from ../cygwin. + * Makefile.in: Build cygrun.exe. + * winsup.api/winsup.exp: Expect cygrun.exe in $rootme. + +2003-01-21 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Find tcl library in the right place. + +2003-01-21 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/cancel9.c: Make child pid static global. + (main): Wait in mainthread until child process has terminated. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/cancel10.c: New test. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/cancel9.c: New test. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/cancel7.c: New test. + * winsup.api/pthread/cancel8.c: Ditto. + +2003-01-14 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/cancel6.c: New test. + +2003-01-09 Thomas Pfaff <tpfaff@gmx.net> + + * winsup.api/pthread/mutex1d.c: New test. Port from pthreads-win32 + project. + * winsup.api/pthread/mutex1e.c: Ditto. + * winsup.api/pthread/mutex4.c: Ditto. + * winsup.api/pthread/mutex5.c: Ditto. + * winsup.api/pthread/mutex6d.c: Ditto. + * winsup.api/pthread/mutex6e.c: Ditto. + * winsup.api/pthread/mutex7.c: Ditto. + * winsup.api/pthread/mutex7d.c: Ditto. + * winsup.api/pthread/mutex7e.c: Ditto. + * winsup.api/pthread/mutex7r.c: Ditto. + +2002-11-25 Robert Collins <rbtcollins@hotmail.com> + + * readme: Document running portions of the test suite (Thanks Egor!). + * winsup.api/pthread/mainthreadexits.c: New file, derived from + Thomas Pfaff's test cases. + * winsup.api/pthread/threadidafterfork.c: Ditto. + +2002-08-25 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (RUNTEST): Use Makefile's srcdir and bupdir* macros, + where appropriate. + * winsup.api/winsup.exp: Use -nodefaultlibs when linking executable to + avoid potentially linking installed dll. + +2002-07-06 Christopher Faylor <cgf@redhat.com> + + * testsuite/winsup.api/winsup.exp: Add -mwin32 to gcc flags so + windows.h will be found. + +2002-07-04 Egor Duda <deo@logos-m.ru> + + * winsup.api/pthread/cancel1.c: New test. Port from pthreads-win32 + project. + * winsup.api/pthread/cancel2.c: Ditto. + * winsup.api/pthread/cancel3.c: Ditto. + * winsup.api/pthread/cancel4.c: Ditto. + * winsup.api/pthread/cancel5.c: Ditto. + +2002-07-03 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Eliminate unneeded Makefile recreation rule. + +2002-02-27 Christopher Faylor <cgf@redhat.com> + + * winsup.api/systemcall.c (main): Ensure that stdin is redirected. + +2001-11-18 Egor Duda <deo@logos-m.ru> + + * winsup.api/pthread/condvar3_1.c: Fix debugging output. + +2001-11-15 Egor Duda <deo@logos-m.ru> + + * winsup.api/pthread/: New directory. Ports of pthread functionality + tests from pthreads-win32 project. + * winsup.api/pthread/test.h: Commmon declaraions for pthread tests. + * winsup.api/pthread/cleanup2.c: New test. + * winsup.api/pthread/cleanup3.c: Ditto. + * winsup.api/pthread/condvar1.c: Ditto. + * winsup.api/pthread/condvar2.c: Ditto. + * winsup.api/pthread/condvar2_1.c: Ditto. + * winsup.api/pthread/condvar3.c: Ditto. + * winsup.api/pthread/condvar3_1.c: Ditto. + * winsup.api/pthread/condvar3_2.c: Ditto. + * winsup.api/pthread/condvar3_3.c: Ditto. + * winsup.api/pthread/condvar4.c: Ditto. + * winsup.api/pthread/condvar5.c: Ditto. + * winsup.api/pthread/condvar6.c: Ditto. + * winsup.api/pthread/condvar8.c: Ditto. + * winsup.api/pthread/count1.c: Ditto. + * winsup.api/pthread/create1.c: Ditto. + * winsup.api/pthread/create2.c: Ditto. + * winsup.api/pthread/equal1.c: Ditto. + * winsup.api/pthread/exit1.c: Ditto. + * winsup.api/pthread/exit2.c: Ditto. + * winsup.api/pthread/exit3.c: Ditto. + * winsup.api/pthread/inherit1.c: Ditto. + * winsup.api/pthread/join0.c: Ditto. + * winsup.api/pthread/join1.c: Ditto. + * winsup.api/pthread/join2.c: Ditto. + * winsup.api/pthread/mutex1.c: Ditto. + * winsup.api/pthread/mutex1r.c: Ditto. + * winsup.api/pthread/mutex2.c: Ditto. + * winsup.api/pthread/mutex3.c: Ditto. + * winsup.api/pthread/mutex6r.c: Ditto. + * winsup.api/pthread/once1.c: Ditto. + * winsup.api/pthread/priority1.c: Ditto. + * winsup.api/pthread/priority2.c: Ditto. + * winsup.api/pthread/self1.c: Ditto. + * winsup.api/pthread/self2.c: Ditto. + * winsup.api/pthread/tsd1.c: Ditto. + +2001-11-08 Corinna Vinschen <corinna@vinschen.de> + + * checksignal.c: New testcase. + +2001-11-04 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Oops. Revert previous change. Add Makefile/Makefile.in + dependency. + +2001-11-04 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add check target. + +2001-11-02 Egor Duda <deo@logos-m.ru> + + * libltp/lib/forker.c: Include proper header to avoid compiler + warning. + +2001-10-29 Egor Duda <deo@logos-m.ru> + + * winsup.api/ltp/stat03.c: Supress compiler warning. + +2001-10-29 Egor Duda <deo@logos-m.ru> + + * winsup.api/signal-into-win32-api.c: Supress compiler warning. + +Mon Oct 8 14:15:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/mmaptest01.c: Add several tests on mmaps. Use libltp. + * winsup.api/winsup.exp: Link all tests agains libltp. + +Fri Oct 5 11:15:55 2001 Christopher Faylor <cgf@cygnus.com> + + * winsup.api/nullgetcwd.c: New file. Check that NULL first argument to + getcwd works. + +Thu Oct 4 22:47:51 2001 Christopher Faylor <cgf@cygnus.com> + + * winsup.api/systemcall.c (main): Change some messages for clarity. + +Thu Oct 4 22:19:39 2001 Christopher Faylor <cgf@cygnus.com> + + * winsup.api/systemcall.c: New file. Check for system call problems. + +2001-09-20 Egor Duda <deo@logos-m.ru> + + * libltp/lib/get_high_address.c (get_high_address): Get inaccessible + address more robustly. + * winsup.api/ltp/stat06.c (high_address_setup): Use generic function + from ltp library to obtain inaccessible address. + +2001-09-15 Egor Duda <deo@logos-m.ru> + + * winsup.api/ltp/sbrk01.c (main): Force output at startup to + make sure that stdio file buffer get allocated. + * winsup.api/ltp/stat06.c (high_address_setup): On cygwin, area + after sbrk(0) may be available, use 0xffff0000 as "high address". + * winsup.api/ltp/symlink01.c: Perform all tests. Mark those tests that + don't work on cygwin with '-1'. Close open files so that temporary + directory can be deleted on exit. + * winsup.api/ltp/vfork01.c: New test. + +2001-09-13 Egor Duda <deo@logos-m.ru> + + * winsup.api/winsup.exp: Run only selected test if environment + variable CYGWIN_TESTSUITE_TESTS is set. Use its value as regular + expression to filter test names. + * winsup.api/ltp/symlink01.c (creat_path_max): Provide explicit + buffer to getcwd to conform to standards and avoid memory leak. + (do_chdir): Ditto. + +2001-09-13 Egor Duda <deo@logos-m.ru> + + * libltp/lib/tst_sig.c: Pass SIGSEGV to application to consider + whether it's expected or not. + * winsup.api/known_bugs.tcl: lseek10 is known to fail because mknod + is not implemented. + * winsup.api/ltp/rename02.c: Fix formatting. + * libltp/lib/libtestsuite.c: New file. + * winsup.api/signal-into-win32-api.c: New test. + * winsup.api/ltp/access04.c: Ditto. + * winsup.api/ltp/access05.c: Ditto. + * winsup.api/ltp/alarm07.c: Ditto. + * winsup.api/ltp/chdir04.c: Ditto. + * winsup.api/ltp/chmod01.c: Ditto. + * winsup.api/ltp/close01.c: Ditto. + * winsup.api/ltp/close02.c: Ditto. + * winsup.api/ltp/creat01.c: Ditto. + * winsup.api/ltp/creat03.c: Ditto. + * winsup.api/ltp/exit01.c: Ditto. + * winsup.api/ltp/exit02.c: Ditto. + * winsup.api/ltp/fchdir01.c: Ditto. + * winsup.api/ltp/fchdir02.c: Ditto. + * winsup.api/ltp/fork02.c: Ditto. + * winsup.api/ltp/fork03.c: Ditto. + * winsup.api/ltp/fork06.c: Ditto. + * winsup.api/ltp/fork07.c: Ditto. + * winsup.api/ltp/fork09.c: Ditto. + * winsup.api/ltp/fork10.c: Ditto. + * winsup.api/ltp/fork11.c: Ditto. + * winsup.api/ltp/fstat02.c: Ditto. + * winsup.api/ltp/fstat03.c: Ditto. + * winsup.api/ltp/fstat04.c: Ditto. + * winsup.api/ltp/ftruncate01.c: Ditto. + * winsup.api/ltp/ftruncate02.c: Ditto. + * winsup.api/ltp/ftruncate03.c: Ditto. + * winsup.api/ltp/getgid02.c: Ditto. + * winsup.api/ltp/getgid03.c: Ditto. + * winsup.api/ltp/getpgid01.c: Ditto. + * winsup.api/ltp/getpgid02.c: Ditto. + * winsup.api/ltp/getpid02.c: Ditto. + * winsup.api/ltp/getppid02.c: Ditto. + * winsup.api/ltp/getuid02.c: Ditto. + * winsup.api/ltp/getuid03.c: Ditto. + * winsup.api/ltp/kill01.c: Ditto. + * winsup.api/ltp/kill02.c: Ditto. + * winsup.api/ltp/kill03.c: Ditto. + * winsup.api/ltp/kill04.c: Ditto. + * winsup.api/ltp/lseek06.c: Ditto. + * winsup.api/ltp/lseek07.c: Ditto. + * winsup.api/ltp/lseek08.c: Ditto. + * winsup.api/ltp/lseek09.c: Ditto. + * winsup.api/ltp/lseek10.c: Ditto. + * winsup.api/ltp/mmap02.c: Ditto. + * winsup.api/ltp/mmap03.c: Ditto. + * winsup.api/ltp/mmap04.c: Ditto. + * winsup.api/ltp/mmap05.c: Ditto. + * winsup.api/ltp/mmap06.c: Ditto. + * winsup.api/ltp/mmap07.c: Ditto. + * winsup.api/ltp/mmap08.c: Ditto. + * winsup.api/ltp/munmap01.c: Ditto. + * winsup.api/ltp/munmap02.c: Ditto. + * winsup.api/ltp/open02.c: Ditto. + * winsup.api/ltp/pipe01.c: Ditto. + * winsup.api/ltp/pipe08.c: Ditto. + * winsup.api/ltp/pipe09.c: Ditto. + * winsup.api/ltp/pipe10.c: Ditto. + * winsup.api/ltp/pipe11.c: Ditto. + * winsup.api/ltp/poll01.c: Ditto. + * winsup.api/ltp/read04.c: Ditto. + * winsup.api/ltp/readlink01.c: Ditto. + * winsup.api/ltp/readlink03.c: Ditto. + * winsup.api/ltp/rename01.c: Ditto. + * winsup.api/ltp/rename08.c: Ditto. + * winsup.api/ltp/rename10.c: Ditto. + * winsup.api/ltp/rmdir01.c: Ditto. + * winsup.api/ltp/stat01.c: Ditto. + * winsup.api/ltp/stat02.c: Ditto. + * winsup.api/ltp/stat03.c: Ditto. + * winsup.api/ltp/symlink03.c: Ditto. + * winsup.api/ltp/symlink04.c: Ditto. + * winsup.api/ltp/symlink05.c: Ditto. + * winsup.api/ltp/sync02.c: Ditto. + * winsup.api/ltp/time02.c: Ditto. + * winsup.api/ltp/times02.c: Ditto. + * winsup.api/ltp/times03.c: Ditto. + * winsup.api/ltp/truncate01.c: Ditto. + * winsup.api/ltp/truncate02.c: Ditto. + * winsup.api/ltp/umask02.c: Ditto. + * winsup.api/ltp/umask03.c: Ditto. + * winsup.api/ltp/wait401.c: Ditto. + * winsup.api/ltp/wait402.c: Ditto. + * winsup.api/ltp/write02.c: Ditto. + * winsup.api/ltp/write03.c: Ditto. + +2001-09-09 Egor Duda <deo@logos-m.ru> + + * winsup.api/ltp/dup03.c: New test. + * winsup.api/ltp/lseek03.c: Ditto. + * winsup.api/ltp/mmap001.c: Ditto. + * winsup.api/ltp/read01.c: Ditto. + * winsup.api/ltp/readdir01.c: Ditto. + * winsup.api/ltp/rmdir05.c: Ditto. + * winsup.api/ltp/sbrk01.c: Ditto. + * winsup.api/ltp/select02.c: Ditto. + * winsup.api/ltp/select03.c: Ditto. + * winsup.api/ltp/signal03.c: Ditto. + * winsup.api/ltp/stat06.c: Ditto. + * winsup.api/ltp/unlink08.c: Ditto. + * winsup.api/known_bugs.tcl: Update to reflect new test's known + failures. + * winsup.api/winsup.exp: Don't delete executable in case of + unexpected pass, as well as in case of unexpected failure. + * README: Update paragraph about expected failures. + +2001-05-21 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/mmaptest01.c: Add log output. + * winsup.api/mmaptest02.c: Write log output to stdout. + * winsup.api/mmaptest03.c: Ditto. + +2001-05-15 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/winsup.exp: Force linking all tests against binmode.o. + +2001-04-27 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/mmaptest04.c: Take care for binmode explicitely. + +2001-04-19 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/mmaptest02.c: New test. + * winsup.api/mmaptest03.c: Ditto. + * winsup.api/mmaptest04.c: Ditto. + +2001-04-03 Corinna Vinschen <corinna@vinschen.de> + + * winsup.api/mmaptest01.c: New test. + +2001-03-10 Egor Duda <deo@logos-m.ru> + + * winsup.api/ltp/access01.c: Avoid compilation error if X_OK + isn't declared as a constant. + +2001-03-09 Egor Duda <deo@logos-m.ru> + + * config/default.exp: Remove unneeded debugging output. + * Makefile.in: Use correct path to find dejagnu in local tree. + +2000-09-06 Egor Duda <deo@logos-m.ru> + + Add 'const' qualifiers where needed to avoid compiler warnings. + * libltp/lib/tst_sig.c (tst_sig): Don't attempt to cleanup on + fatal errors. + * libltp/lib/parse_opts.c (parse_opts): Initialize allocated + string to prevent heap corruption. + +2000-09-04 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Always add libltp headers directory to headers + search path. + +2000-09-02 Egor Duda <deo@logos-m.ru> + + * moved here everything from cygwin/testsuite/ + * configure.in: New file + * configure: New file, generated from configure.in + with autoconf 2.13 + * Makefile.in: New file + * libltp/: New directory. Contains a support library + and headers for tests in winsup.api/ltp/ + * config/default.exp: Print value of CYGWIN environment + variable when test completed + * winsup.api/samples/xf-sample-fail.c renamed to + winsup.api/samples/sample-fail.c + * winsup.api/samples/xf-sample-miscompile.c renamed to + winsup.api/samples/sample-miscompile.c + * winsup.api/known_bugs.tcl: New file. + * winsup.api/winsup.exp: Xfail test if its name is in + list from known_bugs.tcl + * winsup.api/winsup.exp: Don't stop if compiled test executable + can't be deleted + * winsup.api/winsup.exp: If in verbose mode, write test output + to <testname>.log + * winsup.api/ltp/: New directory. Contains cygwin port of testsuite + from Linux Testing Project + * winsup.api/sigchld.c: New file. Test if process recieves SIGCHLD + signal when its child terminates. + * winsup.api/waitpid.c: New file. Test if waitpid function works diff --git a/winsup/CVSChangeLogs.old/utils/ChangeLog-2000 b/winsup/CVSChangeLogs.old/utils/ChangeLog-2000 new file mode 100644 index 000000000..7ea5ae186 --- /dev/null +++ b/winsup/CVSChangeLogs.old/utils/ChangeLog-2000 @@ -0,0 +1,347 @@ +Fri Dec 15 23:41:48 2000 Christopher Faylor <cgf@cygnus.com> + + * cygcheck.cc (cygwin_info): Add some more bounds checking. + +Fri Dec 15 23:41:34 2000 Christopher Faylor <cgf@cygnus.com> + + From Matt Harget <matt@use.net>: + * utils/cygcheck.cc (keyeprint): Move declaration before other + functions so it could be used by all functions to report error + messages. Add comment. + (add_path): Check for NULL return from malloc. + (find_on_path): Check initial uses of pointers for NULL. + (rva_to_offset): Ditto. + (init_paths): Add checking for return values of Win32 calls. + (get_dword): Ditto. + (get_word): Ditto. + (dll_info): Ditto, also add NULL pointer checks. + (scan_registry): Ditto. + (check_keys): Ditto. + (dump_sysinfo): Ditto. Add default case to switch. Add error + reporting if GetVolumeInformation fails, except when it + returns ERROR_NOT_READY. + (track_down): Add checking for NULL pointers and + return values of Win32 calls. + (cygwin_info): Ditto. Correct small memory leak. + +Sun Dec 10 19:08:58 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Compile/link dumper.exe with c++. + +Tue Dec 7 11:15:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * mkpasswd.c: Slight formatting changes to the below patch. + (longopts): Fix typo in `local-groups' option. + (main): Initialize `passed_home_path' before first usage. + +Tue Dec 7 11:15:00 2000 Chris Abbey <cabbey@bresnanlink.net> + + * mkpasswd.c: make default home directory /home/$user if one + can't be found in user registry. Allow user to override + that with command line arg. + +Sun Dec 3 00:40:47 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use CXX to build the DLL. + * configure.in: Find correct c++ compiler. + * configure: Regenerate. + +Sat Nov 18 23:53:59 2000 Christopher Faylor <cgf@cygnus.com> + + * utils.sgml: Document new options for ps and strace. + +Wed Nov 8 08:49:27 2000 Jason Tishler <jt@dothill.com> + + * mount.cc (main): Call show_cygdrive_info instead of + show_cygdrive_prefixes. + * mount.cc (show_cygdrive_prefixes): Remove function. + * mount.cc (show_cygdrive_info): New function. Actually, + show_cygdrive_info is really an enhanced version of + show_cygdrive_prefixes renamed to show_cygdrive_info that also displays + the user and system flags. + +Wed Nov 8 15:52:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (load_netapi): New function to load netapi32.dll functions + dynamically so that mkgroup works on 9x/ME as well. + Use corresponding function pointers throughout. + (usage): Change to `int'. Change text to be conformant to mkpasswd. + (main): Use `getlongopt' to process options. + Special handling to create a group entry on 9x/ME. + * mkpasswd.c (load_netapi): New function to load netapi32.dll functions + dynamically so that mkpasswd works on 9x/ME as well. + Use corresponding function pointers throughout. + (usage): Change to `int'. Change text to be conformant to mkgroup. + (main): Use `getlongopt' to process options. + Special handling to create a passwd entry on 9x/ME. + Change conditional to create an entry for the local administrators + group when appropriate. + +Thu Nov 2 2:01:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * kill.cc (main): Return 1 in case of errors. + +Sat Oct 28 01:37:55 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Accomodate newer gcc's which require linking of c++ + programs with g++. Fixup output for some compilations. + * cygcheck.cc: Respond to compiler warnings. + * dumper.cc (main): Ditto. + * parse_pe.cc (exclusion::sort_and_check): Ditto. + * setfacl.cc (getaclentry): Ditto. + +Fri Oct 27 20:20:29 2000 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (main): Add a '-b' option. + +2000-10-18 DJ Delorie <dj@redhat.com> + + * ssp.c: new + * ssp.txt: new + * Makefile.in: build ssp.exe + +Wed Oct 18 18:57:46 2000 Christopher Faylor <cgf@cygnus.com> + + * ps.cc (main): Add some extra space to Windows pid output for + Windows 95. + +Tue Oct 17 23:49:04 2000 Christopher Faylor <cgf@cygnus.com> + + * ps.cc (main): Add some extra space to pid output for Windows 95. + +Tue Oct 17 1:09:00 2000 Corinna Vinschen <corinna@vinschen.de> + + Patch suggested by Brad Town <btown@ceddec.com>: + * cygcheck.cc (main): Fix argument counting. + +Sat Oct 14 23:42:58 2000 Christopher Faylor <cgf@cygnus.com> + + * ps.cc (main): Accomodate new PID_ constant. + +Thu Oct 12 02:19:12 2000 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (proc_child): Handle exceptions correctly. + +Sun Oct 8 23:11:17 2000 Christopher Faylor <cgf@cygnus.com> + + * ps.cc (main): Change order of reporting slightly so that windows pids + are more obvious. + * strace.cc (add_child): Just add child's pid directly. + (remove_child): No need to close the child process pid since + ContinueDebugEvent does that automatically. + (proc_child): Ditto for child thread. + +Fri Sep 29 13:12:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (keyeprint): New function. + (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. + +Wed Sep 27 16:24:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * cygkeycheck.cc: New file. Utility to retrieve keycodes. + * Makefile.in: Add cygkeycheck to the dependencies. + +2000-09-15 Joerg Schaible <joerg.schaible@gmx.de> + + * cygpath.cc: Add new options: -s and -i. + * utils.sgml: Document the new options. + +Tue Sep 12 22:45:28 2000 Christopher Faylor <cgf@cygnus.com> + + * kill.cc (main): Change behavior of -f so that it will force the + killing of a cygwin process after waiting 2 tenths of a second for it + to terminate. + (forcekill): Add an extra argument determining whether to wait for the + process to exit. + +Sun Sep 10 12:50:02 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Refine dumper.exe message. + +Mon Aug 28 21:55:56 2000 Christopher Faylor <cgf@cygnus.com> + + * kill.c (main): Avoid skipping next argument when a signal number is + specified. + * Makefile.in: Always clean dumper.exe. + +Fri Aug 25 12:41:53 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Only build dumper.exe when all of its library and + include dependencies are available. + +Fri Aug 25 11:44:29 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Make failure to build dumper.exe a non-error. + +Thu Aug 24 18:02:35 2000 Christopher Faylor <cgf@cygnus.com> + + * ps.cc (main): Always print a cygwin process using cygwin paths. + +2000-08-24 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Add dumper.exe target and associated mechanisms for building it. + * dumper.cc: New file. + * dumper.h: New file. + * module_info.cc: New file. + * parse_pe.cc: New file. + +Mon Jul 31 15:12:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (main): Initialize oldpwd before beeing used. + +Sat Jul 29 00:44:46 2000 Christopher Faylor <cgf@cygnus.com> + + * kill.cc (main): Add '-f' option to force termination of a process. + (forcekill): New function. + * ps.cc (main): Add '-W' option to list Windows pids as well as Cygwin + pids. + (dummyprocessmodules): New function. + (GetModuleFileNameEx95): New function. + (init_win): New function. + (to_time_t): New function. + +Thu Jul 27 22:54:28 2000 Jason Tishler <jt@dothill.com> + + * utils/mount.cc (main): Add --show-cygdrive-prefixes option. + (show_cygdrive_prefixes): New function. + * utils/umount.cc (main): Add --remove-cygdrive-prefix option. + (error): Change signature from 'char *' to 'const char *'. + (remove_cygdrive_prefix): New function. + +Thu Jul 13 22:24:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_already_exists): Slightly rearrange. + Change message texts. + +Thu Jul 13 13:02:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_already_exists): Additional warning message + if mount point exists with another mount type. + +Sat Jul 1 00:19:27 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Find getopt.c in cygwin/lib subdirectory. + +Sat Jun 24 23:16:33 2000 Christopher Faylor <cgf@cygnus.com> + + * cygcheck.cc (cygwin_info): New function. Scans DLL for Cygwin + version info. + (dll_info): Add path parameter for checking "cygwin1.dll". + (track_down): Accomodate additional parameter for dll_info. + (ls): Ditto. + (dump_sys_info): Always print cygwin1.dll last. + +2000-06-07 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * mount.cc (error): New function to report an error and exit. + * umount.cc (error): Ditto. + (remove_all_automounts): Check return status of cygwin_umount. + (remove_all_user_mounts): Ditto. + (remove_all_system_mounts): Ditto. + +2000-06-05 DJ Delorie <dj@cygnus.com> + + * mount.cc: add stdlib.h for exit + * umount.cc: ditto + * strace.cc: add #define for alloca + +Fri May 20 0:01:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (find_key): Add parameter `access'. + Call `RegOpenKeyEx' with that desired access. + (cmd_add, cmd_remove, cmd_set, cmd_unset): Call + `find_key' with KEY_ALL_ACCESS access. + (cmd_list, cmd_check, cmd_get): Call `find_key' + with KEY_READ access. + +2000-05-19 DJ Delorie <dj@cygnus.com> + + * cygpath.cc: add --windir/--sysdir options + * utils.sgml: and document them + +Thu May 18 14:38:26 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Eliminate WINSUP_DEPS. + * cygpath.cc: Reorganize includes to accomodate sys/cygwin.h changes. + * mkgroup.c: Ditto. + * mkpasswd.c: Ditto. + * mount.cc: Ditto. Eliminate use of cygwin source specific includes. + * ps.cc: Ditto. + * cygwin.cc: Eliminate obsolete file. + +Wed Apr 26 23:43:25 2000 Christopher Faylor <cgf@cygnus.com> + + * mount.cc (main): Add "-X" option to specify a "Cygwin executable". + +Sat Apr 15 23:34:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * mkpasswd.c (main): Use GetDCName instead of GetAnyDCName. + Don't create extra passwd entry for administrators group + if local_groups is set. + (usage): Change usage text slightly. + (enum_users): Loop while ERROR_MORE_DATA is returned. + (enum_local_groups): Ditto. + * mkgroup.c (enum_local_groups): Ditto. + (enum_groups) Ditto. + (usage): Change usage text slightly. + +Thu Apr 13 01:22:35 2000 Christopher Faylor <cgf@cygnus.com> + + * cygpath.cc (main): Add -a -o and -c options. + (doit): Ditto. + +Mon Apr 10 22:56:07 2000 Christopher Faylor <cgf@cygnus.com> + + * cygpath.cc (main): Add -f option for processing a group of paths from + a file. + (doit): New function. + +Sat Mar 18 22:52:37 2000 Christopher Faylor <cgf@cygnus.com> + + Patch suggested by Mumit Khan <khan@xraylith.wisc.edu>: + * strace.cc (_impure_ptr): New global variable to make strace build + under Cygwin gcc. + +Sat Mar 18 12:45:10 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Make CXXFLAGS consistent with cygwin. + +Wed Mar 15 00:53:58 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use MINGW_CXXFLAGS when compiling strace. + +Sun Mar 12 21:22:25 2000 Christopher Faylor <cgf@cygnus.com> + + * strace.cc: Throughout, track information like start_time, etc. on a + per-process basis. + +Sun Feb 27 23:37:32 2000 Christopher Faylor <cgf@cygnus.com> + + * strace.cc (handle_output_debug_string): Parse strace output to allow + various types of time output. + +Fri Jan 21 02:10:26 Corinna Vinschen <corinna@vinschen.de> + + * utils/regtool.cc (translate): Added unix like backslash + processing. + +2000-01-20 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc: allow forward slashes as key separators + +2000-01-19 DJ Delorie <dj@redhat.com> + + * regtool.cc: New file. + * Makefile.in: add regtool + * utils.sgml: add regtool + +Sat Jan 8 17:13:51 2000 Christopher Faylor <cgf@cygnus.com> + + * getfacl.c: New file. + * setfacl.c: New file. + * Makefile.in: Add getfacl.exe and setfacl.exe to list of PROGS. + Fix link flags in MINGW case. diff --git a/winsup/CVSChangeLogs.old/utils/ChangeLog-2015 b/winsup/CVSChangeLogs.old/utils/ChangeLog-2015 new file mode 100644 index 000000000..2ee81fa74 --- /dev/null +++ b/winsup/CVSChangeLogs.old/utils/ChangeLog-2015 @@ -0,0 +1,4288 @@ +2015-12-25 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.cc (delacl): Remove unused local variable. + +2015-12-21 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.cc (delace): New helper function to delete a single ACE. + (delacl): Call delace. + (modacl): Ditto, if entry is supposed to get deleted. Align comments. + +2015-12-21 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.cc (modacl): Move recomputing mask into new function. + (check_got_mask): New function checking if mask is in input. + (recompute_mask): New function to recompute mask. + (addmissing): Align mask computation to Linux setfacl. + (setfacl): Call check_got_mask and recompute_mask on Set, Delete and + Modify actions. + (usage): Rename --substitute to --set. + (longopts): Add --set option. + +2015-12-20 Houder <houder@xs4all.nl> + + * setfacl.cc (longopts): Drop accidentally requiring an argument to + the --mask and --no-mask options. + +2015-12-19 Houder <houder@xs4all.nl> + + * setfacl.cc (opts): Add colon to x option. + +2015-12-06 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (absolute_flag): Initialize to CCP_RELATIVE to simplify + expressions. + (cygdrive_flag): New global flag. + (long_options): Add --proc-cygdrive option. + (options): Add -U option. + (usage): Add description for -U option. + (do_sysfolders): Or cygdrive_flag to cygwin_conv_path call. + (do_pathconv): Simply or absolute_flag to conv_func. Or + cygdrive_flag to conv_func. + (do_options): Initalize absolute_flag to CCP_RELATIVE. Initialize new + cygdrive_flag. Set absolute_flag to CCP_ABSOLUTE on -a. Set + cygdrive_flag to CCP_PROC_CYGDRIVE on -U. + +2015-11-26 Michael Kwasigroch <mkwasigr@web.de> + + * kill.cc (strsigno): Don't call sys_sigabbrev for signal 0. + (listsig): Don't call strsigno for signal 0. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (action_t): Rename DeleteAll to DeleteExt. Add + DeleteAll. Rearrange for bit-wise testing later in the code. + (delallacl): Handle -b -k combination. + (setfacl): Handle DeleteExt/DeleteAll. + (usage): Fix -b/-k output. Rearrange output to better fill 80 + columns. + (main): Allow to combine -b and -k. + +2015-11-18 Corinna Vinschen <corinna@vinschen.de> + + Reapply POSIX ACL changes. + + * getfacl.c (main): Special-case SYSTEM and Admins group. Add comments. + + * setfacl.c: Align more to Linux tool. + (delacl): New function to delete acl entries only. + (modacl): Drop delete functionality. Add handling of recomputing the + mask and default mask values. + (delallacl): Rename from delacl. + (setfacl): Call delacl in Delete case. Call delallacl in DeleteAll + and DeleteDef case. + (usage): Accommodate new options. Rearrange and rephrase slightly. + (longopts): Emit 'x' in --delete case. Add --no-mask and --mask + options. + (opts): Add -x and -n options. + (main): Handle -d and -x the same. Handle -n and --mask options. + Drop handling for -r option. + + * getfacl.c (usage): Align more closely to Linux version. Add new + options -c, -e, -E. Change formatting to accommodate longer options. + (longopts): Rename --noname to --numeric. Keep --noname for backward + compatibility. Add --omit-header, --all-effective and --no-effective + options. + (opts): Add -c, -e and -E option. + (main): Handle new -c, -e, and -E options. + +2015-10-22 Yaakov Selkowitz <yselkowi@redhat.com> + + * getconf.c (conf_table): Add LEVEL*_CACHE_* variables. + +2015-08-30 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Fix missing commas in products array. + +2015-08-30 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (load_cygwin): Only unload cygwin DLL if not running + under a debugger. Explain why. + +2015-08-30 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016. + Add missing product types. + +2015-08-30 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (track_down): Skip error output for "api-ms-win-" + downlevel DLLs. + +2015-08-03 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (main2): Don't call setvbuf on NULL descriptor. + Explicitely fclose ofile. + +2015-07-29 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (main2): Rename from main. + (main): Make room for _cygtls area on stack and just call main2. Add + comment to explain why. + +2015-07-20 Corinna Vinschen <corinna@vinschen.de> + + * ldd.cc (STATUS_DLL_NOT_FOUND): Drop definition. + (report): Handle STATUS_ENTRYPOINT_NOT_FOUND exception. Explain why. + +2015-07-08 Corinna Vinschen <corinna@vinschen.de> + + * tzset.c (main): Check timezone and country case-insensitive. + +2015-06-07 Jon Turney <jon.turney@dronecode.org.uk> + + * strace.cc (proc_child): Log process and thread create and exit, + and DLL load and unload. + (GetFileNameFromHandle): New function. + +2015-06-10 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc (main): Widen UID field in long format to accommodate longer + UIDs since Cygwin 1.7.34. Remove Windows 2000 considerations. Fix + comments accordingly. + +2015-06-08 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (from_fstab_line): Don't convert slashes to backslashes for + bind mounts. Explain why. + +2015-04-21 Corinna Vinschen <corinna@vinschen.de> + + * tzmap-from-unicode.org: Convert Calcutta to Kolkata. + * tzmap.h: Regenerate. + +2015-02-28 Corinna Vinschen <corinna@vinschen.de> + + * getfacl.c (usage): Change --all to --access, --dir to --default. + Align text to output of Linux tool. + (longopts): Add --access and --default options. + +2015-02-25 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (MAX_SID_LEN): Remove. Instead, use SECURITY_MAX_SID_SIZE + throughout. + (enum_unix_groups): Introduce numeric_psid and rearrange code to avoid + potential heap corruption. + * mkpasswd.c: Ditto. + +2015-02-17 Ken Brown <kbrown@cornell.edu> + + * dump_setup.cc (check_package_files): Accommodate postinstall + files in any directory whose name contains "/postinstall/", not + just /etc/postinstall. + +2015-02-03 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (longopts): Add --force option. + (opts): Add -f option. + (restore_flags): New variable. + (usage): Clarify working of save action. Add restore action. Add + description for -f/--force option. + (set_privilege): Drop function. The Cygwin DLL is doing that anyway. + (cmd_save): Drop call to set_privilege. + (cmd_restore): New function. + (main): Handle -f/--force option. + +2014-12-15 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (action_t): Add DeleteDef value. + (delacl): Take new parameter to differe between DeleteAll and DeleteDef. + Extend conditional to handle DefaultDef. Change comment accordingly. + (setfacl): Call delacl in DefaultDef case as well. + (usage): Add and describe -k option. Add -k to require options. + (longopts): Add --remove-default option. + (opts): Add -k option. + (main): Handle -k option. + +2014-12-05 Václav Zeman <vhaisman@gmail.com> + + * tzmap-from-unicode.org: Create tzmap as const. + * tzmap.h: Regenerate. + +2014-12-05 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add rules to create and depend on tzmap.h. + * tzmap-from-unicode.org: New script to create tzmap.h. + * tzmap.h: New auto-generated file. + * tzset.c: Drop tzmap from here and include tzmap.h instead. Drop + Windows 2000 considerations. + +2014-11-28 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Call enum_local_groups with offset 0x30000 for local + machine, too. + +2014-11-27 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Call enum_groups with offset 0x30000 for local + machine, same as from DB. + * mkpasswd.c (enum_unix_users): Set pw_passwd field to '*'. + (enum_users): Ditto. + (main): Call enum_users with offset of 0x30000 for local machine, + same as from DB. + +2014-11-24 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (GetPW): If server is NULL, and the user is not a local + user, try to fetch the DC to use as server. + (ChangePW): Get Windows username via extra parameter. + (usage): Reduce -d help text to reflect above change. + (main): Fix typo in comment. Call GetPW and ChangePW as per the + changes above. + +2014-11-12 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (usage): Fix language. + * mkpasswd.c (usage): Ditto. + +2014-11-12 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_unix_groups): Always print groupname with machine + prefix. + (usage): Extend help output for -l option. + (main): Drop superfluous goto and label. Make machine prefixing for + local machine when using -l option dependend on options in + /etc/nsswitch.conf. + * mkpasswd.c: Ditto. + +2014-11-10 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Handle Windows 10/Server 2014(?). + +2014-11-03 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_local_groups): Don't generate leading separator char + for builtin accounts. + +2014-10-29 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (setfacl): Fix bracketing in expression. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (usage): Add -b to require options. + +2014-10-27 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (action_t): Add DeleteAll value. + (delacl): New function to remove all ACL entries not representing POSIX + permissions. + (setfacl): Rearrange conditional expression into switch statement. + Add DeleteAll case. + (usage): Add and describe -b option. + (longopts): Add --remove-all option. + (opts): Add -b option. + (main): Handle -b option. + +2014-10-21 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (CYGLSA64_DLL): Remove unused macro. + (dump_sysinfo): If COMSPEC isn't set in the MSVCRT environment, set it. + Explain why. + +2014-09-03 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (addmissing): New function to add missing acl entries to + a modified acl per the rules set by aclcheck. + (setfacl): Call addmissing unless action is Delete. + +2014-09-03 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (getaclentry): Fix previous fix again. Allow lone 'm' as + well as any lone default entry if action is Delete. Fix comments. + (usage): Align usage text. + +2014-09-03 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (getaclentry): Fix return value in case of a lone 'm' if + action is Delete. Drop requirement for a trailing colon if action is + Delete. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (usage): Drop outdated note that default ACEs are not + taken into account. + +2014-08-31 Corinna Vinschen <corinna@vinschen.de> + + * getfacl.c (usage): Add flags description. + (main): Print suid/sgid/vtx flags if available. + +2014-08-15 Corinna Vinschen <corinna@vinschen.de> + + * configure.ac: Convert to new AC_INIT style. + * configure: Regenerate. + +2014-08-14 Corinna Vinschen <corinna@vinschen.de> + + * utils.xml: Move to ../doc. + +2014-08-06 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (usage): Rename DAYS to MINDAYS and MAXDAYS. + * utils.xml (passwd): Ditto. + +2014-07-29 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (usage): Move info message that this /etc/group isn't really + required anymore more to the top of the usage output. + * mkpasswd.c (usage): Ditto for /etc/passwd. Drop old text from output. + * utils.xml: Fix accordingly. + +2014-06-16 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (main): Fix typo in error output. + +2014-04-21 Jon TURNEY <jon.turney@dronecode.org.uk> + + * minidumper.cc (filter_minidump_type): New function. + (minidump): Change default dump type from MiniDumpNormal to + something with more useful information without getting too + big. Use filter_minidump_type() to filter out unsupported dump + types. + +2014-04-21 Jon TURNEY <jon.turney@dronecode.org.uk> + + * Makefile.in (minidumper.exe): Link directly with dbghelp. + * minidumper.cc (minidump): Ditto. + +2014-04-21 Jon TURNEY <jon.turney@dronecode.org.uk> + + * minidumper.cc (minidump): Fix copy and paste error in checking + result of OpenProcess(). + +2014-02-24 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (domlist_t): Drop id_offset. + (get_dcname): Remove. + (current_group): Remove. + (enum_unix_groups): Simplify. Change space to underscore in domain + name. + (enum_local_groups): Simplify to accommodate the fact that it's only + called for foreign machines. + (enum_groups): Ditto. + (print_special_by_sid): Remove. + (print_special_by_name): Remove. + (usage): Align to new code. + (fetch_primary_domain): Remove. + (main): Use cygwin_internal CW_SETENT, CW_GETENT and CW_ENDENT method. + Call enum_local_groups, enum_groups, and enum_unix_groups only for + foreign machines. + * mkpasswd.c (get_dcname): Remove. + (current_user): Remove. + (enum_unix_users): Simplify. Change space to underscore in domain name. + (enum_users): Simplify to accommodate the fact that it's only + called for foreign machines. + (print_special_by_sid): Remove. + (usage): Align to new code. + (longopts): Add -b/--no-builtin option. + (opts): Add -b option. + (print_special_by_name): Remove. + (enum_std_accounts): Remove. + (fetch_primary_domain): Remove. + (main): Use cygwin_internal CW_SETENT, CW_GETENT and CW_ENDENT method. + Call enum_users and enum_unix_users only for foreign machines. + * utils.xml (mkgroup): Align documentation to new usage. + (mkpasswd): Ditto. + +2014-02-23 Jon TURNEY <jon.turney@dronecode.org.uk> + + * minidumper.cc (minidump): Fix -t option argument handling. + +2014-02-07 Jon TURNEY <jon.turney@dronecode.org.uk> + + * minidumper.cc: New file. + * Makefile.in (CYGWIN_BINS): Add minidumper. + * utils.xml (minidumper): New section. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (RtlGetVersion): Declare. + (dump_sysinfo): Call RtlGetVersion rather than GetVersionEx to get + correct OS info even on Windows 8.1. Don't check return value since + RtlGetVersion never fails per MSDN. Move fetching kernel32 module + handle where it's really needed. Drop temporary comment added by + previous checkin. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Revert Windows 8.1 hack. It's not + working. Add a (hopefully temporary) comment. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Drop code trying to fetch OSVERSIONINFO + if fetching OSVERSIONINFOEX failed. Drop code handling unsupported + platform IDs. Add code to tweak dwMinorVersion on Windows 8.1 if no + manifest is present. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygcheck.exe): Link against wininet.dll. + (dumper.exe): Link against psapi.dll. + * cygcheck.cc (_WIN32_WINNT): Define as 0x0602. + (pInternetCloseHandle): Drop pointer. + (PRODUCT_UNLICENSED): Drop definition. + (PRODUCT_PROFESSIONAL_WMC): Ditto. + (package_grep): Delete code loading wininet functions dynamically, just + call functions directly. + * module_info.cc: Drop code loading psapi functions dynamically since + all supported OS versions have it anyway. Call psapi functions + directly. + +2013-11-19 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Distinguish Windows 8 and 8.1, as well + as Windows Server 2012 and 2012 R2. Add missing commas in products + array to avoid crashes. Drop Windows NT4 and 2000 printouts. Just + call IsWow64Process, GetNativeSystemInfo, and GetDiskFreeSpaceEx + directly, rather than loading them dynamically, since they are exported + by all supported OS versions. Fix questionable type usage in call to + GetDiskFreeSpaceEx. + +2013-11-06 Christopher Faylor <me.cygwin2013@cgf.cx> + + * configure.ac: Detect windows headers/libs after we've figured out the + C compiler. + * configure: Regenerate. + * aclocal.m4: Regenerate. + +2013-09-16 Christopher Faylor <me.cygwin2013@cgf.cx> + + * dump_setup.cc (find_tar_ext): Generalize search for .tar extension, + avoiding looking for specific compression types. + +2013-08-23 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygcheck.cc (package_grep): Accommodate arch-specific package layout. + +2013-07-31 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (MINGW_LDFLAGS): Don't link against w32api libs. These + are only for Cygwin executables. + +2013-07-07 Christopher Faylor <me.cygwin2013@cgf.cx> + + * cygcheck.cc (dll_info): Detect and report on symlinks. Output wrong + architecture message inline with stdout for clarity. + * path.cc (is_symlink): Always reset file pointer to beginning on exit. + (readlink): Assume that file pointer is set to the beginning. + +2013-06-26 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (do_pathconv): when -p option is given, generate wide + path without long path prefixing. + * wide_path.h (wide_path::wide_path): Allow extra bool parameter to + specify whether or not performing Windows long path prefixing. + +2013-05-21 Corinna Vinschen <corinna@vinschen.de> + + Reinstantiate accidentally removed patch from 2009-05-16: + * Makefile.in (cygpath.exe): Link against cygwin.a before linking + against ntdll.dll to avoid linking symbols defined in both DLLs + from ntdll. + (ps.exe): Ditto. + +2013-05-10 Warren Young <warren@etr-usa.com> + + * utils.sgml utils.xml: Renamed utils.sgml to utils.xml, added + <?xml> and <!DOCTYPE> tags to the top, and formatted it. No + content change. + +2013-04-23 Corinna Vinschen <corinna@vinschen.de> + + * Merge in cygwin-64bit-branch. See ChangeLog.64bit for details. + +2013-02-20 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in (CYGWIN_LDFLAGS): Replace -static-lib* with -static. + (MINGW_LDFLAGS): Ditto. + (ZLIB): Simplify accordingly. + +2012-12-14 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml (mount): Document sparse mount option. + +2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Move CFLAGS and CXXFLAGS so that they can be manipulated + by Makefile.common. Add -static-libstdc++ to *LDFLAGS. Add + dependencies for loadlib.h. + * loadlib.h: Update copyright. + (_load_sys_library): Properly define set_dll_library as WINAPI to avoid + stack corruption. + +2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in (ZLIBS): Common define to force static load. + (MINGW_LDFLAGS): Use static libgcc. + +2012-11-27 Christopher Faylor <me.cygwin2012@cgf.cx> + + * Makefile.in: Make sure that libz is always loaded staticly. + +2012-11-26 Christopher Faylor <me.cygwin2012@cgf.cx> + + * configure.ac: Rename from configure.in. + * configure.in: Delete. + * configure: Regenerate. + +2012-11-26 Corinna Vinschen <corinna@vinschen.de> + + * bloda.cc: Drop Mingw.org considerations. + * dump_setup.cc: Ditto. + * strace.cc: Ditto. + +2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx> + + * aclocal.m4: Regenerate. + * configure: Ditto. + * autogen.sh: New script. + * configure.in: Revamp for new configury. + * Makefile.in: Revamp for new configury. Rename ALL_* to just *. + Always use "VERBOSE" setting. + (MINGW_CXX): Don't include CFLAGS in definition. + (all): Define target first, before everything else so that it is the + default. + (ps.exe): Don't add useless -lcygwin. + (ldh.exe): For consistency, add to existing MINGW_LDFLAGS rather than + redefining them. + (cygcheck.exe): Always include -lz for MINGW_LDFLAGS. Don't try to + figure out where to find it. + (dumper.exe): Simplify check. Assume libraries are installed rather + than trying to retrieve from source tree. + (install): Just use /bin/mkdir to create directories. + (Makefile): Regenerate when standard dependencies change. + * dump_setup.cc: Always include zlib.h. Remove accommodations for it + possibly not existing. + * parse_pe.cc: Add define which allows building with installed + binutils package. + * dumper.cc: Ditto. + +2012-11-09 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (vcygpath): Handle cygdrive prefix. + +2012-11-07 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in ($(MINGW_BINS)): Drop -B$(mingw_build)/ from build + expression. + +2012-11-05 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (MINGW_CXX): Attach $(CFLAGS) to allow providing + build option tweaks to mingw compiler as well. + +2012-10-24 Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add AC_NO_EXECUTABLES, + * configure: Regenerate. + +2012-10-24 Kai Tietz <ktietz70@googlemail.com> + Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + Corinna Vinschen <corinna@vinschen.de> + + * configure.in: Add check for MINGW_CXX. Remove libiconv check. + * configure: Regenerate. + * Makefile.in: Remove references to mingw and w32api directories. + Use MINGW_CXX instead of mingw script to build MINGW_BINS. + Check for libiconv with $CC --print-file-name. + * cygcheck.cc: Use relative include paths for Cygwin headers. + * path.cc: Ditto. + * strace.cc: Ditto + * mingw: Remove. + +2012-10-19 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygcheck.exe): Add temporary (1.7.17-only) hack to + allow cygcheck running on pre-Vista despite of the new w32api not + matching the locally used w32api. + +2012-10-09 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Convert "if/else if" chain to a switch + statement. Drop "not yet supported" and "Server" from Windows 2012 + output string. + +2012-09-02 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Drop "not yet supported" text from + Windows 8. Update products array. + +2012-07-11 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygcheck.exe): Link against psapi.dll. + * bloda.cc: Change include section to work with Mingw64 headers. + Include psapi.h. Use SystemProcessInformation instead of + SystemProcessesAndThreadsInformation throughout and add define for + w32api headers. Ditto for PSYSTEM_PROCESS_INFORMATION vs. + PSYSTEM_PROCESSES. + (system_module_list): New type to replace SYSTEM_MODULE_INFORMATION. + Change usage throughout accordingly. + (get_module_list): Fetch module list using PSAPI functions + EnumDeviceDrivers and GetDeviceDriverBaseNameA. + * cygcheck.cc (max): Define as __max if not defined already. + (alloca): Only define if not defined already. + (handle_unique_object_name): Use explicit sharing flags rather than + FILE_SHARE_VALID_FLAGS which officially is only available in DDK + headers. + (PRODUCT_ULTIMATE_E): Only define if not defined already. + * dump_setup.cc: Change include section to work with Mingw64 headers. + (NtQueryAttributesFile): Drop NTOSAPI aka DECLSPEC_IMPORT. + * strace.cc: Change include section to work with Mingw64 headers. + (alloca): Only define if not defined already. + +2012-07-06 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc: Change including headers to allow building against + Mingw64 headers. Include ntdef.h and ntdll.h rather than ddk headers. + Define _WIN32_WINNT and WINVER as 0x0602. + (RtlEqualUnicodePathPrefix): Drop definition. Pulled in from ntdll.h + now. + (get_device_name): s/Zw/Nt. + * dumper.cc: Include sys/param.h + (dumper::dump_memory_region): Use MIN rather than min. + * locale.cc: Include stdlib.h. Define _WIN32_WINNT and WINVER as + 0x0602. + * ps.cc: Include ntdef.h and ntdll.h rather than ddk headers. + * regtool.cc (regDeleteKeyEx): Drop WINADVAPI qualifier. + +2012-06-03 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Change "Server 8" to official + "Server 2012". + +2012-05-05 Corinna Vinschen <corinna@vinschen.de> + + * mkpasswd.c (current_user): Actually *use* $HOME if it's available. + Add comment to explain what we're doing here. + +2012-04-05 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (print_special_by_sid): Rename from print_special. Change + calls throughout. + (print_special_by_name): New function. + (main): Call print_special_by_name for TrustedInstaller account. + * mkpasswd.c (print_special_by_sid): Rename from print_special. Change + calls throughout. + (print_special_by_name): New function. + (enum_std_accounts): Call print_special_by_name for TrustedInstaller + account. + +2012-02-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * pldd.c: Fix typo in license header. + +2012-02-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in (CYGWIN_BINS): Add pldd. + (pldd.exe): Add -lpsapi to ALL_LDFLAGS. + * pldd.c: New file. + * utils.sgml (pldd): New section. + +2012-02-09 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc: Add -v option to print version information as well, since + it's used in older csih. + +2012-02-04 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml: Fix typos. + +2012-01-31 Christopher Faylor <me.cygwin2012@cgf.cx> + + * strace.cc (proc_child): Don't right-shift exit value. + (main): Call ExitProcess() to exit exactly the same way as any straced + child. + +2012-01-29 Corinna Vinschen <corinna@vinschen.de> + + * tzset.c: Throughout use wide characters to be locale agnostic. + (main): Call setlocale. + +2012-01-29 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (CYGWIN_BINS): Add tzset. + * tzset.c: New tool, new file. + * utils.sgml (tzset): New section. + +2012-01-24 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * ldd.cc (start_process): Handle .oct and .so as DLLs. + +2011-12-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (ps.exe): Revert previous change. + * ps.cc: Include psapi.h again. + (main): In CW_GETPINFO_FULL case. Evaluate minimal process access mask + required per OS and use that in OpenProcess call. Use + GetModuleFileNameExW on Windows 2000 or if fetching the drive mapping + failed. Handle empty process name. + +2011-12-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (ps.exe): Drop -lpsapi from ALL_LDFLAGS. + * ps.cc: Don't include psapi.h. + (dosdevs): Drop. + (unicode_buf): Define. + (main): Simplify path evaluation in CW_GETPINFO_FULL case. Fetch drive + map from Cygwin DLL. Use it to convert NT device paths to Win32 paths. + +2011-12-02 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygpath.exe): Add -luserenv to ALL_LDFLAGS. + * cygpath.cc: Throughout, use cygwin_conv_path WIN_W rather than WIN_A + conversion. + (get_long_path_name_w32impl): Remove. + (get_long_name): Drop pre-Windows 2000 accommodations. Just call + GetLongPathNameW here directly. + (get_special_folder): Convert first parameter to WCHAR buffer pointer. + Drop conversion of result from WCHAR * to char *. + (do_sysfolders): Accommodate change to get_special_folder and only + convert result to char * last. Drop pre-Windows 2000 accommodations + and just call GetProfilesDirectoryW directly. Replace call to + GetWindowsDirectoryW with call to GetSystemWindowsDirectoryW. + Just call GetShortPathNameW directly. + (do_pathconv): Simplify buffer handling. + +2011-12-01 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Drop support for NT4 domains. + * mkpasswd.c: Ditto. + (psx_dir): Remove. + (current_user): Drop support for -m option. Use $HOME as is since it's + a POSIX path anyway. + (enum_users): Drop support for -m option. + (usage): Mention -m option as ignored. + (main): Drop support for -m option. Mark ignored options as deprecated. + * utils.sgml (mkpasswd): Remove description of -m option. + +2011-11-28 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (print_locale_with_codeset): Fetch Windows path as UNICODE + path and convert that to POSIX. + +2011-11-28 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc: Remove all Win 9x considerations. Use psapi functions + directly. Drop support for older Cygwin DLLs. Just use progname_long + as is since it's already a POSIX path now. Rename "tty" to "pty" as in + the Cygwin DLL. Call setlocale to make sure wcstombs does the right + thing according to the current locale. + * Makefile.in (ps.exe): Link against psapi.dll. + +2011-11-24 Christopher Faylor <me.cygwin2011@cgf.cx> + + * strace.cc (attach_process): Use NT_SUCCESS to figure out if + NtSetInformationProcess succeeded. + (handle_output_debug_string): Put back DebugActiveProcess since it + seems to still be needed (on my system at least). Detect new format + _STRACE_INTERFACE_ACTIVATE_ADDR which informs whether this is a forked + process or not. Use that to decide if forkdebug should be handled. + +2011-11-14 Christopher Faylor <me.cygwin2011@cgf.cx> + + * strace.cc (handle_output_debug_string): Disable code which attempted + to add stuff in between '****' blocks since they no longer are the + first thing output by an straced process. + +2011-10-13 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Add Windows 8 recognition. Note as + unsupported. Update products array. + +2011-10-11 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * utils.sgml (getconf): Expand documentation. + +2011-10-10 Corinna Vinschen <corinna@vinschen.de> + + * ldd.cc (VERSION): Remove. + +2011-10-10 Christopher Faylor <me.cygwin2011@cgf.cx> + + * ldd.cc: Update copyright. + +2011-10-10 Corinna Vinschen <corinna@vinschen.de> + + * Align usage output, version output, as well as usage and version + option handling to use the same style throughout all Cygwin utils. + Throughout use program_invocation_short_name to refer to current + process name in Cygwin executables. + * utils.sgml: Align documentation to above change. Add missing + sections for getconf, ldd, and setmetamode. + * strace.cc (proc_child): Avoid compiler warning. + +2011-10-10 Andy Koppe <andy.koppe@gmail.com> + Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (usage): Restructure, rephrase, add new options. Drop + arguments, don't exit. + (print_version): New function. + (longopts): Add -f, -n, and -V options. Reorder. + (opts): Add -f, -n, and -V options. + (main): Call GetSystemDefaultUILanguage for -s option. Call + GetUserDefaultUILanguage for -u option. Add -f and -n options and + call GetUserDefaultLCID and GetSystemDefaultLCID respectively. Return + 0 after calling usage in -h case. Add -V option and call print_version. + Don't print full usage in default case, rather just a short help message + similar to GNU tools. + * utils.sgml (locale): Align to above changes. Rephrase description. + +2011-10-10 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (check_keys): Use UNICODE Win32 functions. + +2011-09-12 Jon TURNEY <jon.turney@dronecode.org.uk> + + * strace.cc (attach_process): Try to turn off DEBUG_ONLY_THIS_PROCESS + if Attaching to a process with the trace-children flag set. + (handle_output_debug_string): Apparently we don't need to explicitly + attach for debugging when a child process starts + * Makefile.in (strace.exe): Link with ntdll + +2011-08-21 Christopher Faylor <me.cygwin2011@cgf.cx> + + * Makefile.in: Check for header file existence when building dumper.exe + too. + +2011-08-10 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc (main): Don't overwrite process name, just attach <defunct> + to it for zombie processes. + +2011-07-19 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in (CYGWIN_BINS): Add getconf. + (getconf.c): New file. + +2011-06-14 Christopher Faylor <me.cygwin2011@cgf.cx> + + * mingw: Force use of bash. + +2011-05-29 Christopher Faylor <me.cygwin2011@cgf.cx> + + * ps.cc (ttynam): Accommodate new console numbering. + (main): Ditto. + +2011-05-03 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (print_locale_with_codeset): Align printing of locale names + to POSIX. + +2011-04-18 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (getaclentry): Allow extra colon in mask and other entries. + +2011-04-12 Jon TURNEY <jon.turney@dronecode.org.uk> + + * utils.sgml (strace): Fix a pair of exchanged lines in usage text. + +2011-04-04 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (main): Add the ability to specify a username for the -R + command. + * utils.sgml: Document the aforementioned change. + +2011-02-29 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (cmd_set): Avoid a compiler warning. + +2011-02-29 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (handle_unique_object_name): Avoid a compiler warning. + (dump_sysinfo): Ditto. + * loadlib.h (_load_sys_library): Mark as used, to avoid a compiler + warning. + * path.cc (oopt): Gurad with !FSTAB_ONLY to avoid a compiler warning. + (read_flags): Ditto. + +2011-02-28 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (strchrnul): Drop local implementation. + +2011-02-15 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc: Fix copyright dates. + +2011-01-10 Jon TURNEY <jon.turney@dronecode.org.uk> + + * cygcheck.cc (main): don't imply -d from -s option to cygcheck + +2010-12-11 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (strchrnul): New function. + (getaclentry): Rewrite. + +2010-12-06 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (get_device_name): Fix path length test. + +2010-10-30 Dmitry Potapov <dpotapov@gmail.com> + + * regtool.c (cmd_set): Write correct number of bytes for REG_MULTI_SZ + case. + +2010-09-06 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (RtlEqualUnicodePathPrefix): New helper function. + (HARDDISK_PREFIX): Move. + (GLOBALROOT_PREFIX): Define. + (get_device_name): Take GLOBALROOT_PREFIX into account. + Improve check for path to allow filesystem access via block devices. + Potentially drop \\.\ prefix if resulting path is a valid DOS + pathname. + (do_pathconv): Make sure to drop \\?\ prefix only if path is + actually a filesystem based path. + (print_version): Fix copyright. + +2010-08-28 Corinna Vinschen <corinna@vinschen.de> + + * ldh.cc (WinMain): Change DONT_RESOLVE_DLL_REFERENCES to + LOAD_WITH_ALTERED_SEARCH_PATH. + +2010-08-28 Corinna Vinschen <corinna@vinschen.de> + + * loadlib.h: New header implementing safe LoadLibrary calls. + Include throughout files using LoadLibrary function. + * cygcheck.cc (dump_sysinfo): Retrieve kernel32.dll handle via + GetModuleHandle, rather than using LoadLibrary. + * cygpath.cc (get_long_name): Ditto. + (do_sysfolders): Append .dll suffix in LoadLibrary call. + * ldh.cc (WinMain): Use LoadLibraryExW with DONT_RESOLVE_DLL_REFERENCES + to avoid loading malicious library code. + * locale.cc (print_locale_with_codeset): Change way to retrieve + kernel32.dll path. + +2010-08-26 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (get_device_name): Prefer the \\.\X: DOS device for + harddisks, if available. + +2010-08-21 Corinna Vinschen <corinna@vinschen.de> + + * ldd.cc (report): Drop long pathname considerations which result in + invalid path, now that this is done in cygwin_conv_path. + +2010-08-13 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (from_fstab): Fix potentially fatal typo. + +2010-08-11 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (do_mount): Don't treat "bind" mount as remote mount. + (mount_entries): Drop the "bind" option from output. + * utils.sgml (mount): Match examples to actual mount output. Add + "bind" option and add example. + +2010-08-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * mingw: Use sysroot, if present, for mingw_dir. + +2010-07-21 Corinna Vinschen <corinna@vinschen.de> + + * dump_setup.cc (tfx_chars): New WCHAR array, copied from Cygwin. + (transform_chars): New function, copied from Cygwin. + (simple_nt_stat): New function to check file existance using native + NT function. Explain why. + (directory_exists): Call simple_nt_stat. + (file_exists): Ditto. + +2010-07-05 Christopher Faylor <me+cygwin@cgf.cx> + + * ldd.cc: Clean up formatting throughout. + (head): Move earlier. + (saw_file): Ditto. + (print_dlls): Reset head here. Record seen dll names so they will + not potentially be printed later. + (process_file): Remove clearing of head here. + +2010-07-05 Corinna Vinschen <corinna@vinschen.de> + + * dump_setup.cc (dump_file): Read requested content from setup.rc + file created by newer setup.exe. + +2010-06-29 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml (locale): Change stray local cygdrive prefix to Cygwin's + default. + +2010-04-29 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml (mount): Add description for "dos" and "ihash" mount + options. + +2010-04-29 Corinna Vinschen <corinna@vinschen.de> + + * path.cc: Include sys/cygwin.h if built for mount(1). + (struct opt): Add "dos" and "ihash" options. + (from_fstab_line): Call cygwin_internal rather than read_flags if + built for mount(1). + +2010-04-29 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (oopts): Remove entirely. + (usage): Call cygwin_internal (CW_LST_MNT_OPTS) to create list of + mount options. + (print_version): Fix copyright date. + (main): Replace option processing loop with single call to + cygwin_internal (CW_CVT_MNT_OPTS). + +2010-04-28 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (print_lc_xxx_charset): Remove. + (enum type_t): Change according to the fact that nl_langinfo now returns + all locale category values. + (lc_ctype_names): Add new category members. Redefine for exclusive + nl_langinfo usage. + (lc_numeric_names): Ditto. + (lc_time_names): Ditto. + (lc_collate_names): Ditto. + (lc_monetary_names): Ditto. + (lc_messages_names): Ditto. + (print_lc): Change switch according to new type_t values. + +2010-03-27 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (print_charmaps): Add EUC-CN and GB2312. + +2010-03-24 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (find_key): Fix allocation size of "value". + +2010-03-23 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (add_locale_alias_locales): Always use loc_num at function + start to avoid confusing bsearch. + +2010-03-23 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc: Revert accidental checkin of unfinished changes. + +2010-03-23 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (print_locale_with_codeset): Drop redundant name parameter. + Simplify creating locale string. Add "@" in case of a modifier. + (print_locale): Drop name parameter in calls to + print_locale_with_codeset. + +2010-02-25 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * utils.sgml (kill): Add SIGIO, SIGCLD, and SIGPWR. + +2010-02-25 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml (locale): Change description of -a and -av to match + latest changes. + +2010-02-23 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (printlocale): Remove. + (loc_t): New type to keep locale information for printing. + (print_codeset): New function to print codeset as on Linux. + (print_locale_with_codeset): New function to print single locale. + Print verbose style as the Linux locale(1) tool. + (print_locale): New function to print single locale plus its UTF-8 + variation, if available. + (compare_locales): New helper function for bsearch and qsort on loc_t. + (add_locale): New function to store locale in loc_t array. + (add_locale_alias_locales): New function to store locales from + locale.alias file in loc_t. + (print_all_locales): Call add_locale instead of printlocale. + Call add_locale_alias_locales, sort locales alphabetically and print + them. + +2010-02-22 Christopher Faylor <me+cygwin@cgf.cx> + + * strace.cc (mnemonic_table): Add "special" mask option. + (usage): Document it. + * utils.sgml: Ditto. + +2010-02-22 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (do_pathconv): Fix erroneously printing native NT path + prefix introduced by previous patch. + +2010-02-22 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (lc_time_names): Add "date_fmt" entry. + +2010-02-19 Christopher Faylor <me+cygwin@cgf.cx> + + * strace.cc (mnemonic_table): Add pthread mask option. + (usage): Document strace pthread mask option. + * utils.sgml: Ditto. + +2010-02-19 Corinna Vinschen <corinna@vinschen.de> + + * locale.cc (print_lc_mstrings): New function to print + semicolon-separated strings. + (enum type_t): New type is_sepstrings_linf. + (lc_time_names): Change type of era and alt_digits entry to + is_sepstrings_linf. + (print_lc): Add case for is_sepstrings_linf and call print_lc_mstrings + in that case. + +2010-02-17 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (CYGWIN_BINS): Rename getlocale to locale. + * getlocale.c: Rename to ... + * locale.cc: Revamp to add full functionality of POSIX locale(1) tool, + as far as Cygwin supports it. + * utils.sgml (getlocale): Move and rename to ... + (locale): Accommodate new functionality. + +2010-02-13 Ilguiz Latypov <ilatypov@infradead.org> + + * cygpath.cc (do_pathconv): Fix potential crash. + +2010-02-11 Corinna Vinschen <corinna@vinschen.de> + + * getlocale.c (main): Rename local variable to avoid problems. + Avoid string comparisons, rather test language and sublanguage codes + wheere possible. Add more code to handle Serbian language/territory + state identical on all Windows versions. Fix handling for "@latin" + modifier in Belarusian locale. + * utils.sgml (getlocale): Try to make wording and example clearer. + +2010-02-10 Corinna Vinschen <corinna@vinschen.de> + + * getlocale.c (usage): Change text slightly. + +2010-02-10 Corinna Vinschen <corinna@vinschen.de> + + * getlocale.c (main): Restrict -a loop to avoid psudo language entries + on Vista and later. + +2010-02-10 Corinna Vinschen <corinna@vinschen.de> + + * getlocale.c (main): Revamp -a loop to avoid duplicates and to print + locales with the correct, supported modifiers. + +2010-01-25 Corinna Vinschen <corinna@vinschen.de> + + * getlocale.c (main): Use setlocale and fetch string from Windows + using GetLocaleInfoW. Explain why. + +2010-01-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (CYGWIN_BINS): Add getlocale. + * getlocale.c: New file. + * utils.sgml (getlocale): New section describing new getlocale tool. + +2010-01-16 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (get_mixed_name): Drop function. Replace with call to + convert_slashes throughout. + (do_sysfolders): Free allocated buffer. + (do_pathconv): Fix freeing last buffer. + +2010-01-11 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (do_mount_from_fstab): Allow to change cygdrive prefix, too. + +2010-01-07 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc: Throughout, free obsolete path buffers. + +2010-01-07 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (main): Remove enforcing "en_US.UTF-8" locale. + Revert usage of argz functions when reading input from file and + simplify option usage. Allow only one option argument and use + the rest as filename argument to allow spaces in filenames. Restrict + processing special folder type options to one line. + +2009-12-17 Christopher Faylor <me+cygwin@cgf.cx> + + * ps.cc (main): Return 0 if pid found. + +2009-12-16 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc: Throughout, convert all registry calls to wide char + calls and use string conversion according to current locale. + (longopts): Change "dword-le" to "dword-be", as was originally + intended. + (usage): Change usage accordingly. + (print_version): Simplify copyright dates in output. + (cmd_list): Handle REG_LINK like REG_SZ. + (cmd_get): Ditto. + (main): Call setlocale. + * utils.sgml (regtool): Fix options and add missing descriptions for + new features. + +2009-11-29 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (getaclentry): Allow to delete default entries for the + owner and owner group. + +2009-11-27 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Fix typo in products. + +2009-11-11 Corinna Vinschen <corinna@vinschen.de> + + * getfacl.c (print_version): Fix copyright. + (main): Don't reuse local variables confusingly. Don't print any file + information if acl() fails. Improve error message. Always print a + trailing empty line. Set return code to 2 if accessing some file fails. + +2009-11-04 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (read_mounts): Skip unnecessary test if path has been + fetched from loaded cygwin1.dll. + +2009-11-04 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (cygwin_dll_path): New global variable. + (load_cygwin): Fetch cygwin DLL path and store in cygwin_dll_path. + * strace.cc: Full ditto. + * path.cc (read_mounts): First use the path stored in cygwin_dll_path, + if available. Then fall back to fetching own path. Add comment. + Drop printing warnings since they look funny in strace output. + +2009-11-04 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (read_mounts): First get installation path from own path. + Check if cygwin1.dll exists in same directory. Only if not, try to + get installation path from setup registry key. Add ample warnings. + +2009-11-04 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygpath.exe): Add -fno-threadsafe-statics to CXXFLAGS. + +2009-10-31 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc: Include cygprops.h. + (del_orphaned_reg): New option variable. + (unique_object_name_opt): Ditto. + (handle_reg_installation): New function. + (print_reg_installations): Ditto. + (del_orphaned_reg_installations): Ditto. + (memmem): Ditto. + (handle_unique_object_name): Ditto. + (dump_sysinfo): Call print_reg_installations from here. + (usage): Add usage for new options --delete-orphaned-installation-keys, + --enable-unique-object-names, --disable-unique-object-names, and + --show-unique-object-names. + (longopts): Add new options --delete-orphaned-installation-keys, + --enable-unique-object-names, --disable-unique-object-names, and + --show-unique-object-names. + (main): Handle new options. + * utils.sgml (cygcheck): Change documentaion accordingly. + +2009-10-28 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (pretty_id): Drop arguments. Don't change CYGWIN + environment variable. + (dump_sysinfo): Don't tweak CYGWIN environment variable, just call + pretty_id once. + +2009-10-20 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Update with latest NT 6.1 versions. + +2009-10-15 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (get_special_folder): Fetch path as WCHAR and convert + using my_wcstombs. + (get_user_folder): Remove. + (do_sysfolders): Use get_special_folder instead of get_user_folder. + Fetch system paths as WCHAR and convert using my_wcstombs. + +2009-10-12 Corinna Vinschen <corinna@vinschen.de> + + * kill.cc (main): Skip to PID loop on invalid option to handle + negative pids there. + +2009-08-11 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_local_groups): Avoid error message if given group + name isn't found and return 0 to allow searching to proceed. Always + return 0 or 1, not -1. + (enum_groups): Avoid error message if given group name isn't found. + * mkpasswd.c (enum_users): Ditto. + +2009-08-10 Dave Korn <dave.korn.cygwin@gmail.com> + + * mingw: Add fallbacks to search for MinGW components in standard + install locations if not found in compiler's $prefix. + +2009-08-09 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (do_mount): Don't exit, just return. + +2009-07-23 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Add missing "Server Foundation" to + products array. + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (do_mount): Replace --no-executable flag with notexec + mount option in hint for remote filesystems. + * path.cc (getmntent): Fix typo (noexec -> notexec). + +2009-07-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (path-mount.o): Add a rule to build stripped down version + of path.cc for usage in mount. + (mount.exe): Add dependency to path-mount.o. + * mount.cc (force): Convert to bool value. Accommodate throughout. + (from_fstab): New function. + (do_mount_from_fstab): New function. + (longopts): Add --all option. + (opts): Add -a option. + (usage): Document -a/--all option. + (main): Handle -a option as well as single parameter. + * path.cc: Add FSTAB_ONLY conditional to allow building path-mount.o. + (mount_table): Remove static storage class. + (max_mount_entry): Ditto. + (root_here): Unused. Remove. + (from_fstab_line): Remove static. + * path.h (struct mnt_t): Define here rather than in path.cc. + (from_fstab_line): Declare. + (mount_table): Declare. + (max_mount_entry): Declare. + * utils.sgml (mount): Document -a/--all option and mounting of single + path from fstab files. + +2009-07-15 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (main): Open trace output file in UNIX mode. + +2009-07-13 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Remove "not yet supported" text. + +2009-07-04 Christopher Faylor <me+cygwin@cgf.cx> + + * cygwin-console-helper.cc: New file. + +2009-06-10 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (oopts): Sort alphabetically, add missing "auto" and + "override" entries. + (from_fstab_line): Handle mount points same as Cygwin itself. Use + "cygdrive prefix" as posix name of cygdrive prefix. + (from_fstab): Add auto entries for /usr/bin and /usr/lib. Add + MOUNT_AUTOMATIC and MOUNT_IMMUTABLE flags to default root dir entry. + Use "cygdrive prefix" as posix name of default cygdrive prefix. + (getmntent): Allocate smaller buffers. Align output closer to output + of mount(1). + +2009-05-17 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (codepage): New variable. + (long_options): Add --codepage option. + (options): Add -C option. + (usage): Add -C/--codepage description. + (my_wcstombs): New function. Use througout instead of wcstombs. + (do_options): Handle -C/--codepage option. + * utils.sgml (cygpath): Add description for new -C/--codepage option. + +2009-05-16 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygpath.exe): Link against cygwin.a before linking + against ntdll.dll to avoid linking symbols defined in both DLLs + from ntdll. + (ps.exe): Ditto. + +2009-05-15 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (main): Only setlocale for LC_CTYPE category. Fallback + to UTF-8 if locale is "C". + * ldd.cc (main): Ditto. + * mkgroup.c (main): Ditto. + * mkpasswd.c (main): Ditto. + * passwd.c (main): Ditto. + +2009-05-13 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (oopts): Sort. Add override option. Add dummy "auto" + option for consistency. + (mount_entries): Avoid adding auto-mounted entries to -m output. + + * utils.sgml: Sort mount options. Add description of override option. + +2009-05-11 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Link ps.exe agains ntdll.dll. + * ps.cc (main): Enable SE_DEBUG_NAME privilege if Windows processes + have to be enumerated. Workaround EnumProcessModules problem when + running under WOW64 and use NtQueryInformationProcess to fetch + process image name. + +2009-05-06 Corinna Vinschen <corinna@vinschen.de> + + * mkpasswd.c (current_user): Don't use HOMEDRIVE/HOMEPATH to generate + user's homedir. + + * mkgroup.c: Accommodate ctype changes. + * mkpasswd.c: Ditto. + * setfacl.c: Ditto. + * ssp.c: Ditto. + +2009-05-04 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (find_app_on_path): Avoid using NULL pointer if + find_on_path doesn't find the app on the path. + +2009-05-04 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (usage): Fix option order and print. + +2009-04-22 Christopher Faylor <me+cygwin@cgf.cx> + + * strace.cc (create_child): Set CYGWIN=noglob when starting new process + so that Cygwin will leave already-parsed the command line alonw. + +2009-04-15 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (do_pathconv): Only skip \\?\ prefix if it's really + given. Do backslash to slash conversion for mixed paths after + handling \\?\ prefix. + +2009-04-13 Dave Korn <dave.korn.cygwin@gmail.com> + + * Makefile.in (dumper.exe): Add -lz to ALL_LDFLAGS. + +2009-04-07 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (readlink): Accommodate new UTF-16 symlinks. + +2009-04-03 Kevin Buettner <kevinb@redhat.com> + + * utils.sgml: Various syntactical and semantical fixes. + * cygcheck.cc (usage): Fix --find-package explanation. + +2009-03-26 Yaakov Selkowitz <yselkowitz@cygwin.com> + + * utils.sgml (passwd -R): Remove references to CYGWIN="server". + +2009-03-24 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Fix compiler warning in printf. + * strace.cc (proc_child): Ditto. + * ldd.cc: Remove now useless undef wcscasecmp. + +2009-03-23 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (usage): Change description for -d option according to + previous change. + (main): Fix typo. + * utils.sgml: Add missing description for passwd -d option. + +2009-03-23 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (caller_is_admin): New function to test if calling user + is an administrator by inspecting user token. + (main): Drop fetching caller info from logonserver. Only fetch + server from environment when trying to change password for own + account. Drop admin check entirely in case of doing account + maintainance. Otherwise replace check for admin by result of + caller_is_admin call. + +2009-03-22 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (main): Always get logonserver from environment and + use when fetching user info for caller. + +2009-03-22 Corinna Vinschen <corinna@vinschen.de> + + * ldd.cc: Fix compiler warning. + + * passwd.c: Use mbstowcs instead of MultiByteToWideChar throughout. + (main): Call setlocale. Fix a bug in fetching the logon server from + the environment. + +2009-03-18 Christopher Faylor <me+cygwin@cgf.cx> + + * ldh.cc: New file. + +2009-03-17 Christopher Faylor <me+cygwin@cgf.cx> + + * ldd.cc (load_dll): Start helper program rather than ldd.exe. + (set_entry_point_break): Rename from get_entry_point. + (print_dlls): Rename from print_dlls_and_kill_inferior. Avoid printing + specific dll name if we're looking at a dll. + (report): Always dump dlls on process exit. Don't allow thread + creation. Accommodate get_entry_point rename. + (start_process): Start process with DEBUG_ONLY_THIS_PROCESS. + (longopts): Eliminate "dll" option. + (main): Ditto. + +2009-03-17 Corinna Vinschen <corinna@vinschen.de> + Christopher Faylor <me+cygwin@cgf.cx> + + * ldd.cc: Use wide character Win32 paths throughout. + (load_dll): Fix size expression (add fn) in realloc. + +2009-03-14 Christopher Faylor <me+cygwin@cgf.cx> + + * ldd.cc (longopts): Add --dll option. + (get_module_filename): Generalized wrapper function which avoid path + length restrictions. + (load_dll): Handle special-case of inspecting a DLL. + (start_process): Accept an output parameter "isdll". Detect when file + to start is a DLL and start a wrapper instead. + (print_dlls_and_kill_inferior): When dealing with a DLL, avoid printing + everything before the DLL itself first appears. (This is not strictly + correct and should be fixed eventually) + (report): Deal with DLLs. Don't set a breakpoint for DLLs, just let + captive ldd process terminate normally. Pass dll info to + print_dlls_and_kill_inferior. + (main): Handle special-case "--dll" option by loading the DLL and + exiting. + +2009-03-14 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (from_fstab): Use wcstombs/mbstowcs instead of + WideCharToMultiByte/MultiByteToWideChar to accommodate current locale. + +2009-03-14 Corinna Vinschen <corinna@vinschen.de> + + * wide_path.h (class wide_path): New class to convert Windows path + to WCHAR win32 path, including long path conversion if necessary. + * cygcheck.cc: Use class wide_path throughout to call Win32 functions + taking potentially long filenames. + (display_error): Use snprintf rather than sprintf. + (display_error_fmt): Ditto. + (dump_sysinfo): Use FindFirstFileW/FindNextFileW. + * cygpath.cc: Use class wide_path throughout to call Win32 functions + taking potentially long filenames. + (get_device_name): Raise buffer size to take long pathnames. + (get_short_paths): Convert to using GetShortPathNameW. + (get_short_name): Ditto. + (get_long_path_name_w32impl): Convert to equivalent of GetLongPathNameW. + (get_long_name): Convert to using GetLongPathNameW. + (do_sysfolders): Raise buffer size for POSIX pathname to PATH_MAX. + (do_pathconv): In case of POSIX->Win32 conversion, convert to wchar_t + Win32 path name and drop long pathname prefix if possible. + (main): Call setlocale to accommodate wide char/multibyte conversions. + +2009-03-14 Christopher Faylor <me+cygwin@cgf.cx> + + * ldd.cc: Rework to detect missing DLLs. + (start_process): Change to expect windows filename as input. + (tocyg): New function - convert cygwin fn to windows fn. + (print_dlls_and_kill_inferior): Accept extra argument denoting whether + to open input and look for nonexistent DLLs. Use tocyg to convert + filename and pass it to start_process. + (report): Flag when an DLL-not-found exception occurs and pass this + information to print_dlls_and_kill_inferior. + (filelist): New structure. + (saw_file): New function. + (dump_import_directory): Ditto. + (map_file): Ditto. + (skip_dos_stub): Ditto. + (get_directory_index): Ditto. + (process_file): Ditto. + +2009-03-09 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml: Fix typo. + +2009-03-08 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (usage): Fix typo. + +2009-03-02 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml: Set example prompt to "$" throughout. Don't use "/" + as example cygdrive prefix. Remove reference to -u and -s options. + Add an example using the -o flag. + +2009-03-02 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (mount_entries): Handle a "/" cygdrive prefix correctly. + Add comments. + +2009-02-23 Sjors Gielen <mailinglist@dazjorz.com> + + * Makefile.in: Add DESTDIR functionality. + +2009-01-29 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Evaluate and print state of + obcaseinsensitive kernel flag. + +2009-01-21 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c: Remove CYGWIN=server requirement from usage text. + +2009-01-17 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Fix copyright date. + * cygcheck.cc (scan_registry): Take additional parameter and add code + to avoid recursion in Wow6432Node subkey. Rename variable cygnus to + cygwin. Scan for "Cygwin" instead of for "cygnus" substring. + (dump_sysinfo): Drop unused calls to scan_registry. Drop scanning + HKEY_CURRENT_CONFIG. + +2009-01-16 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Raise size of osname. Add Windows 7 + and Windows 2008 R2 as recognized OSes. Update products array to + the latest documented list. + +2009-01-09 Christopher Faylor <me+cygwin@cgf.cx> + + * ldd.cc: New file. First stab at implementing ldd-like functionality + for Cygwin. + * Makefile.in (CYGWIN_BINS): Add ldd. + (ldd.exe): Use -lpsapi. + +2009-01-05 Pierre Humblet <Pierre.Humblet@ieee.org> + + * cygcheck.cc (dump_sysinfo_services): Quote the path for popen. + +2008-12-30 Pierre Humblet <Pierre.Humblet@ieee.org> + + * cygcheck.cc (pretty_id): Quote the path for popen. + (dump_sysinfo_services): Ditto. + +2008-12-16 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml: Fix typo in passwd screen text. + +2008-12-15 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (main): Put how to delete the registry password on its own + line in passwd -R output. + +2008-12-13 Christopher Faylor <me+cygwin@cgf.cx> + + * utils.sgml: Convert some backslashes to slashes. + +2008-11-26 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (longopts): Add --reg-store-pwd option. + (opts): Add -R option. + (usage): Add text for -R/--reg-store-pwd option. + (main): Fix size of local user and password string arrays. + Handle -R option. + * utils.sgml: Add text for passwd -R/--reg-store-pwd option. + +2008-10-29 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (ALL_LDFLAGS): Link libgcc statically for everything + here. + +2008-10-12 Christopher Faylor <me+cygwin@cgf.cx> + + * mingw: Set sawcfile when -xc* is detected. Extend list of detected + source files. + +2008-10-12 Christopher Faylor <me+cygwin@cgf.cx> + + * mingw: Add more checks to allow more varied use. + +2008-10-11 Christopher Faylor <me+cygwin@cgf.cx> + + * mingw: Use a better method to find where mingw directory lives. + +2008-10-11 Christopher Faylor <me+cygwin@cgf.cx> + + * mingw: New front-end script to control building of MinGW files + without using the deprecated -mno-cygwin option. + * Makefile.in: Use mingw front-end. + +2008-09-12 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (pathlike::check_existence): Remove class name from + declaration. + (display_internet_error): Use proper format specifier for DWORD. + (environ): Remove unneeded declaration. + (main): Use brace around nested if to avoid an overly-helpful compiler + warning. + * dump_setup.cc (parse_filename): Reorganize nested if to avoid an + overly-helpful compiler warning. + * path.cc (GUID_shortcut): Use braces around part of initializer which + needs them. + (conv_fstab_spaces): Parenthesize assignment in while loop to avoid a + compiler warning. + (struct opt): Make static. + * ps.cc (main): Reorganize nested if to avoid an overly-helpful + compiler warning. + * regtool.cc: Make some anonymous structs static to avoid a compiler + warning. + * ssp.c (lookup_thread_id): Initialize *tix to zero to avoid potential + uninitialized use. + * strace.cc (add_child): Use proper format specifier for DWORD. + (remove_child): Ditto. + (proc_child): Ditto. + +2008-08-27 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (nuke): Use malloc rather than alloca for environment + variables. + (load_cygwin): Ditto. + * dump_setup.cc (parse_filename): Cosmetic changes. + (get_packages): Ditto. + +2008-08-25 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_local_groups): Don't skip printing groups when + print_current is set and group SID is not curr_pgrp. + (enum_groups): Ditto. + (main): Fix condition when SYSTEM group gets printed. + * mkpasswd.c (enum_users): Don't skip printing users when print_current + is set and user SID is not curr_user. + (main): Allow printing standard accounts even when print_current is set. + +2008-08-18 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_local_groups): Use NetLocalGroupGetInfo to find out + if a group exists, rather than just allocating a buffer and going ahead. + +2008-08-18 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_local_groups): Call print_win_error with GetLastError + as argument when LookupAccountXXX failed. + (enum_groups): Ditto. + +2008-08-18 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_local_groups): Return failure if looking for a single + group succeeded. Add comment. + +2008-08-18 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Keep correctly track of optional arguments. + * mkpasswd.c (main): Ditto. + +2008-08-18 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Always unset environment variable POSIXLY_CORRECT. + Keep track of optional argumnts and fix up optind afterwards. + * mkpasswd.c (main): Ditto. + +2008-08-17 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (print_version): Update copyright dates. + +2008-08-17 Christopher Faylor <me+cygwin@cgf.cx> + + * mkpasswd.c (main): Avoid printing system accounts when a single user + name has been requested. + +2008-08-17 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (ALL_LDFLAGS): Add --enable-auto-import option to quiet + ld warnings. + * mkgroup.c: Change all global variables and most functions to static. + (enum_local_groups): Add a print_current parameter to control whether + entries for everything should be printed or just the current user. + (enum_groups): Ditto. + (main): Move call fetch_current_pgrp_sid earlier to avoid a NULL + deference when no command line arguments are specified. Accommodate + argument changes to above functions. Avoid printing SYSTEM account + when print_current is specified. Issue error when extra stuff is found + on the command line. + * mkpasswd.c: Change all global variables and most functions to static. + (enum_users): Add a print_current parameter to control whether entries + for everything should be printed or just the current user. + (main): Move call fetch_current_user_sid earlier to avoid a NULL + deference when no command line arguments are specified. Accommodate + argument change to above function. Avoid printing standard accounts + when print_current is specified. Issue error when extra stuff is found + on the command line. + +2008-08-15 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (fetch_current_pgrp_sid): New function to fetch primary + group SID from user token. + (current_group): Move up in file. Move fetching primary group SID to + fetch_current_pgrp_sid. + (enum_local_groups): Check if current SID is the same as current user's + primary group SID. + (enum_groups): Ditto. + (main): Call fetch_current_pgrp_sid before enumerating groups. Call + current_group only if current group hasn't been enumerated already. + * mkpasswd.c (fetch_current_user_sid): New function to fetch current + user SID from user token. + (current_user): Move fetching current user SID to + fetch_current_user_sid. + (enum_users): Check if current SID is the same as current user's SID. + (main): Call fetch_current_user_sid before enumerating users. Call + current_user only if current user hasn't been enumerated already. + +2008-08-13 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (NT_MAX_PATH): Define. + (longopts): Rename mount-commands option to mount-entries. + (opts): Remove removed options. + (struct opt): Move up in file to allow using it in usage. + (usage): Change text for --mount-entries option. Remove + -X option. Add valid options output. + (main): Remove handling -b option. + (convert_spaces): New static function to convert spaces to "\040" + string. + (mount_entries): Renamed from mount_commands. Rewrite to emit + /etc/fstab compatible output. + (show_cygdrive_info): Print "nouser" rather than "system". + * umount.cc (longopts): Remove remove-all-mounts, + remove-cygdrive-prefix, remove-system-mounts, system and user options. + (opts): Remove A, c, s, S, u options. + (usage): Remove text for all removed options. + (main): Remove handling for all removed options. + (remove_all_mounts): Remove. + (remove_all_system_mounts): Remove. + (remove_cygdrive_prefix): Remove. + * utils.sgml: Fix mount and umount documentation. Move description + of (cyg,not)exec options to mount table section. + +2008-08-04 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (load_cygwin): Duplicate argv list since it disappears + when cygwin1.dll is unloaded. + +2008-07-30 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + * Makefile.in: Link cygcheck with -lntdll even without mingw-zlib. + +2008-07-27 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (load_cygwin): Free the cygwin dll after we're done with + it. + +2008-07-25 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc: Remove non-unix-like options (-x,-t,b) throughout. + (oopts): Use boolean constants for slightly increased clarity. + + * configure.in: Remove apparently unneeded program_transfer_name code. + * configure: Regenerate. + +2008-07-24 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml: Remove useless text. + +2008-07-23 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Fix test for duplicate domain/machine request. + * mkpasswd.c (main): Ditto. + +2008-07-23 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Rework to allow per-domain/per-machine id_offset. + Add -b option to skip builtin groups. + (main): Simplify code. + * mkpasswd.c: Rework to allow per-domain/per-machine id_offset. + (main): Simplify code. + * utils.sgml: Explain changed mkgroup/mkpasswd -d/-D/-l/-L options. + Add mkgroup -b option. + +2008-07-23 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Consolidate variable names. + (enum_unix_groups): New function. + (print_special): Use LookupAccountSidW instead of LookupAccountSidA. + (current_group): Ditto. + (usage): Add -U option. + (longopts): Add --unix option. + (opts): Add -U option. + (main): Handle -U option. Call enum_unix_groups if set. + * mkpasswd.c: Consolidate variable names. + (current_user): Use LookupAccountSidW instead of LookupAccountSidA. + (enum_unix_users): New function. + (usage): Add -U option. + (longopts): Add --unix option. + (opts): Add -U option. + (main): Handle -U option. Call enum_unix_groups if set. + * utils.sgml: Add -U option text to mkgroup and mkpasswd description. + +2008-07-22 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (enum_groups): Create full qualified groupname using + domain or servername, depending on printing domain or machine accounts. + * mkpasswd.c (enum_users): Ditto for users. + +2008-07-22 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Remove special root group code. Only print + SYSTEM group in case of printing local machine or local domain groups. + +2008-07-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygcheck.exe): Link against ntdll. + * bloda.cc: Use statically linked functions throughout. + * cygpath.cc: Drop 9x considerations. + * mkgroup.c: Revamp. Redefine -l and -d options to take optional + machine and domain parameters. Redefine -c to work always, using + token information. Add -L, -D, -C to create unique groupnames in + domain\group syntax. Add -S option to define domain\group separator + char. Ignore -u and -s options. + * mkpasswd.c: Revamp. Redefine -l and -d options to take optional + machine and domain parameters. Redefine -c to work always, using + token information. Add -L, -D, -C to create unique usernames in + domain\user syntax. Add -S option to define domain\user separator + char. Ignore -g and -s options. Prefer to take homedir from $HOME + over $HOMEDRIVE/$HOMEPATH. + * path.cc (oopts): Add "acl", "noacl", "posix=0" and "posix=1" options. + (getmntent): Accomodate throughout. + * ps.cc: Fix copyright dates. + * utils.sgml: Fix text for mkgroup and mkpasswd. + +2008-07-17 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (do_mount): Remove MOUNT_ENC code. + (oopts): Remove "managed" option. + (mount_commands): Drop "managed" handling. + * path.cc (oopts): Remove "managed" option. + (getmntent): Remove MOUNT_ENC code. + +2008-07-17 Corinna Vinschen <corinna@vinschen.de> + + * utils.sgml: Add id's to all examples. + +2008-07-09 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Use statically linked functions throughout, except for + DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout. + Use defines instead of constants throughout. + (MAX_SID_LEN): Define. + (load_netapi): Just load DsGetDcNameW pointer. + (psx_dir): Remove. + (uni2ansi): Remove. + (enum_local_users): Take server name and use in Net... call. + (DBGSID): Define datastructure. + (MAX_BUILTIN_SIDS): Define. + (builtin_sid_list): Define global sid list. + (builtin_sid_cnt): Define counter for global sid list. + (enum_local_groups): Take server name and use in Net... and Lookup... + calls. Take offset argument. Use MAX_PREFERRED_LENGTH in call to + NetLocalGroupEnum. Check for duplicate builtin groups. + (enum_users): Take server name and use in Net... call. + (usage): Change text slightly. + (print_version): Fix copyright. + (main): Call enum_local_groups for domains as well. + * mkpasswd.c: Use statically linked functions throughout, except for + DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout. + Use defines instead of constants throughout. + (MAX_SID_LEN): Define. + (load_netapi): Just load DsGetDcNameW pointer. + (uni2ansi): Use wcstombs. + (current_user): Replace "unused_by_nt/2000/xp" by + just "unused". + (enum_users): Ditto. + (print_version): Fix copyright. + +2008-05-22 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (setfacl): Change from void to int. Return 2 in case of + error. + (main): Return with error code from setfacl. + +2008-05-15 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (CYGWIN_BINS): Remove ipcrm and ipcs. + * ipcrm.c: Remove. + * ipcs.c: Remove. + +2008-03-23 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (usage): Mark -s and -u as ignored. + (print_version): Simplify printing copyright dates. + (main): Remove default_flag. Dont set flags on -s and -u options. + (mount_commands): Drop handling -s and -u options. + +2008-03-22 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Fix multiple Cygwin DLL test. + * path.cc: Fetch mount points from fstab files instead of from + registry. Use adapted functions copied from Cygwin DLL. + (mnt_t): Drop issys member. Define as "mnt_t" instead of "struct mnt_t" + subsequently. + (max_mount_entry): New variable. + (unconvert_slashes): Move to earlier location in file. Make inline. + (find2): Remove. + (get_cygdrive0): Remove. + (get_cygdrive): Remove. + (skip_ws): New function. + (find_ws): Ditto. + (conv_fstab_spaces): Ditto. + (read_flags): Ditto. + (from_fstab_line): Ditto. + (get_user): Ditto. + (from_fstab): Ditto. + (mnt_sort): Ditto. + (read_mounts): Drop old registry code. Fetch + "Software\Cygwin\Setup\rootdir" value from HKCU or HKLM key. Use + rootdir extracted from module path as fallback. Call from_fstab for + nouser and user mount points. + (setmntent): Check max_mount_entry to test if read_mounts must be + called. + (getmntent): Use MOUNT_SYSTEM flag instead of mnt_t's issys member. + +2008-03-16 Brian Dessent <brian@dessent.net> + + * path.cc: Include malloc.h for alloca. + (is_symlink): Rewrite. Just read the whole file in memory rather + than by parts. Account for an ITEMIDLIST if present, as well as + the new style of Cygwin shortcut supporting targets > MAX_PATH. + +2008-03-12 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (do_sysfolders): Use cygwin_conv_path. + (do_pathconv): Use cygwin_conv_path and cygwin_conv_path_list. + * dumper.cc (main): Use cygwin_conv_path. Allocate target path + dynamically. + * mkpasswd.c (current_user): Use cygwin_conv_path. + (enum_users): Ditto. + * ps.cc (NT_MAX_PATH): Define. + (main): Use cygwin_conv_path. + * regtool.cc (find_key): Ditto. Allocate target path dynamically. + (cmd_save): Ditto. + +2008-03-11 Brian Dessent <brian@dessent.net> + + * cygcheck.cc (find_app_on_path): Make buffer SYMLINK_MAX + 1 + chars. + +2008-03-11 Brian Dessent <brian@dessent.net> + + * cygcheck.cc (dirname): New static function. + (find_app_on_path): Use SYMLINK_MAX. Resolve symlink relative + to link's location. Adjust to the fact that cygpath already + normalizes its return value. + * path.cc (rel_vconcat): Add cwd parameter, and use it instead + of calling GetCurrentDirectory() if possible. Rename throughout. + (vcygpath): Rename from cygpath and accept cwd and va_list. Pass + cwd on to rel_vconcat(). + (cygpath_rel): New front end for vcygpath. + (cygpath): Ditto. + * path.h (cygpath_rel): Declare. + (SYMLINK_MAX): Define to 4095. + +2008-03-09 Brian Dessent <brian@dessent.net> + + * Makefile.in (install): Don't install the testsuite. + +2008-03-08 Brian Dessent <brian@dessent.net> + + * Makefile.in: Add a 'check' target that builds and runs + testsuite.exe from path-testsuite.o and testsuite.o. + * path.cc: Include testsuite.h. + (struct mnt): Change to a mnt_t typedef and don't define + mount_table when TESTSUITE is defined. + (find2): Don't include when TESTSUITE is defined to avoid warning. + (get_cygdrive0): Ditto. + (get_cygdrive): Ditto. + (read_mounts): Provide empty implementation when TESTSUITE is + defined. + (vconcat): Use the isslash macro. + (unconvert_slashes): New helper to convert to backslashses. + (rel_vconcat): Handle relative paths more gracefully. + (cygpath): Skip a leading "./" sequence. Avoid double-slashes. + Normalize final output to backslashes and remove redundant path + sequences. + * testsuite.cc: New file implementing testsuite driver. + * testsuite.h: New header implementing harness mount table and + series of tests. + +2008-03-08 Brian Dessent <brian@dessent.net> + + * Makefile.in: Reorganize considerably, using GNU make's + static pattern rules and target-specific variables. + +2008-02-28 Corinna Vinschen <corinna@vinschen.de> + + * mkpasswd.c (main): Simplify generating SYSTEM entry. Add entries + for LocalService and NetworkService accounts. Change comments. + +2008-01-13 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Always try to get a OSVERSIONINFOEX + first. Load kernel32.dll earlier. Make osname a buffer. Simplify + Non-NT code. Use GetProductInfo in Vista/2008 case. Clean up + non-Vista version info. Exit early if not on NT. + +2007-12-29 Dave Korn <dave.korn@artimi.com> + + * bloda.cc (enum bad_app): Add BYTEMOBILE. + (dodgy_app_detects[]): Add FILENAME entry to detect bmnet.dll. + (big_list_of_dodgy_apps[]): Add description for BYTEMOBILE. + +2007-12-20 Brian Dessent <brian@dessent.net> + + * Makefile.in (cygcheck.exe): Don't link to ntdll. + * bloda.cc (pNtQuerySystemInformation): Add. + (pRtlAnsiStringToUnicodeString): Add. + (get_process_list): Use function pointers for NT functions. + (dump_dodgy_apps): Skip dodgy app check on non-NT platforms. + Use GetProcAddress for NT-specific functions. + +2007-12-07 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (opts): Add missing 'W'. + +2007-12-06 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc: Include limits.h. + (main): Set file name buffer size to PATH_MAX. Use progname or + progname_long member of struct external_pinfo dependent of the value of + the struct's version member. + +2007-08-31 Dave Korn <dave.korn@artimi.com> + + * mkgroup.c (enum_groups): Use MAX_PREFERRED_LENGTH in netgroupenum + call so that it will automatically size returned buffer sufficiently. + +2007-08-03 Dave Korn <dave.korn@artimi.com> + + * Makefile.in (cygcheck.exe): Add bloda.o as prerequisite, adjusting + dependency-filtering $(wordlist ...) call appropriately. Link ntdll. + (bloda.o): New rule to build bloda.o + * cygcheck.cc (dump_sysinfo): Call bloda function dump_dodgy_apps(). + * bloda.cc: New file implements detection of applications from the + Big List Of Dodgy Apps. + +2007-07-24 Corinna Vinschen <corinna@vinschen.de> + + * COPYING.dumper: New file. + * dumper.cc: Change license to plain GPLv2 + later. + * dumper.h: Ditto. + * parse_pe.cc: Ditto. + +2007-07-23 Christopher Faylor <me+cygwin@cgf.cx> + + * strace.cc (create_child): Don't convert a path from cygwin format + unless it has a slash. + +2007-07-09 Christopher Faylor <me+cygwin@cgf.cx> + + * strace.cc (usage): Add missing description for -q. + +2007-07-09 Christopher Faylor <me+cygwin@cgf.cx> + + * Makefile.in (kill.exe): Remove reliance on libiberty. + * kill.cc (strsigno): New function patterned after libiberty but using + newly exported cygwin array. + +2007-06-03 Christopher Faylor <me+cygwin@cgf.cx> + + * cygcheck.cc (pathlike): New class. + (paths): Redefine as type pathlike. + (display_error): Declare a few different ways to allow more flexible + usage throughout. + (display_error_fmt): New function for those cases where C++ just isn't + enough. + (add_path): Rewrite to allocate pathlike paths. Always tack on a + trailing slash since that's what everyone who uses it wants. NULL + terminate the path list. Register "it's a system path" field. + (init_path): Call add_path with info regarding whether path is a system + path or not. + (pathlike::check_existence): Move into pathlike class. Accept file and + extension arguments to build up path on the fly. Modify other + arguments. + (find_on_path): Constify return value and appropriate arguments. + Eliminate short-circuit for fully-qualified paths. Simplify loop which + iterates over path. + (already_did): Constify argument. + (track_down): Ditto. Regularize some error messages. + (find_app_on_path): Ditto. + (cygcheck): Constify argument. Use 20th century string handling + functions. + (dump_sysinfo): Remove odd inclusion of '\\bin' "Just in case". + Accommodate change of paths to pathlike. + * path.cc (isslash): Rename from SLASH_P and use throughout. + (rel_vconcat): Front-end to vconcat which prepends cwd to path before + passing along for conversion to native windows. + (cygpath): Remove "./" test. Call rel_vconcat if filename appears to + be relative. + +2007-05-29 Pedro Alves <pedro_alves@portugalmail.pt> + + * dumper.cc (dumper::prepare_core_dump): Record a phdr for each section. + +2007-05-29 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (do_options): Allow outputflag combined with other + basic flags. Only check options_from_file_flag if reading options + from command line. + (main): Check for NULL argz vector. Don't free argz vector prematurely. + Don't force flag combination in !options_from_file_flag case. + +2007-05-23 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc: Include argz.h. + (options_from_file_flag): Move from main to global static variable. + (mode_flag): Ditto. + (do_sysfolders): Rename from dowin and accommodate throughout. + Don't exit from here. + (do_pathconv): Rename from doit and accommodate throughout. + (print_version): Change copyright. + (do_options): New function, centralizing option processing. + Rework checking options for correctness. + (action): New function, centralizing calling worker functions. + (main): Simplify. Move option processing to do_options. Move calling + worker functions to action. Rework getting arguments from files. + +2007-03-30 Mark Mitchell <mark@codesourcery.com> + + * utils/cygpath.cc (get_long_path_name_w32impl): Close handles returned + by FindFirstFile. + +2007-03-30 Christopher Faylor <me@cgf.cx> + + * mount.cc (main): Turn dos file warnings off since we know what we're + doing. + +2007-02-22 Corinna Vinschen <corinna@vinschen.de> + + * ipcs.c (_POSIX2_LINE_MAX): Drop definition. + +2007-02-20 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Add "not supported" to osname on 9x + machines. Drop "not supported" for Vista. Drop "Longhorn" text + for now. + +2007-01-09 Christian Franke <franke@computer.org> + + * cygpath.cc (usage): Add -O and -F, remove tabs. + (get_special_folder): New function. + (get_user_folder): New function. + (dowin): Add -O and -F, better -D, -P error handling. + (main): Add -O and -F. + * utils.sgml (cygpath): Document -O and -F. + +2006-12-21 Corinna Vinschen <corinna@vinschen.de> + + * dumper.cc: Include ansidecl.h before including bfd.h to woraround + a problem with the order in which system include files are included. + +2006-12-11 Christopher Faylor <me@cgf.cx> + + * dumper.cc: Add an include to accommodate new include/elf usage. + +2006-12-10 Christopher Faylor <me+cygwin@cgf.cx> + + * mount.cc (do_mount): Avoid unnecessary cygwin_conv_to_win32_path and + pass POSIX path directly - this avoids a cygwin DLL warning. + +2006-10-21 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (key_type): Drop. + (REG_AUTO): Define. + (value_type): Replace key_type. Use REG_xxx values directly. + Accomodate change throughout. + (longopts): Add --dword, --dword-le, --none, --qword and --hex options. + (opts): Add -d, -D, -n, -Q and -x options. + (types): Array to convert REG_xxx into strings. + (hex): New variable to keep value of --hex option. + (usage): Accomodate new options. Print only the necessary by default. + Only be verbose in case of -h/--help option. + (cmd_list): Use key separator from -K option when printing. + Print value type when verbose option is given. Handle so far not + handled REG_xxx types. + (cmd_set): Avoid SEGV due to missing argument. Handle so far not + handled REG_xxx types. + (cmd_get): Handle --binary option type agnostic. Handle so far not + handled REG_xxx types. + (main): Handle new options. + +2006-10-19 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (longopts): Add --wow32 option. + (opts): Add -W option. + (usage): Add text for --wow32/-W option. + (main): Handle --wow32/-W option. + * utils.sgml: Document the new -W option. + +2006-10-16 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (KEY_WOW64_64KEY): Drop definition. Instead define + WINVER to 0x0502 before including windows.h. + +2006-10-16 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (KEY_WOW64_64KEY): Define. + (longopts): Add --wow64 option. + (opts): Add -w option. + (wow64): New variable to control usage of KEY_WOW64_64KEY access flag. + (usage): Add text for --wow64/-w option. + (print_version): Fix copyright. + (find_key): Use wow64 value in calls to RegOpenKeyEx and RegCreateKeyEx. + (cmd_add): Use wow64 value in call to RegCreateKeyEx. + (regDeleteKeyEx): New function pointer to load RegDeleteKeyEx function + dynamically. + (cmd_remove): Load and use regDeleteKeyEx when wow64 is set. + (main): Handle --wow64/-w option. + * utils.sgml: Document the new -w option. + +2006-10-05 Igor Peshansky <pechtcha@cs.nyu.edu> + + * cygcheck.cc (get_word, get_dword): Move to path.cc. + (LINK_EXTENSION): New macro. + (check_existence): New static function. + (find_on_path): Check for symbolic links if asked. + (dll_info): New error handling. + (track_down): Only call dll_info() for executables, display + an error for symlinks, and print magic number for others. + (find_app_on_path): New static function. + (cygcheck, dump_sysinfo): Call find_app_on_path() instead of + find_on_path(). + * path.cc (cmp_shortcut_header): New static function. + (get_word, get_dword): Moved from cygcheck.cc. + (EXE_MAGIC, SHORTCUT_MAGIC, SYMLINK_COOKIE, SYMLINK_MAGIC): New + macros. + (is_exe, is_symlink, readlink): New functions. + * path.h (is_exe, is_symlink, readlink): Declare. + (get_word, get_dword): Ditto. + +2006-09-12 Christopher Faylor <cgf@timesys.com> + + * Makefile.in: Fix -ntdll typo. + +2006-09-11 Eric Blake <ebb9@byu.net> + + * cygcheck.cc (main): Restore POSIXLY_CORRECT before displaying user's + environment. + +2006-08-03 Corinna Vinschen <corinna@vinschen.de> + + * path.cc (vconcat): Don't convert backslahes to slashes. + (cygpath): Return native path with all backslashes. + +2006-08-02 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (cygpath.exe): Add rule to link cygpath against ntdll.dll. + * cygpath.cc: Include DDK headers. + (RtlAllocateUnicodeString): New static inline function. + (get_device_name): New static function to evaluate DOS path from + native NT path. + (get_device_paths): New function to do the same for path lists. + (doit): Call get_device_paths/get_device_name where appropriate. + +2006-07-30 Ilya Bobir <ilya@po4ta.com> + + * cygpath.cc (get_long_name): Fallback to get_long_path_name_w32impl. + +2006-07-27 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.c (get_long_name): Cover the case that GetLongPathName + doesn't return valid information for non-existant files. Just return + incoming filename in that case. + +2006-07-03 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * Makefile.in: Build setmetamode.exe. + * setmetamode.c: New file. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * configure.in: Update to newer autoconf. + (thanks to Steve Ellcey) + * configure: Regenerate. + * aclocal.m4: New file. + +2006-05-24 Christopher Faylor <cgf@timesys.com> + + * strace.cc (proc_child): Propagate return code from child process. + (dostrace): Ditto. + (main): Ditto. + +2006-03-03 Christian Franke <franke@computer.org> + + * regtool.cc (options): Add 'binary'. + (usage): Document 'load|unload|save' and '-b'. + (find_key): Add 'options' parameter, add load/unload. + (cmd_set): Add KT_BINARY case. + (cmd_get): Add hex output in KT_BINARY case. + (cmd_load): New function. + (cmd_unload): New function. + (set_privilege): New function. + (cmd_save): New function. + (commands): Add load, unload and save. + (main): Add '-b' + * utils.sgml (regtool): Document it. + +2006-02-17 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (get_long_name): Load GetLongPathNameA instead of incorrect + GetLongPathName. + (doit): Create mixed filename after converting to short or long pathname + respectively. + +2006-02-17 Jerry D. Hedden <jerry@hedden.us> + + * ps.cc (main): Set aflag if -p option is given. + +2006-02-16 Jerry D. Hedden <jerry@hedden.us> + + * ps.cc (longopts): Add --process option. + (opts): Add -p option. + (usage): Mention -p/--process option. + (main): Handle -p option. + * utils.sgml: Describe -p/--process option. + +2006-02-15 Igor Peshansky <pechtcha@cs.nyu.edu> + + * regtool.cc (usage): Clarify help for "-K". + +2006-02-08 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (find_on_path): Update copyright text. + +2006-02-08 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (find_on_path): Create copy of rv on successful access + check, since rv can be reused in subsequent calls. + +2006-01-19 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (common_paths): Add "patch". + +2006-01-19 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (init_paths): Record first_nonsys_path. + (find_on_path): Start on first nonsys path when !search_sysdirs. + +2006-01-18 Christopher Faylor <cgf@timesys.com> + + * Makefile.in (sysconfdir): Remove unneeded variable. + + * mkgroup.c: Replace ` with ' throughout. + * mkpasswd.c: Ditto. + * setfacl.c: Ditto. + * ssp.c: Ditto. + +2006-01-18 Dave Korn <dave.korn@artimi.com> + + * cygpath.cc (dowin): Remove stray debugging printf statement. + +2006-01-17 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Replace etcdir with sysconfdir. + +2006-01-13 Brian Dessent <brian@dessent.net> + + * Makefile.in (cygcheck.exe): Do not link against libwininet.a. + * cygcheck.cc (pInternetCloseHandle): Define global function pointer. + (display_internet_error): Use it. + (package_grep): Attempt to load wininet.dll at runtime. Call WinInet + API through function pointers throughout. + +2006-01-13 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Convert k32 to HMODULE. + +2006-01-13 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Convert osname to const and remove casts + in subsequent assignments. Recognize Longhorn/Vista and report as not + yet supported. Recognize when running under WOW64 and report native + CPU type. Slightly rearrange \n printing. + +2006-01-12 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc: Replace ` with ' throughout. + +2006-01-05 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (dump_sysinfo): Report the failing drive to prevent + having to guess. + +2005-12-29 Christopher Faylor <cgf@timesys.com> + + * strace.cc (nprocesses): Make static global. + (quiet): New variable. + (strace_active): Ditto. + (add_child): Increment nprocesses here. Don't add a child if it is + already added (windows bug?). Report on child if not quiet. + (get_child): Just return NULL if child not found. + (remove_child): Report on child if not quiet. + (attach_process): Don't complain if given a windows process. Use + windows pid in error. + (handle_output_debug_string): Issue error if trying to manipulate a process that we don't know about. + Handle _STRACE_CHILD_PID - attach to reported child when we get this. + (proc_child): Move nprocesses to file scope. + Report on exceptions. + (longopts): Implement "--quiet". + (opts): Implement "-q". + (main): Manipulate quiet flag. + * utils.sgml (strace): Add words describing '-q'. + +2005-12-29 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (common_apps): Add crontab, vi, vim. + +2005-12-19 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * dump_setup.cc (package_find): Fix is_alias computation for "/usr/lib". + +2005-12-14 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (common_apps): Add a few more binaries to look for. + +2005-12-05 Christopher Faylor <cgf@timesys.com> + + * strace.cc (show_usecs): Renamed from 'usecs'. + (main): Use show_usecs rather than usecs. Toggle delta if '-u' is + specified. + (handle_output_debug_string): Avoid printing microsecond timestamp if + show_usecs == 0. + * utils.sgml (strace): Add words to describe '-u'. + +2005-11-22 Brian Dessent <brian@dessent.net> + + * Makefile.in: Link cygcheck with libwininet.a. + * cygcheck.cc: Add includes. + (grep_packages): New global variable. + (display_internet_error): New function. + (safe_chars): New global variable. + (base_url): Ditto. + (package_grep): New function. + (usage): Reword --help output for clarity. Document new argument. + (longopts): Add 'package-query' option. + (opts): Add 'p' option, reorder to be consistent with 'longopts'. + (main): Accommodate new option. + * utils.sgml (cygcheck): Update --help output. Document new -p option. + +2005-09-22 Corinna Vinschen <corinna@vinschen.de> + + Align error message handling to mkpasswd's error messages throughout. + * mkgroup.c (print_win_error): Create macro calling ... + (_print_win_error): ... this function created from former + print_win_error. Move up in source. + (PDOMAIN_CONTROLLER_INFOW): Define return type of DsGetDcNameW. + (dsgetdcname): New function pointer for DsGetDcNameW. + (load_netapi): Get DsGetDcNameW address. + (main): If DsGetDcNameW is available, use it. + * mkpasswd.c (PDOMAIN_CONTROLLER_INFOW): Define return type of + DsGetDcNameW. + (dsgetdcname): New function pointer for DsGetDcNameW. + (load_netapi): Get DsGetDcNameW address. + (main): If DsGetDcNameW is available, use it. Rename local variable + domain_name_specified to domain_specified as in mkgroup.c. + +2005-09-08 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * 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. + +2005-08-18 Corinna Vinschen <corinna@vinschen.de> + + * 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. + +2005-08-16 Brian Dessent <brian@dessent.net> + + * cygcheck.cc (dump_sysinfo_services): Properly null-terminate 'buf'. + Avoid extraneous cygrunsrv invocation if 'verbose' is true. + +2005-08-03 Corinna Vinschen <corinna@vinschen.de> + + * mount.cc (longopts): Fix typo which disallows --options option. + +2005-07-19 Christopher Faylor <cgf@timesys.com> + Eric Blake <ebb9@byu.net> + + * cygcheck.cc (find_on_path): Perform .exe magic on non-PATH search. + +2005-07-05 Eric Blake <ebb9@byu.net> + + * cygcheck.cc (track_down, cygcheck): Return true on success. + (main): Reflect cygcheck failures in exit status. + +2005-06-14 Corinna Vinschen <corinna@vinschen.de> + + * parse_pe.c (exclusion::sort_and_check): Remove crude cast. + +2005-05-30 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Recognize XP Media Center and Tablet PC + Editions. Change .NET to 2003 throughout. Recognize 2003 Web Server + and Datacenter Server. Report when running in terminal server session. + +2005-05-27 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (load_cygwin): Make half-hearted attempt to work with + older DLLs. + * strace.cc (load_cygwin): Ditto. + +2005-05-22 Brian Dessent <brian@dessent.net> + + * cygcheck.cc (dump_sysinfo_services): Add new function that uses + new cygrunsrv options to dump service info. + (dump_sysinfo): Call dump_sysinfo_services if running under NT. + Change 'Cygnus' to 'Cygwin' in output. + +2005-05-20 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (load_cygwin): Remove debugging statement. + +2005-05-20 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (dump_sysinfo): Don't attempt to use path if it is not + set. + (nuke): Fix off by one error in allocation of environment variable. + (load_cygwin): Always set PATH even if cygwin environment is empty. + +2005-05-16 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (cygwin_internal): Define as a "C" function. + * strace.cc (cygwin_internal): Ditto. + + * cygpath.cc (print_version): Update copyright. + +2005-05-15 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (load_cygwin): Avoid calling putenv with a NULL path. + +2005-05-15 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (load_cygwin): Don't touch $PATH for now. + (print_version): Fix copyright. + * strace.cc (print_version): Ditto. + +2005-05-13 Christopher Faylor <cgf@timesys.com> + + * mount.cc (mount_commands): Display "-X" option when appropriate. + +2005-05-08 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (nuke): New function. + (load_cygwin): New function. + (main): Use load_cygwin to load argv/envp from cygwin environment, if + appropriate. + +2005-05-08 Christopher Faylor <cgf@timesys.com> + + * strace.cc (attach_process): Don't call load_cygwin(). Assume that + it's already happened. + (dotoggle): Ditto. + (main): Set argv from cygwin environment, if it exists. + +2005-05-01 Christopher Faylor <cgf@timesys.com> + + * mount.cc (usage): Clarify action of -m option. + +2005-04-29 Dave Korn <dave.korn@artimi.com> + + * path.cc (getmntent): Add previously-omitted 'noexec' and 'managed' + flags to mnt_opts string if present in mount flags. + +2005-04-20 Brian Dessent <brian@dessent.net> + + * utils.sgml (mount): Clarify setting cygdrive prefix for user + and system-wide. + +2005-03-24 Brian Dessent <brian@dessent.net> + + * cygcheck.cc (init_paths): Use full path instead of "." for the + current directory. Do not add "." if present in $PATH. + (dump_sysinfo): Skip placeholder first value of paths[]. + +2005-03-07 Christopher Faylor <cgf@timesys.com> + + * kill.cc (getsig): Rectify bug introduced by 2005-02-26 change. Don't + pad signal name with spaces. + +2005-03-07 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (handle_output_debug_string): Fix compiler warning. + +2005-03-06 Christopher Faylor <cgf@timesys.com> + + * cygpath.cc (usage): Pass in one more copy of program_name to printf + to avoid a SEGV. + +2005-02-27 Christopher Faylor <cgf@timesys.com> + + * regtool.cc (opts): The argument to 'K' is not optional. + (main): Revert previous change. Just let getopt deal with missing + argument. + +2005-02-27 Christopher Faylor <cgf@timesys.com> + + * regtool.cc (main): Avoid a SEGV when nothing follows -K. + +2005-02-26 Christopher Faylor <cgf@timesys.com> + + * kill.cc (getsig): Avoid buffer overflow when generating a signal name. + + * strace.cc (handle_output_debug_string): Make error a little more specific. + +2005-02-23 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygpath.cc (usage): Clarify help output to indicate acceptance + of multiple file names as arguments. + +2005-01-16 Christopher Faylor <cgf@timesys.com> + + * ps.cc (main): Eliminate use of PID_ZOMBIE. + * strace.cc (main): Recognize new option for displaying hex value of + strace type. + (handle_output_debug_string): Prepend output with hex value of strace + message if -H is specified. + +2005-01-11 Pierre Humblet <pierre.humblet@ieee.org> + + * mkpasswd.c (print_win_error): Transform into macro. + (_print_win_error): Upgrade former print_win_error by + printing the line. + (current_user): Call _print_win_error. + (enum_users): Print name in case of lookup failure. + (enum_local_groups): Ditto. + +2004-11-18 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (eprintf): New function. + +2004-11-16 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (find_on_path): Clear show_error and/or print_failed + parameters to display_error. + (rva_to_offset): Ditto. + (dll_info): Ditto. + (track_down): Ditto. + +2004-11-13 Pierre Humblet <pierre.humblet@ieee.org> + + * kill.cc (forcekill): Do not pass negative pids to + cygwin_internal. Check if sig == 0. Improve error messages. + (main): Make pid a long long and distinguish between pids, gpids + (i.e. negative pids) and Win9x pids. + +2004-11-11 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc: Change "keyeprint" to "display_error" throughout. + +2004-11-11 Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (main): Allow a '-l' without an additional argument. + +2004-11-11 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (keyeprint): New optional parameters: show_error and + print_failed. + +2004-10-31 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (get_dword): Fix errormessage. + (cygwin_info): Ditto. + (track_down): Ditto. + (check_keys): Ditto. + +2004-10-27 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (dump_sysinfo): Warn about missing or multiple cygwin1 + dlls. + +2004-10-25 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (dump_sysinfo): Add leading newline before legend for + drive-list. + +2004-10-22 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (dump_sysinfo): In legend for drive-list: Add ``ram'' and + ``unk''. Use single puts. Add leading newline. Line up equal-signs. + +2004-10-20 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (dump_sysinfo): Allow for larger drives in drive-list. + Change ``Used'' to ``Free'' in helptext-title for drive-list. + +2004-10-18 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (pretty_id): Don't let i become negative. Fix + printf-format. + +2004-10-17 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (pretty_id): Allocate space for ')' in uid and guid. + +2004-10-17 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (pretty_id): Allocate space for trailing '\0' in uid and + guid. + +2004-10-15 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + Christopher Faylor <cgf@timesys.com> + + * cygcheck.cc (pretty_id): Don't exit on id error. Fix size + calculations. + +2004-10-14 Christopher Faylor <cgf@timesys.com> + Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (pretty_id): Correct column calculations. Abort if id is + acting funny. + +2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (add_path): Don't leak memory when path is already in + ``paths''. + +2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (dump_sysinfo): Warn about trailing (back)slash on mount + entries. + +2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (dump_sysinfo): Don't warn about empty path components, + just display ``.''. + +2004-10-06 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (_impure_ptr): Remove. + +2004-10-06 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (dump_sysinfo): Warn about empty path components. + +2004-10-04 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * cygcheck.cc (pretty_id): Close pipe. + +2004-09-23 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * dump_setup.cc (dump_setup): Remove unneeded strlen when check_files + is not set. + +2004-09-22 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + Corinna Vinschen <corinna@vinschen.de> + + * dump_setup.cc (dump_setup): Avoid trailing spaces on package-list. + +2004-09-15 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + + * getfacl.c (main): Correct layout when nopt is set. + +2004-07-12 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * mkgroup.cc (netapibufferallocate,netgroupgetinfo): New function + pointers. + (load_netapi): Load NetApiBufferAllocate and NetGroupGetInfo. + (enum_local_groups,enum_groups): Add disp_groupname parameter. + Load info for disp_groupname if specified. + (usage): Add description of "-g/--group" option. + (longopts,opts): Add "-g/--group" option. + (main): Process "-g/--group" option. + * utils.sgml (mkgroup): Add description of "-g/--group" option + +2004-06-15 Alan Modra <amodra@bigpond.net.au> + + * dumper.cc (dumper::prepare_core_dump): Use bfd_get_section_size + instead of _raw_size. + (dumper::write_core_dump): Likewise. + * parse_pe.cc (select_data_section): Likewise. + +2004-05-29 John Paul Wallington <jpw@gnu.org> + + * ssp.c (usage): Add missing linefeed. + +2004-05-27 Christopher Faylor <cgf@alum.bu.edu> + + * kill.cc (listsig): Fix "kill -l" segv. NSIG includes Signal 0, so we + need to avoid calling strtosigno with NSIG - 1. + +2004-03-21 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (dump_sysinfo): Remove "Win95/NT" from output. + +2004-03-15 Christopher Faylor <cgf@redhat.com> + + * cygpath.cc (usage): Don't issue helpful message if -i is used. + (from Igor Pechtchanski) + +2004-03-13 Rob Siklos <rob2@siklos.ca> + + * kill.cc (get_debug_priv): New function. + (forcekill): Call get_debug_priv before trying to kill process. + +2004-02-24 Christopher Faylor <cgf@redhat.com> + + * cygpath.cc (long_options): Add "mode" option. + (options): Ditto. + (usage): Report on new option. + (report_mode): New function. + (main): Implement -M option. + +2004-02-20 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (build_dumper): Detect missing iconv library. + + * cygpath.cc (dowin): Report on filename conversion errors. + (doit): Ditto. + + * strace.cc (main): Use symbolic constant for _STRACE_ALL when setting + mask. + +2004-02-14 Corinna Vinschen <corinna@vinschen.de> + + * ssp.c (opts): Add leading '+' to force posixly correct behaviour. + +2004-02-11 Corinna Vinschen <corinna@vinschen.de> + + * strace.cc (opts): Add leading '+' to force posixly correct + behaviour. + (main): Revert POSIXLY_CORRECT manipulations. + +2004-02-10 Christopher Faylor <cgf@redhat.com> + + * strace.cc (main): Guard against previous setting of POSIXLY_CORRECT. + +2004-02-10 Christopher Faylor <cgf@redhat.com> + + * strace.cc: Update copyrights. + * cygcheck.cc: Update copyrights. + +2004-02-10 Christopher Faylor <cgf@redhat.com> + + * strace.cc (main): Ensure POSIXLY_CORRECT argument ordering. + * cygcheck.cc (main): Ditto. + +2004-01-23 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (pretty_id): Make more robust in absence of id.exe. + +2004-01-22 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (dowin): Revert accidental checkin from November. + +2003-11-26 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Print "root" group with local admins group sid + and gid 0. + +2003-11-19 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in: Add rules to build ipcrm and ipcs. + * ipcrm.c: New file. + * ipcs.c: New file. + +2003-11-14 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Avoid compiler warnings throughout. + * mkpasswd.c: Ditto. + * passwd.c: Ditto. + +2003-11-07 Mark Blackburn <marklist@fangorn.ca> + + * cygpath.cc (main): Allow multiple pathnames on command line. + +2003-11-04 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (PrintPW): Turn around meaning printed for "Password not + required" option to be in line with Windows meaning. + (main): Use more appropriate 1008 option when calling + NetUserSetInfo to change flag values. + +2003-11-04 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c (UF_LOCKOUT): Remove (defined in lmaccess.h). + (version): Bump version number to 1.5. + (longopts): Add -c, -C, -e, -E, -p, -P options. + (opts): Ditto. + (PrintPW): Print values of UF_PASSWD_CANT_CHANGE and + UF_DONT_EXPIRE_PASSWD flags. Slightly reformat output. Don't suppress + correct system password settings just because the account has admin + privileges. + (usage): Define as "noreturn" function. Restructure and rephrase + output. Accommodate new options. + (print_version): Fix copyright dates. + (main): Accommodate new options for setting UF_PASSWD_CANT_CHANGE, + UF_DONT_EXPIRE_PASSWD and UF_PASSWD_NOTREQD settings. + +2003-10-17 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (pretty_id): Don't exec if `id' program is not found. + +2003-09-20 Christopher Faylor <cgf@redhat.com> + + * kill.cc (main): Allow negative pids (indicates process groups). + +2003-09-17 Christopher Faylor <cgf@redhat.com> + + * parse_pe.cc (exclusion::sort_and_check): Make error message a little + more explicit and ignore (hopefully) harmless region overlap. + +2003-09-13 Christopher Faylor <cgf@redhat.com> + + * kill.c (forcekill): Wait for process to terminate even if + TerminateProcess says it failed. + +2003-09-11 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Tweak mingw libz.a detection to make it more reliably + detect when libz.a is not available. + +2003-09-11 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * cygcheck.cc (dump_only): New global variable. + (usage): Add "--dump-only" option, fix "--verbose" line. + (longopts, opts): Add "--dump-only" option. + (main): Process the "--dump-only" flag. Add new semantic check. + Pass dump_only information to dump_setup(). + +2003-09-11 Corinna Vinschen <corinna@vinschen.de> + + * getfacl (main): Remove extern declaration of optind. + * setfacl (main): Remove extern declaration of optarg and optind. + +2003-09-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (cygcheck.o): Use MINGW_CXX for compilation. + * cygcheck.cc: Just include <getopt.h> rather than cygwin version. + (pretty_id): Avoid compiler warnings. + * cygpath.cc (usage): Ditto. + +2003-09-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (MINGW_CXX): Define and use for mingw-compiled files. + * path.cc: Include more path info in cygwin-specific includes since the + cygwin directory is no longer included by default. + +2003-09-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: More fixups to adjust for the fact that mingw_getopt.o + is no longer built. + +2003-09-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Remove references to getopt since it is now part of + mingwex. + +2003-09-08 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Rename libz.h -> zlib.h. + +2003-09-07 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Detect existence of mingw zlib headers and libraries. + Build cygcheck without package checking if they are unavailable. + * dump_setup.cc: Generate dummy zlib macros when zlib is not available. + (open_package_list): Use zlib functions to uncompress package lists. + Return gzFile rather than FILE *. + (check_package_files): Change fp to gzFile to accommodate zlib + functions. Use gzgets to read from package file. Use gzclose to close + the handle. + (package_list): Ditto. + (package_find): Ditto. + +2003-09-05 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * dump_setup.cc (check_package_files): Don't fail on empty package. + +2003-09-01 AJ Reins <reinsaj@yahoo.com> + + * mount.cc (mount_commands): Ensure user mode is actually user mode and + not the default system mode. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * kill.cc (forcekill): Silence some compiler warnings. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Oops. Put the '...' in the right place. + +2003-08-31 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Display "..." when not-verbose. + + * kill.cc (forcekill): Default to entered pid when pinfo fails. Issue + some warnings when things don't work. + +2003-08-17 David Rothenberger <daveroth@acm.org> + + * dump_setup.cc (check_package_files): Strip leading / and ./ from + package file names. + +2003-08-16 David Rothenberger <daveroth@acm.org> + + * dump_setup.cc (package_find): Don't stop searching on missing + file list. + (package_list): Ditto. + +2003-08-16 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * dump_setup.cc: (package_list): Make output terse unless + verbose requested. Fix formatting. + (package_find): Ditto. + +2003-08-15 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (main): Fix some formatting and help text printing. + +2003-08-15 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * cygcheck.cc (find_package,list_package): New global + variables. + (usage): Add "--find-package" and "--list-package" options, + reformat output. + (longopts, opts): Add "--find-package" and "--list-package" + options. + (main): Process the "--find-package" and "--list-package" + flags. Add new semantic checks. Add calls to find_package() + and list_package(). + * dump_setup.cc: Fix header comment. + (match_argv): Change return type to int to distinguish + between real matches and default ones. + (open_package_list): New static function. + (check_package_files): Factor out opening the package list + file into open_package_list(). + (get_packages): New static function. + (dump_setup): Factor out getting a list of packages into + get_packages(). + (package_list, package_find): New global functions. + +2003-08-15 Corinna Vinschen <corinna@vinschen.de> + + * regtool.cc (usage): Add missing linefeed. Move example to --help + text. Fix forward slash description. + +2003-08-13 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * dump_setup.cc (check_package_files): Fix extra '/' in filename. + Resize command buffer. Fix buffer overflow bug. + +2003-08-09 Igor Pechtchanski <pechtcha@cs.nyu.edu> + Christopher Faylor <cgf@redhat.com> + + * dump_setup.cc (dump_setup): Check for the existence of the package + list file. Rework slightly to use static buffer for popen commands. + +2003-08-07 Igor Pechtchanski <pechtcha@cs.nyu.edu> + Christopher Faylor <cgf@redhat.com> + + * dump_setup.cc (version_len): New static variable. + (could_not_access,directory_exists): New static function. + (file_exists): Ditto. + (check_package_files): Ditto. + (dump_setup): Check the contents of each package if check_files is true + and output the result in the "Status" column. Flush output after each + package. + +2003-08-07 Igor Pechtchanski <pechtcha@cs.nyu.edu> + Christopher Faylor <cgf@redhat.com> + + * dump_setup.cc (dump_setup): Remove redundant null check. Add + informative message if package info not found. + +2003-07-26 Christopher Faylor <cgf@redhat.com> + + * mount.cc (do_mount): Issue warning when using managed mount option on + non-empty directory. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * configure.in: Use 'install-sh -c'. + * configure: Regenerate. + +2003-07-25 Christopher Faylor <cgf@redhat.com> + + * configure.in: Always use install-sh. + * configure: Regenerate. + +2003-07-03 Christopher Faylor <cgf@redhat.com> + + * mount.cc (struct opt): Remove posix option. + +2003-07-03 Christopher Faylor <cgf@redhat.com> + + * mount.cc (longopts): Add long "options" keyword. + (opts): Add -o option. + (usage): Display -o option. + (struct opt): New. + (concat3): New function. + (main): Handle -o flag. + +2003-06-12 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (pretty_id): Rework slightly to not rely on spaces. + +2003-06-12 Christopher Faylor <cgf@redhat.com> + + * cygpath.cc: Throughout, always return error when GetShortPathName + returns 0. + +2003-04-26 Joshua Daniel Franklin <joshuadfranklin at yahoo dot com> + + * mkpasswd.c (usage) Remove extra newline from description output. + +2003-04-26 Joshua Daniel Franklin <joshuadfranklin at yahoo dot com> + + * cygcheck.cc (usage) Add description output. + * cygpath.cc (usage) Add description output. + * dumper.cc (usage) Add newline to description output. + * kill.cc (usage) Add description output. + * mkgroup.c (usage) Grammatical change to description output. + * mkpasswd.c (usage) Grammatical change to description output. + * mount.cc (usage) Add description output. + * passwd.c (usage) Add description output. + * ps.cc (usage) Add description output. + * regtool.cc (usage) Add description output. + * setfacl.c (usage) Remove extra newline from description output. + * ssp.c (usage) Add description output. + * strace.cc (usage) Add description output. + * umount.cc (usage) Add description output. + +2003-04-10 Pierre Humblet <pierre.humblet@ieee.org> + + * mkpasswd.c (current_user): print uid and gid as unsigned. + (enum_users): Ditto. Do not free servername. + (usage): Update to allow several domains and improve -p. + (main): On Win9x limit uids to 1000. Only print specials + when -l is specified. Add a loop to allow several domains + and free servername in the loop. + * mkgroup.c (enum_groups): Do not free servername. + (usage): Update to allow several domains. Change uid to gid. + (main): Only print specials when -l is specified. Add a + loop to allow several domains and free servername in the loop. + +2003-03-24 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (dump_sysinfo): Ensure that CYGWIN environment variable + is correctly set. + +2003-03-09 Corinna Vinschen <corinna@vinschen.de> + + * getfacl.c (username): Fix ambiguous printf calls. + (groupname): Ditto. + (main): Ditto. + +2003-03-04 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (strace.exe): Include mingw_getopt.o in link line. + * cygcheck.cc (print_version): Update copyright. + * strace.cc (print_version): Ditto. + (main): Allow cygwin paths for -o option. + (create_child): Allow cygwin path as argv[0]. + * path.cc (path.cc): Allow UNC paths. + +2003-03-01 Pierre Humblet <pierre.humblet@ieee.org> + + * mkpasswd.cc (main): On Win95, output both a default line and a + line for the current user (if known) with a pseudorandom uid. If + the -u switch is given, produce a line for the specified user. + * mkgroup.cc (main): On Win95 change the group name from "unknown" to + "all". + +2003-02-28 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (cygcheck.o): Fix so that actual mingw include files are + used. + * cygcheck.cc (find_on_path): Translate from cygwin path when qualified + path name found. + (pretty_id): New function. Dump output of id command. + (dump_sysinfo): Call pretty_id for CYGWIN=ntsec and CYGWIN=nontsec cases. + +2003-02-12 Christopher Faylor <cgf@redhat.com> + + * cygpath.cc (doit): Allocate more space for non-path filename. + +2003-02-07 Christopher Faylor <cgf@redhat.com> + + * dump_setup.cc (compar): Use case insensitive comparisons. + (dump_setup): Calculate package_len based on already used "len". Don't + bother with version_len. + +2003-02-07 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * dump_setup.cc (dump_setup): Compute the longest package name + and align columns properly. + +2003-02-06 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (common_apps): Add some more apps. + * path.cc (get_cygdrive): Correctly set system flag. + +2003-01-22 Corinna Vinschen <corinna@vinschen.de> + + * Makefile.in (ALL_LDFLAGS): Remove newlib/libm from tools paths. + (MINGW_LDFLAGS): Remove in favor of definition from Makefile.common. + +2003-01-15 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Fix copyright date. + * mkpasswd.c: Ditto. + * setfacl.c: Ditto. + +2003-01-09 Pierre Humblet <pierre.humblet@ieee.org> + + * setfacl.c (usage): Remove double ":" for mask and other. + +2003-01-07 Pierre Humblet <pierre.humblet@ieee.org> + + * mkpasswd.c (current_user): Create. + (usage): Reorganize to support Win95/98/ME. + (main): Add option for -c. Reorganize to parse options for + Win95/98/ME and to call current_user. Add username in gecos field + on Win95/98/ME. + * mkgroup.c (enum_groups): Print gid with %u. + (print_win_error): Create from passwd.cc. + (current_group): Create. + (usage): Reorganize to support Win95/98/ME. + (main): Add option for -c. Reorganize to parse options for + Win95/98/ME and to call current_group. + +2002-12-14 Pierre Humblet <pierre.humblet@ieee.org> + + * setfacl.c (main): Place a single : after other and mask. + * getfacl.c (getaclentry): Allow both : and :: for other and mask. + (main): Remove extraneous break. + +2002-11-25 Corinna Vinschen <corinna@vinschen.de> + + * mkpasswd.c (main): Set pw_passwd field to '*' on 9x/Me. + +2002-11-24 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (getperm): Set only `other' permission bits. + (getaclentry): Set a_id to -1 by default. + +2002-11-24 Corinna Vinschen <corinna@vinschen.de> + + * getfacl.c (permstr): Use `other' permission bits for requesting + ace permissions. + +2002-11-08 Corinna Vinschen <corinna@vinschen.de> + + * setfacl.c (usage): Add missing LF. + +2002-10-30 Christopher Faylor <cgf@redhat.com> + + * cygpath.cc (get_long_path_name_w32impl): Define similarly to + GetLongPathName. + (get_long_name): Correctly prototype GetLongPathName. + (get_long_paths): Implement using get_long_name to cut down on code + duplication. + (doit): Do various things to make path output work predictably. + +2002-10-19 Christopher Faylor <cgf@redhat.com> + + * mount.cc (usage): Correctly report default mode. + * strace.cc (main): Use strtoul as appropriate. + +2002-09-29 Christopher Faylor <cgf@redhat.com> + + * cygpath.cc (close_arg): Remove unused static. + * mkgroup.c (enum_local_users): Avoid compiler warning. + (enum_users): Ditto. + * mkpasswd.c: Ditto throughout. + * ssp.c: Ditto throughout. + +2002-09-18 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc: Include sys/time.h rather than time.h to avoid a + compiler error. + +2002-09-17 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc: Reorder includes to avoid compiler error. + +2002-09-15 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygcheck.cc (print_version) Add final newline. + * getfacl.c (print_version) Add final newline. + * kill.cc (print_version) Add final newline. + * mkgroup.c (print_version) Add final newline. + * mkpasswd.c (print_version) Add final newline. + * mount.cc (print_version) Add final newline. + * passwd.c (print_version) Add final newline. + * ps.cc (print_version) Add final newline. + * regtool.cc (print_version) Add final newline. + * setfacl.c (print_version) Add final newline. + * ssp.c (print_version) Add final newline. + * strace.cc (print_version) Add final newline. + * umount.cc (print_version) Add final newline. + +2002-09-12 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * cygpath.cc (options) New global variable. + (main) Make short options global for easier change. + (print_version) Add a missing newline. + +2002-08-07 Igor Pechtchanski <pechtcha@cs.nyu.edu> + + * regtool.cc (find_key): Add support for custom key separator. + (usage): Document it. + +2002-08-02 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Don't print an entry for "Everyone". + * mkpasswd.c (print_special): Set pw_gid to 544 for SYSTEM user. + (main): Don't print an entry for "Everyone". + +2002-07-06 Christopher Faylor <cgf@redhat.com> + + * configure.in: Check for libiconv.a. + * configure: Regenerate. + * Makefile.in: Add libiconv.a to libraries required for dumper.exe. + +2002-07-06 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Use MINGW stuff from Makefile.common. + +2002-07-01 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Add function pointers for functions from advapi32.dll. + (load_netapi): Load used functions from advapi32.dll. + (main): Use function pointers instead of statically linked functions + from advapi32.dll. + +2002-07-01 Christopher Faylor <cgf@redhat.com> + + * mount.cc (main): Ensure that mount_already_exists() also gets default + flag that is passed to do_mount. + +2002-06-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygpath.cc (long_options): Add "dos" and "mixed", correct "close", + "file" and "type" to use NULL flag. + (usage): Clean up usage output (more), accomodate new options. + (main): Add --dos and --mixed options; accomodate all output forms in + --type. Make UNIXy output default. + +2002-06-18 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygpath.cc (usage): Clean up usage output. + (dowin): Correct output of -t mixed for -ADHPSW options. + +2002-06-14 Corinna Vinschen <corinna@vinschen.de> + + * passwd.c: Rearrange includes to avoid unnecessary warnings. + (GetPW): Add parameter to (dis)allow printing of Windows username. + Use defines instead of numerical constants where possible. + Try avoiding impersonation problem. Rearrange to print Windows + username only if it's different from Cygwin username. + (ChangePW): Use defines instead of numerical constants where possible. + (main): Call GetPW with additional parameter. Change error text. + +2002-06-14 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * passwd.c (GetPW): Handle case of user-edited /etc/passwd + with cygwin_internal (CW_EXTRACT_DOMAIN_AND_USER, ...). + +2002-06-09 Christopher Faylor <cgf@redhat.com> + + * path.cc (cygpath): Change MOUNT_AUTO to MOUNT_CYGDRIVE. + (getmntent): Ditto. + +2002-06-09 Christopher Faylor <cgf@redhat.com> + + * mount.cc (main): Use default system/user flag for cygdrive stuff, + too. + (change_cygdrive_prefix): Change MOUNT_AUTO to MOUNT_CYGDRIVE. + * umount.cc (remove_cygdrive_prefix): Ditto. + (main): Use default system/user flag for cygdrive stuff, too. + +2002-06-08 Christopher Faylor <cgf@redhat.com> + + * mount.cc (opts): Remove '-i' option. + (usage): Ditto. + (main): Ditto. + (longopts): Remove --import-old-mounts option. + +2002-06-07 David Peterson <chief@mail.idrive.com> + Christopher Faylor <cgf@redhat.com> + + * cygpath.cc: Add option to output windows paths in different formats: + "dos" and "mixed". + (main): Process options. + (doit): Check new options flags. + +2002-06-06 Egor Duda <deo@logos-m.ru> + + * regtool.cc (Fail): Be more verbose. + (find_key): Add support for remote registry access. + (usage): Document it. + * utils.sgml: Document it. + +2002-06-06 Christopher Faylor <cgf@redhat.com> + + * strace.cc (main): Make toggle a local variable. + +2002-06-07 Conrad Scott <conrad.scott@dsl.pipex.com> + + * strace.cc (toggle): New global variable. + (error): Use exit instead of ExitProcess so that stdio buffers get + flushed. + (create_child): Remove command line error checking. + (dostrace): Ditto. + (dotoggle): New function. + (usage): Add entry for new option -T|--toggle. Alphabetize. + (longopts): Add new option -T|--toggle. + (opts): Ditto. + (main): Handle new -T|--toggle option. Move all command line checking + here from other functions. + * utils.sgml: Update section for strace. + +2002-06-05 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * strace.cc (version): New global variable. + (usage): Accommodate stdout output. + (print_version): New function. + +2002-06-03 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * ssp.c (version): New global variable. + (longopts): Ditto. + (opts): Ditto. + (run_program): Correct cmd_line typos to cmdline. + (usage): New function. Standardize usage output. Add ssp.txt to + --help output. + (print_version): New function. + (main): Accommodate getopt. + +2002-06-03 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * umount.cc (version): New global variable. + (longopts): Accommodate new --version option. + (opts): Ditto. + (usage): Standardize usage output. + (print_version): New function. + (main): Accommodate --help, --version options. + +2002-06-02 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * regtool.cc (prog_name): New global variable. + (longopts): Ditto. + (opts): Ditto. + (usage): Standardize usage output. Rearrange/add descriptions. + (print_version): New function. + (main): Accommodate longopts and new --help, --version options. Add + check for (_argv[optind+1] == NULL). + +2002-06-02 Christopher Faylor <cgf@redhat.com> + + * strace.cc (forkdebug): Make true by default. + (attach_process): Use window pid if cygwin pid isn't available (yet). + (create_child): Use either DEBUG_ONLY_THIS_PROCESS or DEBUG_PROCESS, + exclusively. (Suggested by Conrad.Scott@dsl.pipex.com) + +2002-05-30 Christopher Faylor <cgf@redhat.com> + + * mkpasswd.cc (main): Don't reset to binmode if stdout is a terminal. + +2002-05-29 Christopher Faylor <cgf@redhat.com> + + * mount.cc (main): Make -b the default. + +2002-05-29 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc (main): Use uid or uid32 member of struct external_pinfo + dependent of the value of the struct's version member. + +2002-05-29 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc (main): Change print format for uid to unsigned. Use uid32 + member of struct external_pinfo instead of uid. + +2002-05-28 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * passwd.c (prog_name): New global variable. + (longopts): Ditto. + (opts): Ditto. + (usage): Standardize output. Accommodate new options. + (print_version): New function. + (main): Accommodate longopts and new --help, --version options. + +2002-05-28 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * ps.cc (usage): Fix typo. + +2002-05-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * ps.cc (prog_name): New global variable. + (longopts): Ditto. + (opts): Ditto. + (usage): New function. + (print_version): New function. + (main): Accommodate longopts and new --help, --version options. + +2002-05-26 Christopher Faylor <cgf@redhat.com> + + * strace.cc (attach_process): Don't tell process to start stracing + here. + (proc_child): Do it here, instead, after first debug event. This + should work around inexplicable races with DebugActiveProcess. + (dostrace): Pass any pid argument to proc_child. + +2002-05-23 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * getfacl.c (usage): Standardize usage output. Change return type to + static void. + (print_version): New function. + (longopts): Added longopts for all options. + (main): Accommodate new help and version options. + +2002-05-22 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * mount.cc (version): New global variable. + (usage): Standardize usage output. Accommodate new version option. + (print_version): New function. + (longopts): Accommodate new version option. + (opts): Ditto. + (main): Ditto. + +2002-05-22 Corinna Vinschen <corinna@vinschen.de> + + * cygpath.cc (usage): Change usage output slightly. + +2002-05-20 Joerg Schaible <joerg.schaible@gmx.de> + + * cygpath.cc (main): Add option l to support conversion to + Windows long file names. Refactured code for capital options. + Support of options from file for capital options. + (dowin): New function. Refactured from main. + (doit): Call long path conversion. + (get_long_name): New function. + (get_long_paths): New function. + (get_long_path_name_w32impl): New function. Reimplementation + of Windows API function GetLongPathName (only 98/Me/2000/XP or + higher). + (get_short_name): Call GetShortPathName only once. + (get_short_paths): Fix calculating buffer size. + * utils.sgml: Update cygpath section for l option. + +2002-05-18 Christopher Faylor <cgf@redhat.com> + + * strace.cc (add_child): Use calloc since new requires working + libstdc++.a. + (remove_child): Ditto for delete/free. + +2002-05-15 Mark Blackburn <marklist@fangorn.ca> + + * cygpath.cc (get_short_paths): Fix more error checking. + (get_short_name): Ditto. + +2002-05-14 Joerg Schaible <joerg.schaible@gmx.de> + + * cygpath.cc (main): Add option H to show the Windows' profiles + directory. Support short names for options DPSW. Clean up + copied code lines. + * utils.sgml: Update cygpath section for H option and s support. + +2002-05-14 Mark Blackburn <marklist@fangorn.ca> + + * cygpath.cc (get_short_paths): Fix error checking. + +2002-05-13 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * kill.cc (prog_name): New global variable. + (usage): Standardize usage output. Add descriptions. + (print_version): New function. + (longopts): Accommodate new version option. + (opts): Ditto. + (main): Ditto. + +2002-05-13 Christopher Faylor <cgf@redhat.com> + + * kill.cc (listsig): Display numeric id when given symbolic input. + +2002-05-13 Christopher Faylor <cgf@redhat.com> + + * kill.cc (usage): Show new options. Allow specification of output + stream. + (main): Implement 'h' option. + +2002-05-13 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (kill.exe): Add as a specific target. + * kill.cc (longopts): New. + (opts): Ditto. + (get_sig): Accept const char * parameter. Return -1 on unknown signal. + (test_for_unknown_sig): New function. + (listsig): New function. + (main): Use getopt_long for option parsing. Implement -l, and -s + options. Use test_for_unknown_sig() to test for signal validity. + + * mount.cc (longopts): Make static. + (opts): Ditto. + +2002-05-12 Christopher Faylor <cgf@redhat.com> + + * mount.cc (do_mount): Default to non-exec option for remote drives. + Report warnings before attempting a mount. + (longopts): Add no-executable option. + (mount_commands): Ditto. + (opts): Ditto. + (usage): Ditto. Indicate that system mount is now the default. + (main): Accommodate no-executable option. Make system mount the + default. + * umount.cc (usage): Indicate that system umount is now the default. + (main): Make system umount the default. + +2002-05-07 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * dumper.cc (usage): Standardize usage output. Generalize to allow use + for help. + (longopts): New struct. Added longopts for all options. + (print_version): New function. + (main): Change getopt to getopt_long. Accommodate new help and version + options. + +2002-03-29 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): Change call to exit() to a return statement. + * mkpasswd.c (main): Ditto. + +2002-03-27 Joshua Daniel Franklin joshuadfranklin@yahoo.com + + * mkpasswd.c (usage): Simplify usage output. Generalize to allow use + for help. Correct '?' typo to 'h'. + (longopts): Add version option. + (opts): Add 'v' version option. + (print_version): New function. + (main): Accommodate new version option. Accommodate usage parameter + changes. + +2002-03-19 Christopher Faylor <cgf@redhat.com> + + * mkgroup.c (usage): Use one just fprintf + string concatenation for + output message. + (print_version): Add void to function type and update copyright. + +2002-03-16 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * mkgroup.c (usage): Simplify usage output. Generalize to allow use + for help. Correct '?' typo to 'h'. + (longopts): Add version option. + (opts): Add 'v' version option. + (print_version): New function. + (main): Accommodate new version option. Accommodate usage parameter + changes. Use usage to output help message. + +2002-03-15 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): When generating group 513, check for computer's + primary domain instead of current user's domain. + +2002-03-14 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c (main): When generating group 513, check for domain SID + if computer name isn't mapped to a SID. + +2001-03-11 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * kill.cc (usage): Move to top of file. + (getsig): Ditto. + (forcekill): Ditto. + +2002-03-06 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc: Reformat. + +2002-03-06 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (longopts): Use correct short option for --version. + +2002-03-06 Christopher Faylor <cgf@redhat.com> + + * cygpath.cc: Reformat. + +2002-02-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygpath.cc (print_version): New function. + (main): Accommodate new version function. Initialize 'o' to prevent + warning. + +2002-02-27 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (main): Eliminate non-GNU formatting glitch. + +2002-02-27 Christopher Faylor <cgf@redhat.com> + + * ssp.c (help_desk): Fix compiler warning. + +2002-02-27 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + Christopher Faylor <cgf@redhat.com> + + Change appropriate globals to statics throughout. + * cygcheck.cc (usage): Simplify usage output. Generalize to allow use + for help. + (longopts): Add version option. + (opts): Add 'V" version option. + (print_version): New function. + (main): Accommodate new version option. Accommodate usage parameter + changes. Use usage to output help message. + +002-02-19 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (CXXFLAGS): Add override so that HAVE_DECL_GETOPT is + defined. + (libbfd): Use -B rather than -L so that bfd from build directory is + correctly found. + (libintl): Ditto. + +2002-02-15 Christopher Faylor <cgf@redhat.com> + + * mount.cc (usage): Fix typo in output. + +2002-02-14 Christopher Faylor <cgf@redhat.com> + + * strace.cc (attach_process): Change CW_STRACE_ON to CW_STRACE_TOGGLE. + +2002-01-31 Corinna Vinschen <corinna@vinschen.de> + + * mkpasswd.c (main): Set default home path for 9x/Me if --path-to-home + isn't given. + +2002-01-30 Corinna Vinschen <corinna@vinschen.de> + + * passwd.cc (ChangePW): Add parameter to differ between called for + checking old password and called for changing password. If called + for checking old password, return non-zero only if password is surely + incorrect. + (main): Call ChangePW() with additional parameter. + +2002-01-29 Christopher Faylor <cgf@redhat.com> + + * dump_setup.cc (parse_filename): Don't consider '_' part of the + version. + +2002-01-28 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc: Fix typo. Remove uid_t kludge. Rely on kludge in + sys/cygwin.h instead. + * getfacl.c: Add include to remove warning. + * mkgroup.c (main): Assign variables outside of parameter passing. + This seems to eliminate some compiler warnings. + +2002-01-28 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc: Use specific cygwin includes, as required. + +2002-01-28 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (MINGW_INCLUDES): Change cygwin include. + * strace.cc: Use specific cygwin includes, as required. + (load_cygwin): New function. Loads cygwin DLL, if necessary. + (attach_process): Attaches strace to a running process. + (dostrace): Accept pid argument. Attach to pid if supplied. + (usage): Describe -p option. Correct system description. + (longopts): Alphabetize. + (opts): Ditto. + (main): Ditto. Handle -p option. + +2002-01-21 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (CXXFLAGS): Ensure that important settings are preserved + even when overriden by command line. + +2002-01-21 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Build intermediate cygcheck.o to force use of MINGW_CXXFLAGS. + * cygcheck.cc (cygwin_info): Intitialize variable to quiet g++ warning. + (dump_sysinfo): Make variables unsigned to quiet g++ warnings. + * strace.cc (version_string): Rename from SCCSid. + (add_child): Remove unused variable. + (version): Use version_string. Avoid use of fprintf. + +2002-01-21 DJ Delorie <dj@redhat.com> + + * Makefile.in: Use CXX instead of CC to compile C++ sources. + +2002-01-17 DJ Delorie <dj@redhat.com> + + * cygcheck.cc (already_did): Avoid default constructors, which may + require exception support. + +2001-01-16 Joshua Daniel Franklin <joshuadfranklin@yahoo.com> + + * cygpath.cc (main): Add options to show Desktop and Start + Menu's Programs directory for current user or all users. + Move bulk of DPWS options outside the getopt case statement. + * utils.sgml: Update cygpath section for ADPWS options. + +2002-01-15 Joerg Schaible <joerg.schaible@gmx.de> + + * cygpath.cc (doit): Empty file ignored using option -i. + +2002-01-15 Mark Bradshaw <bradshaw@crosswalk.com> + + * mkpasswd.c (print_win_error): Add a new function. + (enum_users): Use print_win_error. + (enum_local_groups): Ditto. + (main): Ditto. + +2001-12-26 Jonathan Kamens <jik@curl.com> + + * cygpath.cc (doit): Detect and warn about an empty path. Detect and + warn about errors converting a path. + (main): Set prog_name correctly -- don't leave an extra slash or + backslash at the beginning of it. + +Fri Dec 14 14:04:37 2001 Jason Tishler <jason@tishler.net> + + * mkpasswd.c (enum_users): Change to unconditionally use + the --path-to-home option, if supplied by the user. Use default + --path-to-home option value, if appropriate. + (usage): Change usage statement to reflect new semantics. + (main): Remove defaulting of the --path-to-home option. + +Fri Dec 14 12:10:39 2001 Jason Tishler <jason@tishler.net> + + * mkpasswd.c (opts): Add indication that '-p' option requires an + argument. + +2001-12-11 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Add define to CXXFLAGS. + +2001-12-03 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (usage): Add -c description. + * cygpath.cc (usage): Alphabetize options. + * strace.cc (usage): Ditto. + +2001-11-21 Christopher Faylor <cgf@redhat.com> + + * path.cc (cygpath): Don't consider cygdrive stuff when trying to derive + native paths. + +2001-11-20 Mark Bradshaw <bradshaw@staff.crosswalk.com> + + * mkpasswd.c: include lmerr.h + (main): New -u option to allow specifying a + specific user. If specified, groups aren't displayed and + output is limited to only the specified user. + (enum_users): If specific user is specified, via -u option, + display only that user's record. With -u use NetUserGetInfo + instead of NetUserEnum. + (load_netapi): Added netusergetinfo. + +2001-11-15 Gary R. Van Sickle <g.r.vansickle@worldnet.att.net> + + * strace.cc (main): Change getopt() to getopt_long(). + Add support for help and version info. + Use new parse_mask() function for -m/--mask option. + (longopts): Add long options structure. + (opts): Move options string from getopts call to static var. + (usage): Print usage information. + (SCCSid): Version info. + (version): New function for displaying version info. + (parse_mask): New function supporting parsing of mnemonics, + hex, and basic expressions in masks. + (mnemonic2ul): New mnemonic parsing function. + (tag_mask_mnemonic): New type. + (mnemonic_table): New table of mnemonics for mnemonic2ul() to + search through. + +2001-11-12 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Redefine output format slightly. + Print correct build number on 9x/ME systems. + +2001-11-12 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (main): Slight formatting tweak. + +2001-11-12 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Add some more details. + +2001-11-12 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Print more detailed OS information string + using OSVERSIONINFOEX information. + +2001-11-11 Christopher Faylor <cgf@redhat.com> + + * path.h: New file. + +2001-11-11 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (scan_registry): Open registry with read-only access. + (main): Reflect argument change for dump_setup. + * dump_setup.cc (dump_setup): Add preliminary extra argument for future + use. + * path.cc (read_mounts): Open registry with read-only access. + +2001-11-11 Christopher Faylor <cgf@redhat.com> + + * cygcheck.cc (main): Display package info when '-s' is specified. + * dump_setup.cc (dump_setup): Change header. Remove typo. Always sort + packages output. + +2001-11-11 Christopher Faylor <cgf@redhat.com> + + * dump_setup.cc: New file. + * Makefile.in: Add info for dump_setup.o. + * cygcheck.cc (main): Recognize '-c' option for checking setup + installed base. + * path.cc (cygpath): Read mount table if not loaded. + +2001-11-10 Christopher Faylor <cgf@redhat.com> + + * Makefile.in (cygcheck.exe): Compile as -mno-cygwin executable. + * path.cc: New file. + * cygcheck.cc (init_paths): Use MS-DOS path syntax. + (cygwin_info): Properly display cygwin version numbers. Prettify some + output. + (dump_sysinfo): Calculate max names of posix and ms-dos paths for + prettier output. + +2001-11-09 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dump_sysinfo): Print more detailed OS information string. + +2001-11-04 Corinna Vinschen <corinna@vinschen.de> + + * getfacl.c (username): New function. + (groupname): Ditto. + (usage): Ditto. Add more user friendly help text. + (main): Add -n and --help option. Print names instead of IDs + unless -n option is given. + * setfacl.c (getperm): Tolerate whitespace and comment chars in input. + (getaclentry): Fix several input string misdetections. + (getaclentries): Allow - as input file name to read from stdin. + Tolerate whitespace and comment chars in input. + (usage): Add more user friendly help text. + (main): Add --help option. + +2001-11-04 Egor Duda <deo@logos-m.ru> + + * strace.cc (main): New option '-w'. Start traced process in separate + window. New option '-S x'. Flush buffered output every x seconds. + (create_child): Start child process in new window, when requested. + When requested, periodically flush debugging output. + +2001-10-24 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Remove EXEEXT consideration. We always need .exe + extensions. + +2001-10-20 Corinna Vinschen <corinna@vinschen.de> + + * mkgroup.c: Avoid compiler warnings. + (print_special): New function. + (main): Print special accounts by calling print_special(). + * mkpasswd.c: Avoid compiler warnings. + (enum_users): Print additional U-domain\username info in gecos + field when SIDs are printed. + (print_special): New function. + (main): Print special accounts by calling print_special(). + +2001-10-15 Christopher Faylor <cgf@redhat.com> + + * mkpasswd.cc (enum_users): Shorten "unused" passwd field. + +2001-10-13 Christopher Faylor <cgf@redhat.com> + + * Makefile.in: Allow stdinc searching for dumper. + +Tue Oct 9 21:59:00 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (MINGW_INCLUDES): Accommodate changes in Makefile.common. + +Sun Oct 7 23:06:39 2001 Christopher Faylor <cgf@cygnus.com> + + * kill.cc (main): Set exit value to 1 on invalid pid. Perform minor + cleanup. + +Fri Sep 21 20:40:30 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (mingw_getopt.o): Ensure that newlib include directories + are not searched. + +Thu Sep 20 21:00:20 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (MINGW_INCLUDES): Still need cygwin/include directory. + +Wed Sep 19 12:22:08 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Filter newlib includes from mingw compilation. + +2001-09-14 Egor Duda <deo@logos-m.ru> + + * dumper.cc (dumper::dumper): Print error code in case of error. + (dumper::add_thread): Ditto. + (dumper::collect_memory_sections): Ditto. + (dumper::dump_memory_region): Ditto. + (dumper::collect_process_information): Ditto. + (print_section_name): Fix formatting. + +2001-09-13 Egor Duda <deo@logos-m.ru> + + * dumper.cc (main): Properly recognize negative pids (used by w9x). + +2001-09-09 Egor Duda <deo@logos-m.ru> + + * dumper.cc (main): Change command-line arguments format to be + similar to gdb. Allow adding error_start=x:\path\to\dumper.exe to + CYGWIN environment variable to perform core dumping in case of + program crash. + (usage): Ditto. + +Wed Sep 5 22:37:21 2001 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (dumper): Change logic for libbfd and libintl so that + they will be found either in the build tree or the installed directory. + * mkpasswd.c (enum_users): Add a comment as a password for NT. + +2001-09-03 Michael A Chase <mchase@ix.netcom.com> + + * mount.cc (mount_commands): Don't write /cygdrive/u mount points. + +2001-09-03 Michael A Chase <mchase@ix.netcom.com> + + * mount.cc (longopts): Add mount-commands to options list. + (usage): Add mount-commands option. + (mount_commands): New function. Write commands to recreate current + mounts. + +Sat Sep 1 15:58:11 2001 Christopher Faylor <cgf@cygnus.com> + + * mount.cc (main): Eliminate excess arguments in printf. + +2001-08-30 Egor Duda <deo@logos-m.ru> + + * dumper.h: Update copyright notice. + * dumper.cc: Ditto. + * dumper.cc: (dumper::print_core_section_list): New function. + * dumper.h: (dumper::print_core_section_list): Declare it. + * dumper.cc (print_section_name): New function. + (dumper::collect_process_information): Augment debugging output. + Stop debugee processing if it posts double exception. + (usage): Fix typo in option name. + +Tue Aug 28 14:45:02 2001 Christopher Faylor <cgf@cygnus.com> + + * mount.cc (main): Issue correct warning for 'not enough arguments'. + +2001-08-14 Joerg Schaible <joerg.schaible@gmx.de> + + * cygpath.cc (main): Support -w for Windows (System) directories and + return physical correct orthography for the Windows System dir. + +2001-07-14 Chris Genly <chgenly@alum.mit.edu> + + * regtool.cc (find_key): Handle keys with only one subkey. + +Wed Jun 27 22:46:10 2001 Christopher Faylor <cgf@cygnus.com> + + * regtool.cc (find_key): Revert previous change. + +Wed Jun 27 13:37:41 2001 Keith Starsmeare" <keith_starsmeare@yahoo.co.uk> + + * regtool.cc (find_key): Allow '/' as a synonym for '\\'. + +Fri Jun 15 00:49:21 2001 Christopher Faylor <cgf@cygnus.com> + + * mkpasswd.c (main): Output passwd file in binary mode so that there + are no CRs in the file. + * umount.cc (remove_all_user_mounts): Don't try to remove /cygdrive + mounts. + +Tue May 1 10:50:48 2001 Christopher Faylor <cgf@cygnus.com> + + * mkpasswd.c (enum_users): Use /bin/bash as the default shell. + (main): Ditto. + +Sat Apr 28 22:32:01 2001 Christopher Faylor <cgf@cygnus.com> + + * passwd.cc (ttymnam): New function. + (main): Use ttynam() to report name of tty. + +2001-04-19 Egor Duda <deo@logos-m.ru> + + * dumper.cc (dumper::init_core_dump): Set architecture field in dump + header. + +Mon Apr 16 15:08:00 2001 Corinna Vinschen <vinschen@redhat.com> + + * mkgroup.c: Add function pointers `netlocalgroupgetmembers' and + `netgroupgetusers'. + (load_netapi): Load function pointers `netlocalgroupgetmembers' + and `netgroupgetusers'. + (enum_local_users): New function. + (enum_local_groups): Call `enum_local_users' for each group if + `print_users' is set. + (enum_users): New function. + (enum_groups): Call `enum_users' for each group if `print_users' is set. + (usage): Add usage text for `-u/--users'. + (longopts): Add option `--users'. + (opts): Add option character `u'. + (main): Set `print_users' according to option `-u/--users'. + Call `enum_local_groups' and `enum_groups' with additional parameter + `print_users'. + +2001-04-15 Michael A Chase <mchase@ix.netcom.com> + + * mount.cc (longopts): Add help to options list. + (opts): Add 'h' to options string. + * umount.cc (longopts): Add help to options list. + (opts): Add 'h' to options string and change 'R' to 'A'. + +2001-04-13 Kazuhiro Fujieda <fujieda@jaist.ac.jp> + + * mkgroup.c (enum_groups): Use RID + offset specified an additional + argument as ID. + (usage): Add description of -o option. + (longopts, opts): Add specifications of -o/--id-offset option. + (main): Add -o option. Invoke enum_groups with specified offset. + * mkpasswd.c (enum_users): Just like mkgroup.c. + (usage, longopts, opts): Ditto. + (main): Add -o option. Invoke enum_users with specified offset only + against domain accounts. + +2001-04-11 Egor Duda <deo@logos-m.ru> + + * mkgroup.c (uni2ansi): Use native method to convert from Unicode + to multi-byte strings. + * mkpasswd.c (uni2ansi): Ditto. + (enum_users): Pass buffer size when converting string. + (enum_local_groups): Ditto. + * mkgroup.c (enum_groups): Ditto. + (enum_local_groups): Ditto. + +Mon Apr 2 22:41:33 2001 Christopher Faylor <cgf@cygnus.com> + + * mount.cc (main): Use getopt_long for parsing arguments. + (usage): Reformat, show long and short options. + * umount.cc (main): Ditto, all of the above. + +Mon Apr 2 10:58:26 2001 Christopher Faylor <cgf@cygnus.com> + + * mount.cc (show_mounts): Change format string to more closely resemble + UNIX when displaying mount table. + +Sat Mar 17 21:46:06 2001 Christopher Faylor <cgf@cygnus.com> + + * kill.cc (forcekill): Use dwProcessId when opening a process, not the + Cygwin pid. + +Mon Mar 5 18:50:00 2001 Corinna Vinschen <vinschen@redhat.com> + + * getfacl.c: Add copyright hint. + * setfacl.c: Ditto. + * strace.cc: Ditto. + +Tue Jan 09 10:26:23 2001 Tony Sideris <tonys1110@home.com> + + * regtool.cc (cmd_list): Add new registry display options. + (cmd_list): Add code to implement -p, -k, and -l options. + + * regtool.cc (Fail): Add call to LocalFree to free memory allocated by + FormatMessage. + +Wed Jan 10 09:16:57 2001 Christopher Faylor <cgf@cygnus.com> + + * regtool.cc (translate): Ensure that 'c' is initialized. + (cmd_set): Ditto for rv. diff --git a/winsup/CVSChangeLogs.old/utils/ChangeLog.64bit b/winsup/CVSChangeLogs.old/utils/ChangeLog.64bit new file mode 100644 index 000000000..69c235672 --- /dev/null +++ b/winsup/CVSChangeLogs.old/utils/ChangeLog.64bit @@ -0,0 +1,85 @@ +2013-03-28 Peter Rosin <peda@lysator.liu.se> + Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dll_info): Fix crash due to sizeof(time_t) being not + equal to sizeof(int). Output timestamp RFC 3339 compatible. + +2013-03-26 Corinna Vinschen <corinna@vinschen.de> + + * tzset.c (main): Don't try to overwrite space with NUL. Explain why. + Rather, just print the string with computed precision value. + +2013-03-22 Corinna Vinschen <corinna@vinschen.de> + + * kill.cc (main): Chack pid against INT_MIN and (U)INT_MAX since pid_t + is 4 byte on all platforms. + * mkgroup.c (main): Check domlist[i].id_offset against UINT_MAX since + DWORD is 4 byte on all platforms. + * mkpasswd.c (main): Ditto. + +2013-02-19 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc (dll_info): Handle x86_64 binaries. Make sure to print + only architecture matching cygcheck build, otherwise suffer path + evaluation problems. + +2013-02-17 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> + + Fix 64-bit type problems in dumper.exe + * dumper.cc: Througout, cast pid to unsigned int, change addresses + and sizes from DWORD to SIZE_T, and use %p for pointer addresses. + (dumper::add_mem_region): Change size type to SIZE_T. + (dumper::split_add_mem_region): Ditto. + * dumper.h (struct process_mem_region): Change size type to SIZE_T. + (class exclusion): Change last, size, and step types to size_t. + (exclusion::exclusion): Change argument type to size_t. + (exclusion::add): Change mem_size type to SIZE_T. + (dumper::add_mem_region): Change size type to SIZE_T. + (dumper::split_add_mem_region): Ditto. + (psapi_get_module_name): Change BaseAddress type to LPVOID. + * module_info.cc (psapi_get_module_name): Ditto. + * parse_pe.cc: Througout, change addresses and sizes from DWORD to + SIZE_T, and use %p for pointer addresses. + (exclusion::add): Change mem_size type to SIZE_T. + +2013-02-13 Corinna Vinschen <corinna@vinschen.de> + + * kill.cc (forcekill): Use unsigned int printf format specifier and + cast to avoid compiler warnings where DWORD value is used. + * regtool.cc: Ditto, throughout. + +2013-02-06 Corinna Vinschen <corinna@vinschen.de> + + * ldd.cc: Drop including inttypes.h. Use %u rather than PRIu32. + * mount.cc: Fix type problem with %* expression. + * cygcheck.cc: Ditto. + +2013-02-06 Corinna Vinschen <corinna@vinschen.de> + + Throughout, fix type problems on 32 and 64 bit. Except: + * ssp.c: Disable entire functionality on x86_64 for now. + +2012-11-22 Corinna Vinschen <corinna@vinschen.de> + + * dump_setup.cc: Drop temporary workaround to handle older Mingw header + files on Fedora 17. + * strace.cc: Ditto. + +2012-08-16 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc (main): Define uid correctly as uid_t. + +2012-08-16 Corinna Vinschen <corinna@vinschen.de> + + * cygcheck.cc: Change include path to not depend on installed + cygwin/version.h. + (_NOMNTENT_MACROS): Define before including mntent.h. + * path.cc (_NOMNTENT_MACROS): Ditto. + * dump_setup.cc: Add temporary workaround to handle older Mingw header + files on Fedora 17. + * strace.cc: Ditto. + +2012-08-13 Corinna Vinschen <corinna@vinschen.de> + + * ps.cc (main): Drop unneeded cast. + |