Commit Graph

5263 Commits

Author SHA1 Message Date
Corinna Vinschen 98d4d68ec4 Fix ChangeLog entry. 2011-03-30 21:58:58 +00:00
Corinna Vinschen d22bbac76c * hires.h: Fix copyright.
* times.cc: Ditto.
	localtime, gmtime).
	(FACTOR): Add comment.
	(NSPERSEC): Ditto.
	(JITTER): New definition.  Comment.
	(systime_ns): Avoid gratuitous copying of the value returned by
	GetSystemTimeAsFileTime.
	(corelocaltime, localtime, gmtime): Remove very old, unused code block.
	(cygwin_tzset): Remove.
	(hires_ms::timeGetTime_ns): Add missing semicolon in comment.
	(hires_ms::nsecs): Redefine check for difference between internal
	timer value and system time.
2011-03-30 21:54:09 +00:00
Corinna Vinschen af23d12d33 * times.cc (hires_ms::resolution): Make sure resolution is never 0.
(clock_setres): Ditto.
2011-03-30 11:30:34 +00:00
Corinna Vinschen da00863389 * cygtls.h (struct _local_storage): Redefine process_ident as wchar_t
pointer.
	* syslog.cc (CYGWIN_LOG_NAME): Convert to wide char constant.
	(openlog): Convert incoming ident string to wide char.  Fix formatting.
	(vsyslog): Print ident string as wide char string.  Convert message
	string to wide char and call UNICODE Win32 Event functions to make sure
	to use correct codeset.
	* tlsoffset.h: Regenerate.
2011-03-29 11:18:10 +00:00
Corinna Vinschen 39735c85f2 * fhandler_socket.cc (get_inet_addr): Make externally available.
* autoload.cc (GetUdpTable): Define.
	* syslog.cc (connect_syslogd): Use get_inet_addr rather than _stat64
	to check for local socket file.  Create socket with type returned by
	get_inet_addr.  If connect on UDP socket works, test if there's
	really a listening peer, otherwise fall back to Windows event log.
	(try_connect_syslogd): Use syslogd_inited flag to check if syslogd
	is available.
2011-03-29 11:07:23 +00:00
Corinna Vinschen 91d3057085 * uinfo.cc (cygheap_user::env_domain): Use LookupAccountSidW and
convert user and domain to multibyte strings to make sure to use
	correct codeset.
2011-03-29 10:46:04 +00:00
Corinna Vinschen 5f660ecf24 * autoload.cc (UuidCreate): Remove.
(UuidCreateSequential): Remove.
	* passwd.cc (internal_getpwsid): Avoid a strict-aliasing compiler
	error with gcc 4.5.1.
	* fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Ditto.
	* ntdll.h (NtAllocateUuids): Declare.
	* syscalls.cc (gethostid): Use NtAllocateUuids function rather than
	UuidCreateSequential/UuidCreate to get rid of rpcrt4 dependency.
2011-03-29 10:42:11 +00:00
Corinna Vinschen f00fe1b8e7 * cygwin.din (pthread_spin_destroy): Export.
(pthread_spin_init): Export.
	(pthread_spin_lock): Export.
	(pthread_spin_trylock): Export.
	(pthread_spin_unlock): Export.
	* posix.sgml (std-susv4): Add pthread_spin_destroy, pthread_spin_init,
	pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock.
	(std-notimpl): Remove pthread_spin_[...].
	* pthread.cc (pthread_spin_init): New function.
	* thread.cc (pthread_spinlock::is_good_object): New function.
	(pthread_mutex::pthread_mutex): Rearrange initializers to accommodate
	protected data in pthread_mutex.
	(pthread_spinlock::pthread_spinlock): New constructor.
	(pthread_spinlock::lock): New method.
	(pthread_spinlock::unlock): New method.
	(pthread_spinlock::init): New method.
	(pthread_spin_lock): New function.
	(pthread_spin_trylock): New function.
	(pthread_spin_unlock): New function.
	(pthread_spin_destroy): New function.
	* thread.h (PTHREAD_SPINLOCK_MAGIC): Define.
	(class pthread_mutex): Change access level of members shared with
	derived classes to protected.
	(pthread_mutex::set_shared): New protected method.
	(class pthread_spinlock): New class, derived class of pthread_mutex.
	* include/pthread.h (pthread_spin_destroy): Declare.
	(pthread_spin_init): Declare.
	(pthread_spin_lock): Declare.
	(pthread_spin_trylock): Declare.
	(pthread_spin_unlock): Declare.
	* include/cygwin/types.h (pthread_spinlock_t): New typedef.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-03-29 10:32:40 +00:00
