Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2004-04-10 * Use new unified status_flag accessor methods from classes fhandler_*,Corinna Vinschen
tty_min, mtinfo and fs_info thoroughout. * fhandler.h: Redefine all set_close_on_exec methods to take a bool argument. (enum conn_state): Rename from connect_state. (class fhandler_base): Rename some status flags to align with accessor method names. Drop encoded flag entirely. Unify status accessor methods. Const'ify all read accessor methods. (class fhandler_socket): Ditto. (class fhandler_dev_raw): Ditto. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use fs.fs_is_fat() instead of evaluating FATness of file system here. (fhandler_disk_file::opendir): Drop call to set_encoded(). (fhandler_disk_file::readdir): Use pc.isencoded() directly. * mtinfo.h (class mtinfo_drive): Const'ify all read accessor methods. * path.cc (fsinfo_cnt): Add. (fs_info::update): Accomodate class changes. Evaluate file system name specific flags right here. Add thread safety for reading and writing global fsinfo array. * path.h (enum path_types): Drop values for flags kept in fs already. (struct fs_info): Move status informatin into private struct type status_flags. Add accessor methods. Remove path and file system name string arrays in favor of status bits. (class path_conv): Use new fs_info status information where appropriate. (path_conf::fs_has_ea): Rename from fs_fast_ea. (path_conf::fs_has_acls): New method. (path_conf::root_dir): Remove. (path_conf::volname): Remove. * syscalls (statfs): Evaluate root dir locally. * tty.h (class tty_min): Unify status accessor methods. Const'ify all read accessor methods.
2004-04-09 * fhandler.h (fhandler_base::status): Declare private.Corinna Vinschen
(fhandler_base::open_status): Ditto. (class fhandler_socket): Move status bits into private bitfield struct type status_flags. Change accessor methods appropriately. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Accomodate above status bit changes. * tty.h: Remove status bit enumerator. (TTYISSETF): Remove. (TTYSETF): Remove. (TTYCLEARF): Remove. (TTYCONDSETF): Remove. (tty_min::status): Define as private bitfield struct type status_flags. Add appropriate accessor methods. * fhandler_console.cc: Use tty_min::status accessor methods throughout. * fhandler_termios.cc: Ditto. * winsup.h (__ISSETF): Remove. (__SETF): Remove. (__CLEARF): Remove. (__CONDSETF): Remove.
2004-02-09* debug.h (console_printf): Define for non-debugging condition.Christopher Faylor
* 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.
2004-01-19* cygwin/include/signal.h: Add copyright notice.Christopher Faylor
* cygwin.din: Make clock SIGFE. Add clock_gettime, sigwaitinfo, timer_create, timer_delete, timer_settime. * include/cygwin/version.h: Reflect above additions. * fork.cc (fork_child): Call fixup_timers_after_fork. * signal.cc (sigwait): Remove unused variable. * timer.cc: New file. (clock_gettime): Define new function. (timer_tracker): Define new struct used by timer functions. (timer_tracker::timer_tracker): New function. (to_us): New function. (timer_thread): New function. (timer_tracker::settime): New function. (timer_create): New function. (timer_settime): New function. (timer_delete): New function. (fixup_timers_after_fork): New function. * cygthread.cc: Bump thread count. * signal.cc (sigwaitinfo): Define new function. (sigwait): Redefine based on sigwaitinfo. * include/cygwin/signal.h (sigwaitinfo): Declare. (sigwait): Ditto. * dtable.cc (dtable::vfork_parent_restore): Avoid double close of ctty when ctty == ctty_on_hold. * cygtls.h (_threadinfo::threadkill): New element. (_threadinfo::set_threadkill): Declare new function. (_threadinfo::reset_threadkill): Declare new function. * dcrt0.cc (dcrt0_1): Call here so that it will be possible to attach to running process with #(*& Windows Me/9x. (initial_env): Try to initialize strace if uninitialized. * gendef: Don't zero signal if threadkill is set since that will happen in the called function. * signal.cc (sigwait): Ensure cleanup in error conditions. * sigproc.cc (sig_send): Clear packet mask storage. (wait_subproc): Fill in child exit code in siginfo_t structure. * thread.cc (pthread_kill): Set threadkill flag. * tlsoffsets.h: Regenerate. Throughout, use siginfo_t to fill out all signal information for "kernel" signals. * cygtls.h (_threadinfo::set_siginfo): Declare new function. * cygtls.cc (_threadinfo::set_siginfo): Define new function. * dcrt0.cc (do_exit): Accommodate siginfo_t considerations. * exceptions.cc (handle_exceptions): Ditto. (sig_handle_tty_stop): Ditto. (ctrl_c_handler): Use killsys() to send signal. (sigpacket::process): Rename from sig_handle. Use siginfo_t field from sigpacket for everything. (tty_min::kill_pgrp): Accommodate siginfo_t considerations. (fhandler_termios::bg_check): Ditto. * fhandler_tty.cc (fhandler_tty_slave::ioctl): Use killsys() to send signal. * signal.cc (kill_worker): Rewrite to use siginfo_t second argument. (kill_pgrp): Ditto. (kill0): Define new function pulled from kill(). (kill): Rewrite as frontend to kill0. (killsys): Define new function. * sigproc.cc (sigelem): Eliminate. (sigpacket): Move to sigproc.h. Subsume sigelem. (pending_signals): Use sigpacket rather than sigelem for everything. (sig_clear): Ditto. (wait_sig): Ditto. (sig_send): Rewrite to use siginfo_t argument. (sig_send): New function wratpper to sig_send with siginfo_t argument. (wait_subproc): Accommodate siginfo_t considerations. * thread.cc (pthread_kill): Ditto. * sigproc.h (sigpacket): Move here. (sigpacket::process): Declare "new" function. (sig_handle): Eliminate declaration. (sig_send): Declare with new paramaters. (killsys): Declare new function. (kill_pgrp): Declare. * winsup.h: Move some signal-specific stuff to sigproc.h. * include/cygwin/signal.h: Tweak some siginfo_t stuff.
2003-12-08Change use of BOOL, TRUE, FALSE to bool, true, false, as appropriate,Christopher Faylor
throughout. * tty.cc (tty::common_init): Remove call to SetKernelObjectSecurity and edit some comments. * cygheap.h (init_cygheap::ctty): Add new element. * devices.in (device::parse): Remove special handling for /dev/tty. * devices.cc: Regenerate. * dtable.cc (build_fh_pc): Don't reset /dev/tty device. Let the device opener do that. * fhandler_termios.cc (tty_min::set_ctty): Redefine to _pinfo class. * fhandler_tty.cc (fhandler_tty_common::set_close_on_exec): Avoid setting noninherit flag for ctty. * tty.h: Move BOOLs to bools. (tty_min::set_ctty): Redeclare to _pinfo class. * pinfo.cc (_pinfo::set_ctty): Define new function based on tty_min::set_ctty. Change first argument from tty number to tty_min class. * pinfo.h (_pinfo::set_ctty): Declare. * fhandler_console.cc (fhandler_console::get_tty_stuff): Reflect move of set_ctty to _pinfo class. * fhandler_tty.cc (fhandler_tty_slave::open): Treat FH_TTY specially. Use saved cygheap value if it exists. Otherwise convert to real device and save on first time open. (fhandler_tty_common::dup): Potentially set controlling tty if duping a slave tty. * syscalls.cc (setsid): Close controlling tty in cygheap. * tty.cc: Change some BOOLs to bools.
2003-11-29* pinfo.h (_pinfo::getsig): Remove obsolete function, here and throughout.Christopher Faylor
* exceptions.cc: Ditto. * fhandler_termios.cc: Ditto. * signal.cc: Ditto. * sigproc.cc: Ditto. * Makefile.in: Revert previous change which made a cygwin.din newer than a version.h a warning rather than an error.
2003-09-25* devices.cc: New file.Christopher Faylor
* devices.gperf: New file. * devices.shilka: New file. * cygwin-gperf: New file. * cygwin-shilka: New file. * fhandler_fifo.cc: New file. * fhandler_nodevice.cc : New file. Reorganize headers so that path.h precedes fhandler.h throughout. Remove device argument and unit arguments from fhandler constructors throughout. Remove pc arguments to fhandler functions and use internal pc element instead, throughout. Use dev element in pc throughout. Use major/minor elements rather than units and device numbers previously in fhandler class. Use correct methods for fhandler file names rather than directly accessing file name variables, throughout. * Makefile.in (DLL_OFILES): Add devices.o, fhandler_fifo.o * dcrt0.cc (dll_crt0_1): Call device::init. * devices.h: Renumber devices based on more Linux-like major/minor numbers. Add more devices. Declare standard device storage. (device): Declare struct. * dir.cc (opendir): Use new 'build_fh_name' to construct a fhandler_* type. * dtable.cc (dtable::get_debugger_info): Ditto. (cygwin_attach_handle_to_fd): Ditto. (dtable::release): Remove special FH_SOCKET case in favor of generic "need_fixup_before" test. (dtable::init_std_file_from_handle): Use either build_fh_dev or build_fh_name to build standard fhandler. (dtable::build_fh_name): Renamed from dtable::build_fhandler_from_name. Move out of dtable class. Don't accept a path_conv argument. Just build it here and pass it to: (build_fh_pc): Renamed from dtable::build_fhandler. Move out of dtable class. Use intrinsic device type in path_conv to create new fhandler. (build_fh_dev): Renamed from dtable::build_fhandler. Move out of dtable class. Simplify arguments to just take new 'device' type and a name. Just return pointer to fhandler rather than trying to insert into dtable. (dtable::dup_worker): Accommodate above build_fh name changes. (dtable::find_fifo): New (currently broken) function. (handle_to_fn): Use strechr for efficiency. * dtable.h: Reflect above build_fh name changes and argument differences. (fhandler_base *&operator []): Return self rather than copy of self. * fhandler.cc (fhandler_base::operator =): Use pc element to set normalized path. (fhandler_base::set_name): Ditto. (fhandler_base::raw_read): Use method to access name. (fhandler_base::write): Correctly use get_output_handle rather than get_handle. (handler_base::device_access_denied): New function. (fhandler_base::open): Eliminate pc argument and use pc element of fhandler_base throughout. (fhandler_base::fstat): Detect if device is based in filesystem and use fstat_fs to calculate stat, if so. (fhandler_base::fhandler_base): Eliminate handling of file names and, instead, just free appropriate component from pc. (fhandler_base::opendir): Remove path_conv parameter. * fhandler.h: Remove all device flags. (fhandler_base::pc): New element. (fhandler_base::set_name): Change argument to path_conv. (fhandler_base::error): New function. (fhandler_base::exists): New function. (fhandler_base::pc_binmode): New function. (fhandler_base::dev): New function. (fhandler_base::open_fs): New function. (fhandler_base::fstat_fs): New function. (fhandler_base::fstat_by_name): New function. (fhandler_base::fstat_by_handle): New function. (fhandler_base::isfifo): New function. (fhandler_base::is_slow): New function. (fhandler_base::is_auto_device): New function. (fhandler_base::is_fs_special): New function. (fhandler_base::device_access_denied): New function. (fhandler_base::operator DWORD&): New operator. (fhandler_base::get_name): Return normalized path from pc. (fhandler_base::get_win32_name): Return windows path from pc. (fhandler_base::isdevice): Renamed from is_device. (fhandler_base::get_native_name): Return device format. (fhandler_fifo): New class. (fhandler_nodevice): New class. (select_stuff::device_specific): Remove array. (select_stuff::device_specific_pipe): New class element. (select_stuff::device_specific_socket): New class element. (select_stuff::device_specific_serial): New class element. (select_stuff::select_stuff): Initialize new elements. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Move to base class from fhandler_disk_file. (fhandler_base::fstat_by_name): Ditto. (fhandler_base::fstat_by_name): Ditto. (fhandler_disk_file::open): Move most functionality into fhandler_base::open_fs. (fhandler_base::open_fs): New function. (fhandler_disk_file::close): Move most functionality into fhandler_base::close_fs. (fhandler_base::close_fs): New function. * fhandler_mem.cc (fhandler_dev_mem::open): Use device name in debugging output. * fhandler_socket.cc (fhandler_socket::set_connect_secret): Copy standard urandom device into appropriate place. (fhandler_socket::accept): Reflect change in fdsock return value. * fhandler_tty.cc: See "throughouts" above. * net.cc: Accommodate fdsock change throughout. (fdsock): Return success or failure, accept fd argument and device argument. * path.cc (symlink_info::major): New element. (symlink_info::minor): New element. (symlink_info::parse_device): Declare new function. (fs_info::update): Accommodate changes in path_conv class. (path_conv::fillin): Ditto. (path_conv::return_and_clear_normalized_path): Eliminate. (path_conv::set_normalized_path): New function. (path_conv::path_conv): Set info in dev element. Use path_conv methods Check for FH_FS rather than FH_BAD to indicate when to fill in filesystem stuff. where appropriate rather than direct access. Use set_normalized_path to set normalized path. (windows_device_names): Eliminate. (get_dev): Ditto. (get_raw_device_number): Ditto. (get_device_number): Ditto. (win32_device_name): Call new device name parser to do most of the heavy lifting. (mount_info::conv_to_win32_path): Fill in dev field as appropriate. (symlink_worker): Handle new device files. (symlink_info::check): Ditto. (symlink_info::parse_device): Define new function. * path.h (executable_states): Move here from fhandler.h. (fs_info): Rename variables to *_storage and create methods for accessing same. (path_conv): Add dev element, remove devn and unit and adjust inline methods to accommodate. (set_normalized_path): Declare new function. * pinfo.cc (_pinfo::commune_recv): Add broken support for handling fifos. (_pinfo::commune_send): Ditto. * pipe.cc (fhandler_pipe::close): check for existence of handle before closing it. (handler_pipe::create): Rename from make_pipe. Change arguments to accept fhandler_pipe array. Accommodate fifos. (pipe): Rework to deal with fhandler_pipe::create changes. (_pipe): Ditto. * select.cc: Use individual device_specific types throughout rather than indexing with obsolete device number. (set_bits): Use is_socket call rather than checking device number. * shared_info.h (CURR_MOUNT_MAGIC): Update. (conv_to_win32_path): Reflect addition of device argument. * syscalls.cc (mknod_worker): New function. (open): Use build_fh_name to build fhandler. (chown_worker): Detect if this is an 'auto' device rather than an on-filesystem device and handle appropriately. (chmod_device): New function. (chmod): Detect if this is an 'auto' device rather than an on-filesystem device and handle appropriately. Use chmod_device to set mode of in-filesystem devices. (stat_worker): Eliminate path_conv argument. Call build_fh_name to construct fhandler. Use fh->error() rather than pc->error to detect errors in fhandler construction. (access_worker): New function pulled from access. Accommodate in-filesystem devices. (access): Use access_worker. (fpathconf): Detect if this is an 'auto' device rather than an on-filesystem device and handle appropriately. (mknod_worker): New function. (mknod32): New function. (chroot): Free normalized path -- assuming it was actually cmalloced. * tty.cc (create_tty_master): Tweak for new device class. (tty::common_init): Ditto. * winsup.h (stat_worker): Remove. (symlink_worker): Declare. * exceptions.cc (set_process_mask): Just call sig_dispatch_pending and don't worry about pending_signals since sig_dispatch_pending should always do the right thing now. (sig_handle): Reorganize SIGCONT handling to more closely conform to SUSv3. * pinfo.h: Move __SIG enum to sigproc.h. (PICOM_FIFO): New enum element. (_pinfo): Remove 'thread2signal' stuff throughout class. (_pinfo::commune_send): Make varargs. (_pinfo::sigtodo): Eliminate. (_pinfo::thread2signal): Ditto. * signal.cc (kill_worker): Eliminate call to setthread2signal. * sigproc.cc (local_sigtodo): Eliminate. (getlocal_sigtodo): Ditto. (sigelem): New class. (pending_signals): New class. (sigqueue): New variable, start of sigqueue linked list. (sigcatch_nonmain): Eliminate. (sigcatch_main): Eliminate. (sigcatch_nosync): Eliminate. (sigcomplete_nonmain): Eliminate. (pending_signals): Eliminate. (sig_clear): Call signal thread to clear pending signals, unless already in signal thread. (sigpending): Call signal thread to get pending signals. (sig_dispatch_pending): Eliminate use of pending_signals and just check sigqueue. (sigproc_terminate): Eliminate all of the obsolete semaphore stuff. Close signal pipe handle. (sig_send): Eliminate all of the obsolete semaphore stuff and use pipe to send signals. (getevent): Eliminate. (pending_signals::add): New function. (pending_signals::del): New function. (pending_signals::next): New function. (wait_sig): Eliminate all of the obsolete semaphore stuff. Use pipe to communicate and maintain a linked list of signals. * sigproc.h: Move __SIG defines here. Add __SIGPENDING. (sig_dispatch_pending): Remove "C" specifier. (sig_handle): Accept a mask argument. * thread.cc: Remove signal handling considerations throughout.
2003-09-17* pinfo.h (winpids::pid_access): New element.Christopher Faylor
(winpids::winpids): Rejigger to set pinfo_access. * pinfo.cc (winpids::add): Try to open shared memory region with supplied pinfo_access first, then default to readonly. * fhandler_termios.cc (tty_min::kill_pgrp): When getting list of pids to work with, suggest opening with PID_MAP_RW. * signal.cc (kill_pgrp): Ditto. * sigproc.cc (sig_send): Perform a write check on todo prior to attempting to increment it. Return EACCES if we can't write to it.
2003-06-16Throughout, remove "include <errno.h>" from files which already includeChristopher Faylor
cygerrno.h. * include/cygwin/config.h (__DYNAMIC_REENT__): Define. * include/cygwin/version.h: Bump API minor version. * cygwin.din: Export __getreent * cygerrno.h: Include errno.h. Fix places where _impure_ptr is used directly to store the errno value. * debug.cc (__set_errno): Ditto. * errno.cc: Remove _RRENT_ONLY define to get errno.cc compiled. * signal.cc: Rename _reent_clib to _REENT throughout. * thread.h (reent_clib): Remove prototype. * thread.cc (reent_clib): Rename reent_clib to __getreent. Return _impure_ptr until MTinterface is initialized. (reent_winsup): Fix a possible SEGV when _r == NULL. Return NULL instead. * MTinterface::fixup_after_fork: Switch reent back to _impure_ptr to keep signal handling running when fork is called from a thread other than the mainthread.
2003-04-01 * dir.cc: Change __off32_t to _off_t and __off64_t to _off64_tCorinna Vinschen
throughout. * fhandler.cc: Ditto. * fhandler.h: Ditto. * fhandler_clipboard.cc: Ditto. * fhandler_disk_file.cc: Ditto. * fhandler_dsp.cc: Ditto. * fhandler_floppy.cc: Ditto. * fhandler_mem.cc: Ditto. * fhandler_proc.cc: Ditto. * fhandler_process.cc: Ditto. * fhandler_random.cc: Ditto. * fhandler_registry.cc: Ditto. * fhandler_tape.cc: Ditto. * fhandler_termios.cc: Ditto. * fhandler_virtual.cc: Ditto. * fhandler_zero.cc: Ditto. * mmap.cc: Ditto. * pipe.cc: Ditto. * syscalls.cc: Ditto. * winsup.h: Ditto. * include/cygwin/stat.h: Ditto. * include/cygwin/types.h: Ditto. Remove definition of __off32_t and __off64_t.
2003-02-13* spawn.cc (linebuf::~linebuf): Resurrect commented out (for debugging?) code.Christopher Faylor
2003-02-04Eliminate most unneeded this-> pointers throughout.Christopher Faylor
2003-01-17whitespaceChristopher Faylor
2003-01-10 Split ChangeLog, create ChangeLog-2002.Corinna Vinschen
Fix copyright dates.
2002-12-28* fhandler_termios.cc (fhandler_termios::line_edit): Perform echo before inputChristopher Faylor
is accepted or suffer a "race".
2002-12-27* fhandler.h (fhandler_termios::line_edit): Replace third argument withChristopher Faylor
passed-in termios struct. * fhandler_console.cc (fhandler_console::read): Prior to loop, make a copy of current termios for passing to line_edit prior so that all characters are processed consistently. * fhandler_tty.cc (fhandler_pty_master::write): Ditto. (process_input): Make a copy of curent termios prior to read for use in subsequent line_edit. * fhandler_termios.cc (fhandler_termios::line_edit): Replace third parameter with passed-in termios struct and use it throughout rather than the data from the current fhandler_termios class.
2002-12-21* fhandler.h (line_edit_status): Reorganize so that tests for error conditionChristopher Faylor
can be < or >. * fhandler_tty.cc (fhandler_pty_master::write): Don't return after sending a signal. * fhandler_termios.cc (fhandler_termios::line_edit): Trivial change to use built-in bool types.
2002-12-20* fhandler.h (line_edit_status): Add a new element.Christopher Faylor
* fhandler_termios.cc (fhandler_termios::line_edit): After accept_input, handle both potential error condition and pipe full conditions. * fhandler_tty.cc (fhandler_pty_master::accept_input): Return -1 on error. (fhandler_pty_master::write): Handle pipe full condition.
2002-12-17* fhandler_termios.cc (fhandler_termios::line_edit): Return line_edit_error andChristopher Faylor
remove last char from readahead buffer if accept_input() fails. * fhandler_tty.cc (fhandler_pty_master::accept_input): Return 0 and restore readahead buffer when tty slave pipe is full.
2002-12-14* fhandler_termios.cc (fhandler_termios::line_edit): Call accept_input() inChristopher Faylor
character processing loop. Set return value independently of input_done.
2002-12-05* fhandler.h (fhandler_termios::line_edit): Change return from an int to anChristopher Faylor
enum to allow the function to return an error. * fhandler_console.cc (fhandler_console::read): Update the line_edit call to use the new enum. * fhandler_termios.cc (fhandler_termios::line_edit): Change return from an int to an enum to allow the function to return an error. Put put_readahead call before doecho for future patch. * fhandler_tty.cc (fhandler_pty_master::write): Change to call line_edit one character at a time, and stop if an error occurs.
2002-09-23More GNUify non-GNU formatted functions calls throughout.Christopher Faylor
2002-09-22* fhandler.cc (fhandler_base::dup): Don't set handle on failure. Caller hasChristopher Faylor
already taken care of that. * fhandler_console.cc (fhandler_console::open): Initialize handles to NULL. (fhandler_console::close): Ditto. GNUify non-GNU formatted functions calls throughout.
2002-07-29* fhandler_console.cc (fhandler_console::read): Use appropriate kill_pgrpChristopher Faylor
method. * select.cc (peek_console): Ditto. * fhandler_termios.cc (fhandler_termios::bg_check): Send "stopped" signal to entire process group as dictated by SUSv3. * termios.cc (tcsetattr): Detect when stopped signal sent and force a stop before setting anything.
2002-06-05* dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote shares.Christopher Faylor
* path.cc (mount_info::conv_to_win32_path): Set flags to binary when mount entry is not found. (mount_info::set_flags_from_win32_path): Ditto.
2002-06-05Remove fcntl.h includes throughout.Christopher Faylor
* fhandler.h: Move fcntl.h include here. (fhandler_base::set_flags): Accept supplied_bin argument. Make non-inlined. * dtable.cc (dtable::init_std_file_from_handle): Just use binmode from pc. (reset_to_open_binmode): Use set_flags. * cygwin.din (open): Avoid newlib wrapper. (read): Ditto. (unlink): Ditto. (write): Ditto. * fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument. Make binmode decisions here. (fhandler_base::open): Avoid using pc if it is NULL. Eliminate binmode logic. Just call set_flags with binmode argument. (fhandler_base::init): Call set_flags with binmode argument. * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto. * fhandler_console.cc (fhandler_console::open): Ditto. (fhandler_console::init): Force binary on open. * fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode here. Let it happen in base class. * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open. Set return value appropriately if unable to open. * fhandler_proc.cc (fhandler_proc::open): Make sure flags are set before open_status. * fhandler_process.cc (fhandler_process::open): Ditto. * fhandler_registry.cc (fhandler_registry::open): Ditto. * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto. * fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default. * fhandler_serial.cc (fhandler_serial::init): Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. (fhandler_pty_master::open): Ditto. * fhandler_virtual.cc (fhandler_virtual::open): Ditto. * fhandler_windows.cc (fhandler_windows::open): Ditto. * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. * net.cc (fdsock): Ditto. * path.cc (path_conv::check): Avoid checking for extension when error or directory. (set_flags): Set PATH_TEXT explicitly, when appropriate. (mount_info::conv_to_win32_path): Use set_flags() to set path flags. * path.h (PATH_TEXT): New enum. (path_conv::binmode): Return appropriate constant based on binmode. * pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY. * syscalls.cc (setmode_helper): Make debugging message a little clearer. (setmode): Set binmode via set_flags.
2002-05-28* autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.Christopher Faylor
(LoadFuncEx2): Adapted from LoadFuncEx. Provides control of return value for nonexistent function. (NtQueryObject): Declare. (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if not available. * debug.h (being_debugged): Just rely on IsDebuggerPresent return value. * dtable.cc (handle_to_fn): New function. (dtable::init_std_file_from_handle): Attempt to derive std handle's name via handle_to_fn. (dtable::build_fhandler_from_name): Fill in what we can in path_conv structure when given a handle and path doesn't exist. * fhandler.cc (fhandler_base::open): Don't set the file pointer here. Use pc->exists () to determine if file exists rather than calling GetFileAttributes again. * fhandler.h (fhandler_base::exec_state_isknown): New method. (fhandler_base::fstat_helper): Add extra arguments to declaration. (fhandler_base::fstat_by_handle): Declare new method. (fhandler_base::fstat_by_name): Declare new method. * fhandler_disk_file (num_entries): Make __stdcall. (fhandler_base::fstat_by_handle): Define new method. (fhandler_base::fstat_by_name): Define new method. (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate. (fhandler_disk_file::fstat_helper): Accept extra arguments for filling out stat structure. Move handle or name specific stuff to new methods above. (fhandler_disk_file::open): Use real_path->exists rather than calling GetFileAttributes again. * ntdll.h (FILE_NAME_INFORMATION): Define new structure. (OBJECT_INFORMATION_CLASS): Partially define new enum. (OBJECT_NAME_INFORMATION): Define new structure. (NtQueryInformationFile): New declaration. (NtQueryObject): New declaration. * path.cc (path_conv::fillin): Define new method. * path.h (path_conv::fillin): Declare new method. (path_conv::drive_thpe): Rename from 'get_drive_type'. (path_conv::volser): Declare new method. (path_conv::volname): Declare new method. (path_conv::root_dir): Declare new method. * syscalls.cc (fstat64): Send real path_conv to fstat as second argument.
2002-05-25Remove unneeded sync.h, where appropriate, throughout. Remove unneeded heap.h,Christopher Faylor
where appropriate, throughout. Remove unneeded exceptions.h, where appropriate, throughout. Remove unneeded perprocess.h, where appropriate, throughout.
2002-03-192002-03-15 Robert Collins <rbtcollins@hotmail.com>Robert Collins
* fhandler.h (fhandler_termios::lseek): Override lseek. * fhandler_termios.cc (fhandler_termios::lseek): Implement this.
2002-03-05 * include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.Corinna Vinschen
* fhandler_termios.cc: Include <sys/termios.h>. (line_edit): Recognize disabled c_cc[] chars. Ignore VDISCARD when not in ICANON mode.
2002-02-22* sync.h (new_muto): Just accept an argument which denotes the name of theChristopher Faylor
muto. Use this argument to construct static storage. * cygheap.cc (cygheap_init): Reflect above change. * exceptions.cc (events_init): Ditto. * malloc.cc (malloc_init): Ditto. * path.cc (cwdstuff::init): Ditto. * cygheap.h (cwdstuff): Change name of lock element to make it less generic. * path.cc (cwdstuff::get_hash): Ditto. (cwdstuff::get_initial): Ditto. (cwdstuff::set): Ditto. (cwdstuff::get): Ditto. * sigproc.cc (proc_subproc): Ditto. * debug.cc (lock_debug): Change to method. Use method rather than macro throughout. * tty.h (tty_min::kill_pgrp): Declare new method. * fhandler_termios.cc (tty_min::kill_pgrp): New method. (fhandler_termios::line_edit): Use new method for killing process. * dcrt0.cc (do_exit): Ditto. * dtable.cc (dtable::get_debugger_info): New method for inheriting dtable info from a debugger. * tty.cc (tty_init): Attempt to grab file handle info from parent debugger, if appropriate. # dtable.cc (dtable::stdio_init): Make this a method. (dtable::init_std_file_from_handle): Don't set fd unless it's not open. (dtable::build_fhandler_from_name): Move name setting to dtable::build_fhandler. (dtable::build_fhandler): Add win32 name parameter. * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init. * dtable.h (dtable): Reflect build_fhandler parameter change. * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in build_fhandler. * net.cc (fdsock): Remove set_name call since it is now handled by build_fhandler. * sigproc.cc (proc_subproc): Release muto as early as possible.
2001-08-07* fhandler_console.cc (get_tty_stuff): Don't initialize shared memory consoleChristopher Faylor
area if it is already initialized. * fhandler_termios.cc (fhandler_termios::tcsetpgrp): Augment debugging info.
2001-07-26Throughout, reorganize header file inclusion to put security.h prior toChristopher Faylor
fhandler.h. * fhandler.h (fhandler_base::get_inheritance): New method. * fhandler_socket.cc (fhandler_socket::create_secret_event): Use proper close-on-exec inheritance when creating. (fhandler_socket::check_peer_secret_event): Create handle as non-inheritable.
2001-05-10remove erroneous header.Christopher Faylor
2001-05-09* fhandler.h (fhandler_termios::echo_erase): Declare new method.Christopher Faylor
* fhandler_termios.cc (fhandler_termios::echo_erase): New method for echoing erase characters. (fhandler_termios::line_edit): Check the echo flag before echoing control characters (from Kazuhiro Fujieda <fujieda@jaist.ac.jp>).
2001-04-29Throughout, change 'tty_attached' to 'real_tty_attached', for clarity.Christopher Faylor
Throughout, change 'OutputStopped' to 'output_stopped', for consistency. * dtable.cc (stdio_init): Set controlling tty if not set by stdio opens. * exceptions.cc (ctrl_c_handler): Avoid special pgid checking if no tty is associated with the process. (Suggested by Tim Baker <dbaker@direct.ca>) * external.cc (fillout_pinfo): Return actual tty number for ctty. * fhandler_console.cc (get_tty_stuff): Set ctty when shared memory is allocated. Accept flags input from open(). (set_console_ctty): New function. (fhandler_console::open): Pass flags to get_tty_stuff and rely on this function to set the ctty, if appropriate. * fhandler_termios.cc (fhandler_termios::set_ctty): Move to tty_min class. * fhandler_tty.cc (fhandler_tty_slave::open): Use tc field to access set_ctty(). * tty.h (TTY_CONSOLE): Move to include/sys/cygwin.h. (tty_min): Add set_ctty class here. * include/sys/cygwin.h (TTY_CONSOLE): New home here. * path.cc (symlink_info): Make contents an actual buffer. Pass more flags to case_check. (path_conv::check): Reorganize to do parsing based on posix path rather than native path. (symlink_info::check): Expect posix path as input. Translate to native path here. Accept path_conv flags. Stop parsing if not a symlink regardless of whether previous path was a symlink.
2001-03-18* fhandler.h (fhandler_tty_slave): Declare new methods.Egor Duda
* select.cc (fhandler_tty_slave::select_read): New method. * select.cc (fhandler_tty_slave::ready_for_read): Ditto. * select.cc (verify_tty_slave): New function. * fhandler_termios.cc (fhandler_termios::line_edit): Empty input buffer on signal. * fhandler_tty.cc (fhandler_tty_slave::read): Check for input data after reading from pipe. Reset event if input pipe is empty. * tty.h (class tty): Allow creating events with manual reset. * tty.cc (tty::get_event): Use manual_reset flag. * tty.cc (tty::common_init): Create input_available_event with manual reset.
2001-03-17* fhandler_termios.cc (fhandler_termios::line_edit): Don't accept input when aChristopher Faylor
signal is sent or we'll end up in an EOF/signal race.
2001-03-13* fhandler.h (fhandler_termios::fixup_after_exec): New function.Egor Duda
* fhandler.cc (fhandler_termios::fixup_after_fork): New function. Fixup output handle. * fhandler_tty.cc (fhandler_tty_common::fixup_after_fork): Output handle is now fixed up in fhandler_termios::fixup_after_fork().
2001-03-05* dlopen.c (dlopen): Return NULL when name is NULL (suggested byChristopher Faylor
chrisiasci@aol.com). * cygwin.din: Add a new, internally used export - _check_for_executable. * dcrt0.cc (dll_crt0_1): Set _check_for_executable for older binaries. Pass user_data to premain functions. * fhandler.cc (fhandler_disk_file::open): Only check for executable if the linked program is intereested in the executable bit. (fhandler_disk_file::check_execable_p): Delete. * fhandler.h (executable_states): New enumeration of various states of executable bit caring. (fhandler_base::set_execable_p): New method. * fhandler_termios.cc (fhandler_termios::line_edit): Flag when a signal has been sent to the tty. Return -1 when this is so. * fhandler_console.cc (fhandler_console::read): Return -1 when signal sending character encountered. * path.cc (path_conv::check): Record when path refers to a disk device. Move executable extension check here. (check_sysfile): Accomodate new EXEC path states. (has_suffix): Remove. (next_suffix): Remove. (class suffix_scan): New clas. (suffix_scan::has): New method. (suffix_scan:next): New method. (symlink_info::check): Use suffix_scan method to control for scanning for suffixes. * path.h (path_conv::exec_state): New method. * perprocess.h: Make "C" friendly. * include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_S_IEXEC. Bump CYGWIN_VERSION_API_MINOR. * include/sys/cygwin.h: Change premain declarations. * winsup.h: Move __cplusplus test to after builtin defines.
2001-01-17* autoload.cc (LoadDLLinitfunc): Remove debugging statement.Christopher Faylor
* exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier in interrupt. ((interrupt_setup): i.e., here. (sig_handle): Don't queue multiple SIGSTOPS. * fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity. * signal.cc (kill_pgrp): Minor cleanup. * fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type for function return. Don't raise signal if a signal is already queued. * fhandler_console.cc (fhandler_console::read): Use enumerated return type for bg_check. * select.cc: Ditto, throughout. * read.cc: Ditto, throughout. * termios.cc: Ditto, throughout. (_read): YA interrupt detect simplification. * wait.cc (wait4): Ditto.
2000-10-21* fhandler.h (fhandler_console): Remove tcsetpgrp.Christopher Faylor
* fhandler_console.cc (fhandler_console::tcsetpgrp): Eliminate. * fork.cc (fork_parent): Avoid returning same pid twice in a row regardless of OS. * pinfo.cc (pinfo::init): Rename create argument to flags and treat it as such. * signal.cc (set_sigcatchers): New function. (signal): Use set_sigcatchers to increment or decrement sigcatcher tracker. (sigaction): Ditto. Add debugging output. * spawn.cc (spawn_guts): Always quote first argv[0] argument when it's a COMSPEC shell.
2000-10-19* Makefile.in: add miscfuncs.ccDJ Delorie
* miscfuncs.cc: new, miscellaneous functions * winsup.h: define table-driven tolower/toupper * environ.cc: use them * fhandler_console.cc: ditto * fhandler_termios: ditto * path.cc: ditto (strncasematch, strcasematch, strcasestr): move to miscfuncs.cc
2000-09-07Split out tty and shared_info stuff into their own headers and use throughout.Christopher Faylor
Include sys/termios.h for files which need it. * tty.h: New file. * shared_info.h: New file. * fhandler.h: Move inline methods that rely on tty stuff to fhandler_console.cc. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Set output_done_event immediately after reading data to speed up tty output processing. (process_output): Set write_error to errno or zero. (fhandler_tty_slave::write): Check previous write error prior to writing to slave end of pipe. This allows tty output to be slightly less synchronous. * fhandler_console.cc (fhandler_console::tcsetpgrp): Moved here from fhandler.h. (fhandler_console::set_input_state): Ditto.
2000-09-07* exceptions.cc (signal_exit): Reset all mutos owned by the main thread.Christopher Faylor
* fhandler.h: Define *_output_mutex macros for serializing tty output. (fhandler_termios): Remove restart_output_event. Define dummy output mutex methods. (fhandler_pty_master): Remove unneeded fixup_after_fork method. * fhandler_termios.cc (fhandler_termios::line_edit): Acquire output_mutex when CTRL-S is hit. Release it on CTRL-Q. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Remove inappropriate OutputStopped test here. Just use the output mutex. (fhandler_pty_master::fhandler_pty_master): Remove obsolete reference to restart_output_event. (fhandler_tty_common::close): Ditto. (fhandler_pty_master::set_close_on_exec): Ditto. (fhandler_pty_master::fixup_after_fork): Delete. * tty.cc (tty::common_init): Ditto. * sync.cc (muto::reset): New method. * sync.h: Declare above method.
2000-09-02* sigproc.cc (proc_info): Rename proc_exists which takes a pid to "pid_exists".Christopher Faylor
* shared.h: Split out "child_info" stuff into a new header file and use where necessary. Declare pid_exists. * child_info.h: New file.
2000-08-22* winsup.h: Eliminate inclusion of most of the cygwin .h files. Use .h filesChristopher Faylor
only in sources which require them. * Makefile.in: Generate dependencies with -MD option.
2000-08-22* cygerrno.h: New file. Use this throughout whenever errno manipulation isChristopher Faylor
required. * errno.cc: Use DWORD to hold Windows errors. (geterrno_from_win_error): New function. (seterrno_from_win_error): Use geterrno_from_win_error to convert supplied windows error (suggested by Corinna Vinschen). * path.cc (symlink_info): Add error element. * path.cc (path_conv::check): Remove errno setting. Use new symlink_info errno element to set path_conv error, where appropriate. (symlink_info::check): Set error element rather than attempting to manipulate errno. Add more checks for trailing / and /.. even though they are currently useless. Avoid setting EINVAL. * path.cc (normalize_posix_path): Correct check for trailing /.
2000-08-12* winsup.h: Split out dtable definitions into separate header file.Christopher Faylor
* dtable.h: New file. * sigproc.h: Eliminate pinfo.h usage here. Use it in source files that need it.
2000-08-02* winsup.h: take out protections of environ, errno, allow C useDJ Delorie
* *.cc: put winsup.h before other headers (for __INSIDE_CYGWIN__); use cur_environ() instead of just environ * times.cc: remove import protections * glob.c: add winsup.h * localtime.c: ditto * smallprint.c: ditto * Makefile.in: don't __INSIDE_CYGWIN__ as it messes up profiling.