Commit Graph

5551 Commits

Author SHA1 Message Date
Corinna Vinschen 7be671075d * include/endian.h: Move definitions of __BIG_ENDIAN, __LITTLE_ENDIAN,
and __BYTE_ORDER into ...
	* include/bits/endian.h: New file.
	* include/arpa/nameser_compat.h: Include endian.h rather than defining
	BYTE_ORDER here.
	* include/asm/byteorder.h: Include bits/endian.h.  Drop definition of
	__LITTLE_ENDIAN.
	* include/netinet/ip.h: Include bits/endian.h.  Drop definitions of
	BIG_ENDIAN, LITTLE_ENDIAN, and BYTE_ORDER.  Use underscored variants
	of aforementioned constants.
	* include/netinet/tcp.h: Ditto.
	* include/sys/param.h: Drop disabled definitions of BIG_ENDIAN,
	LITTLE_ENDIAN, and BYTE_ORDER.

	* include/netinet/ip.h: Reformat.  Define setsockopt IP_TOS options
	matching recent RFCs.  Tweak comments.
2011-02-11 12:42:30 +00:00
Eric Blake 96b998db51 strerror_r: fix compilation bug in previous patch
* errno.cc (includes): Avoid compilation failure if <string.h>
settles on wrong strerror_r signature.
2011-02-10 20:25:54 +00:00
Eric Blake 3c9abad56b strerror_r: obey POSIX, and match newlib header change
* errno.cc (__xpg_strerror_r): New function.
(strerror_r): Update to copy newlib's fixes.
(strerror): Set errno on failure.
(_sys_errlist): Cause EINVAL failure for reserved values.
* cygwin.din: Export new function.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Combine
this into minor 236.
2011-02-10 17:36:51 +00:00
Yaakov Selkowitz 3696acf497 * cygwin.din (pthread_yield): Export as alias to sched_yield.
* include/pthread.h (pthread_yield): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* posix.sgml (std-deprec): Add pthread_yield.
2011-02-10 10:51:14 +00:00
Christopher Faylor ca1953eeee * cygheap.cc: Add some __stdcall decoration where appropriate.
* lib/cygwin_crt0.c: __attribute -> __attribute__.
2011-02-10 02:22:36 +00:00
Christopher Faylor 27239c6372 * hookapi.cc (hook_or_detect_cygwin): Prevent i from being considered
uninitialized by gcc.
2011-02-09 15:46:00 +00:00
Christopher Faylor 7a5f322c35 * exception.h: Remove DEBUG_EXCEPTION left over debugging ifdef.
* dll_init.cc: Fix typo in comment.
2011-02-09 15:40:37 +00:00
Christopher Faylor 38286e47f0 * dll_init.cc: Fix typo in comment. 2011-02-08 20:14:37 +00:00
Corinna Vinschen 4bd8eb7d1b * configure.in: Remove AC_ALLOCA test and test for __builtin_memset.
* configure: Regenerate.
2011-02-07 16:22:02 +00:00
Corinna Vinschen 050d09e873 * fhandler_console.cc (fhandler_console::write_normal): Remove
erroneous premature return after collecting truncated multibyte
	sequence in trunc_buf.  Rather fall through to printing routine.
	Fix return value to take trunc_buf content into account.  Improve
	comments.
2011-02-07 11:18:19 +00:00
Christopher Faylor 63398011f9 * autoload.cc (wsock_init): Properly define WSAStartup function pointer to
avoid stack damage.
2011-02-05 19:38:21 +00:00
Corinna Vinschen b148ba7af2 * libc/bsdlib.cc: Include err.h. 2011-02-02 15:17:14 +00:00
Corinna Vinschen b22bd786e3 * include/err.h: Fix loss of semicolons in previous patch. 2011-02-02 15:14:46 +00:00
Corinna Vinschen 0cda941fa1 * include/err.h (err): Add noreturn attribute.
(errx): Ditto.
	(verr): Ditto.
	(verrx): Ditto.