Corinna Vinschen a011f95216 * net.cc (SIO_BASE_HANDLE): Define.
(fdsock): If we got an LSP handle, try to create a copy of the base
	handle instead.  Change comment to explain.
2011-03-29 10:25:20 +00:00
Corinna Vinschen b8fe0ec799 * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 10. 2011-03-29 10:24:19 +00:00
Corinna Vinschen cd50649255 * autoload.cc (winmm): Remove time functions. Don't treat
unloadable wave functions as fatal.
	* hires.h (hires_ms::timeGetTime_ns): New private method.
	(hires_ms::dmsecs): Call timeGetTime_ns here.
	* ntdll.h (struct _KSYSTEM_TIME): Define.
	(KUSER_SHARED_DATA): Redefine to allow access to InterruptTime.
	(SharedUserData): Define here.
	(NtQueryTimerResolution): Declare.
	(NtSetTimerResolution): Declare.
	* path.cc (SharedUserData): Move to ntdll.h.
	* times.cc (hires_ms::timeGetTime_ns): New private method.
	Use throughout instead of timeGetTime.  Document entire functionality
	of timeGetTime in case we need it.
	(hires_ms::resolution): Try a call to NtQueryTimerResolution
	to fetch current period.  Fall back to heuristic if that fails.
	Cast to DWORD in assignments to minperiod.
	(clock_setres): Align period to possible values per a call to
	NtQueryTimerResolution.  Explain why.  Replace calls to timeBeginPeriod
	and timeEndPeriod with underlying call to NtSetTimerResolution.  Use
	status code from NtSetTimerResolution to compute errno.
	Convert period to ULONGLONG and store 100ns value to simplify code.
2011-03-29 10:21:30 +00:00
Corinna Vinschen c9c50e7aa4 * include/sys/xattr.h: New file. 2011-03-29 08:03:35 +00:00
Corinna Vinschen 056b8e60cd * thread.cc (semaphore::init, destroy, close): Standards conformance
fix.  On a failure, return -1 and set errno.
	* thread.h (semaphore::terminate): Save errno since semaphore::close()
	may now modify it.
2011-03-29 07:49:25 +00:00
Corinna Vinschen ec0f7c31f3 * cygwin.din (strchrnul): Export.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
	* posix.sgml (std-gnu): Add strchrnul.
2011-03-28 14:55:20 +00:00
Christopher Faylor f3e3e0e7eb * dll_init.cc (dll::init): Accommodate ill-behaved dlls who don't fill out
p.envptr.
2011-03-27 19:14:02 +00:00
Corinna Vinschen 57abff16c3 * mmap.cc (mmap64): Add a cheat to let a certain autoconf test succeed
on 64 bit systems.  Explain why.
2011-03-25 20:39:26 +00:00
Christopher Faylor 50160412b0 * wincap.cc (wincap_2003): Set use_dont_resolve_hack to true. 2011-03-23 21:33:36 +00:00
Christopher Faylor bb991481c5 * autoload.cc (dll_load): Change error message to make it clear if a newer DLL
is being run.
2011-03-23 05:30:49 +00:00
Corinna Vinschen cb8c63e08d Fix typo. 2011-03-20 15:36:13 +00:00
Corinna Vinschen 33150e7f40 * fenv.cc (_feinitialise); Don't use SSE instructions on systems not
supporting them.
	* wincap.h (wincaps::supports_sse): New element.
	* wincap.cc: Implement above element throughout.
