Commit Graph

9654 Commits

Author SHA1 Message Date
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
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 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
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
Corinna Vinschen 862de2d0ae * libc/rcmd.cc: Don't undef __INSIDE_CYGWIN_NET__. 2012-07-06 12:05:19 +00:00
Corinna Vinschen da36286e64 * 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-06 10:44:38 +00:00
Corinna Vinschen 0390476c47 * Makefile.common (ALL_CFLAGS): Change := to = to allow overriding in
dependent Makefiles.
2012-07-06 10:32:11 +00:00
Christopher Faylor ea51d3d425 * dcrt0.cc (build_argv): Guard against NULL pointer dereference found by Clang. 2012-07-04 17:30:55 +00:00
Christopher Faylor 85b2b14e7a * exceptions.cc (setup_handler): Remove unneeded assignment found by Clang. 2012-07-04 06:06:54 +00:00
Christopher Faylor 226133e80c * hookapi.cc (find_first_notloaded_dll): Remove unused assignment of
importRVASize found by Clang.
2012-07-04 06:04:16 +00:00
Christopher Faylor 0bdf68577d * fhandler_tty.cc (fhandler_pty_slave::read): Remove duplicate assignment to
bytes_in_pipe found by Clang.
2012-07-04 06:01:16 +00:00
Christopher Faylor aa01a03c10 fix typo 2012-07-04 02:26:52 +00:00
Christopher Faylor 51e4c3d44c * exceptions.cc (exception::handle): Use error_code in klog, as intended.
Found by Clang.
2012-07-03 05:31:11 +00:00
Corinna Vinschen 8fd8f9e72b * 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 20:17:27 +00:00
Christopher Faylor ceec584ad3 * fhandler_virtual.cc (fhandler_virtual::opendir): Eliminate duplicate
assignment found by Clang.
2012-07-02 20:01:19 +00:00
Christopher Faylor e82360f659 * fhandler_registry.cc (fhandler_registry::open): Handle missing EROFS error
condition pointed to by Clang.
2012-07-02 20:00:22 +00:00
Christopher Faylor e9d7f5b3a9 * pinfo.cc (_pinfo::commune_request): Eliminate unneeded assignment found by
Clang.
2012-07-02 19:55:51 +00:00
Christopher Faylor fb348d22af * external.cc (fillout_pinfo): Return NULL rather than 0.
(exit_process): Guard against NULL pointer dereference found by Clang.
2012-07-02 19:48:33 +00:00
Christopher Faylor e14a5a7efa * mount.cc (mount_info::conv_to_win32_path): Eliminate unneeded assignment
found by CLANG.
* path.cc (symlink_info::check): Remove unneeded/unused variable found by
CLANG.
2012-07-02 19:42:34 +00:00
Christopher Faylor fade1f2e21 * path.cc (symlink_info::check): Remove unneeded/unused variable. 2012-07-02 19:38:41 +00:00
Corinna Vinschen 26e603454f * dll_init.cc (dll_list::alloc): Take long UNC paths into account. 2012-07-02 14:14:01 +00:00
Christopher Faylor 1809b65e23 * 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-02 02:24:25 +00:00
Christopher Faylor c4441d46b6 * path.cc: Perform some whitespace fixups throughout. 2012-07-02 00:40:06 +00:00
Corinna Vinschen ca4d966d1b * kernel32.cc (_KERNEL32_): Define. Explain why.
(CreateFileMappingW): Drop undocumented flProtect flags.
2012-06-28 20:06:23 +00:00
Corinna Vinschen ca7f6a04b3 * 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 19:25:22 +00:00
Corinna Vinschen 06e429fd6d * 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-28 14:06:06 +00:00
Christopher Faylor b052bf2671 * 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 21:42:11 +00:00
Corinna Vinschen c60437258a * 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 16:24:54 +00:00
Corinna Vinschen 165f575341 * miscfuncs.cc (WritePipeOverlapped): Define second parameter LPCVOID,
rather than PCVOID.
	* miscfuncs.h (WritePipeOverlapped): Ditto.