2011-02-02 10:16:30 +00:00
Corinna Vinschen cecc445d5c * path.cc (conv_path_list): Remove enclosing quotes and trailing
backslashes from Win32 environment path lists.
2011-02-02 09:59:10 +00:00
Corinna Vinschen 0e126cb141 * fhandler.cc (fhandler_base::fsync): Ignore ERROR_INVALID_FUNCTION
error from FlushFileBuffers().
2011-02-01 08:46:48 +00:00
Corinna Vinschen 2daa7e07ce * syscalls.cc (utmp_data): Fix potential buffer overflow. 2011-01-31 13:58:59 +00:00
Corinna Vinschen adef8606bd * fhandler_socket.cc (address_in_use): Improve comment readability. 2011-01-31 08:53:57 +00:00
Corinna Vinschen a01454811a * fhandler_socket.cc (address_in_use): Disable. Add comment.
(fhandler_socket::bind): Change comment to explain setting the
	SO_EXCLUSIVEADDRUSE socket option.  Remove code which checks for
	address in use.
	* net.cc (cygwin_setsockopt): Never set SO_REUSEADDR option.  Improve
	comment to compensate for the deleted comment in fhandler_socket::bind.
	* wincap.cc: Throughout, drop has_enhanced_socket_security from wincaps.
	* wincap.h (struct wincaps): Drop has_enhanced_socket_security flags
	and method.
2011-01-30 21:52:12 +00:00
Christopher Faylor 9ce2a54f70 winsup:
* configure.in: Configure winsup/cygserver regardless of cross_host.
* configure: Regenerate.
winsup/cygwin:
* configure.in: Define LIBSERVER regardless of cross_host.
* configure: Regenerate.
2011-01-29 06:41:28 +00:00
Corinna Vinschen 93a4d9d97c * fhandler_socket.cc (fhandler_socket::wait_for_events): Call
pthread_testcancel in case of timeout to enable pthread_cancel
	on waiting thread.
2011-01-28 11:17:29 +00:00
Corinna Vinschen b5ca0d7271 * include/features.h (__STDC_ISO_10646__): Move to newlib's
sys/features.h.
2011-01-27 11:55:51 +00:00
Corinna Vinschen 40aca06884 * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Fix
computation of st_blocks.
	(fhandler_base::fstat_helper): Fix formatting.
2011-01-26 10:55:13 +00:00
Corinna Vinschen cd06f7049b * include/features.h (__STDC_ISO_10646__): Define. Add comment. 2011-01-24 16:27:35 +00:00
Corinna Vinschen a1c35b8b65 * syscalls.cc (rename): Fix permission problem with symlinks on NFS.
Rework how NtOpenFile gets called to make it more readable.  Change
	comment.
2011-01-21 13:13:00 +00:00
Corinna Vinschen 2aba945c95 * exec.cc: Include pinfo.h.
* winf.h: Move definitions of _P_PATH_TYPE_EXEC and _P_MODE from here...
	* pinfo.h: ...to here.
	(_P_PATH_TYPE_EXEC): Redefine to be bigger than _P_SYSTEM.
	(_P_MODE): Redefine so as not to mask out _P_SYSTEM.
	* spawn.cc (spawnlp): Add _P_PATH_TYPE_EXEC flag in call to spawnve.
	(spawnlpe): Ditto.
	(spawnvp): Ditto.
2011-01-20 11:09:21 +00:00
Corinna Vinschen 9b68968b21 * spawn.cc (av::fixup): Reenable #! handling for all exec functions.
Return ENOEXEC in !p_type_exec case only for unrecognized files.
	Fix comment formatting.
2011-01-19 14:59:10 +00:00
Corinna Vinschen 1393f63206 * exec.cc (execlp): Add missing _P_PATH_TYPE_EXEC flag in call to
spawnve.
2011-01-19 10:30:39 +00:00
Corinna Vinschen 26b070c0cf * exec.cc: Rearrange functions in alphabetical order.
(_execve): Drop temporary define and drop export alias.
	(execl): Call spawnve.
	(execle): New function.
	(execlp): New function.
	(execv): Call spawnve.
	(execve): Drop converting NULL envp to emtpy envp.
	(execvp): Call spawnve.
	(execvpe): Drop converting NULL envp to emtpy envp.  Call spawnve.
	(fexecve): Call spawnve.
	* spawn.cc (spawnve): Convert NULL envp to emtpy envp.  Remove outdated
	comment.
	(spawnlp): Call spawnve.
	(spawnlpe): Ditto.
	(spawnvp): Ditto.
	(spawnvpe): Fix formatting.
