summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * exceptions.cc (setup_handler): Avoid suspending a thread if it in a cygwinChristopher Faylor2004-03-096-28/+49
| | | | | | | | | | | function, in an exception, spinning, or locked. * gendef (_sigfe): Move incyg setting earlier. (sigreturn): Set incyg flag to avoid interrupting called cygwin functions. (sigdelayed): Ditto. (stabilize_sig_stack): Ditto. * sigproc.cc (proc_subproc): Don't restore process lock early in exec case. * cygtls.h: Reorganize fields in _cygtls slightly. * tlsoffsets.h: Regenerate.
* add missing entryChristopher Faylor2004-03-071-0/+2
|
* * fork.cc (fork_parent): Save parent pid in a temporary variable since childChristopher Faylor2004-03-076-65/+95
| | | | | | | | | | | | | | | | | could conceivably exit before function returns, rendering the child's shared memory area invalid. * cygtls.h (_cygtls::incyg): Declare new field. (_cygtls::in_exception): Define new function. * exceptions.cc (setup_handler): Remove locked flag. Use 'incyg' flag and in_exception function to determine when we're in a cygwin function. (_cygtls::call_signal_handler): Decrement incyg flag prior to calling a handler. Increment it on return. * gendef (_sigfe): Increment incyg flag. Use testl for zero testing rather than orl, for consistency. (_sigbe): Decrement incyg flag. Use testl for zero testing rather than orl, for consistency. (_cygtls::pop): Use testl for zero testing rather than orl, for consistency. (stabilize_sig_stack): Ditto.
* update some documentationChristopher Faylor2004-03-061-93/+133
|
* * gendef (sigdelayed): Handle return here rather than going through sigbe toChristopher Faylor2004-03-052-85/+96
| | | | ensure that flags are properly restored.
* * include/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP):Thomas Pfaff2004-03-044-82/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New define. (PTHREAD_NORMAL_MUTEX_INITIALIZER_NP): Ditto. (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Ditto. * thread.cc (pthread_mutex::is_good_initializer): Check for all posssible initializers (pthread_mutex::is_good_initializer_or_object): Ditto. (pthread_mutex::is_good_initializer_or_bad_object): Ditto. (verifyable_object_isvalid): Support up to three static initializers. (verifyable_object_isvalid (void const *,long)): Remove. (pthread_cond::is_good_initializer_or_bad_object): Remove unneeded objectState var. (pthread_cond::init): Condition remains unchanged when creation has failed. (pthread_rwlock::is_good_initializer_or_bad_object): Remove unneeded objectState var. (pthread_rwlock::init): Rwlock remains unchanged when creation has failed. (pthread_mutex::init): Remove obsolete comment. Mutex remains unchanged when creation has failed. Add support for new initializers. (pthread_mutex_getprioceiling): Do not create mutex, just return ENOSYS. (pthread_mutex_lock): Simplify. (pthread_mutex_trylock): Remove unneeded local themutex. (pthread_mutex_unlock): Just return EPERM if mutex is not initialized. (pthread_mutex_setprioceiling): Do not create mutex, just return ENOSYS. * thread.h (verifyable_object_isvalid): Support up to three static initializers. (verifyable_object_isvalid (void const *,long)): Remove prototype. (pthread_mutex::init): Add optional initializer to parameter list.
* * gendef (sigreturn): Call stabilize_sig_stack to ensure that there are noChristopher Faylor2004-03-045-38/+50
| | | | | | pending signals. Restore edx later. (sigdelayed): Save edx earlier. * malloc_wrapper.cc (malloc_init): Add some more debugging output.
* * fhandler_raw.cc (fhandler_dev_raw::raw_read): When reading withCorinna Vinschen2004-03-023-11/+36
| | | | | | | | variable block size, read only one block, read directly into user supplied buffer, return ENOMEM if user supplied buffer is smaller than size of next block to read. Use read2 instead of bytes_to_read to count number of bytes read. * fhandler_tape.cc (fhandler_dev_tape::open): Add debug output.
* fix minor typoChristopher Faylor2004-03-011-1/+1
|
* fix minor typoChristopher Faylor2004-03-011-2/+2
|
* * miscfuncs.cc (check_invalid_virtual_addr): Assure the last pageCorinna Vinschen2004-02-263-3/+9
| | | | | in the range is always tested. Add appropriate const. * mmap.cc (mmap_record::aloc_fh): Remove unused static path_conf object.
* * exceptions.cc (setup_handler): Signal event for any sigwaitinfo if it existsChristopher Faylor2004-02-269-44/+137
| | | | | | | | | | | | | | | | | | | | | to force signal to be handled. Zero event here to prevent races. * signal.cc (sigwaitinfo): Use local handle value for everything since signal thread could zero event element at any time. Detect when awaking due to thread not in mask and set return value and errno accordingly. Don't set signal number to zero unless we've recognized the signal. * sigproc.cc (sigq): Rename from sigqueue throughout. * thread.cc (pthread::join): Handle signals received while waiting for thread to terminate. * cygwin.din: Export sighold, sigqueue. * exceptions.cc (sighold): Define new function. * signal.cc (handle_sigprocmask): Set correct errno for invalid signal. Simplify debugging output. (sigqueue): Define new function. * include/cygwin/signal.h (sighold): Declare new function. (sigqueue): Ditto. * include/cygwin/version.h: Bump API minor version number. * include/limits.h (TIMER_MAX): Define. (_POSIX_TIMER_MAX): Ditto.
* * miscfuncs.cc (check_invalid_virtual_addr): New function.Corinna Vinschen2004-02-254-1/+22
| | | | | | * winsup.h (check_invalid_virtual_addr): Declare. * mmap.cc (munmap): Call check_invalid_virtual_addr instead of IsBadReadPtr.
* * gendef (stabilize_sig_stack): Correctly align this pointer for call toChristopher Faylor2004-02-254-2/+12
| | | | | | _cygtls::call_signal_handler. * gentls_offsets: Output sizeof field. * tlsoffsets.h: Regenerate.
* * dcrt0.cc (_dll_crt0): Don't check sync_startup if threadfunc_ix is set.Christopher Faylor2004-02-254-3/+24
| | | | | * external.cc (cygwin_internal): Implement CW_GET_BINMODE. * include/sys/cygwin.h: Declare CW_GET_BINMODE.
* * dcrt0.cc (_dll_crt0): Add some stern internal errors.Christopher Faylor2004-02-243-2/+12
|
* * thread.cc (pthread::cancelable_wait): Rearrange slightly.Corinna Vinschen2004-02-243-26/+66
| | | | | | | | | | | | | | | Add do_sig_wait parameter. Wait for signal_arrived if set to true. Return WAIT_SIGNALED if signal arrived. (pthread_cond::wait): Accomodate change to pthread::cancelable_wait. (pthread::join): Ditto. (semaphore::_timedwait): Ditto. (semaphore::_wait): Ditto. Change to return int to allow status feedback. (semaphore::wait): Return return value from semaphore::_wait. * thread.h (WAIT_SIGNALED): New definition. (pthread::cancelable_wait): Change declaration. Define do_sig_wait as false by default to not interfere with existing calls accidentally. (semaphore::_wait): Declare int.
* 2004-01-12 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>Joshua Daniel Franklin2004-02-227-32/+32
| | | | | | | | | | * dll_init.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD. * dtable.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD. * external.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD. * path.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD. * pinfo.cc: Update funcsynopsis for DocBook 4.2 SGML DTD. * shared.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD. * stackdump.sgml: Update funcsynopsis for DocBook 4.2 SGML DTD.
* * exceptions.cc (sigpacket::process): Make sure that tls is filled in forChristopher Faylor2004-02-212-3/+12
| | | | | | SIGSTOP condition. (_cygtls::call_signal_handler): Restore signal mask using saved oldmask rather than current oldmask.
* * path.cc (conv_path_list): Return error condition.Christopher Faylor2004-02-213-45/+119
| | | | | | | | | | | | | | | | (copy1): New function. (copyenc): New function. (mount_item::fnmunge): Return error condition. Use new functions to copy strings. (mount_item::build_win32): Ditto. (mount_info::conv_to_win32_path): Return error condition. (cygwin_conv_to_posix_path): Return result of path conversion. (cygwin_conv_to_full_posix_path): Ditto. (return_with_errno): New macro. (cygwin_win32_to_posix_path_list): Use new macro to potentially set errno. (cygwin_posix_to_win32_path_list): Ditto. * path.h (mount_item::fnmunge): Add size argument. (mount_item::build_win32): Ditto.
* * getopt.c: Avoid useless compiler warnings.Corinna Vinschen2004-02-202-1/+9
|
* * getopt.c: Replace with latest vanilla(!) OpenBSD version 1.16.Corinna Vinschen2004-02-202-251/+298
|
* * fork.cc (fork_child): Invert sense of test which defeated correct handling inChristopher Faylor2004-02-183-16/+17
| | | | | | | | a fork from a non-main thread. * dcrt0.cc (initial_env): Eliminate parameter and just send DebugBreak when appropriate. (dll_crt0_0): Reflect parameter change to initial_env. (dll_crt0_1): Don't call initial_env.
* * gendef (stabilize_sig_stack): New function.Christopher Faylor2004-02-183-54/+62
| | | | | | (setjmp): Import, add sig stack handling. Store sig stack info. (longjmp): Call stabilize_sig_stack. Restore sig stack info. * config/i386/setjmp.c: Remove.
* * fork.cc (fork_child): Move fixup_shms_after_fork so thatCorinna Vinschen2004-02-172-4/+9
| | | | signal_arrived is initialized when calling it.
* * Makefile.in (clean): Clean libserver, too.Christopher Faylor2004-02-176-8/+21
| | | | | | | | * fhandler.cc (fhandler_base::~fhandler_base): Remove path_conv cleanup. * syscalls.cc (chroot): Ditto. * path.cc (path_conv::~path_conv): Define new destructor. (conv_path_list_buf_size): Remove explicit path_conv cleanup. * path.h (path_conv::~path_conv): Declare new destructor.
* * Makefile.in: Compile flock.o with -fomit-frame-pointer.Christopher Faylor2004-02-172-0/+5
|
* * Makefile.in: Compile dlfcn.o with -fomit-frame-pointer.Christopher Faylor2004-02-162-0/+5
|
* * Makefile.in: Compile delqueue.o with -fomit-frame-pointer.Christopher Faylor2004-02-162-0/+5
|
* * syscalls.cc (rename): Do not test the MoveFile error codeCorinna Vinschen2004-02-162-6/+9
| | | | where MoveFileEx exists.
* correct changelogChristopher Faylor2004-02-161-2/+2
|
* * cygheap.cc (_csbrk): Report failing condition to stderr rather than strace.Christopher Faylor2004-02-163-7/+7
|
* * Makefile.in: Compile syscalls.o with -fomit-frame-pointer.Christopher Faylor2004-02-153-1/+7
| | | | * sigproc.cc: Eliminate unused variable.
* * getopt.c: Replace with latest NetBSD version 1.16. Keep CygwinCorinna Vinschen2004-02-142-47/+49
| | | | specific changes as minimal as possible.
* * sigproc.cc (proc_subproc): Change warning back to silent debug output.Christopher Faylor2004-02-142-1/+6
|
* * dcrt0.cc (alloc_stack_hard_way): Revert to previous implementation.Christopher Faylor2004-02-145-14/+22
| | | | | (alloc_stack): Ditto. * exceptions.cc (ctrl_c_handler): Add debugging output.
* * Makefile.in (clean): Remove sigfe.s.Christopher Faylor2004-02-1312-100/+134
| | | | | | | | | | | | | | | | | | | | | | | (sigfe.s): Ensure that sigfe.s will be regenerated if it does not exist. * dll_init.cc (dll_dllcrt0): Simplify initializing tests. * exceptions.cc (setup_handler): Detect when stub caller is either spinning or has acquired the lock after being suspended to avoid windows problems with suspending a win32 API call. * cygtls.h (_cygtls::spinning): Declare new element. * gendef: Remove unused _siglist_index and _siglist declaration. (_sigfe): Set spinning element when potentially looping, waiting for lock. (_sigbe): Ditto. (_cygtls::lock): Ditto. (_longjmp): Ditto. * tlsoffsets.h: Regenerate. * pinfo.cc (_pinfo::exit): Set final exit state here. Call sigproc_terminate if invoked with 'norecord'. Clear any residual _cygtls stuff. * winsup.h (exit_states): Define ES_FINAL. * spawn.cc (spawn_guts): Don't call proc_terminate specifically when execing. Let _pinfo::exit handle that case. * sigproc.cc (wait_subproc): Always exit loop early when proc_loop_wait. * init.cc (munge_threadfunc): Eliminate unused argument. (dll_entry): Reflect above change in call to munge_threadfunc.
* * gendef (_sigbe): Zero location on pop.Christopher Faylor2004-02-122-4/+7
| | | | (_cygtls::pop): Ditto.
* * dcrt0.cc (alloc_stack_hard_way): Eliminate second argument.Christopher Faylor2004-02-122-3/+7
| | | | (alloc_stack): Remove use of 'b' throughout.
* Rename _threadinfo to _cygtls, throughout.Christopher Faylor2004-02-1223-209/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cygtls.h (_cygtls::call_signal_handler): Rename from call_signal_handler_now. (_cygtls::push): Make second argument mandatory. (_cygtls::fixup_after_fork): Declare new function. (_cygtls::lock): Ditto. * cygtls.cc (_cygtls::fixup_after_fork): Define new function. * dcrt0.cc (cygwin_finished_initializing): Define as bool. (alloc_stack): Use _tlstop rather than arbitrary variable in probably vain attempt to avoid strange fork problem on CTRL-C. (dll_crt0_0): Remove obsolete winpids::init call. * dll_init.cc (dll_dllcrt0): Detect forkee condition as equivalent to initializing. * winsup.h (cygwin_finished_initializing): Declare as bool. * exceptions.cc (handle_exceptions): Rely on cygwin_finished_initializing to determine how to handle exception during process startup. (_cygtls::call_signal_handler): Rename from call_signal_handler_now. (_cygtls::interrupt_now): Fill in second argument to push. (signal_fixup_after_fork): Eliminate. (setup_handler): Initialize locked to avoid potential inappropriate unlock. Resume thread if it has acquired the stack lock. (ctrl_c_handler): Just exit if ctrl-c is hit before cygiwn has finished initializing. * fork.cc (sync_with_child): Don't call abort since it can cause exit deadlocks. (sync_with_child): Change debugging output slightly. (fork_child): Set cygwin_finished_initializing here. Call _cygtls fork fixup and explicitly call sigproc_init. (fork_parent): Release malloc lock on fork failure. (vfork): Call signal handler via _my_tls. * sigproc.cc (sig_send): Ditto. * syscalls.cc (readv): Ditto. * termios.cc (tcsetattr): Ditto. * wait.cc (wait4): Ditto. * signal.cc (nanosleep): Ditto. (abort): Ditto. (kill_pgrp): Avoid killing self if exiting. * sync.cc (muto::acquire): Remove (temporarily?) ill-advised exiting_thread check. * gendef (_sigfe): Be more agressive in protecting stack pointer from other access by signal thread. (_cygtls::locked): Define new function. (_sigbe): Ditto. (_cygtls::pop): Protect edx. (_cygtls::lock): Use guaranteed method to set eax to 1. (longjmp): Aggressively protect signal stack. * miscfuncs.cc (low_priority_sleep): Reduce "sleep time" for secs == 0. * pinfo.cc (winpids::set): Counterintuitively use malloc's lock to protect simultaneous access to the pids list since there are pathological conditions which can cause malloc to call winpid. (winpids::init): Eliminate. * pinfo.h (winpids::cs): Eliminate declaration. * pinfo.h (winpids::init): Eliminate definition.
* * security.cc (get_nt_object_attribute): Fix error handling.Corinna Vinschen2004-02-112-33/+29
|
* * fhandler_socket.cc (fhandler_socket::ioctl): Add FIONREAD handling.Corinna Vinschen2004-02-092-0/+9
|
* * debug.h (console_printf): Define for non-debugging condition.Christopher Faylor2004-02-0967-95/+116
| | | | | | | | | | | | | | * cygtls.h (_threadinfo::lock): Remove wait argument. (_threadinfo::interrupt_setup): Remove retaddr argument. * exceptions.cc (_threadinfo::interrupt_setup): Ditto. (_threadinfo::interrupt_now): Accommodate change to interrupt_setup argument. (setup_handler): Ditto. Always lock sig stack prior to determining interrupt method. * gendef (_sigfe): Correct thinko regarding cmpxchg. (_sigbe): Ditto. (_threadinfo::lock): Ditto. (_threadinfo::pop): Eliminate left-over stack unlock. * sigproc.cc (proc_subproc): Chnage debugging output to printed warning.
* * localtime.cc (localtime_r): Call tzset.Christopher Faylor2004-02-0811-100/+214
| | | | | | | | | | | | | | | | | | | | | | * Makefile.in: Make version.h/cygwin.din version check a warning since it is not foolproof. * cygheap.h (CYGHEAPSIZE): Bump size down. * cygtls.h (_threadinfo::stacklock): New element. (_threadinfo::pop): Make regparm. (_threadinfo::lock): New function. (_threadinfo::unlock): New function. * cygtls.cc (_threadinfo::push): Wait for a lock on the stack before performing the operation. (_threadinfo::pop): Move to another file. * cygwin.din: More SIGFE changes. * exceptions.cc (try_to_debug): Always display messages on console. (handle_exceptions): Unwind stack only when actually about to call sig_send. (setup_handler): Lock stack prior to performing any operations. * gendef (_sigfe): Ditto. (_sigbe): Ditto. (_threadinfo::pop): Ditto. Move here. * gen_tlsoffsets: Generate positive offsets. * tlsoffsets.h: Regenerate.
* * cygserver.h (CYGWIN_SERVER_VERSION_API): Bump.Corinna Vinschen2004-02-063-1/+9
| | | | | * cygserver_ipc.h (struct proc): Add signal_arrived member. (ipc_set_proc_info): Inititalize blk.signal_arrived.
* * uinfo.cc (cygheap_user::init): Use sec_user_nih to build aCorinna Vinschen2004-02-064-43/+30
| | | | | | security descriptor. Set both the process and the default DACLs. * fork.cc (fork_parent): Use sec_none_nih security attributes. * spawn.cc (spawn_guts): Ditto.
* * cygwin.din: Make many more functions SIGFE.Christopher Faylor2004-02-053-69/+76
| | | | * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
* * security.h (SID): New macro.Corinna Vinschen2004-02-055-48/+62
| | | | | | | | | | (well_known_*_sid): Change type to cygpsid. (cygsid::init): Delete declaration. * sec_helper.cc (well_known_*_sid): Define using above SID macro. (cygsid::init): Delete. * dcrt0.cc (dll_crt0_0): Do not call cygsid::init. * security.cc (get_user_local_groups): Change the second argument type to cygpsid.
* update copyrightChristopher Faylor2004-02-041-1/+1
|
* * tlsoffsets.h: Regenerate.Christopher Faylor2004-02-031-1/+2
|