Corinna Vinschen
d8ff96389f
* pinfo.h (class push_process_state): New class to push a process state
...
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 19:43:04 +00:00
Corinna Vinschen
23db0a41d8
* syscalls.cc (readv): Add myfault handler. Don't check repeatedly
...
open state of file handler. Streamline loop.
(writev): Add myfault handler.
2011-05-05 18:46:38 +00:00
Christopher Faylor
8ea8474947
* fhandler.cc (fhandler_base_overlapped::raw_read): Rename from
...
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 17:44:42 +00:00
Christopher Faylor
b8424c5e9a
* fork.cc (fork): Clear PID_REAPED.
...
* pinfo.cc (pinfo_init): Ditto.
(pinfo::init): Check for PID_REAPED.
* sigproc.cc (stopped_or_terminated): Ditto.
2011-05-05 15:03:54 +00:00
Christopher Faylor
1395dac1d0
* pinfo.cc (_pinfo::exists): Check for PID_REAPED.
2011-05-05 14:46:14 +00:00
Corinna Vinschen
42a668f28a
Fix typo.
2011-05-05 13:46:32 +00:00
Corinna Vinschen
2b31bc47a7
* fhandler_disk_file.cc (fhandler_disk_file::pread): Correctly return
...
with errno set to EBADF if file open mode is incorrect.
(fhandler_disk_file::pwrite): Ditto.
2011-05-05 13:45:06 +00:00
Joseph Myers
25c50222d9
* configure.ac (alpha*-dec-osf*, i[[3456789]]86-*-rdos*,
...
sh*-*-pe|mips*-*-pe|arm-wince-pe, sparc-*-sunos4*, *-*-aix*,
*-*-beos*, *-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-linux*
| *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu, *-*-lynxos*,
*-*-mingw*, *-*-netbsd*, *-*-netware*, *-*-tpf*, *-*-uclinux*,
*-*-vxworks*): Disable newlib and libgloss in separate case
statement.
(i[[3456789]]86-*-linux*): Move logic allowing newlib to be built
to separate case statement.
(*-*-chorusos, *-*-dragonfly*, *-*-freebsd*, *-*-netbsd*,
*-*-netware*, *-*-tpf*, *-*-uclinux*, *-*-vxworks*,
alpha*-dec-osf*, alpha*-*-linux*, am33_2.0-*-linux*, sh-*-linux*,
sh*-*-pe|mips*-*-pe|*arm-wince-pe, arm-*-coff, arm-*-elf* |
arm*-*-eabi*, arm*-*-linux-gnueabi, arm*-*-symbianelf*, avr-*-*,
bfin-*-*, cris-*-* | crisv32-*-*, frv-*-*, i[[3456789]]86-*-coff |
i[[3456789]]86-*-elf, i[[3456789]]86-w64-mingw*,
i[[3456789]]86-*-mingw*, x86_64-*-mingw*,
i[[3456789]]86-*-interix*, i[[3456789]]86-*-beos*,
i[[3456789]]86-*-rdos*, m32r-*-*,
m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*, m68k-*-elf*, m68*-*-*
| fido-*-*, powerpc-*-aix*, powerpc-*-beos*, powerpc-*-eabi,
powerpc-*-eabi* | powerpcle-*-eabi* | powerpc-*-rtems*,
rs6000-*-lynxos*, rs6000-*-aix*, mips*-*-linux*, sparclet-*-aout*
| sparc86x-*-*, sparc-*-elf*, sparc64-*-elf*, sparclite-*-*,
sparc-*-sunos4*, sparc-*-solaris* | sparc64-*-solaris* |
sparcv9-*-solaris*, *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu |
*-*-kopensolaris*-gnu, *-*-lynxos*, *-*-*): Don't disable newlib
and libgloss in main case over targets. Remove most empty cases
in main case over targets.
* configure: Regenerate.
2011-05-05 12:39:33 +00:00
Corinna Vinschen
392323df55
* fhandler.cc (is_at_eof): Drop static storage class. Drop err
...
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 09:05:04 +00:00
Corinna Vinschen
03406c1ae6
* dcrt0.cc (dll_crt0_1): Reset locale to "C" even when dynamically
...
loaded.
2011-05-05 07:31:13 +00:00
Corinna Vinschen
192737978e
* posix.sgml (std-notimpl): Remove bsd_signal, setcontext, and
...
swapcontext, marked obsolete in SUSv3 and not present in SUSv4.
2011-05-05 06:48:51 +00:00
Corinna Vinschen
2849cbde54
* fhandler_registry.cc (fhandler_registry::exists): Fix regression
...
in EACCES handling.
(fhandler_registry::open): Fix "%val" case.
2011-05-05 06:45:21 +00:00
Christopher Faylor
5069a2b0d9
* signal.cc (_pinfo::kill): Return success on kill(0) only if pid exists or is
...
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-05 00:31:22 +00:00
Yaakov Selkowitz
942945956c
* new-features.sgml (ov-new1.7.10): Document psiginfo, psignal,
...
and sys_siglist.
2011-05-04 22:18:16 +00:00
Yaakov Selkowitz
2f7a5c89cc
* cygwin.din (psiginfo): Export.
...
(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 22:12:15 +00:00
Joseph Myers
fab6d5dd03
* configure.ac: Remove code setting special library locations for
...
hppa*64*-*-hpux11*. Remove code setting compiler for
sparc-sun-solaris2*.
* configure: Regenerate.
2011-05-04 21:45:47 +00:00
Christopher Faylor
975757698f
* dll_list::detach (dll_list::detach): Avoid doing anything with detach during
...
a failing fork.
2011-05-04 19:19:46 +00:00
Christopher Faylor
3521d50480
* dll_init.cc (dll_global_dtors): Avoid calling destructors during failing
...
fork().
2011-05-04 16:02:45 +00:00
Corinna Vinschen
54e4df33a2
* fhandler.h (class fhandler_base): Remove uninterruptible_io status
...
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 13:06:10 +00:00
Corinna Vinschen
82fa6b929b
* fhandler.h (class fhandler_mailslot): Move down in file and change
...
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 12:56:12 +00:00
Corinna Vinschen
412693ab65
* fhandler.h (fhandler_dev_tape::_lock): Add bool parameter.
...
* 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 12:23:00 +00:00
Corinna Vinschen
5152a53ade
* fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add fh member.
...
(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 11:41:22 +00:00
Yaakov Selkowitz
307b0a5d4b
* libc/include/signal.h (psignal): Declare.
...
* libc/sys/linux/psignal.c: Move from here...
* libc/signal/psignal.c: ... to here. Document.
* libc/sys/linux/Makefile.am (GENERAL_SOURCES): Move psignal.c from here...
* libc/signal/Makefile.am (LIB_SOURCES): ... to here.
(CHEWOUT_FILES): Add psignal.def.
* libc/sys/linux/Makefile.in: Regenerate.
* libc/signal/Makefile.in: Ditto.
* libc/signal/signal.tex: Add references to psignal.
2011-05-04 11:26:22 +00:00
Tristan Gingold
b27340db63
include/coff
...
2011-05-04 Tristan Gingold <gingold@adacore.com>
* rs6000.h (union external_auxent): Add x_ftype field.
* rs6k64.h: (struct external_auxent): Remap x_file field.
bfd/
2011-04-28 Tristan Gingold <gingold@adacore.com>
* coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust for x_file.
(bfd_xcoff_swap_aux_out): Ditto.
* coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Ditto.
(bfd_xcoff64_swap_aux_out): Ditto.
2011-05-04 11:05:14 +00:00
Joseph Myers
3c34866881
* configure.ac: Separate libgloss_dir settings from general case
...
over targets.
* configure: Regenerate.
2011-05-04 09:51:31 +00:00
Corinna Vinschen
f737a4edba
* libc/locale/lmessages.h (__messages_load_locale): Declare. Remove
...
accidental declaration of __numeric_load_locale.
* libc/locale/locale.c: Include timelocal.h to get declaration of
__time_load_locale.
(__set_locale_from_locale_alias): Fix return type.
(__locale_msgcharset): Avoid compiler warnings.
(_localeconv_r): Ditto.
2011-05-04 08:54:34 +00:00
Corinna Vinschen
6e16da9dec
Cygwin-specific patch from Andy Koppe:
...
* libc/locale/locale.c (current_categories): On Cygwin, set LC_CTYPE
to C.UTF-8 to match initial __wctomb and __mbtowc settings.
(lc_ctype_charset): On Cygwin, initialize to "UTF-8".
(loadlocale): Remove unused Cygwin-specifc code.
2011-05-04 08:45:17 +00:00
Tristan Gingold
aa8097021e
2011-05-04 Tristan Gingold <gingold@adacore.com>
...
* rs6000.h (struct external_exceptab): New struct.
(EXCEPTSZ): New macro.
* rs6k64.h: (struct external_exceptab): New struct.
(EXCEPTSZ): New macro.
2011-05-04 06:53:38 +00:00
Christopher Faylor
9d2b7928b5
* thread.h (pthread::static_cancel_self): Mark as noreturn.
...
(pthread::cancel_self): Ditto.
* thread.cc (pthread::cancel_self): Explicitly use pthread::exit to avoid a
"function returns" error.
2011-05-04 06:16:59 +00:00
Christopher Faylor
cdbb272b4c
* pinfo.cc (pinfo::pinfo): Set procinfo to NULL to avoid potential cleanup of
...
uninitialized garbage. (Suggested by Ryan Johnson)
2011-05-04 06:00:54 +00:00
Corinna Vinschen
781822a646
* select.cc (cygwin_select): Make degenerate case cancelable.
...
(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 15:58:52 +00:00
Corinna Vinschen
3728c79d48
* locale.cc (print_locale_with_codeset): Align printing of locale names
...
to POSIX.
2011-05-03 10:34:25 +00:00
Corinna Vinschen
c402095aae
* fhandler.cc (fhandler_base_overlapped::wait_overlapped): Make
...
cancelable. Remove test for main thread, always add signal_arrived
to waited objects.
2011-05-03 10:11:19 +00:00
Tristan Gingold
368ee04706
2011-05-03 Tristan Gingold <gingold@adacore.com>
...
* rs6000.h (struct external_ldsym): Use E_SYMNMLEN instead of
SYMNMLEN.
2011-05-03 09:21:05 +00:00
Corinna Vinschen
3ff46ba853
* fhandler_tty.cc (fhandler_tty_slave::read): Set WFMO timeout to 0 for
...
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 07:58:13 +00:00
Yaakov Selkowitz
af4f7961d0
* new-features.sgml (ov-new1.7.10): Document new pthread APIs.
2011-05-03 04:09:52 +00:00
Christopher Faylor
3f359e3254
* signal.cc (_pinfo::kill): Avoid referencing 'pid' after ESRCH.
2011-05-03 02:03:04 +00:00
Yaakov Selkowitz
705a187ee9
* cygwin.din (pthread_attr_getstack): Export.
...
(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.
2011-05-03 01:13:37 +00:00
Christopher Faylor
1e92c34ee4
fix typo
2011-05-02 23:11:18 +00:00
Christopher Faylor
2671ba6f3a
* Makefile.in: Allow CFLAGS to be overridden from the environment.
2011-05-02 19:14:39 +00:00
Corinna Vinschen
183ad8597c
* thread.cc (cancelable_wait): Remove test for main thread.
...
* fhandler_fifo.cc (fhandler_fifo::open_nonserver): Ditto.
2011-05-02 18:48:11 +00:00
Corinna Vinschen
27dd7bfbcd
* fhndler_tty.cc (andler_pty_master::process_slave_output): Make
...
interruptible and cancelable. Fix nonblocking case.
2011-05-02 18:41:10 +00:00
Corinna Vinschen
e4f70cddcd
* fhandler_console.cc (fhandler_console::read): Make restartable and
...
cancelable.
2011-05-02 17:38:16 +00:00
Christopher Faylor
d85a0c243b
* strace.cc (strace::vprntf): Avoid closing unopened handle.
2011-05-02 17:05:10 +00:00
Yaakov Selkowitz
58349d7c9d
* sysconf.cc (sca): Set _SC_SPIN_LOCKS to _POSIX_SPIN_LOCKS.
2011-05-02 16:11:06 +00:00
Yaakov Selkowitz
5f555b0bd3
* libc/include/sys/features.h [__CYGWIN__] (_POSIX_SPIN_LOCKS): Define.
...
* libc/include/sys/types.h: Cygwin provides its own pthread_spinlock_t
typedef.
2011-05-02 16:05:06 +00:00
Christopher Faylor
8978381c2a
Eliminate trailing whitespace in some files.
...
* dll_init.cc (dll_list::alloc): Reset 'p' in forked process.
* select.cc (select_stuff::wait): Move cleanup() closer to WFMO to minimize
unavoidable (?) race.
2011-05-02 15:28:35 +00:00
Corinna Vinschen
138f3e0cbd
Throughout remove NT4 from documentation.
...
* new-features.sgml (ov-new1.7.10): Document change in passwd command.
2011-05-02 11:56:36 +00:00
Corinna Vinschen
29b1327208
* fhandler_serial.cc (fhandler_serial::raw_read): Add restartability
...
after a signal. Add cancelability.
(fhandler_serial::raw_write): Wait for write to succeed if O_NONBLOCK
is not set. Add signal handling and cancelability.
2011-05-02 10:20:35 +00:00
Corinna Vinschen
a91ac4dca9
* fhandler_windows.cc (fhandler_windows::read): Use
...
pthread::get_cancel_event to fetch thread's cancel event.
* flock.cc (lf_setlock): Ditto.
* posix_ipc.cc (ipc_cond_timedwait): Ditto.
* thread.cc (pthread::get_cancel_event): New static method.
* thread.h (pthread::get_cancel_event): Declare.
2011-05-01 17:42:41 +00:00