2011-01-19 10:28:39 +00:00
Corinna Vinschen 17133a85de * exec.cc (strccpy): Move function from here...
* strfuncs.cc (strccpy): ...to here.
	* string.h (strccpy): Declare.
	* winsup.h (strccpy): Drop declaration.
2011-01-19 09:41:54 +00:00
Corinna Vinschen 808aae3d13 * errno.cc (errmap): Add error codes for invalid binaries.
* exec.cc (execvp): Call spawnve with _P_PATH_TYPE_EXEC flag
	from here.
	(execvpe): Ditto.
	* spawn.cc (spawn_guts): Filter _P_PATH_TYPE_EXEC from mode and
	store in p_type_exec.  Call av::fixup with addtional p_type_exec
	argument.
	(spawnve): Check for filtered mode.
	(spawnvpe): Add _P_PATH_TYPE_EXEC flag when calling spawnve.
	(av::fixup): Accept additional bool parameter p_type_exec.  Only check
	for script if p_type_exec is true.
	* winf.h (_P_PATH_TYPE_EXEC): Define.
	(_P_MODE): Define.
	(av::fixup): Declare with additional bool parameter.
2011-01-19 09:15:17 +00:00
Corinna Vinschen fc660168bf * fhandler_proc.cc (format_proc_partitions): Fix compiler warning. 2011-01-17 14:31:30 +00:00
Corinna Vinschen be37165114 * path.cc (path_conv::check): Don't follow reparse point symlinks if
PC_SYM_NOFOLLOW_REP flag is set.
	(cygwin_conv_path): Set PC_SYM_NOFOLLOW_REP flag when converting from
	POSIX to Win32.
	* path.h (enum pathconv_arg): Define PC_SYM_NOFOLLOW_REP flag.
2011-01-17 14:19:39 +00:00
Corinna Vinschen 483e9d0022 * fhandler_proc.cc (proc_tab_cmp): Fix typo in comment.
(fhandler_proc::fill_filebuf): Handle return value of 0 from format
	function as error.
	(format_proc_stat): Set errno when returning 0 size.
	(format_proc_partitions): Rewrite method to fetch partition info.
2011-01-17 13:38:06 +00:00
Corinna Vinschen 49d31b4e82 Fix typo, fix copyright 2011-01-13 14:00:00 +00:00
Corinna Vinschen 07c43238cf * fhandler_disk_file.cc (fhandler_base::fstat_helper): Alwasy set
st_size of directories to 0.  Explain why.
2011-01-13 13:50:02 +00:00
Corinna Vinschen cf8d5ec5ae Really check in now 2011-01-13 13:48:12 +00:00
Corinna Vinschen c049f0f6ff * posix.sgml: Add madvise to BSD list. 2011-01-12 13:09:31 +00:00
Corinna Vinschen 6147b7f8a3 * cygwin.din (madvise): Export posix_madvise as madvise.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR.
	* include/sys/mman.h: Define madvise constants, keep Linux-specific
	constants undefined.
	(madvise): Declare.
2011-01-12 13:01:43 +00:00
Corinna Vinschen 667f187146 * fhandler.h (struct part_t): New type.
(class fhandler_dev_floppy): Convert partitions to part_t pointer.
	Add lock_partition method.
	* fhandler_floppy.cc (fhandler_dev_floppy::lock_partition): New method
	to implement ondemand partition locking.
	(fhandler_dev_floppy::write_file): Call lock_partition from here if
	writing failed due to a potential write restriction on a disk
	partition.
	(fhandler_dev_floppy::open): Don't lock partitions here.
	(fhandler_dev_floppy::close): Keep track of partition handle reference
	count.  Close handles and remove partitions pointer ony if count is 0.
	(fhandler_dev_floppy::dup): Just copy partitions pointer and increment
	reference count.