2012-06-27 13:35:48 +00:00
Corinna Vinschen 25f3ea84f8 * 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-27 13:19:11 +00:00
Corinna Vinschen a90b8a20ed * winsup.h (GetLastError): Drop redundant definition. 2012-06-26 16:36:00 +00:00
Christopher Faylor 8bec43b39b fix typo 2012-06-26 05:23:10 +00:00
Christopher Faylor 6ec05d23b3 * cygwait.cc (cancelable_wait): Make sure that timer is cancelled before
cancelling thread.
2012-06-25 16:28:50 +00:00
Christopher Faylor d6953d3f7d * cygwait.h (cancelable_wait): Need to force time to negative to indicate
relative time.
2012-06-25 05:00:39 +00:00
Corinna Vinschen 970790c681 * path.cc (realpath): Fix comment. 2012-06-22 09:51:29 +00:00
Corinna Vinschen 797ff24dfb * 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-21 09:33:19 +00:00
Christopher Faylor 978441cc0e * 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-19 00:52:59 +00:00
Christopher Faylor 2addde8cb1 Revert errneous checkin.
Check in actual change associated with ChangeLog.
2012-06-19 00:38:02 +00:00
Christopher Faylor af5cd14583 * 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-19 00:31:15 +00:00
Corinna Vinschen 099817c3db * 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-18 20:17:15 +00:00
Christopher Faylor 4ae6378382 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-17 20:50:24 +00:00
Yaakov Selkowitz 933ee0ecbf Fix last ChangeLog entry. 2012-06-12 18:34:38 +00:00
Yaakov Selkowitz 3e5a48af5e * regex/regcomp.c (p_ere): Allow vertical-line following
left-parenthesis in ERE, as in glibc.
2012-06-11 22:15:27 +00:00
Yaakov Selkowitz 53943a2e87 * include/sys/elf_common.h (R_386_16): Define.
(R_386_PC16): Define.
	(R_386_8): Define.
	(R_386_PC8): Define.
2012-06-10 18:28:16 +00:00
Christopher Faylor abf1b60039 * 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-10 01:57:53 +00:00
Yaakov Selkowitz f513e3a206 * 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-06 04:45:48 +00:00
Corinna Vinschen cd69beda67 * fhandler_disk_file.cc (fhandler_disk_file::link ): Translate
STATUS_NOT_SUPPORTED to EPERM as well.
2012-06-04 08:49:13 +00:00
Christopher Faylor b9c61a8d7b * 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-04 01:26:05 +00:00
Christopher Faylor 3143cb7c00 * 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 18:02:45 +00:00
Corinna Vinschen ff80d22a7c * new-features.sgml (ov-new1.7.16): Document ReFS support. 2012-06-03 16:53:03 +00:00
Corinna Vinschen ba9846ad9b *** empty log message *** 2012-06-03 16:47:57 +00:00
Corinna Vinschen 115d74b99e * 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 16:46:53 +00:00
Corinna Vinschen 6a713dabad * cygcheck.cc (dump_sysinfo): Change "Server 8" to official
"Server 2012".
2012-06-03 16:45:27 +00:00
Christopher Faylor b7ae842aea * winbase.h: Add missing copyright date. 2012-06-03 16:32:00 +00:00
Christopher Faylor 7c15768aa5 * 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-03 16:31:33 +00:00
Christopher Faylor 00a3124325 * select.cc (cygwin_select): Add some comments.
(select_stuff::wait): Ditto.
2012-06-03 03:29:47 +00:00
Christopher Faylor 45b61a88be * 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 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-03 02:59:20 +00:00
Christopher Faylor faab45455a * exceptions.cc (setup_handler): Make debugging output a little more verbose. 2012-06-03 02:26:58 +00:00
Christopher Faylor 841ab2f971 * cygtls.h (_cygtls::protect_linked_list): Delete unused field. 2012-06-02 20:28:57 +00:00
Corinna Vinschen 0b592aeef2 * 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 14:37:53 +00:00
Corinna Vinschen 52174bb4cc * 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-30 09:15:38 +00:00
Corinna Vinschen d6719f7e17 * select.cc (select_stuff::wait): Temporarily disable restarting
entirely.
2012-05-29 13:11:34 +00:00
Corinna Vinschen d560c4b2ba * security.h (cygsidlist::+=): Correctly copy well_known_sid info from
source cygsid.
2012-05-29 13:01:50 +00:00
Corinna Vinschen 00ef94f338 * 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.
2012-05-29 12:46:01 +00:00
Corinna Vinschen d610936513 * registry.cc (reg_key::build_reg): Fix typo in debug output. 2012-05-25 14:49:56 +00:00
Corinna Vinschen 8e599b1e3a * 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 14:33:18 +00:00
Corinna Vinschen df5cda0e93 * fhandler_serial.cc (fhandler_serial::raw_read): Check for
ERROR_OPERATION_ABORTED rather than ERROR_IO_INCOMPLETE after CancelIo.
2012-05-25 11:08:10 +00:00
Corinna Vinschen 96d5b7d17c * fhandler_serial.cc (fhandler_serial::raw_read): Just call ReadFile
directly in case of non-blocking I/O and handle result gracefully.
2012-05-25 09:29:17 +00:00
Corinna Vinschen 32c02f191b * 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-24 14:17:51 +00:00
Corinna Vinschen 9cbf10a06e * thread.cc (__cygwin_lock_lock): Take null thread at process startup
into account.
	(__cygwin_lock_trylock): Ditto.
	(__cygwin_lock_unlock): Ditto.