2011-03-20 15:34:29 +00:00
Corinna Vinschen b8bdc60019 * cygwin.sc: Raise default cygheap size to 2 Megs. 2011-03-18 18:16:37 +00:00
Corinna Vinschen 3c40dbce73 Fix typo. 2011-03-18 14:42:30 +00:00
Christopher Faylor 41045fb74d * fhandler.h (DEFAULT_PIPEBUFSIZE): Reset to 64K. 2011-03-18 14:25:33 +00:00
Corinna Vinschen ccbc7fca21 * mmap.cc (mmap_record::alloc_fh): Initialize nmae strings in fdev to
empty strings or suffer a SEGV.  Drop second parameter in call to
	build_fh_dev.
2011-03-18 13:56:56 +00:00
Corinna Vinschen bf69faeb0d * mmap.cc (class mmap_record): Pack 4 byte-aligned. Convert member dev
to plain int.
	(mmap_record::alloc_fh): Create temporary device from dev and use in
	call to build_fh_dev.
2011-03-18 13:42:03 +00:00
Corinna Vinschen ac706ac123 * mmap.cc (mmap_record::page_map): Define as variable array rather than
as pointer.
	(mmap_record::alloc_page_map): Remove.
	(mmap_record::free_page_map): Remove.
	(mmap_record::init_page_map): New method.
	(mmap_record::add_record): Take mmap_record parameter by reference
	rather than by value.
	(mmap_record::map_pages): Fix comment.
	(mmap_list::add_record): Allocate space for mmap_record including the
	page_map in a single ccalloc call.  Call init_page_map afterwards.
	(mmap_list::del_record): Remove call to mmap_record::free_page_map.