2011-01-12 09:16:51 +00:00
Corinna Vinschen 95a5c969ab * fhandler.h (MAX_PARTITIONS): New definition.
(class fhandler_dev_floppy): Add partitions array member.  Add close
	method.
	* fhandler_floppy.cc (fhandler_dev_floppy::fhandler_dev_floppy): Zero
	out partitions array.
	(fhandler_dev_floppy::open): Fix "entire disk" condition for call to
	DeviceIoControl (FSCTL_ALLOW_EXTENDED_DASD_IO).
	When opening disks for writing, call DeviceIoControl (FSCTL_LOCK_VOLUME)
	on all affected disk partitions starting with Vista.
	(fhandler_dev_floppy::close): New method.
	(fhandler_dev_floppy::dup): Duplicate handles in partitions, if any.
	* wincap.h (wincaps::has_restricted_raw_disk_access): New element.
	* wincap.cc: Implement above element throughout.
2011-01-11 14:50:45 +00:00
Corinna Vinschen b7d4651e3e * termios.cc (cfgetospeed, cfgetispeed): Constify argument per POSIX.
* include/sys/termios.h (cfgetospeed, cfgetispeed): Declare functions.
	Move macros after declarations and make conditional on !__cplusplus.
2011-01-11 10:09:23 +00:00
Corinna Vinschen cd441f06e2 * cygtls.cc (_cygtls::init_thread): Call _REENT_INIT_PTR. Drop setting
current locale and calling srand48.
2011-01-11 08:05:51 +00:00
Christopher Faylor 8b0be52ba0 * ChangeLog-2010: Create from ChangeLog.
* ChangeLog: Start fresh.
2011-01-03 01:53:19 +00:00
Christopher Faylor 2be50cacae * cygtls.cc: Include stdlib.h.
(_cygtls::init_thread): Seed random number generator on a per-thread basis.
2010-12-29 06:33:30 +00:00
Christopher Faylor c8d1848d07 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 234. 2010-12-27 17:29:25 +00:00
Christopher Faylor 589e430baa cygwin:
* cygwin.din: Export program_invocation_name and
	program_invocation_short_name.
	* dcrt0.cc: Set program_invocation*name to correct values, based on
	argv[0].
	* globals.cc (program_invocation_name): Define.
	(program_invocation_short_name): Ditto
newlib:
	* libc/include/sys/errno.h (program_invocation_name): Declare.
	(program_invocation_short_name): Ditto.
2010-12-26 21:11:38 +00:00
Corinna Vinschen 9296807af3 * security.cc (alloc_sd): Really fix erroneous inheritence entry
duplication now.  Add more comments for clarity.
2010-12-16 10:31:09 +00:00
Corinna Vinschen e445b7c336 * sec_acl.cc (getacl): Ensure that the default acl contains at least
DEF_(USER|GROUP|OTHER)_OBJ entries.
2010-12-15 14:11:03 +00:00
Corinna Vinschen 38042584f3 * security.cc (alloc_sd): Fix erroneous inheritence entry duplication. 2010-12-15 13:56:32 +00:00
Corinna Vinschen e52961c403 * syscalls.cc (check_dir_not_empty): Never count more than 3 directory
entries.
2010-12-12 15:32:45 +00:00
Christopher Faylor f646aeb049 * init.cc (search_for): Put this in shared section or suffer subtle problems
with the tls.
* pinfo.cc (status_exit): Add debug output to report on unexpected exit.
* tls_pbuf.cc (tmp_pathbuf::c_get): Add more details to internal error.
2010-12-12 05:48:29 +00:00
Christopher Faylor 4f26f8486c fix typo 2010-12-09 21:44:22 +00:00
Corinna Vinschen 0dcfb061cf * autoload.cc (RETRY_COUNT): New define.
(std_dll_init): Restructure loop to retry loading a DLL only if
	specific errors occur.  If these errors persist, try to load DLL
	with name only.