2012-05-23 19:49:39 +00:00
Corinna Vinschen 2b165a453e * thread.cc (pthread::cancel): Re-allow asynchronous cancellation from
Cygwin code since it looks like the problem is Windows only.
2012-05-23 17:39:39 +00:00
Corinna Vinschen bff08077a6 * 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 16:26:34 +00:00
Corinna Vinschen 86b35406f2 * thread.cc (pthread::cancel): Only allow asynchronous cancellation
if the thread is not executing Cygwin or Windows code.  Explain why.
2012-05-23 13:30:26 +00:00
Corinna Vinschen 750329ae90 * thread.cc (pthread::precreate): Make sure mutex is recursive.
Explain why.
2012-05-23 13:24:57 +00:00
Corinna Vinschen dacf4be3fa * 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 13:18:34 +00:00
Corinna Vinschen 2ca9ed527e * fhandler.h (refcnt): Add i interlocked. Explain why.
* winbase.h (ilockadd): New function.
	(InterlockedAdd): Define as ilockadd.
2012-05-23 13:13:56 +00:00
Corinna Vinschen 73447abbb6 * 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 17:37:40 +00:00
Corinna Vinschen 6014310903 * thread.cc (pthread::cancel): Set thread's cancel_event in
PTHREAD_CANCEL_ASYNCHRONOUS case, too.  Explain why.
2012-05-22 10:28:05 +00:00
Corinna Vinschen 08d7e0c909 * 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 19:45:12 +00:00
Corinna Vinschen 428aba22a9 *** empty log message *** 2012-05-21 16:01:31 +00:00
Corinna Vinschen 6cb222edce * net.cc (cygwin_recvfrom): Don't shortcircuit if len == 0. Add comment
to explain why.
	(cygwin_recv): Ditto.
	(cygwin_recvmsg): Ditto.
