Commit Graph

14555 Commits

Author SHA1 Message Date
Christopher Faylor a8344a0181 Doh. Check in missing file from previous submission. 2012-07-29 21:44:03 +00:00
Christopher Faylor dd06381996 * cygtls.cc (_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 21:43:29 +00:00
Christopher Faylor ab6596266f Add missing file from last checkin. 2012-07-29 21:42:10 +00:00
Earnie Boyd c5b9032e48 * include/sdkddkver.h: New file.
* include/windows.h: Include sdkddkver.h.
2012-07-29 20:52:41 +00:00
Christopher Faylor 7ea2ecec23 * 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-29 19:18:05 +00:00
Corinna Vinschen a2b7f56971 * include/inttypes.h: Add x86_64 target considerations throughout.
Define macros in C++ according to C99 requirements.
	* include/stdint.h: Ditto.
2012-07-28 14:21:34 +00:00
Nick Clifton 7ae7345dd6 Fix attributation of PR 13135 patch. 2012-07-26 14:05:37 +00:00
Christopher Faylor 8f748bdaca * signal.cc (clock_nanosleep): Force return on signal rather than letting
cancelable_wait loop on signal.
2012-07-25 22:21:17 +00:00
Corinna Vinschen a654829ade * 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-25 12:32:37 +00:00
Corinna Vinschen 67d71dbf10 * 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-24 13:56:14 +00:00
Nick Clifton 5f3eab86a6 PR binutils/13135
* arm-dis.c: Add necessary casts for printing integer values.
	Use %s when printing string values.
	* hppa-dis.c: Likewise.
	* m68k-dis.c: Likewise.
	* microblaze-dis.c: Likewise.
	* mips-dis.c: Likewise.
	* ppc-dis.c: Likewise.
	* sparc-dis.c: Likewise.

	* dis-asm.h (fprintf_ftype): Add ATTRIBUTE_FPTR_PRINTF_2.
2012-07-24 12:56:47 +00:00
Christopher Faylor 44aa2292b7 Change "set_thread_waiting" to "set_signal_arrived" throughout. 2012-07-23 04:36:48 +00:00
Christopher Faylor 962f9a2ccc * 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 22:58:20 +00:00
Christopher Faylor b8a84b73d7 * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 17. 2012-07-21 17:13:42 +00:00
Eric Blake 0cf8865cf0 readdir: drop bogus code
* libc/posix/readdir.c (readdir): Drop bogus attempt to catch
bogus pointers.
2012-07-20 16:55:19 +00:00
Corinna Vinschen f20f7e36ad Forced checkin to fix date 2012-07-20 09:45:34 +00:00
Corinna Vinschen 1692ae3a30 * 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-20 09:23:44 +00:00
Corinna Vinschen 847a5f899b * woutsup.h: Just include winlean.h. 2012-07-19 17:56:46 +00:00
Corinna Vinschen 7cad0dc664 *** empty log message *** 2012-07-19 09:43:56 +00:00
Yaakov Selkowitz 90c352ad77 * mount.cc (getmntent_r): Remove unused but set variable. 2012-07-19 09:04:02 +00:00
Ralf Corsepius f9a0f9ad5f 2012-07-18 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/sys/rtems/machine/_types.h (_ssize_t): Use signed int for
	__v850__, __851__.
2012-07-18 15:22:45 +00:00
Yaakov Selkowitz fe05ac4f14 * new-features.sgml (ov-new1.7.16): Document getmntent_r. 2012-07-18 11:23:11 +00:00
Corinna Vinschen 010f7350ba * 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-18 11:17:25 +00:00
Yaakov Selkowitz 03b7882aa0 * faq-programming.xml (faq.programming.unix-gui): Update to
reflect the availability of X11 toolkits on Cygwin.
2012-07-18 02:11:04 +00:00
Ralf Corsepius 392c090c7e 2012-07-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/search/hcreate_r.c (hdestroy_r): #ifdef 0 unused vars ie, idx.
2012-07-17 16:56:45 +00:00
Ralf Corsepius 1acc80f5d2 2012-07-16 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/posix/telldir.c: Conditionally build dd_hash_lock.
2012-07-16 17:03:50 +00:00
Doug Evans 2fca7fa911 include/
* filenames.h: #include "hashtab.h".
	(filename_hash, filename_eq): Declare.
	libiberty/
	* filename_cmp.c (filename_hash, filename_eq): New functions.
2012-07-13 23:39:46 +00:00
Andreas Krebbel 5e99c15672 2012-07-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* elf64-s390.c: Include elf-s390-common.c.
	(R_390_IRELATIVE): New reloc.
	(elf_s390_reloc_type_lookup): Support R_390_IRELATIVE.
	(RELA_ENTRY_SIZE): New macro.
	(elf_s390_link_hash_entry): New fields ifunc_resolver_address and
	*ifunc_resolver_section.
	(struct plt_entry): New struct.
	(struct elf_s390_obj_tdata): New field local_plt.
	(elf_s390_local_plt): New macro.
	(struct elf_s390_link_hash_table): New field irelifunc.
	(ELF64): New macro.
	(link_hash_newfunc): Initialize new fields.
	(elf_s390_check_relocs): Handle IFUNC symbols.
	(elf_s390_adjust_dynamic_symbol): Don't do anything for IFUNC
	symbols.
	(allocate_dynrelocs): Call s390_elf_allocate_ifunc_dyn_relocs for
	IFUNC symbols.
	(elf_s390_size_dynamic_sections): Handle IFUNC symbols.
	(elf_s390_relocate_section): Likewise.
	(elf_s390_finish_dynamic_symbol): Likewise.
	(elf_s390_finish_dynamic_sections): Handle local IFUNC symbols.
	(elf_s390_finish_ifunc_symbol): New function.
	(elf_s390_gc_sweep_hook): Handle local plt entries.
	(elf_backend_add_symbol_hook): Define.
	* elf32-s390.c: See elf64-s390.c changes.
	* elf-s390-common.c: New file.
	* bfd-in2.h (BFD_RELOC_390_IRELATIVE): New enum field.
	* libbfd.h (BFD_RELOC_390_IRELATIVE): New entry for
	BFD_RELOC_390_IRELATIVE.
	* reloc.c (BFD_RELOC_390_IRELATIVE): Document new relocation.

2012-07-13  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* elf/s390.h (START_RELOC_NUMBERS): Define R_390_IRELATIVE reloc.

2012-07-13  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* emulparams/elf_s390.sh (IREL_IN_PLT): Define.
	* emulparams/elf64_s390.sh (IREL_IN_PLT): Define.
2012-07-13 15:47:25 +00:00
Ralf Corsepius d2f675622f 2012-07-13 Ralf Corsépius <ralf.corsepius@rtems.org>
* libc/sys/rtems/machine/_types.h (_ssize_t): Add __ARM_EABI__,
	__v850__, __851__.
2012-07-13 09:21:45 +00:00
Corinna Vinschen 52970c1fa5 Fix copy-paste error 2012-07-13 07:57:14 +00:00
Corinna Vinschen 6902b88b0b * 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.

	Fix previous ChangeLog entry.
2012-07-12 11:27:28 +00:00
Corinna Vinschen 568e72f561 * pseudo-reloc.cc: Drop including wchar.h.
(__report_error): Define module as WCHAR.
	* advapi.cc: Drop including wchar.h.
	* kernel32.cc: Ditto.
2012-07-12 10:33:54 +00:00
Corinna Vinschen 6e1e3bb8e5 * 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-11 16:41:51 +00:00
Corinna Vinschen 4a4f6f949c * cygtls.cc (well_known_dlls): Add ole32.dll and wbemprox.dll. 2012-07-11 09:21:36 +00:00
Corinna Vinschen 6930762ffa * cygwin.sc (.rdata): Revert patch from 2012-07-06. 2012-07-09 14:55:02 +00:00
Corinna Vinschen 7c4626ed08 * 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 12:57:03 +00:00
Corinna Vinschen 821c8b9aac * libc/stdio/fileno.c (fileno): Check if f is a valid stream. If not,
return -1 and set errno to EBADF per POSIX.
2012-07-09 12:13:16 +00:00
Corinna Vinschen c416f16d44 * Makefile.in, configure.in, mkvers.sh: Revert accidental checkin from
2012-07-06.
2012-07-09 09:00:56 +00:00
Christopher Faylor a9cd97c8e2 * Makefile.in: Change mingw_lib (temporarily?) back to w32api_lib. 2012-07-08 00:51:45 +00:00
Corinna Vinschen 9cfc9511cd * 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-07-06 14:52:33 +00:00
Corinna Vinschen 3eedbf8611 * winlean.h (__STRALIGN_H_): Drop definition. 2012-07-06 14:44:13 +00:00
Maciej W. Rozycki e75fa972ac * mips.h: Fix a typo in description. 2012-07-06 14:20:22 +00:00
Corinna Vinschen 44fb3af98a * fhandler_procnet.cc: Fix copyright.
* syslog.cc: Ditto.
	* libc/minires-os-if.c: Ditto.
	* libc/minires.h: Ditto.
2012-07-06 13:56:37 +00:00
Corinna Vinschen acddda4bf9 Add files missing in previous checkin 2012-07-06 13:53:23 +00:00
Corinna Vinschen db80f635c1 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 13:52:19 +00:00
Corinna Vinschen dc45bfa0bf * include/winsock.h: Keep IP_OPTIONS and SO_xxx definitions when
building Cygwin.
	* include/winsock2.h: Keep sockaddr and sockaddr_storage definitions
	when building Cygwin.
2012-07-06 13:52:10 +00:00
Corinna Vinschen f3a43e7ef0 * winbase.h: Throughout use LONG rather than long type to prepare for
64 bit.
	(InterlockedCompareExchangePointer): Define.
2012-07-06 13:51:26 +00:00
Corinna Vinschen 6f94526c1c * 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 13:49:53 +00:00
Corinna Vinschen 261c701bf3 * 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 13:43:05 +00:00
Corinna Vinschen a02924944e * winsup.h (_WIN32_WINNT): Define. Explain why. 2012-07-06 12:13:50 +00:00