2010-12-09 16:50:36 +00:00
Corinna Vinschen 51ecb7d9af * include/strings.h: Remove in favor of equivalent newlib file. 2010-12-08 14:28:18 +00:00
Corinna Vinschen 7695120581 * sec_acl.cc (getacl): Set DEF_CLASS_OBJ permissions to 07 instead
of 0777.
2010-12-08 10:24:20 +00:00
Corinna Vinschen 9de485e8e0 * path.cc (path_conv::check): Don't generate ENOENT for non-existant
CYGDRIVE and NETDRIVE paths.  Add comment.
2010-12-06 13:09:40 +00:00
Corinna Vinschen bdcc0b84ed * net.cc (get_xp_ifs): Fix counting of idx to return stable interface
alias names for interfaces with multiple IPv4 addresses.
2010-12-02 11:39:15 +00:00
Corinna Vinschen 910e31f015 * fhandler_tty.cc (fhandler_tty_slave::dup): Free path_conv strings
to avoid memory leak.  Add comment.
	(fhandler_pty_master::dup): Ditto.
	* path.h (path_conv::free_strings): New method.
2010-11-29 20:51:38 +00:00
Corinna Vinschen 943c59e3e8 * autoload.cc (SendARP): Remove.
* net.cc (get_flags): Set IFF_NOARP flag for PPP and SLIP devices.
	(get_xp_ifs): Unify IFF_BROADCAST setting.  Drop calling SendARP to
	set IFF_NOARP flag.
2010-11-23 15:37:41 +00:00
Corinna Vinschen 5fe7c5e01b * path.cc (symlink_info::check): Don't use FileNetworkOpenInformation
on Netapps.  Relax condition for workaround.  Always request size
	information via FileStandardInformation info class in workaround.
2010-11-23 09:26:16 +00:00
Corinna Vinschen fc0fb0ba13 * mount.cc (NETAPP_IGNORE): Add FILE_PERSISTENT_ACLS.
(FS_IS_NETAPP_DATAONTAP): Drop test for FILE_PERSISTENT_ACLS.
	(fs_info::update): Set filetype to ntfs in remote case, too.  Fix a
	couple of comments.  Add test for Netapps faking to be FAT.

	* mount.h (IMPLEMENT_FS_FLAG): Simplify definition and usage.
2010-11-22 14:19:50 +00:00
Corinna Vinschen 9dda712bd9 * net.cc (get_ipv4fromreg_ipcnt): Fix debug output. Only create debug
output if error is not ERROR_FILE_NOT_FOUND.
	(get_ipv4fromreg): Ditto.
2010-11-22 13:03:00 +00:00
Corinna Vinschen 5c6904b515 * fhandler_tty.cc (fhandler_tty_slave::fchown): Initialize mode to 0. 2010-11-18 18:55:10 +00:00
Corinna Vinschen 8506523421 * posix.sgml: Move llround and llroundf to implemented SUSv4 functions.
* include/cygwin/version.h: Add llround and llroundf to the comment for
	the 233 CYGWIN_VERSION_API_MINOR bump.