2012-05-21 14:56:02 +00:00
Corinna Vinschen ece05938f2 * fhandler_disk_file.cc (path_conv::isgood_inode): Rearrange, take
Samba versions >= 3.5.4 into account, add comments.
2012-05-21 12:00:09 +00:00
Christopher Faylor fe66a97ae4 * 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-17 02:18:41 +00:00
Christopher Faylor bd8afa5eb1 * 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-16 01:56:41 +00:00
Christopher Faylor 8f55341ea1 * child_info.h (CURR_CHILD_INFO_MAGIC): Update. 2012-05-14 23:29:03 +00:00
Christopher Faylor 3de7be4c1d * 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-14 22:42:56 +00:00
Christopher Faylor 1f99484812 * 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 20:26:43 +00:00
Christopher Faylor 348b56b5a3 * 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-12 19:17:17 +00:00
Corinna Vinschen 2ef123fccc *** empty log message *** 2012-05-10 08:37:56 +00:00
Corinna Vinschen 54659e14a0 * new-features.sgml (ov-new1.7.16): Document memrchr. 2012-05-10 08:36:44 +00:00
Corinna Vinschen 3ebb4f04b5 * cygwin.din (memrchr): Export.
* posix.sgml (std-gnu): Add memrchr.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2012-05-10 08:35:22 +00:00
Corinna Vinschen 3ef81a86fb * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 16. 2012-05-10 06:51:40 +00:00
Yaakov Selkowitz dc4536187c * new-features.sgml (ov-new1.7.15): Fix XML syntax. 2012-05-09 07:32:48 +00:00
Christopher Faylor 61c33dbfd8 Add url for reported mailing list problem 2012-05-08 22:38:42 +00:00
Keith Marshall 359d971109 Remove references to nonexistent files. 2012-05-08 19:41:12 +00:00
Christopher Faylor dfd5d5bea6 * 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-08 15:06:43 +00:00
Christopher Faylor 51180c08ed Add additional observation to cgf-000003 2012-05-07 15:28:40 +00:00
Christopher Faylor 06bd0ef2ab * 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-07 15:05:56 +00:00
Christopher Faylor 8620cb7925 * new-features.sgml (ov-new1.7.15): Fix tag. 2012-05-07 14:40:20 +00:00
Christopher Faylor 5c0e79c218 * cygwinenv.sgml: Add pipe_byte description.
* new-features.sgml (ov-new1.7.15): Add new pipe_byte description for 1.7.15.
2012-05-06 18:59:46 +00:00
Corinna Vinschen d6d8002e43 *** empty log message *** 2012-05-06 08:13:58 +00:00
Corinna Vinschen 6428476bdd * mkpasswd.c (current_user): Actually *use* $HOME if it's available.
Add comment to explain what we're doing here.
2012-05-05 08:55:17 +00:00
Christopher Faylor fb9d631817 * 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-04 03:00:43 +00:00
Corinna Vinschen 00a76ece10 * 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-03 08:34:44 +00:00
Christopher Faylor 287a26f349 Reflect ChangeNotes -> DevNotes 2012-05-02 20:39:31 +00:00
Christopher Faylor 0386e4bf17 . 2012-05-02 16:48:13 +00:00
Christopher Faylor b79c0094f8 * ChangeNotes: 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 16:39:39 +00:00
Corinna Vinschen 6f5a3401aa * fenv.cc (fesetround): Fix test for valid input parameter.
(fesetprec): Ditto.
2012-05-02 07:42:08 +00:00
Christopher Faylor 28c8ae66d5 * 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-30 15:38:45 +00:00
Chris Sutcliffe c9306c71ed 2012-04-29 Jan Ringos <tringi@users.sf.net>
* include/winbase.h (GetModuleHandleEx[A/W]): Correct version guard.
2012-04-30 00:44:48 +00:00
Chris Sutcliffe d578467671 2012-04-28 LRN <l_r_nightmare@users.sf.net>
* include/shobjidl.h: New file.
        * lib/shobjidl-uuid.c: New file.
        * lib/Makefile.in: Reference shobjidl-uuid.c.
