aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin
AgeCommit message (Collapse)AuthorFilesLines
2004-03-24update copyright. Minor reformatting.Christopher Faylor1-4/+6
2004-03-24 * fhandler_dsp.cc (fhandler_dev_dsp::write): Remove typeCorinna Vinschen2-3/+12
cast from argument to audio_out_->parsewav() to make reference work properly. Now .wav file headers are properly discarded.
2004-03-23white space fixupChristopher Faylor1-3/+3
2004-03-23 * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use createdCorinna Vinschen2-3/+16
handle regardless of nohandle state. Clean up afterwards.
2004-03-23 * autoload.cc: Load eight more functions for waveIn support.Corinna Vinschen4-344/+1190
* fhandler.h (class fhandler_dev_dsp): Add class Audio, class Audio_in and class Audio_out members and audio_in_, audio_out_ pointers so that future changes are restricted to file fhandler_dsp.cc. * fhandler_dsp.cc (fhandler_dev_dsp::Audio): Add this class to treat things common to audio recording and playback. Add more format conversions. (fhandler_dev_dsp::Audio::queue): New queues for buffer management to fix incomplete cleanup of buffers passed to the wave device. (fhandler_dev_dsp::Audio_in): New, added class to implement audio recording. (fhandler_dev_dsp::Audio_out): Rework to use functionality provided by fhandler_dev_dsp::Audio. Allocate memory audio buffers late, just before write. (fhandler_dev_dsp::Audio_out::start): Size of wave buffer allocated here depends on audio rate/bits/channels. (fhandler_dev_dsp::Audio_in::start): Ditto. (fhandler_dev_dsp::setupwav): Replaced by following function. (fhandler_dev_dsp::Audio_out::parsewav): Does not setup wave device any more. Discard wave header properly. (fhandler_dev_dsp::open): Add O_RDONLY and_RDWR as legal modes. Protect against re-open. Activate fork_fixup. (fhandler_dev_dsp::ioctl): Protect against actions when audio is active. SNDCTL_DSP_GETFMTS only returns formats supported by mmsystem wave API, not all supported formats. SNDCTL_DSP_GETBLKSIZE result now depends on current audio format. (fhandler_dev_dsp::fixup_after_fork): Call fork_fixup for the Audio classes to let them duplicate the CRITICAL_SECTION.
2004-03-22Christopher Faylor <cgf@redhat.com>Christopher Faylor2-18/+22
* init.cc (munge_threadfunc): Handle all instances of search_for. (prime_threads): Test threadfunc_ix[0].
2004-03-21* cygheap.cc (init_cheap): Set initial_sz to something or suffer spuriousChristopher Faylor2-4/+12
output. (cygheap_fixup_in_child): Set alloc_sz to passed in size to ensure that children will have the right size heap. (_csbrk): Make output conditional on DEBUGGING.
2004-03-21* cygheap.cc (init_cheap): Conditionalize debugging code.Christopher Faylor2-0/+6
2004-03-21* cygheap.cc (init_cheap): Add ability to specify minimal cygwin heap size whenChristopher Faylor7-54/+75
debugging. (_csbrk): Report error in allocation to stderr. (ccalloc): Ditto. * dtable.cc (dtable::find_fifo): Remove use of atoms. * dtable.h (dtable::find_fifo): Ditto. * fhandler.h (fhandler_fifo): Ditto. * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Ditto. (fhandler_fifo::set_use): Ditto. (fhandler_fifo::open_not_mine): Ditto. (fhandler_fifo::open): Ditto. * pinfo.cc (_pinfo::commune_recv): Ditto. (_pinfo::commune_send): Ditto.
2004-03-202004-03-19 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2-36/+44
* dir.cc (rmdir): Reorganize error handling to reduce indentation.
2004-03-19* include/cygwin/version.h: Bump DLL minor number to 10.Christopher Faylor2-1/+5
2004-03-18* child_info.h (CURR_CHILD_INFO_MAGIC): Reset to new value.Christopher Faylor4-9/+33
(child_info::cygheap_alloc_sz): New field. * cygheap.cc (init_cheap): Reduce size of cygwin stack until minimal hit when attempting initial allocation. (cygheap_setup_for_child): Use alloc_sz to create secondary memory mapped entry. Store alloc_sz in cygheap_alloc_sz. (cygheap_fixup_in_child): Use cygheap_alloc_sz to map parent's cygheap. * cygheap.h (_CYGHEAPSIZE_SLOP): New define. (CYGHEAPSIZE): Use _CYGHEAPSIZE_SLOP.
2004-03-18 * fhandler_proc.cc (format_proc_meminfo): On NT, try to figure outCorinna Vinschen3-2/+54
real swap file usage by requesting SystemPagefileInformation. Use GlobalMemoryStatus as fallback. * ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemPagefileInformation. (struct _SYSTEM_PAGEFILE_INFORMATION): Define.
2004-03-17add missing changelog entryChristopher Faylor1-0/+4
2004-03-17* include/cygwin/version.h: Bump DLL minor number to 9.Christopher Faylor3-2/+6
2004-03-16* sigproc.cc (proc_terminate): Release sync_proc_subproc when done terminatingChristopher Faylor2-1/+8
or suffer potential hangs. (get_proc_lock): Reorganize debugging output slightly.
2004-03-16* cygtls.cc (_cygtls::fixup_after_fork): Just manipulate the signal stack if aChristopher Faylor2-5/+12
signal occurred during the parent's fork. Otherwise leave it alone.
2004-03-15* exceptions.cc (try_to_debug): Report on tid of caller.Christopher Faylor4-33/+33
* sync.cc (muto::acquire): Fix some races. * sync.h (muto): Expose some fields for easier debugging.
2004-03-15 Fix ChangeLog dates.Corinna Vinschen5-65/+109
* fhandler.h (fhandler_dev_tape::tape_get_pos): Declare with extra parameter for partition number. (fhandler_dev_tape::_tape_set_pos): Ditto. (fhandler_dev_tape::tape_partition): New method. (fhandler_dev_tape::tape_set_partition): New method. * fhandler_tape.cc (fhandler_dev_tape::open): Call private methods directly instead of ioctl. (fhandler_dev_tape::ioctl): Use long erase on MTERASE by default. Don't use absolute positioning on MTSEEK. Call tape_set_partition on MTSETPART, tape_partition on MTMKPART. (fhandler_dev_tape::tape_get_pos): Add partition number parameter. Prefer logical position information over absolute position information. Return partition number. (fhandler_dev_tape::_tape_set_pos): Add partition number parameter. Use in SetTapePosition. (fhandler_dev_tape::tape_set_pos): Remove special TAPE_ABSOLUTE_BLOCK handling. (fhandler_dev_tape::tape_erase): Rewind before erasing. (fhandler_dev_tape::tape_status): Rearrange slightly. Try to get a MediaType even if no tape is loaded. Store active partition in mt_resid as on Linux. (fhandler_dev_tape::tape_partition): New method. (fhandler_dev_tape::tape_set_partition): New method. * include/cygwin/mtio.h: Fix copyright. Add comment to explain mt_resid content. * include/cygwin/version.h: Bump API minor number.
2004-03-15* cygtls.cc (_cygtls::remove): Call remove_wq even when we can't necessarilyChristopher Faylor4-24/+38
get the cygtls table lock. * cygtls.h (_cygtls::remove_wq): Add wait argument. * sigproc.cc (_cygtls::remove_wq): Honor wait argument when acquiring lock. (proc_terminate): Don't NULL sync_proc_subproc since other threads may still try to access it.
2004-03-14 * errno.cc (errmap): Map ERROR_BEGINNING_OF_MEDIA andCorinna Vinschen6-149/+245
ERROR_SETMARK_DETECTED to EIO instead of ESPIPE. Handle ERROR_FILEMARK_DETECTED. * fhandler_tape.cc (TAPE_FUNC): Add comment that ERROR_BUS_RESET has still to be handled correctly. (fhandler_dev_tape::open): Accomodate fact that get.mt_dsreg also contains density code. (fhandler_dev_tape::ioctl): Rearrange slightly. Reset devbuf also on MTNOP, MTWSM, MTSETBLK, MTSETDRVBUFFER, MTSETPART and MTMKPART. (fhandler_dev_tape::tape_set_pos): Rearrange. Match behaviour to the Linux tape driver. (fhandler_dev_tape::tape_status): Call IOCTL_STORAGE_GET_MEDIA_TYPES_EX if available. Return device type and density code in appropriate mtget members. * wincap.h (wincaps::has_ioctl_storage_get_media_types_ex): New element. * wincap.cc: Implement above element throughout. * include/cygwin/mtio.h: Add tape device types as returned by IOCTL_STORAGE_GET_MEDIA_TYPES_EX. (MT_TAPE_INFO): Use above type codes. (struct mtget): Change mt_dsreg comment.
2004-03-142004-03-14 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2-49/+54
* dir.cc (rmdir): Construct real_dir with flag PC_FULL. Use a loop instead of recursion to handle the current directory.
2004-03-14* cygtls.cc (_cygtls::remove): Call remove_wq to ensure that wait stuff isChristopher Faylor5-2/+30
removed from proc_subproc linked list. * cygtls.h (_cygtls::remove_wq): Declare. * sigproc.cc (_cygtls::remove_wq): Define. (proc_subproc): Label event handle appropriately. * spawn.cc (spawn_guts): Return -1 when wait() fails for spawn types that require waiting.
2004-03-14minor cleanupChristopher Faylor1-35/+40
2004-03-14Fix typo.Christopher Faylor1-2/+2
2004-03-13 * errno.cc (errmap): Handle ERROR_BUS_RESET.Corinna Vinschen5-366/+334
* fhandler.h (fhandler_dev_raw::write_file): New method, created from former static function. (fhandler_dev_raw::read_file): Ditto. (reset_devbuf): New inline method. (class fhandler_dev_tape): Add TAPE_GET_DRIVE_PARAMETERS member `dp'. (fhandler_dev_tape::write_file): New method. (fhandler_dev_tape::read_file): Ditto. (fhandler_dev_tape::tape_get_feature): Convert to inline method. (fhandler_dev_tape::tape_error): New method, created from former static function. (fhandler_dev_tape::tape_get_blocksize): Remove declaration. * fhandler_raw.cc (fhandler_dev_raw::write_file): New method, created from former static function. (fhandler_dev_raw::read_file): Ditto. (fhandler_dev_raw::writebuf): Accomodate the fact that no devbuf exists under variable block size condition. (fhandler_dev_raw::raw_read): Ditto. Add local p pointer to simplify pointer arithmetic. (fhandler_dev_raw::raw_write): Always set devbufend to 0 when starting with writing. Accomodate the fact that no devbuf exists under variable block size condition. * fhandler_tape.cc: Various formatting changes. (TAPE_FUNC): New macro. Use throughout as tape function loop. (get_ll): Convert into macro. (IS_EOM): New macro. (IS_EOF): New macro. (fhandler_dev_tape::is_eom): Use IS_EOM macro. (fhandler_dev_tape::is_eof): Use IS_EOF macro. (fhandler_dev_tape::write_file): New method. (fhandler_dev_tape::read_file): New method. (fhandler_dev_tape::open): Get drive information block here once. (fhandler_dev_tape::lseek): Remove unneeded duplicate code. (fhandler_dev_tape::dup): Duplicate drive information block. (fhandler_dev_tape::ioctl): Remove drvbuf in variable block size mode. Return ERROR_INVALID_BLOCK_LENGTH instead of ERROR_MORE_DATA if buffer contains data which would get lost on buffer size changing. Use absolute tape positioning also if drive only supports logical block positioning. (fhandler_dev_tape::tape_error): New method, created from former static function. (fhandler_dev_tape::tape_get_pos): Allow logical block reporting. Workaround tape driver bug. (fhandler_dev_tape::_tape_set_pos): Reset device buffer and flags after successful repositioning. (fhandler_dev_tape::tape_set_pos): Allow logical block positioning. Workaround tape driver bug. (fhandler_dev_tape::tape_erase): Use dp instead of calling GetTapeParameters. (fhandler_dev_tape::tape_prepare): Ditto. (fhandler_dev_tape::tape_get_blocksize): Remove. (fhandler_dev_tape::tape_set_blocksize): Don't call tape_get_blocksize. Error handling already done in fhandler_dev_tape::ioctl. (fhandler_dev_tape::tape_status): Remove local `dp' variable. Accomodate logical tape reporting. Call tape_get_feature instead of accessing feature words directly. (fhandler_dev_tape::tape_compression): Use dp instead of calling GetTapeParameters. Fix resetting datcompression.
2004-03-12* wait.cc (wait4): Initialize pointer on entry. Avoid callingChristopher Faylor2-13/+14
call_signal_handler twice since that guarantees exiting with errno set to EINTR.
2004-03-12 * exceptions.cc (sigpacket::process): Simplify code slightly.Corinna Vinschen2-3/+5
2004-03-12* cygtls.h (waitq): Declare structure here.Christopher Faylor11-109/+134
(_cygtls::wq): Declare. * cygtls.cc (_cygtls::fixup_after_fork): Clear wq.thread_ev to avoid using an invalid event handle in forked process. * dcrt0.cc (waitq_storage): Delete. (threadstuff): Remove waitq_storage. * perthread.h (per_thread_waitq): Delete. (waitq_storage): Delete declaration. * sigproc.cc (sigproc_init): Remove perthread waitq consideration. * sigproc.h (waitq): Delete declaration. * wait.cc (wait4): Use _my_tls waitq structure rather than per_thread. * cygtls.h (_cygtls::newmask): Delete member. (_cygtls::deltamask): New member. * gendef (_sigdelayed): Replace the call to set_process_mask by a call to set_process_mask_delta. * exceptions.cc (handle_sigsuspend): Do not filter tempmask. Or SIG_NONMASKABLE in deltamask as a flag. (_cygtls::interrupt_setup): Set deltamask only. (set_process_mask_delta): New function. (_cygtls::call_signal_handler): Replace the first call to set_process_mask by a call to set_process_mask_delta. * tlsoffsets.h: Regenerate.
2004-03-12* cygtls.cc (_cygtls::fixup_after_fork): Remove unneeded setting of oldmask.Christopher Faylor4-100/+93
* exceptions.cc: Remove some __I386__ conditionals. (handle_exceptions): Move ppid test to outside of a loop for efficiency. (setup_handler): Make debugging output more wordy. (_cygtls::call_signal_handler): To avoid a race, use lock/unlock to synchronize with signal thread and ensure that signal_arrived event has actually been set. * gendef (_sigfe): Use ebx for all sigstack manipulations to ensure that the register is saved. Move setting of incyg to within stack lock to avoid setup_handler confusion. (_sigbe): Use ebx for all sigstack manipulations to ensure that the register is saved. (_cygtls::pop): Ditto. (_cygtls::lock): Ditto. (stabilize_sig_stack): Ditto. (setjmp): Ditto. (longjmp): Ditto.
2004-03-09* fhandler_serial.cc (fhandler_serial::ioctl): Implement TIOCSBRK and TIOCCBRK.Christopher Faylor3-0/+22
* include/sys/termios.h: Define TIOCSBRK and TIOCCBRK.
2004-03-09.Christopher Faylor1-1/+1
2004-03-09* exceptions.cc (setup_handler): Avoid suspending a thread if it in a cygwinChristopher Faylor6-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.
2004-03-07add missing entryChristopher Faylor1-0/+2
2004-03-07* fork.cc (fork_parent): Save parent pid in a temporary variable since childChristopher Faylor6-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.
2004-03-06update some documentationChristopher Faylor1-93/+133
2004-03-05* gendef (sigdelayed): Handle return here rather than going through sigbe toChristopher Faylor2-85/+96
ensure that flags are properly restored.
2004-03-04* include/pthread.h (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP):Thomas Pfaff4-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.
2004-03-04* gendef (sigreturn): Call stabilize_sig_stack to ensure that there are noChristopher Faylor5-38/+50
pending signals. Restore edx later. (sigdelayed): Save edx earlier. * malloc_wrapper.cc (malloc_init): Add some more debugging output.
2004-03-02 * fhandler_raw.cc (fhandler_dev_raw::raw_read): When reading withCorinna Vinschen3-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.
2004-03-01fix minor typoChristopher Faylor1-1/+1
2004-03-01fix minor typoChristopher Faylor1-2/+2
2004-02-26 * miscfuncs.cc (check_invalid_virtual_addr): Assure the last pageCorinna Vinschen3-3/+9
in the range is always tested. Add appropriate const. * mmap.cc (mmap_record::aloc_fh): Remove unused static path_conf object.
2004-02-26* exceptions.cc (setup_handler): Signal event for any sigwaitinfo if it existsChristopher Faylor9-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.
2004-02-25 * miscfuncs.cc (check_invalid_virtual_addr): New function.Corinna Vinschen4-1/+22
* winsup.h (check_invalid_virtual_addr): Declare. * mmap.cc (munmap): Call check_invalid_virtual_addr instead of IsBadReadPtr.
2004-02-25* gendef (stabilize_sig_stack): Correctly align this pointer for call toChristopher Faylor4-2/+12
_cygtls::call_signal_handler. * gentls_offsets: Output sizeof field. * tlsoffsets.h: Regenerate.
2004-02-25* dcrt0.cc (_dll_crt0): Don't check sync_startup if threadfunc_ix is set.Christopher Faylor4-3/+24
* external.cc (cygwin_internal): Implement CW_GET_BINMODE. * include/sys/cygwin.h: Declare CW_GET_BINMODE.
2004-02-24* dcrt0.cc (_dll_crt0): Add some stern internal errors.Christopher Faylor3-2/+12
2004-02-24 * thread.cc (pthread::cancelable_wait): Rearrange slightly.Corinna Vinschen3-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-02-222004-01-12 Joshua Daniel Franklin <joshuadfranklin@yahoo.com>Joshua Daniel Franklin7-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.