aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
AgeCommit message (Collapse)AuthorFilesLines
2011-05-15 * cygwin.din (pthread_attr_getguardsize): Export.Corinna Vinschen12-24/+274
(pthread_attr_setguardsize): Export. (pthread_attr_setstack): Export. (pthread_attr_setstackaddr): Export. * init.cc (dll_entry): Remove wow64_test_stack_marker. Check for unusual stack address by testing stack addresses from current TEB. Check validity of _my_tls by testing if it's within the stack as given in current TEB. * miscfuncs.cc (struct thread_wrapper_arg): New structure used to push all required information to thread_wrapper function. (thread_wrapper): Wrapper function for actual thread function. If an application stack has been given, change %ebp and %esp so that the thread function runs on that stack. If the thread has been created by CygwinCreateThread, set up the POSIX guard pages if necessary. (CygwinCreateThread): New function. * miscfuncs.h (CygwinCreateThread): Declare. * ntdll.h (struct _TEB): Define all members up to Peb. * posix.sgml (std-susv4): Move pthread_attr_getguardsize, pthread_attr_setguardsize and pthread_attr_setstack here. (std-deprec): Add pthread_attr_setstackaddr. * sysconf.cc (sca): Set _SC_THREAD_ATTR_STACKADDR to _POSIX_THREAD_ATTR_STACKADDR. * thread.cc (pthread::precreate): Copy pthread_attr stackaddr and guardsize members. (pthread::create): Call CygwinCreateThread. (pthread_attr::pthread_attr): Initialize guardsize. (pthread_attr_setstack): New function. (pthread_attr_setstackaddr): New function. (pthread_attr_setguardsize): New function. (pthread_attr_getguardsize): New function. (pthread_getattr_np): Copy attr.guardsize. * thread.h (pthread_attr): Add member guardsize. * include/pthread.h (pthread_attr_getguardsize): Declare. (pthread_attr_setguardsize): Declare. * include/cygwin/version.h: Bump API minor number.
2011-05-13 * fhandler_process.cc (struct heap_info::heap): Convert base toCorinna Vinschen3-26/+110
uintptr_t. Add heap_id, end, flags members. (heap_info::heap_vm_chunks): Rename from heaps. (heap_info::heap_info): Rearrange using RtlQueryProcessDebugInformation to get information of heap virtual memory blocks. Store heap id and flags, as well as end address of each block. (heap_info::fill_if_match): Check incoming base address against full address range of heap chunks. Convert flag values in extra heap information. (format_process_maps): Change order so that heap check is done before MEM_MAPPED check since there are shareable heaps. * ntdll.h (PDI_HEAP_BLOCKS): Define. (HEAP_FLAG_NOSERIALIZE): Define. (HEAP_FLAG_GROWABLE): Define. (HEAP_FLAG_EXCEPTIONS): Define. (HEAP_FLAG_NONDEFAULT): Define. (HEAP_FLAG_SHAREABLE): Define. (HEAP_FLAG_EXECUTABLE): Define. (HEAP_FLAG_DEBUGGED): Define. (struct _DEBUG_HEAP_ARRAY): Define. (struct _DEBUG_HEAP_BLOCK): Define.
2011-05-12 Based on newlib patch to strptime by Peter Rosin <peda@lysator.liu.se>:Corinna Vinschen2-0/+101
* libc/time/strptime.c (is_leap_year): New static function. (first_day): Ditto. (__strptime): Fill in tm_yday when all of tm_year, tm_mon and tm_mday are updated. Fill in tm_mon, tm_mday and tm_wday when both of tm_year and tm_yday are updated.
2011-05-12* fhandler_proc.cc (format_proc_meminfo): Rewrite to use sysinfo().Yaakov Selkowitz2-64/+31
Support RAM and swap space larger than 4GB. Remove output elements not found with modern Linux kernels. (format_proc_swaps): Support paging files larger than 4GB.
2011-05-11 * autoload.cc: Remove useless comment.Corinna Vinschen2-1/+4
2011-05-11 * autoload.cc (EnumProcessModules): Remove.Corinna Vinschen4-17/+57
* dlfcn.cc (dlopen): Make sure errno is set if an error occurs. (dlsym): Rewrite using RtlQueryProcessDebugInformation instead of EnumProcessModules. * ntdll.h (struct _DEBUG_MODULE_ARRAY): Define. (RtlCreateQueryDebugBuffer): Declare. (RtlDestroyQueryDebugBuffer): Declare. (RtlQueryProcessDebugInformation): Declare.
2011-05-11 * autoload.cc (GetModuleFileNameExW): Remove.Corinna Vinschen2-2/+5
* autoload.cc (GetModuleInformation): Remove.
2011-05-11 * autoload.cc (QueryWorkingSet): Remove.Corinna Vinschen2-1/+4
2011-05-11 * fhandler_process.cc (format_process_maps): Rework to reportCorinna Vinschen3-69/+246
all mapped address space in a process (committed or reserved), identifying the nature of the mapping (mapped file/image, heap, shared memory) when possible. (dos_drive_mappings): New helper classes. (heap_info): Ditto. * ntdll.h (struct _MEMORY_SECTION_NAME): Define.
2011-05-11 * autoload.cc (GetProcessMemoryInfo): Remove.Corinna Vinschen3-8/+14
* resource.cc (fill_rusage): Call NtQueryInformationProcess rather than GetProcessMemoryInfo to drop a psapi dependency.
2011-05-11 * fhandler_socket.cc (get_inet_addr): Rearrange for better readability.Corinna Vinschen3-84/+126
Make waiting loop interruptible and cancelable. Check for SYSTEM DOS flag before reading the file. Change return value to return 0 on success, SOCKET_ERROR on failure. (fhandler_socket::bind): Only set R/O DOS flag on filesystems not supporting ACLs. (fhandler_socket::connect): Accommodate changed return values from get_inet_addr. Use SOCKET_ERROR instead of -1. (fhandler_socket::sendto): Accommodate changed return values from get_inet_addr. * syslog.cc (connect_syslogd): Ditto.
2011-05-10 * security.cc (check_registry_access): Handle missingChristian Franke2-1/+11
security descriptor of HKEY_PERFORMANCE_DATA.
2011-05-10 * lc_msg.h: Regenerate.Corinna Vinschen2-1/+12
2011-05-10 * fhandler_proc.cc (format_proc_uptime): Don't call GetSystemInfo.Corinna Vinschen7-24/+34
Fetch CPU count from wincap. (format_proc_stat): Ditto. * globals.cc (system_info): Move to wincap. * heap.cc (heap_init): Fetch page size from wincap. * syscalls.cc (getpagesize): Fetch allocation granularity from wincap. (getsystempagesize): Fetch page size from wincap. * wincap.cc (wincap_2003): Default is_server to false. (wincapc::init): Call GetSystemInfo here. Always set is_server value. * wincap.h (class wincapc): Add system_info as private member. (wincapc::cpu_count): New public method. (wincapc::page_size): Ditto. (wincapc::allocation_granularity): Ditto.
2011-05-10 * environ.cc (set_chunksize): Remove.Corinna Vinschen5-27/+12
(parse_thing): Remove forkchunk entry. * fork.cc (child_copy): Drop handling external chunksize setting. * wincap.cc: Througout, drop chunksize. (wincapc::set_chunksize): Remove. * wincap.h (struct wincaps): Drop chunksize and declaration of set_chunksize.
2011-05-09* times.cc (settimeofday): Add EFAULT handler.Yaakov Selkowitz5-7/+53
Set errno to EINVAL if tv.tv_nsec is invalid, and to EPERM if SetSystemTime fails. Return -1 in case of failure, all for compatibility with BSD and Linux. (clock_settime): New function. * cygwin.din (clock_settime): Export. * posix.sgml (std-susv4): Add clock_settime. Move clock_setres from here... (std-deprec): ... to here. (std-notes): Correct limitation of clock_setres to only CLOCK_REALTIME. Add limitation of clock_settime to only CLOCK_REALTIME. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-05-07 * registry.cc (get_registry_hive_path): Change system_printf toCorinna Vinschen2-4/+10
debug_printf. (load_registry_hive): Ditto.
2011-05-06* fhandler.h (fhandler_base::close_with_arch): Make non-virtual.Christopher Faylor2-2/+8
(fhandler_base::open_fs): Move closer to it's close counterpart.
2011-05-06* fhandler.cc (fhandler_base::dup): Avoid duping a handle when an fhandler hasChristopher Faylor3-5/+14
an archetype. * fhandler_console.cc (fhandler_console::invisible_console): Move to the top. (fhandler_console::set_close_on_exec): Don't set close-on-exec on handle since it's an archetype and you don't know how many things could be using it.
2011-05-06* fhandler.h (fhandler_dev_dsp): Cosmetic change.Christopher Faylor4-3/+16
* fhandler_tty.cc (fhandler_pty_master::process_slave_output): Put back Sleep(10) for tty_master case. * sigproc.cc (stopped_or_terminated): Don't consider a pid which has been reaped to be terminated.
2011-05-06* sysconf.cc (sysinfo): New function.Yaakov Selkowitz6-3/+129
* cygwin.din (sysinfo): Export. * posix.sgml (std-gnu): Add sysinfo. * include/sys/sysinfo.h (struct sysinfo): Define. (sysinfo): Declare. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-05-06 * libc/minires-os-if.c (get_dns_info): Drop printing uninitializedCorinna Vinschen2-1/+6
value of dwRetVal in debug output.
2011-05-06 * fhandler.h (fhandler_socket::read): Declare.Corinna Vinschen5-54/+135
(fhandler_socket::write): Declare. * fhandler_procsys.cc (fhandler_procsys::read): Add FIXME comment. (fhandler_procsys::write): Ditto. * fhandler_socket.cc (fhandler_socket::read): New method. (fhandler_socket::write): New method. * syscalls.cc: Rearrange order of read/write functions. (read): Call fhandler read method directly instead of just readv. (readv): Remove EINTR loop. This is done in all affected fhandler's now. (write): Call fhandler write method directly instead of just writev. Fix debug output.
2011-05-05* cygheap.cc (cygheap::close_ctty): Close ctty via close_with_arch().Christopher Faylor14-406/+408
* debug.cc (close_handle): Call debugger on failure. * devices.in (device::tty_to_real_device): Delete. * devices.h (device::tty_to_real_device): Ditto. * devices.cc: Regenerate. * dtable.cc: Delete old ifdef'ed vfork code. (dtable::release): Don't handle archetype here. (dtable::init_std_file_from_handle): Consolidate console tests. Generate major/minor for tty ASAP. Fix incorrect setting of DEV_TTYS* for serial. (fh_alloc): New function derived from build_fh_pc. Pass current tty when building tty. (build_pc_pc): Use fh_alloc to create. Set name from fh->dev if appropriate. Generate an archetype or point to one here. (dtable::dup_worker): Deal with archetypes. Rely on = operator copying whole class rather than just fhandler_base. (dtable::fixup_after_exec): Call close_with_arch to handle closing of fhandlers with archetypes. * fhandler.cc (fhandler_base::operator =): Call memcpy with fhandler's size() rather than sizeof fhandler_base. (fhandler_base::open_with_arch): New function. Handles opening of fhandler's with archetypes, dealing with usecounts, etc. (fhandler_base::close_with_arch): Ditto for close. * fhandler.h: Many changes for archetypes. (fhandler_base::set_name): Set both normalized path and regular path. (fhandler_base::open_with_arch): New function. (fhandler_base::open_setup): Ditto. (fhandler_base::use_archetype): Ditto. (fhandler_base::_archetype_usecount): Ditto. (fhandler_*::size): Ditto. (fhandler_dev_tape::open): Remove virtual decoration. (fhandler_console::use_archetype): New function. Return true. (fhandler_console::open_setup): New function. (fhandler_console::dup): Delete. (fhandler_tty_slave::fhandler_tty_slave): Redeclare to take an argument. (fhandler_tty_slave::use_archetype): New function. Return true. (fhandler_tty_slave::cleanup): New function. (fhandler_pty_master::use_archetype): New function. Return true. (fhandler_pty_master::cleanup): New function. (fhandler_pty_master::is_tty_master): New function. Return false. (fhandler_tty_master::is_tty_master): New function. Return true. (fhandler_dev_dsp::fhandler_dev_dsp): New function. Return true. (report_tty_counts): Only report on archetype's usecount if there is one. * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove handling of setsid, set_ctty, set_flags, and manage_console_count. (fhandler_console::open_setup): New function. Implement functionality removed from get_tty_stuff. (fhandler_console::dup): Delete. (fhandler_console::output_tcsetattr): Set errno on error. (fhandler_console::fhandler_console): Set device early. (fhandler_console::init): Use open_with_arch to open console handles. (fhandler_console::fixup_after_fork_exec): Nuke most of the stuff for dealing with console handles. * fhandler_dsp.cc (fhandler_dev_dsp::open): Remove archetype handling. (fhandler_dev_dsp::write): Ditto. (fhandler_dev_dsp::read): Ditto. (fhandler_dev_dsp::close): Ditto. (fhandler_dev_dsp::dup): Ditto. (fhandler_dev_dsp::ioctl): Ditto. (fhandler_dev_dsp::fixup_after_fork): Ditto. (fhandler_dev_dsp::fixup_after_exec): Ditto. * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Add a little more debugging. (fhandler_tty_common::__release_output_mutex): Ditto. (fhandler_pty_master::process_slave_output): Ditto. Don't do signal handling or pthread_cancel handling in the tty master thread. (process_output): Minor reorg. (fhandler_tty_slave::fhandler_tty_slave): Set device based on new ntty argument. (fhandler_tty_slave::open): Remove archetype handling. Move some processing into open_setup(). (fhandler_tty_slave::open_setup): New function. (fhandler_tty_slave::cleanup): New function. (fhandler_tty_slave::close): Remove archetype handling. Move some processing into cleanup(). (fhandler_tty_slave::init): Rename argument from f to h. Open device using open_with_arch(). Remove archetype handling. (fhandler_pty_master::dup): Ditto. (fhandler_pty_master::open): Ditto. (fhandler_pty_master::close): Ditto. Move some handling to cleanup(). (fhandler_pty_master::cleanup): New function. (fhandler_tty_master::init_console): Give unique name to captive console fhandler. * pinfo.cc (_pinfo::set_ctty): Rename argument from arch to fh. Eliminate archetype assumption. * syscalls.cc (close_all_files): Use close_with_arch for closing. (open): Use open_with_arch() rather than open(). (close): Use close_with_arch() rather than close().
2011-05-05 * pinfo.h (class push_process_state): New class to push a process stateCorinna Vinschen5-19/+73
flag temporarily into myself->process_state. * fhandler_console.cc (fhandler_console::read): Add push_process_state handler. (fhandler_console::write): Call bg_check from here. Add push_process_state handler. * fhandler_tty.cc (fhandler_tty_slave::write): Ditto. (fhandler_tty_slave::read): Ditto. (fhandler_pty_master::write): Ditto. (fhandler_pty_master::read): Ditto. * syscalls.cc (readv): Remove bg_check call and setting process state. (writev): Ditto.
2011-05-05 * syscalls.cc (readv): Add myfault handler. Don't check repeatedlyCorinna Vinschen2-34/+29
open state of file handler. Streamline loop. (writev): Add myfault handler.
2011-05-05* fhandler.cc (fhandler_base_overlapped::raw_read): Rename fromChristopher Faylor6-40/+39
read_overlapped. (fhandler_base_overlapped::raw_e): Rename from write_overlapped. * fhandler.h (fhandler_*::raw_read): Add reparm decoration. (fhandler_*::raw_write): Ditto. (fhandler_base_overlapped::raw_read): Rename from read_overlapped. (fhandler_base_overlapped::raw_write): Rename from write_overlapped. (fhandler_pipe::raw_read): Delete. (fhandler_pipe::raw_write): Ditto. (fhandler_mailslot::raw_read): Ditto. * fhandler_fifo.cc (fhandler_fifo::raw_read): Reflect read_overlapped -> raw_read rename. (fhandler_fifo::raw_write): Ditto. * fhandler_mailslot.cc (fhandler_mailslot::raw_read): Delete. (fhandler_mailslot::raw_write): Reflect read_overlapped -> raw_read rename. * pipe.cc (fhandler_pipe::raw_read): Delete. (fhandler_pipe::raw_write): Ditto.
2011-05-05* fork.cc (fork): Clear PID_REAPED.Christopher Faylor4-5/+12
* pinfo.cc (pinfo_init): Ditto. (pinfo::init): Check for PID_REAPED. * sigproc.cc (stopped_or_terminated): Ditto.
2011-05-05* pinfo.cc (_pinfo::exists): Check for PID_REAPED.Christopher Faylor2-1/+5
2011-05-05 Fix typo.Corinna Vinschen1-1/+1
2011-05-05 * fhandler_disk_file.cc (fhandler_disk_file::pread): Correctly returnCorinna Vinschen2-0/+18
with errno set to EBADF if file open mode is incorrect. (fhandler_disk_file::pwrite): Ditto.
2011-05-05 * fhandler.cc (is_at_eof): Drop static storage class. Drop errCorinna Vinschen3-4/+72
parameter since we don't change the Win32 error here anymore. (fhandler_base::raw_read): Accommodate change to is_at_eof. * fhandler_disk_file.cc (fhandler_disk_file::pread): In binary mode use direct call to NtReadFile, rather than lseek/read. (fhandler_disk_file::pwrite): In binary mode use direct call to NtWriteFile, rather than lseek/write.
2011-05-05 * dcrt0.cc (dll_crt0_1): Reset locale to "C" even when dynamicallyCorinna Vinschen2-1/+9
loaded.
2011-05-05 * posix.sgml (std-notimpl): Remove bsd_signal, setcontext, andCorinna Vinschen2-4/+6
swapcontext, marked obsolete in SUSv3 and not present in SUSv4.
2011-05-05 * fhandler_registry.cc (fhandler_registry::exists): Fix regressionCorinna Vinschen2-2/+10
in EACCES handling. (fhandler_registry::open): Fix "%val" case.
2011-05-05* signal.cc (_pinfo::kill): Return success on kill(0) only if pid exists or isChristopher Faylor4-5/+16
in PID_EXITED state. Report pid 0 when pid does not exist rather than pid -1. Make debug output reflect actual function call. * sigproc.cc (stopped_or_terminated): Set process state to reaped when we've finished waiting for it. * include/sys/cygwin.h (PID_REAPED): New enum.
2011-05-04* cygwin.din (psiginfo): Export.Yaakov Selkowitz6-5/+74
(psignal): Export. (sys_siglist): Export. * posix.sgml (std-notimpl): Move psiginfo and psignal from here... (std-susv4): ... to here. (std-deprec): Add sys_siglist. * strsig.cc (sys_siglist): New array. (psiginfo): New function. * include/cygwin/signal.h (sys_siglist): Declare. (psiginfo): Declare. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2011-05-04* dll_list::detach (dll_list::detach): Avoid doing anything with detach duringChristopher Faylor2-1/+9
a failing fork.
2011-05-04* dll_init.cc (dll_global_dtors): Avoid calling destructors during failingChristopher Faylor2-0/+10
fork().
2011-05-04 * fhandler.h (class fhandler_base): Remove uninterruptible_io statusCorinna Vinschen8-90/+27
flag. (fhandler_base::ready_for_read): Remove declaration. (fhandler_socket::ready_for_read): Ditto. (fhandler_pipe::ready_for_read): Ditto. (fhandler_tty_master::is_slow): Remove. * fhandler_console.cc (fhandler_console::open): Drop setting uninterruptible_io. * fhandler_serial.cc (fhandler_serial::open): Ditto. * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Ditto. (fhandler_tty_master::init_console): Ditto. * pipe.cc (fhandler_pipe::fhandler_pipe): Ditto. (fhandler_pipe::open): Ditto. (_pipe): Ditto. * select.cc (fhandler_pipe::ready_for_read): Remove. (fhandler_base::ready_for_read): Remove. * syscalls.cc (readv): Drop unneeded wait variable. Remove entire test which might lead to calling ready_for_read. Remove now unused label out.
2011-05-04 * fhandler.h (class fhandler_mailslot): Move down in file and changeCorinna Vinschen3-20/+42
parent class to fhandler_base_overlapped. Remove declaration of method write. Add declaraiotns for raw_read and raw_write. * fhandler_mailslot.cc (fhandler_mailslot::fhandler_mailslot): Call fhandler_base_overlapped constructor. (fhandler_mailslot::fstat): Call fhandler_base_overlapped::fstat. (fhandler_mailslot::open): Drop FILE_SYNCHRONOUS_IO_NONALERT flag from call to NtOpenFile. (fhandler_mailslot::raw_read): New method. (fhandler_mailslot::raw_write): Ditto. Take over length algorithm from former write method. (fhandler_mailslot::write): Remove. (fhandler_mailslot::ioctl): Call fhandler_base_overlapped::ioctl.
2011-05-04 * fhandler.h (fhandler_dev_tape::_lock): Add bool parameter.Corinna Vinschen3-11/+40
* fhandler_tape.cc (lock): Call _lock with false argument. (_lock): Take bool cancelable parameter. Handle O_NONBLOCK. Make cancelable if cancelabe parameter is true. (fhandler_dev_tape::raw_read): Call _lock with true argument. (fhandler_dev_tape::raw_write): Ditto.
2011-05-04 * fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add fh member.Corinna Vinschen2-25/+119
(fhandler_dev_dsp::Audio_out::Audio_out): Take pointer to encapsulating fhandler_dev_dsp as parameter. (fhandler_dev_dsp::Audio_in::Audio_in): Ditto. (fhandler_dev_dsp::Audio::Audio): Take pointer to encapsulating fhandler_dev_dsp as parameter and store in fh. (fhandler_dev_dsp::Audio_out::write): Change return type to int and return number of bytes written. Return -1 if waitforspace returns false and no bytes have been written so far. (fhandler_dev_dsp::Audio_out::waitforspace): Change return type to bool. Handle O_NONBLOCK. Make waiting loop interruptible and cancelable. Return false in any of these cases, otherwise true. (fhandler_dev_dsp::Audio_in::read): Set returned nBytes to -1 if waitfordata returns false and nothing has been read so far. (fhandler_dev_dsp::Audio_in::waitfordata): Change return type to bool. Handle O_NONBLOCK. Make waiting loop interruptible and cancelable. Return false in any of these cases, otherwise true. (fhandler_dev_dsp::write): Call Audio_out constructor with this as parameter. (fhandler_dev_dsp::read): Call Audio_in constructor with this as parameter.
2011-05-04* thread.h (pthread::static_cancel_self): Mark as noreturn.Christopher Faylor3-3/+12
(pthread::cancel_self): Ditto. * thread.cc (pthread::cancel_self): Explicitly use pthread::exit to avoid a "function returns" error.
2011-05-04* pinfo.cc (pinfo::pinfo): Set procinfo to NULL to avoid potential cleanup ofChristopher Faylor2-1/+6
uninitialized garbage. (Suggested by Ryan Johnson)
2011-05-03 * select.cc (cygwin_select): Make degenerate case cancelable.Corinna Vinschen4-10/+51
(select_stuff::destroy): New inline method to delete memory taken by select_stuff. (select_stuff::~select_stuff): Call destroy. (select_stuff::wait): Add case to allow canceling select. * select.h (select_stuff::destroy): Declare. * thread.cc: Mark poll, pselect and poll as cancelable.
2011-05-03 * fhandler.cc (fhandler_base_overlapped::wait_overlapped): MakeCorinna Vinschen2-5/+12
cancelable. Remove test for main thread, always add signal_arrived to waited objects.
2011-05-03 * fhandler_tty.cc (fhandler_tty_slave::read): Set WFMO timeout to 0 forCorinna Vinschen2-37/+83
nonblocking case. Drop useless waiter variable. Rewrite wait for input_available_event to use a switch statement. Handle timeout and failure more gracefully. Make restartable and cancelable. Rewrite wait for input_mutex to use WFMO and a switch statement. Handle timeout and failure more gracefully. Make restartable and cancelable.
2011-05-03* signal.cc (_pinfo::kill): Avoid referencing 'pid' after ESRCH.Christopher Faylor2-1/+9
2011-05-03* cygwin.din (pthread_attr_getstack): Export.Yaakov Selkowitz8-6/+122
(pthread_attr_getstackaddr): Export. (pthread_getattr_np): Export. * ntdll.h (enum _THREAD_INFORMATION_CLASS): Add ThreadBasicInformation. (struct _THREAD_BASIC_INFORMATION): Define. (NtQueryInformationThread): Declare. * posix.sgml (std-susv4): Add pthread_attr_getstack. (std-gnu): Add pthread_getattr_np. (std-deprec): Add pthread_attr_getstackaddr. (std-notimpl): Remove pthread_attr_[gs]etstackaddr, as they were removed from SUSv4. * thread.cc (pthread_attr::pthread_attr): Initialize stackaddr. (pthread_attr_getstack): New function. (pthread_attr_getstackaddr): New function. (pthread_attr_setstacksize): Return EINVAL if passed size less than PTHREAD_STACK_MIN, as required by POSIX. (pthread_getattr_np): New function. * thread.h (class pthread_attr): Add stackaddr member. * include/pthread.h (pthread_attr_getstack): Declare. (pthread_attr_getstackaddr): Declare unconditionally. (pthread_attr_setstack): Declare inside false conditional for reference. (pthread_getattr_np): Declare. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.