(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.
(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.
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.
* syscalls.cc (rename): Check for cross-device situation before
touching anything. Explain why. Workaround NFS bug in call to
NtSetInformationFile(FileRenameInformation).
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.
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.
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.
* 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.
* 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.
(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 NULL since, in
this context, it is a number, not a pointer.
(pthread_spinlock::unlock): Ditto.
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.
* _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.
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.
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-11-23 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Use explicit path to mkdir.
lsaauth/ChangeLog:
2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Use /bin/mkdir to make directories.
testsuite/ChangeLog:
2012-11-23 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Remove old Makefile.common'isms. Don't rely on
in-build tools.
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.
cygserver/ChangeLog:
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.
cygwin/ChangeLog:
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.
utils/ChangeLog:
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.
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.
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.
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'.
* 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.
read-ahead buffer for reading Windows clipboard if caller's
buffer is too small for complete characters.
* include/limits.h: Remove outdated TODO comment.
* 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.
(_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.
* 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.
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.
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.
problem.
* cygwin/winlean.h: Define constant which will be needed eventually. Remove
hack in favor of another hack.
* cygwin/lib/crt0.h: Use "winlean.h".
* 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.
* 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.
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.
(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.
* 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.
Add comment to explain why.
* winsup.h: Include winlean.h from C sources as well.
* libc/minires-os-if.c: Drop including ntdef.h.
Fix previous ChangeLog entry.
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.
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.
* 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.
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.
* 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.
* 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.
(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.
(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.
* 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.
* 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.
* 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.
* 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 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.