2011-03-18 13:38:34 +00:00
Corinna Vinschen b532ee08bc * crt0.c (mainCRTStartup): Move call to _feinitialise from here...
* dcrt0.cc (_dll_crt0): ...to here.
2011-03-17 08:40:25 +00:00
Corinna Vinschen d2948a681d * winver.rc: Fix copyright dates. 2011-03-16 21:10:51 +00:00
Corinna Vinschen 91b3d1ed7a * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Only use
file id as inode number if it masters the isgood_inode check.
2011-03-14 09:14:17 +00:00
Christopher Faylor 9636c4262e * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Remove special
treatment for ERROR_NO_SYSTEM_RESOURCES.  Cancel I/O and reset the overlapped
handle on error.
(fhandler_base_overlapped::write_overlapped): Limit writes to max_atomic_write
bytes in blocking case.  Incorporate code from now-defunct
write_overlapped_fallback.  Fix serious oversight where ptr was not advanced as
buffer was written.
(fhandler_base_overlapped::write_overlapped_fallback): Eliminate.
* fhandler.h (fhandler_base_overlapped::write_overlapped_fallback): Ditto for
declaration.
(DEFAULT_PIPEBUFSIZE): Lower size to slightly less than documented worst-case
atomic write size.
(fhandler_overlapped::wait_return): Remove unused element.
2011-03-13 20:20:58 +00:00
Christopher Faylor 904e3e2004 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): Handle
overlapped_fallback error condition like other error conditions.  Set res
carefully and specifically for each condition rather than resorting to a
default.
(fhandler_base_overlapped::write_overlapped): Preserve errno in
overlapped_fallback condition.  Correct write_overlapped_fallback to avoid
inappropriate looping.
(fhandler_base_overlapped::write_overlapped_fallback): Add some more comments.
2011-03-09 22:48:05 +00:00
Christopher Faylor ed6b66c88d * fhandler.cc (fhandler_base_overlapped::write_overlapp): Oops! Accommodate
change in arguments to wait_overlapped.
2011-03-09 16:55:54 +00:00
Christopher Faylor 779ece3ce0 * errno.cc (errmap): Change mapping of NO_SYSTEM_RESOURCES to EFBIG.
* fhandler.cc (MAX_OVERLAPPED_WRITE_LEN): New constant.
(MIN_OVERLAPPED_WRITE_LEN): Ditto.
(fhandler_base_overlapped::close): Accommodate change in arguments to
wait_overlapped.
(fhandler_base_overlapped::setup_overlapped): Add __stdcall and regparm
modifiers.
(fhandler_base_overlapped::destroy_overlapped): Ditto.
(fhandler_base_overlapped::has_ongoing_io): Ditto.
(fhandler_base_overlapped::wait_overlapped): Modify to return an enum returning
various states.  Accept nonblocking parameter.
(fhandler_base_overlapped::read_overlapped): Add __stdcall and regparm
modifiers.  Rework to attempt to be smarter about reacting to states returned
by wait_overlapped.
(fhandler_base_overlapped::write_overlapped): Ditto.  Add fallback option for
when wait_overlapped detects that smaller chunks must be written.
(fhandler_base_overlapped::write_overlapped_fallback): Ditto.
* fhandler.h (DEFAULT_PIPEBUFSIZE): Move definition here from pipe.cc.
(fhandler_base::has_ongoing_io): Define with __stdcall and regparm modifiers.
(fhandler_base_overlapped::wait_return): New enum.
(fhandler_base_overlapped::max_atomic_write): New variable.
(fhandler_base_overlapped:: wait_overlapped): Accommodate changes mentioned
above to arguments and modifiers.
(fhandler_base_overlapped::setup_overlapped): Ditto for modifiers.
(fhandler_base_overlapped::read_overlapped): Ditto.
(fhandler_base_overlapped::write_overlapped): Ditto.
(fhandler_base_overlapped::destroy_overlapped): Ditto.
(fhandler_base_overlapped::has_ongoing_io): Ditto.
(fhandler_base_overlapped::fhandler_base_overlapped): Zero max_atomic_write.
* fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Set max_atomic_write to the
size of the DEFAULT_PIPEBUFSIZE.
(fhandler_fifo::wait): Accommodate change in arguments to wait_overlapped.
* pipe.cc (fhandler_pipe::fhandler_pipe): Set max_atomic_write to the size of
the DEFAULT_PIPEBUFSIZE.
(fhandler_pipe::create_selectable): Allow minimum size of DEFAULT_PIPEBUFSIZE.
(DEFAULT_PIPEBUFSIZE): Delete here, move to fhandler.h.
2011-03-09 16:47:44 +00:00
Corinna Vinschen e7b5eaaac9 * security.cc: Fix copyright dates. 2011-03-08 15:12:58 +00:00
Corinna Vinschen 69d7815eae * fhandler.cc (fhandler_base::open): When creating a file on a
filesystem supporting ACLs, create the file with WRITE_DAC access.
	Explain why.
	* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for
	directories.
	* fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets.
	* path.cc (symlink_worker): Ditto for symlinks.
	* security.cc (get_file_sd): Always call GetSecurityInfo for directories
	on XP and Server 2003.  Improve comment to explain why.
	(set_file_attribute): Explicitely cast mode_t value to bool in call to
	get_file_sd.
	* wincap.h (wincaps::use_get_sec_info_on_dirs): New element.
	* wincap.cc: Implement above element throughout.
2011-03-08 14:26:15 +00:00
Corinna Vinschen d5071ad7f5 * fhandler_procsys.cc (fhandler_procsys::exists): Rewrite.
(fhandler_procsys::fill_filebuf): Fill buffer with valid string even if
	reading the symlink fails.
2011-03-04 17:51:42 +00:00
Corinna Vinschen b994b83729 * posix_ipc.cc (ipc_cond_timedwait): If ipc_mutex_unlock fails, return
actual error number.
	(_mq_send): Break loop if ipc_cond_timedwait returns with error.
	(_mq_receive): Ditto.