2012-04-29 02:43:40 +00:00
Christopher Faylor ea17849f8b * environ.cc (struct parse_thing): Add temporary (?) "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-28 19:49:58 +00:00
Corinna Vinschen 2d487f2dd6 * path.cc (find_fast_cwd_pointer): Fix for W8 CP 32 bit. 2012-04-27 12:07:15 +00:00
Corinna Vinschen 8e487e5954 * new-features.sgml (ov-new1.7.14): Add mouse reporting mode 1005. 2012-04-25 07:34:34 +00:00
Corinna Vinschen 070a2dd5dd *** empty log message *** 2012-04-25 07:33:03 +00:00
Corinna Vinschen 8ee7527dc2 * 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-25 07:25:00 +00:00
Corinna Vinschen f1ce77295d * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 15. 2012-04-24 16:05:20 +00:00
Corinna Vinschen bd8839bbce * new-features.sgml (ov-new1.7.14): New section. Add new console mouse
reporting modes.
2012-04-24 14:42:51 +00:00
Corinna Vinschen d581bbfa8e * 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 14:39:22 +00:00
Corinna Vinschen 503a59c70b *** empty log message *** 2012-04-24 14:31:35 +00:00
Corinna Vinschen c9df1b2729 * 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-24 14:29:37 +00:00
Yaakov Selkowitz a5fa16e277 * configure: Regenerate. 2012-04-24 08:55:41 +00:00
Yaakov Selkowitz 7940dd8118 * faq-using.xml (faq.using.emacs, faq.using.xemacs): Change links
from http://cygwin.com/xfree to http://x.cygwin.com.
2012-04-23 22:10:37 +00:00
Yaakov Selkowitz 0a5135e32a * 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-23 21:46:46 +00:00
Christopher Faylor f76ca72740 add in preparation for release 2012-04-23 15:18:54 +00:00
Christopher Faylor 8b4bd08220 * 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-21 19:52:11 +00:00
Christopher Faylor 080f275bae * 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-19 17:21:32 +00:00
Christopher Faylor 55dcba98db * 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-18 05:57:38 +00:00
Christopher Faylor c1d26a99cd reformat 2012-04-15 17:56:50 +00:00
Christopher Faylor aba77cbe8f 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-15 17:51:22 +00:00
Christopher Faylor 0a3819e655 clarify latest entry 2012-04-13 05:05:42 +00:00
Christopher Faylor 3bfa9d984b * devices.in (exists_console): Allow /dev/con{sole,in,out} to be referenced
they exist.
* devices.cc: Regenerate.
* fhandler_console.cc (fhandler_console::set_unit): Ditto.
2012-04-13 02:30:51 +00:00
Corinna Vinschen e62d782aec * syscalls.cc (fhandler_base::stat_fixup): Fix inode numbers of
non-device files in virtual fileysystems.
2012-04-11 08:49:52 +00:00
Christopher Faylor e5b7e4d1c7 * 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-07 17:32:44 +00:00
Christopher Faylor 00ceaad134 * 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 19:40:58 +00:00
Christopher Faylor 25fdb1ded1 * path.c (path_conv::check): Avoid directly referencing fields of the dev
structure when it can be easily avoided.
2012-04-06 04:40:49 +00:00
Christopher Faylor 7217f94752 Fix a couple of typos. 2012-04-06 04:36:22 +00:00
Corinna Vinschen d422f9e30f * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 14. 2012-04-05 15:26:27 +00:00
Corinna Vinschen 93bb67edb2 * new-features.sgml (ov-new1.7.13): Add typeahead description. 2012-04-05 15:04:24 +00:00
Christopher Faylor 82405d4448 Add typeahead description. 2012-04-05 14:23:06 +00:00
Corinna Vinschen 260738bd33 * new-features.sgml (ov-new1.7.13): New section. Add entry for
mkpasswd/mkgroup change to print TrustedInstaller account.
2012-04-05 13:41:49 +00:00
Corinna Vinschen ba17d0ed88 *** empty log message *** 2012-04-05 13:39:59 +00:00
Corinna Vinschen 036fb4772c * 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-04-05 13:37:32 +00:00
Corinna Vinschen b475fe5497 * passwd.cc (pwdgrp::read_passwd): Fix pretty_ls entry tyo contain
the required number of colons.
2012-04-05 10:16:09 +00:00
Christopher Faylor 7b03b0d8ce * 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.  Cleanup 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-05 02:54:51 +00:00
Corinna Vinschen ffcd2c3f89 * 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 12:45:24 +00:00
Corinna Vinschen ce508e512a * path.cc (path_conv::check): Convert device type to FH_FS for
non-existant files on /dev, unless /dev itself doesn't exist on disk.
	Add comment to explain why.