2010-11-15 12:44:57 +00:00
Yaakov Selkowitz cc353b9f34 * include/paths.h (_PATH_VARTMP): Define. 2010-11-02 17:38:36 +00:00
Christopher Faylor 49808040c5 * localtime.cc (is_upper): Rename to isupper and include ctype.h to pull in
standard macro.
(lcl_is_set): Define as an enum.
(tzsetwall): Assign lcl_is_set to correct enum values.
(tzset): Ditto.  Copy as much of TZ as will fit to TZ buffer.
2010-10-30 19:22:42 +00:00
Christopher Faylor 3e38e8abf7 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 233. 2010-10-27 14:22:27 +00:00
Christopher Faylor ec515e9e47 Tweak entry. 2010-10-24 19:33:03 +00:00
Christopher Faylor 5160c5f430 * dcrt0.cc (do_exit): Don't set thread termination until all fds have been
closed since an fd may rely on a thread.
* fhandler_tty.cc: Reformat comment.
(fhandler_pty_master::pty_master_thread): Refuse ERROR_PIPE_CONNECTED state as
an error.
* globals.cc (exit_states): Reorder ES_THREADTERM.
* path.cc (find_fast_cwd_pointers): Remove excessively wordy DEBUGGING output.
2010-10-24 18:50:57 +00:00
Christopher Faylor 488ddaced3 * exceptions.cc (try_to_debug): Improve comment.
* fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Add a comment.
2010-10-24 15:26:05 +00:00
Christopher Faylor c4f296c2a9 * pinfo.cc (pinfo::exit): Grab a tty lock before setting pgid. 2010-10-23 18:57:43 +00:00
Christopher Faylor 74882a259a * pinfo.cc (pinfo::exit): Reset tty pgrp to zero if no more handles open.
(_pinfo::set_ctty): Remove debugging stuff.
2010-10-23 18:55:01 +00:00
Christopher Faylor 50ed699a2a * fhandler_tty.cc (fhandler_pty_master::open): Remove debugging printf. 2010-10-23 18:11:20 +00:00
Christopher Faylor 4ce975efd3 * fhandler.h (fhandler_termios::tcinit): Make second argument non-optional.
* fhandler_console.cc (fhandler_console::open): Specify second argument to
tcinit.
* fhandler_termios.cc (fhandler_termios::tcinit): Rename second argument.  Set
pgid to 0 if this is a pty master.
(fhandler_termios::tcgetpgrp): Just return value of pgid.  It will be zero if
not initialized.
* fhandler_tty.cc (fhandler_tty_slave::open): Specify second argument to
tcinit.
(fhandler_tty_slave::ioctl): Implement TIOCGPRP/TIOCSPGRP.  Fix switch
indentation.
(fhandler_tty_master::ioctl): Implement TIOCGPRP/TIOCSPGRP.
* include/sys/termios.h (TIOCGPGRP): Define similarly to Linux.
* include/sys/termios.h (TIOCSPGRP): Ditto.
2010-10-23 18:07:08 +00:00
Christopher Faylor 2d5f37a988 * winsup/cygwin/cygwin.din: Add llround and llroundf. 2010-10-18 15:14:17 +00:00
Christopher Faylor 0e66e62668 fix dates 2010-10-16 17:58:48 +00:00
Corinna Vinschen 05aef9c690 *** empty log message *** 2010-10-09 11:01:03 +00:00
Corinna Vinschen 9c154abedb * cygheap.h (cwdstuff::override_win32_cwd): Declare.
* ntdll.h (struct _PEB): Add members accessed by the fast cwd method
	starting with Vista.
	(struct _KUSER_SHARED_DATA): Define with only the DismountCount.
	(RtlAllocateHeap): Declare.
	(RtlEnterCriticalSection): Declare.
	(RtlFreeHeap): Declare.
	(RtlLeaveCriticalSection): Declare.
	* path.cc (get_user_proc_parms): Remove.
	(struct _FAST_CWD): New structure.
	(fast_cwd_ptr): Define.
	(SharedUserData): Define.
	(peek32): Define.
	(find_fast_cwd_pointers): New function to find the global pointer
	to the current FAST_CWD structure.
	(copy_cwd_str): New helper function.
	(cwdstuff::override_win32_cwd): New method to set the Win32 CWD.
	(cwdstuff::init): Just call override_win32_cwd from here when
	started from native Win32 parent.
	(cwdstuff::set): Access Win32 CWD via PEB reference instead of using
	get_user_proc_parms function.  Memorize old DismountCount before
	opening directory handle.  Call override_win32_cwd to set up Win32 CWD.
	Be more verbose in comments.
	* wincap.h (wincaps::has_fast_cwd): New element.
	* wincap.cc: Implement has_fast_cwd element throughout.
2010-10-09 10:54:13 +00:00
Corinna Vinschen 9810eef4bf * cygwin.din: Export new complex math functions from newlib.
* posix.sgml: Move newly exported complex functions to implemented
	SUSv4 functions.
	* include/cygwin/version.h: Bump API minor version.