2011-03-03 15:48:36 +00:00
Corinna Vinschen b7351dcfb1 * errno.cc (__xpg_strerror_r): Add accidentally missing condition. 2011-03-03 09:50:13 +00:00
Corinna Vinschen 723223ab9f * fhandler_procsys.cc (fhandler_procsys::open): Call worker exists
method, rather than wrapper.
2011-03-02 13:22:44 +00:00
Christopher Faylor 7a3190f081 * autoload.cc (dll_load): Avoid in_forkee test since this apparently fails even
when not forked.
2011-03-01 22:36:19 +00:00
Christopher Faylor 96ef911a49 * include/cygwin/version.h: Bump CYGWIN_VERSION_DLL_MINOR to 9. 2011-03-01 22:35:00 +00:00
Christopher Faylor ba5f92981d * autoload.cc (dll_load): Only perform DONT_RESOLVE_DLL_REFERENCES hack on
systems which need it.
* wincap.cc (use_dont_resolve_hack): Set as appropriate.
* wincap.h (use_dont_resolve_hack): Define.
2011-03-01 00:19:23 +00:00
Christopher Faylor 8ceb4854b6 * autoload.cc (dll_load): Make inline. Clarify logic. 2011-02-28 20:55:10 +00:00
Corinna Vinschen 7b5dc6db8e * autoload.cc (dll_load): Only call LoadLibraryExW with
DONT_RESOLVE_DLL_REFERENCES if a normal LoadLibrary call failed with
	ERROR_INVALID_ADDRESS.
	(LsaRegisterLogonProcess): Align comment to previous change.
2011-02-27 09:45:58 +00:00
Christopher Faylor a16b0549d4 * autoload.cc: Use LoadDLLfuncEx3 for all winmm functions. Accommodate changes
to LoadDLLprime.
(LoadDLLprime): Take an extra argument indicating whether this dll needs
special handling on fork.  Place this information in the "handle" location.
(LoadDLLfuncEx3): Eliminate "func" handling.  Pass new no_resolve_on_fork
argument to LoadDLLprime.
(dll_load): New function.
(std_dll_init): Accommodate changes to dll_info::handle.  Use dll_load to load
DLL in both cases where it is used.
2011-02-26 23:30:33 +00:00
Corinna Vinschen e80f6dc8f0 * autoload.cc: Make autoloaded ntdll function non-optional. Ditto for
secur32 functions, except for LsaRegisterLogonProcess.  Change return
	value to ERROR_PROC_NOT_FOUND.  Explain why.
	* sec_auth.cc (lsaauth): Handle ERROR_PROC_NOT_FOUND from call to
	LsaRegisterLogonProcess when generating the errno value.
2011-02-26 20:47:56 +00:00
Corinna Vinschen 12374d7d2f * dcrt0.cc: Fix copyright dates.
* winsup.h: Ditto.
	* syscalls.cc (_read): Move EXPORT_ALIAS to its rightful place.
2011-02-22 09:17:57 +00:00
Christopher Faylor ca05a1b4fd * cygwin.din: Mark __assert* and _abort as NOSIGFE. 2011-02-22 01:32:42 +00:00
Corinna Vinschen 41e50f04cf Add missing Changelog entry for previous patch:
* fhandler_socket (fhandler_socket::readv): Call recv_internal directly,
	rather than recvmsg.
	(fhandler_socket::writev): Call send_internal directly, rather than
	sendmsg.
	* net.cc (cygwin_recv): Call fhandler_socket::recvfrom directly, rather
	than cygwin_recvfrom.
	(cygwin_send): Call fhandler_socket::sendto directly, rather than
	cygwin_sendto.
