Jeff Johnston [Thu, 17 Mar 2005 20:11:23 +0000 (20:11 +0000)]
2005-03-17 Jeff Johnston <jjohnstn@redhat.com>
* configure.in: Add new check to see if compiler supports
aliasing of arrays and define _HAVE_ARRAY_ALIASING if true.
* configure: Regenerated.
* Makefile.in: Ditto.
* newlib.hin: Add _HAVE_ARRAY_ALIASING.
* libc/ctype/ctype_.c: Check for _HAVE_ARRAY_ALIASING before
aliasing the _ctype_ array to _ctype_b.
* libc/include/ctype.h: Change macros to use __ctype_ptr. Mark
_ctype_ as deprecated.
Corinna Vinschen [Thu, 17 Mar 2005 11:56:30 +0000 (11:56 +0000)]
* 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.
* 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.
* 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.
* 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.
* 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.
Corinna Vinschen [Thu, 10 Mar 2005 17:02:52 +0000 (17:02 +0000)]
* 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:.
* autoload.cc (LoadDLLprime): Use nocopy segment or forked processes will not
initialize properly.
* autoload.cc (LoadDLLprime): Scrap use of .linkonce and just use an
* 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.
* 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.
* 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.
* 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.
* path.cc (mount_info::read_cygdrive_info_from_registry): Use the user prefix
if it exists.
* 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.
* libc/include/machine/_types.h: New file.
* libc/include/sys/types.h: Do not check for __rtems__
when including <machine/_types.h>. Remove some redundant
declarations now that <machine/_types.h> is included.
* libc/sys/rtems/machine/_types.h: Removed. Replaced with
shared header file.
* 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.
* 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.
* autoload.cc (std_dll_init): Save and restore fpu control register around
LoadAddress to prevent loaded dlls (like msvcrt.dll) from setting unwanted
stuff.
* 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.
Merged from libada-gnattools-branch:
2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
* Makefile.def: Add gnattools as a module, depending on target-libada.
* Makefile.in: Regenerate.
* configure.in: Include gnattools in host_tools; disable it if ada
is disabled.
* configure: Regenerate.
config:
2005-02-28 Paolo Bonzini <bonzini@gnu.org>
PR bootstrap/17383
* acx.m4 (GCC_TOPLEV_SUBDIRS): Set HOST_SUBDIR if an in-src
gcc build is going.
Corinna Vinschen [Mon, 28 Feb 2005 13:11:50 +0000 (13:11 +0000)]
* 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.
* 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.
* 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.
Jeff Johnston [Fri, 25 Feb 2005 22:31:21 +0000 (22:31 +0000)]
2005-02-25 Eric Blake <ebb9@byu.net>
* libc/include/time.h (__tzrule_struct): Make offset long, since
a 16-bit int overflows on a 12-hour offset.
* libc/sys/linux/include/time.h: Ditto.
* libc/time/mktime.c (mktime): Use new type of __tzrule.offset.
* libc/time/mktm_r.c: Ditto.
* libc/time/gettzinfo.c: Ditto.
* libc/time/strftime.c (strftime): Fix '%x' to deal with negative
years. Fix '%z' to use long, not int.
Corinna Vinschen [Fri, 25 Feb 2005 21:23:15 +0000 (21:23 +0000)]
* 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):
Accomodate 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): Accomodate 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): Accomodate new parameters when calling
fhandler's fixup_mmaps_after_fork function.
* ntdll.h (AT_ROUND_TO_PAGE): New define.
Corinna Vinschen [Fri, 25 Feb 2005 11:15:22 +0000 (11:15 +0000)]
* 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 MAP_FIXED case.
* libc/include/sys/types.h [__rtems__]: Include new
header file machine/_types.h.
* libc/include/machine/types.h: Ditto.
* libc/sys/rtems/machine/_types.h: New file.
Corinna Vinschen [Wed, 23 Feb 2005 22:17:28 +0000 (22:17 +0000)]
* localtime.cc: Implement setting __tzrule's offset member using
newlib's __gettzinfo () interface.
(__tzrule): Remove.
(timezone): Define as long according to POSIX.
Jeff Johnston [Wed, 23 Feb 2005 19:08:58 +0000 (19:08 +0000)]
2005-02-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/time.h [!CYGWIN](_timezone): Change to long.
(__tzrule_type, __tzinfo_type): New types.
(__gettzinfo): New function.
* libc/sys/linux/include/time.h: Ditto.
* libc/time/Makefile.am: Add gettzinfo.c.
* libc/time/Makefile.in: Regenerated.
* libc/time/local.h: Moved __tzrule_type to time.h.
* libc/time/mktime.c: Call __gettzinfo to reference
__tznorth, __tzyear, and __tzrule array.
* libc/time/mktm_r.c: Ditto.
* libc/time/strftime.c: Ditto.
* libc/time/tzset_r.c: Ditto. Also remove definition
of __tzrule which is now in gettzinfo.c. Change _timezone
references to not cast to time_t.
* libc/time/gettzinfo.c: New file.