2010-10-08 10:51:17 +00:00
Corinna Vinschen dd0821e345 * fhandler.h (fhandler_base::get_stat_access): Delete.
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Always check
	executable suffix to get x-bits for .exe files also in notexec case.
	Always reopen file when checking for file header.
	* ntdll.h (wait_pending): Delete.
	* path.cc (symlink_info::check_shortcut): Drop call to wait_pending
	since file is always opened for sync IO.
	(symlink_info::check_sysfile): Ditto.
	(MIN_STAT_ACCESS): Remove.
	(FULL_STAT_ACCESS): Remove.
	(symlink_info::check): Drop access flag.  Revert to open file with
	just read attributes access.  Reorder symlink check to check for
	reparse points first.  Don't check reparse points for anything else,
	even on remote drives.  Open file for GENERIC_READ when trying to
	read shortcuts or system-bit symlinks. Accommodate dropped access
	flag in call to path_conv_handle::set.
	* path.h (class path_conv_handle): Drop access flag and accommodate
	all related methods.
2010-10-07 14:03:26 +00:00
Corinna Vinschen 3748b3e8e7 * posix_ipc.cc (ipc_mutex_init): Call NtCreateMutant to make sure the
access mask is correct.
	(ipc_cond_init): Take additional parameter to differ between send and
	receive event.  Call NtCreateEvent to make sure the access mask is
	correct.
	(ipc_cond_timedwait): Reset Event prior to calling WFMO.
	(struct mq_info): Split mqi_wait into two events, mqi_waitsend and
	mqi_waitrecv.
	(mq_open): Calloc mqinfo.  Create mqi_waitsend and mqi_waitrecv events.
	Make sure all synchronization objects are closed in case of an error.
	(_mq_send): Wait for mqi_waitsend event.  Signal mqi_waitrecv event.
	(_mq_receive): Wait for mqi_waitrecv event.  Signal mqi_waitsend event.
	(mq_close): Close mqi_waitsend and mqi_waitrecv events.
2010-10-06 20:20:01 +00:00
Corinna Vinschen 7c5ede22c5 * path.h (enum pathconv_arg): Remove PC_CHECK_EA. 2010-10-05 14:19:17 +00:00
Christopher Faylor f0b04035b1 * dcrt0.cc (dll_crt0_0): Move _main_tls initialization here.
(__dll_crt0): Only initialize _main_tls if it changes.
* fhandler_console.cc (fhandler_console::write): Fix debugging output.
2010-10-02 19:08:21 +00:00
Corinna Vinschen 1da77c2678 * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Simplify.
Just call nfs_fetch_fattr3 if called via fstat.
	* nfs.cc (nfs_fetch_fattr3): New function to fetch NFS fattr3 info from
	file handle.
	* nfs.h (nfs_fetch_fattr3): Declare.
	* path.cc (symlink_info::check): Simplify NFS case.  Just call
	nfs_fetch_fattr3.
2010-10-02 19:03:44 +00:00
Corinna Vinschen ad2b2724a7 * fhandler_procsys.cc (fhandler_procsys::exists): Return virt_none
if path is invalid.
2010-10-02 08:44:08 +00:00
Christopher Faylor b66f254618 * autoload.cc (std_dll_init): Add a retry loop. 2010-10-01 21:53:11 +00:00
Corinna Vinschen 2d355410b7 * fhandler.cc: Drop including nfs.h.
* fhandler_disk_file.cc: Ditto.
	(fhandler_base::fstat_by_nfs_ea): Use fattr3 from path_conv member,
	unless called from fstat.
	* path.cc: Drop including nfs.h.
	(symlink_info::check): Rearrange definition of file info buffers.
	Fetch fattr3 info for files on NFS and store in conv_hdl for later
	use in fhandler_base::fstat_by_nfs_ea.  Use fattr3 file type to
	recognize symlink on NFS and try to fetch symlink target only for
	actual symlinks.
	* path.h: Include nfs.h.
	(class path_conv_handle): Change file info storage to union of
	FILE_NETWORK_OPEN_INFORMATION and fattr3 structures.
	(path_conv_handle::fnoi): Align to aforementioned change.
	(path_conv_handle::nfsattr): New method.
	(path_conv::nfsattr): New method.