2011-02-21 17:11:10 +00:00
Christopher Faylor 05901e6aee * fhandler.cc (fhandler_base_overlapped::close): Finish any pending I/O before
closing.
(fhandler_base_overlapped::wait_overlapped): Defensively zero bytes read.  Add
more info to debugging output.
2011-02-21 03:18:30 +00:00
Christopher Faylor 734e1c50ff * dcrt0.cc (dll_crt0_1): Add a CYGHEAP_DEBUG conditional for debugging which
allocates a lot of space at startup.
2011-02-18 17:43:22 +00:00
Corinna Vinschen f65dbc7e27 * cygwin.sc: Set alignment of .cygheap section to 64K. 2011-02-18 16:15:20 +00:00
Corinna Vinschen 8ec562ed28 * spawn.cc (spawn_guts): Only set PID_NOTCYGWIN in _P_OVERLAY mode.
Drop flag if creating new process failed.
2011-02-15 18:11:50 +00:00
Corinna Vinschen 3591470260 * Throughout fix copyright dates. 2011-02-15 15:56:03 +00:00
Corinna Vinschen a413f8a20e * devices.in: Throughout use slashes instead of backslashes in the
native path of devices not backed by native NT devices.
	* devices.cc: Regenerate.
	* globals.cc (ro_u_pmem): Use correct case.
	(ro_u_globalroot): New R/O unicode string.
	* path.cc (path_conv::check): Fix incorrect handling of /proc/sys
	block devices if they are just visited due to a component check.
	(symlink_info::posixify): Fix typo in comment.
	(cygwin_conv_path): Use ro_u_globalroot instead of string constant.
	(fast_cwd_version): New shared variable to store FAST_CWD version
	used on the system.
	(find_fast_cwd_pointer): Rename from find_fast_cwd_pointers.  Don't
	set global fast_cwd_ptr pointer here.  Return pointer value instead.
	(find_fast_cwd): New function to set fast_cwd_ptr and fast_cwd_version.
	(cwdstuff::override_win32_cwd): Call find_fast_cwd from here.
	Check for fast_cwd_version to differ between old and new FAST_CWD
	structure.  Check old_cwd for NULL to avoid SEGV.  Don't set CWD if
	we have neitehr a valid fast_cwd_ptr, nor a valid CWD handle in the
	process parameter block.
	(cwdstuff::set): Create Win32 path taking /proc/sys paths into account.
	* spawn.cc (spawn_guts): Recode creating runpath.  Also take /proc/sys
	paths into account.  Drop special CWD handling when starting non-Cygwin
	processes.
2011-02-15 15:25:59 +00:00
Corinna Vinschen fe222f2210 * fhandler_procsys.cc (fhandler_procsys::opendir): Avoid SEGV if
opening object directory fails.
	* fhandler_virtual.cc (fhandler_virtual::opendir): Don't leak memory.
2011-02-15 14:44:11 +00:00
Corinna Vinschen c48947b454 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
append slash if there is one already.
2011-02-15 10:47:24 +00:00
Corinna Vinschen ec58420870 Revert change from 2010-08-31:
* path.cc (normalize_posix_path): Drop support for //./ and //?/
	prefixes.
	(path_conv::check): Ditto.
2011-02-15 10:39:36 +00:00
Corinna Vinschen 2908e3eb80 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Use POSIX
path to check for symlink.
2011-02-15 10:31:54 +00:00
Corinna Vinschen 4655360348 * config/i386/profile.h: Sync with Mingw. 2011-02-14 09:42:19 +00:00
Corinna Vinschen 32d86d2ab2 * path.cc (struct _FAST_CWD): Redefine to new layout used since patch
for KB 2393802.  Adjust comments throughout.
	(struct _FAST_CWD_OLD): Rename former definition.
	(cwdstuff::override_win32_cwd): Check if the OS is using the old or the
	new FAST_CWD structure layout and handle accordingly.
2011-02-13 15:43:00 +00:00
Christopher Faylor 98525461c8 * mkstatic: Make sure that we are not cd'ed to temporary directory on exit to
avoid bogus warnings on directory cleanup.
* speclib: Ditto.
* mkimport: Ditto.
2011-02-11 18:00:55 +00:00
Christopher Faylor 41f06f51ac * cygwin.sc: Eliminate __cygheap_mid.
* cygheap.cc: Ditto.
2011-02-11 16:18:34 +00:00
Christopher Faylor cc25fb3641 * cygheap.cc (_cygheap_mid): Drop unneeded section attribute.
(cygheap_init): Just zero cygheap structure.
* cygwin.sc: Keep 16 byte alignment but drop all other alignments related to
cygheap.  Eliminate unused __cygheap_end1.
2011-02-11 16:05:26 +00:00
Corinna Vinschen 5ec0839c12 * cygwin.sc: Raise default cygheap size to 1 Meg. Set alignment to
standard 64K.
2011-02-11 12:58:01 +00:00
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
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