2012-04-04 12:06:21 +00:00
Corinna Vinschen 9e1fe26d12 * hookapi.cc (rvadelta): Compute max_size using SizeOfRawData rather
than VirtualSize.
2012-04-04 11:09:44 +00:00
Corinna Vinschen 7c1d11f7e8 * 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-04 09:57:17 +00:00
Corinna Vinschen ecdcf15712 2012-04-03 Corinna Vinschen <corinna@vinschen.de>
* new-features.sgml (ov-new1.7.12): Fix layout of flock example.
2012-04-03 19:16:10 +00:00
Corinna Vinschen fba41a7c3d * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 13. 2012-04-03 14:54:17 +00:00
Corinna Vinschen f777ddfbe3 * syscalls.cc (fhandler_base::stat_fixup): Replace string comparison
with new device::is_dev_resident() call.
2012-04-03 07:28:48 +00:00
Christopher Faylor 17a61045ff * 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 20:41:46 +00:00
Corinna Vinschen eb7729eb36 * 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 19:25:58 +00:00
Corinna Vinschen 467e17b9af * 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 16:19:29 +00:00
Corinna Vinschen f7c8c4540a * 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 15:56:43 +00:00
Corinna Vinschen 1f312200d3 * 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 11:45:56 +00:00
Corinna Vinschen 949cc8b640 * 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 11:18:45 +00:00
Corinna Vinschen da8274643c * 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 11:08:07 +00:00
Corinna Vinschen 5346e8aebb * mount.cc (fillout_mntent): Use "none" rather than 0 when checking
FS type.
2012-04-02 11:00:17 +00:00
Christopher Faylor 881beea81d * 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 22:28:39 +00:00
Corinna Vinschen c4ee9311c2 * fhandler_dev.cc (fhandler_dev::readdir): Fix formatting. Simplify
code.  Use device::type() to fetch dirent compatible device type.
	Add comment.
2012-04-01 10:38:07 +00:00
Christopher Faylor 727a81f4d9 * 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-04-01 07:19:52 +00:00
Corinna Vinschen e2e887c5ac * 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-31 20:14:14 +00:00
Christopher Faylor 4303e52e4f update copyright 2012-03-31 17:38:40 +00:00
Christopher Faylor 1c1294b4ce (Interim checkin while we work on this)
* 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-31 17:38:00 +00:00
Corinna Vinschen 54440304b3 Fix typo 2012-03-30 13:28:17 +00:00
Corinna Vinschen 4ceddd6276 *** empty log message *** 2012-03-30 13:27:38 +00:00
Corinna Vinschen e612307024 * 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-30 11:30:13 +00:00
Corinna Vinschen 8a92f14092 * posix.sgml (std-notes): Change description of flock restrictions. 2012-03-30 11:29:57 +00:00
Corinna Vinschen a918afd703 * 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-30 09:26:45 +00:00
Corinna Vinschen 6e4ac6e81c *** empty log message *** 2012-03-29 18:24:45 +00:00
Corinna Vinschen b255aece50 * 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-29 18:23:32 +00:00
Corinna Vinschen 9ca7bca3c3 * 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 18:02:54 +00:00
Christopher Faylor d46ed263af * fhandler_console.cc (fhandler_console::set_unit): Don't succeed unless we are
opening a console actually associated with this process.
2012-03-29 17:34:55 +00:00
Corinna Vinschen 60ecc3d68b * sec_acl.cc (acl32): Fix potnetial crash if build_fh_name returns NULL. 2012-03-29 15:01:18 +00:00
Christopher Faylor 74daacfd31 * 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-29 05:45:49 +00:00
Christopher Faylor cf22fb91a1 * sigproc.cc (proc_terminate): Avoid releasing myself. 2012-03-28 17:28:27 +00:00
Corinna Vinschen 6680cb64f1 * times.cc (clock_setres): Set minperiod to period. 2012-03-28 07:38:35 +00:00
Corinna Vinschen f5e3a51ca0 Fix copyright. 2012-03-27 18:31:09 +00:00
Corinna Vinschen cd24077999 * 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.

	* new-features.sgml (ov-new1.7.11): Add mountinfo.
2012-03-27 18:30:28 +00:00
Corinna Vinschen 4b6a427b0a * times.cc (clock_setres): Revert previous change. 2012-03-27 08:50:45 +00:00
Corinna Vinschen c2c7860fff * 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 11:24:51 +00:00