2010-09-30 13:52:34 +00:00
Corinna Vinschen ab3cd88858 * path.cc (symlink_info::check): Remove erroneous assumption about
required permissions when reading NFS symlinks.
2010-09-30 10:42:34 +00:00
Christopher Faylor 1b0358455c * fhandler_tty.cc (fhandler_tty_slave::init): Revert to using tc->setpgid since
previous change broke some use cases.
2010-09-29 15:08:49 +00:00
Christopher Faylor f95f18c950 * fhandler_tty.cc (fhandler_tty_slave::init): Add debugging. Use tcsetpgrp to
potentially set pgid since it is smarter about deciding if a process is in the
background.
* include/sys/cygwin.h (PID_ORPHANED): Actually delete as planned.
(PID_NOTCYGWIN): Correctly define.
2010-09-29 03:57:24 +00:00
Corinna Vinschen 9d86e31826 * net.cc (getdomainname): Drop special case for NT4. 2010-09-28 16:18:57 +00:00
Corinna Vinschen 2a9b4b7aa0 Revert accidental previous login. 2010-09-28 14:49:31 +00:00
Corinna Vinschen 2f1f8815c0 * Makefile.in (DLL_IMPORTS): Remove libadvapi32.a.
* autoload.cc: Add all advapi32 entry points.
	* mount.cc (mount_info::init): Read user fstab only if we have a
	username.
	* passwd.cc (pwdgrp::read_passwd): Only use username if we have one.
	* shared.cc (user_info::initialize): Set cb last so as not to override
	planned behaviour in pwdgrp::read_passwd.
	* uinfo.cc (cygheap_user::init): Fetch Windows username from environment
	variable $USERNAME.  Don't set name in cygheap if variable is empty.
	(internal_getlogin): If we still have no username, try GetUserNameW.
2010-09-28 14:40:18 +00:00
Corinna Vinschen 91e0b943a0 * fhandler_tty.cc (fhandler_pty_master::setup): Always create master
thread.
2010-09-28 10:13:19 +00:00
Corinna Vinschen 41c91ad68d * syscalls.cc (gethostid): Use correct path to ProductId registry value. 2010-09-28 07:54:52 +00:00
Corinna Vinschen 3f1d4f8757 * mount.cc (fs_info::update): Remove erroneous NtClose on random handle
value.
2010-09-27 16:10:14 +00:00
Corinna Vinschen ebdc75d9b5 * uinfo.cc (cygheap_user::init): Call GetUserNameW and convert to
multibyte here so as not to rely on the current ANSI page.
2010-09-26 15:45:10 +00:00
Christopher Faylor 71ef21429a * dcrt0.cc (__main): Force signal synchronization. 2010-09-26 14:57:12 +00:00
Corinna Vinschen 6fe59500e5 * fhandler_socket.cc (fhandler_socket::bind): Drop has_exclusiveaddruse
condition.  Fix comment about availability.  Move remaining comment to
	the right spot.  Drop has_ip_helper_lib condition.
	* net.cc (cygwin_setsockopt): Drop has_disabled_user_tos_setting
	condition.  Fix comment.
	(get_2k_ifs): Fix comment.
	(get_nt_ifs): Remove.
	(getifaddrs): Drop call to get_nt_ifs.
	(get_ifconf): Ditto.
	* wincap.cc: Throughout, drop has_ip_helper_lib,
	has_disabled_user_tos_setting, and has_exclusiveaddruse settings from
	wincaps.
	(wincap_unknown): Remove.
	(wincap_nt4): Remove.
	(wincap_minimal): New macro, set to wincap_nt4sp4 for now.
	(wincapc::init): Drop test for pre-SP4 NT4.  Just imply at least NT SP4.
	Replace references to wincap_unknown with references to wincap_minimal.
	* wincap.h (struct wincaps): Drop has_ip_helper_lib,
	has_disabled_user_tos_setting, and has_exclusiveaddruse flags and
	methods.
2010-09-25 20:06:21 +00:00