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
2002-09-19* cygthread.cc (cygthread::initialized): Avoid copying on fork or some threadsChristopher Faylor
may not end up in the pool. (cygthread::new): Avoid race when checking for initialized. Add debugging code. * fhandler.cc (fhandler_base::raw_read): Add case for ERROR_INVALID_HANDLE due to Win95 directories. (fhandler_base::open): Handle errors due to Win95 directories. (fhandler_base::close): Add get_nohandle () test. (fhandler_base::set_close_on_exec): Ditto. (fhandler_base::fork_fixup): Ditto. (fhandler_base::lock): Change error code to Posix EINVAL. (fhandler_base::dup): If get_nohandle (), set new value to INVALID_HANDLE_VALUE instead of NULL. * fhandler_disk_file.cc (fhandler_disk_file::fstat): Call fstat_by_name if get_nohandle (). Remove extraneous element from strpbrk. (fhandler_disk_file::open): Remove test for Win95 directory. * fhandler_random.cc (fhandler_dev_random::open): Add set_nohandle (). * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto. * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. (fhandler_dev_zero::close): Delete. * fhandler.h (class fhandler_dev_zero): Ditto.
2002-09-04 * fhandler.h (fhandler_socket::read): Remove method.Corinna Vinschen
(fhandler_socket::write): Ditto. (fhandler_socket::readv): New method. (fhandler_socket::writev): Ditto. (fhandler_socket::recvmsg): Add new optional argument. (fhandler_socket::sendmsg): Ditto. * fhandler.cc (fhandler_socket::read): Remove method. (fhandler_socket::write): Ditto. (fhandler_socket::readv): New method. (fhandler_socket::writev): Ditto. (fhandler_socket::recvmsg): Use win32's scatter/gather IO where possible. (fhandler_socket::sendmsg): Ditto. * net.cc (cygwin_recvmsg): Check the msghdr's iovec fields. (cygwin_sendmsg): Ditto. Add omitted sigframe.
2002-08-30* miscfuncs.cc (check_iovec_for_read): Don't check buffer when zero lengthChristopher Faylor
iov_len. (check_iovec_for_write): Ditto. * fhandler.h (fhandler_base::readv): New method. (fhandler_base::writev): Ditto. * fhandler.cc (fhandler_base::readv): New method. (fhandler_base::writev): Ditto. * syscalls.cc (_read): Delegate to readv(2). (_write): Ditto, mutatis mutandi. (readv): Rewrite, based on the old _read code, to use the new fhandler_base::readv method. Improve access mode handling and ensure all calls reach the final strace statement. (writev): Ditto, mutatis mutandi. * include/sys/uio.h (struct iovec): Change field types to match SUSv3. * winsup.h (check_iovec_for_read): New function. (check_iovec_for_write): Ditto. * miscfuncs.cc (check_iovec_for_read): Ditto. (check_iovec_for_write): Ditto.
2002-08-28 * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flagsCorinna Vinschen
not understood by WinSock. (fhandler_socket::sendto): Ditto. If WinSock sendto() returns WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL isn't set in flags. * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL. * include/cygwin/version.h: Bump API minor number.
2002-08-27 * fhandler_socket.cc (fhandler_socket::check_peer_secret_event):Corinna Vinschen
Fix strace message. (fhandler_socket::connect): Remove sigframe. (fhandler_socket::accept): Ditto. (fhandler_socket::getsockname): Ditto. (fhandler_socket::getpeername): Ditto. (fhandler_socket::recvfrom): Ditto. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendto): Ditto. (fhandler_socket::sendmsg): Ditto. (fhandler_socket::close): Ditto. (fhandler_socket::ioctl): Ditto. * ioctl.cc (ioctl): Add sigframe. *net.cc (cygwin_sendto): Ditto. (cygwin_recvfrom): Ditto. (cygwin_recvfrom): Ditto. (cygwin_connect): Ditto. (cygwin_shutdown): Ditto. (cygwin_getpeername): Ditto. (cygwin_accept): Ditto. Improve strace message. (cygwin_getsockname): Ditto. Ditto. (cygwin_recvmsg): Ditto. Ditto. (cygwin_sendmsg): Fix strace message.
2002-08-26 * fhandler.h (fhandler_socket::recvfrom): Fix prototype.Corinna Vinschen
(fhandler_socket::sendto): Ditto. * fhandler_socket.cc (fhandler_socket::recvfrom): Ditto. (fhandler_socket::sendto): Ditto. * include/sys/socket.h (recv): Fix prototype. (recvfrom): Ditto. (send): Ditto. (sendto): Ditto. * net.cc (cygwin_sendto): Ditto. Improve strace message (cygwin_recvfrom): Ditto. Ditto. (cygwin_setsockopt): Improve strace message. (cygwin_getsockopt): Ditto. (cygwin_connect): Ditto. (cygwin_accept): Ditto. (cygwin_bind): Ditto. (cygwin_getsockname): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Fix prototype. (cygwin_send): Ditto. (cygwin_recvmsg): Improve strace message. (cygwin_sendmsg): Ditto.
2002-08-12 * fhandler.h (fhandler_socket::recv): Remove method.Conrad Scott
(fhandler_socket::send): Ditto. * fhandler_socket.cc (fhandler_socket::recv): Ditto. (fhandler_socket::send): Ditto. (fhandler_socket::read): Delegate to fhandler_socket::recvfrom. (fhandler_socket::write): Delegate to fhandler_socket::sendto. (fhandler_socket::sendto): Check for null `to' address. * net.cc (cygwin_sendto): Check for zero request length. (cygwin_recvfrom): Ditto. Fix signature, use void *buf. (cygwin_recv): Delegate to cygwin_recvfrom. (cygwin_send): Delegate to cygwin_sendto.
2002-08-08 * winsup.h (__check_null_invalid_struct): Make ptr argument non-const.Conrad Scott
(__check_null_invalid_struct_errno): Ditto. * miscfuncs.cc (__check_null_invalid_struct): Ditto. (__check_null_invalid_struct_errno): Ditto. (__check_invalid_read_ptr_errno): Remove superfluous cast. * net.cc (get): Set appropriate errno if fd is not a socket. (cygwin_sendto): Fix parameter checking. (cygwin_recvfrom): Ditto. (cygwin_setsockopt): Ditto. (cygwin_getsockopt): Ditto. (cygwin_connect): Ditto. (cygwin_gethostbyaddr): Ditto. (cygwin_accept): Ditto. (cygwin_bind): Ditto. (cygwin_getsockname): Ditto. (cygwin_listen): Ditto. (cygwin_getpeername): Ditto. (cygwin_send): Ditto. (cygwin_shutdown): Ditto. Move sigframe to fhandler_socket. (cygwin_recvmsg): Fix parameter checking. Add tracing. (cygwin_sendmsg): Ditto. * fhandler_socket.cc (fhandler_socket::shutdown): Add sigframe. * resource.cc (setrlimit): Fix parameter checking.
2002-08-07 Fix by Conrad Scott <conrad.scott@dsl.pipex.com>:Corinna Vinschen
* fhandler_socket.cc (fhandler_socket::accept): Fix FIONBIO call.
2002-07-14* debug.h (handle_list): Move here from debug.cc. Add "inherit" flagChristopher Faylor
functionality. * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk. (_csbrk): Reorganize to not assume first allocation is <= 1 page. (cygheap_setup_for_child): Mark protected handle as inheritable. * cygheap.h (cygheap_debug): New struct. (init_cygheap): Add new structure when debugging. * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle here, if appropriate. Don't protect subproc_ready, since it is already protected in the parent. Call memory_init prior to ProtectHandle to ensure that cygheap is set up. Call debug_fixup_after_fork_exec when appropriate. (_dll_crt0): Don't close ppid_handle here. * debug.cc: Use cygheap debug structure rather than static elements throughout. (add_handle): Don't issue a warning if attempt to protect handle in exactly the same way from exactly the same place. Add pid info to warning output. Accept additional argument controlling whether handle is to be inherited. Add pid to stored information. (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork. Reorganize to avoid erroneously skipping handles. (mark_closed): Add pid info to warning output. (setclexec): Rename from setclexec_pid. * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg. (fhandler_base::fstat): Add debugging output. (fhandler_base::set_inheritance): Call setclexec rather than setclexec_pid. (fhandler_base::fork_fixup): Ditto. * fhandler_console.cc (get_tty_stuff): Mark protected handle as inheritable. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * tty.cc (tty::make_pipes): Ditto. (tty::common_init): Ditto. * fork.cc (fork_parent): Ditto. (fork_child): Close protected handles with correct name. Remove debug_fixup_after_fork call. * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark protected handle as inheritable/non-inheritable, as appropriate. * shared.cc (memory_init): Mark protected handle as inheritable. Call debug_init here. * sigproc.cc (wait_sig): Close protected handle with correct name. * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as inheritable. * exceptions.cc (debugger_command): Try to run dumper.exe, if found. * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup since path is already resolved.
2002-07-06 * fhandler.h (fhandler_socket::is_unconnected): Constify.Corinna Vinschen
(fhandler_socket::is_connect_pending): Ditto. (fhandler_socket::is_connected): Ditto. (fhandler_socket::set_connect_state): New method. (struct select_record): Add member `except_on_write'. (select_record::select_record): Initialize all bool values to `false'. * fhandler_socket.cc: Use set_connect_state() method throughout. (fhandler_socket::connect): Set state always to connected if connection isn't pending. * net.cc (cygwin_getsockopt): Revert erroneous previous patch. * select.cc (set_bits): Check for `except_on_write'. Set fd in write_fds if set. Set connect state to connected if fd has been returned by WINSOCK_SELECT. (peek_socket): Check for `except_on_write'. (start_thread_socket): Ditto. (fhandler_socket::select_write): Don't set `write_ready' if connect is pending. Set `except_on_write' if connect is pending.
2002-07-05 * fhandler.h (UNCONNECTED): New define.Corinna Vinschen
(CONNECT_PENDING): Ditto. (CONNECTED): Ditto. (class fhandler_socket): Add member `had_connect_or_listen'. Add member functions `is_unconnected', `is_connect_pending' and `is_connected'. * fhandler_socket.cc (fhandler_socket::connect): Set member `had_connect_or_listen' according to return code of WinSock call. (fhandler_socket::listen): Ditto. * net.cc (cygwin_getsockopt): Modify SO_ERROR return value in case of socket with pending connect(). * select.cc (peek_socket): Only add socket to matching fd_set if it's not "ready". Call WINSOCK_SELECT only if at least one socket is in one of the fd_sets. (start_thread_socket): Only add socket to matching fd_set if it's not "ready". (fhandler_socket::select_write): Set write_ready to true also if socket isn't connected or listening.
2002-07-04 * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't freeCorinna Vinschen
memory here. Allow NULL parameter.
2002-07-04 * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operationCorinna Vinschen
on sun_path.
2002-07-03 * autoload.cc (WSAEventSelect): Define new autoload function.Corinna Vinschen
(WSAEnumNetworkEvents): Ditto. * fhandler_socket.cc (fhandler_socket::accept): If socket is in blocking mode wait for incoming connection and signal.
2002-06-26 * fhandler.h (fhandler_socket::bind): Add method definition.Corinna Vinschen
(fhandler_socket::connect): Ditto. (fhandler_socket::listen): Ditto. (fhandler_socket::accept): Ditto. (fhandler_socket::getsockname): Ditto. (fhandler_socket::getpeername): Ditto. (fhandler_socket::recvfrom): Ditto. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendto): Ditto. (fhandler_socket::sendmsg): Ditto. (fhandler_socket::shutdown): Ditto. * fhandler_socket.cc (get_inet_addr): Move here from net.cc. (fhandler_socket::bind): New method. (fhandler_socket::connect): Ditto. (fhandler_socket::listen): Ditto. (fhandler_socket::accept): Ditto. (fhandler_socket::getsockname): Ditto. (fhandler_socket::getpeername): Ditto. (fhandler_socket::recvfrom): Ditto. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendto): Ditto. (fhandler_socket::sendmsg): Ditto. (fhandler_socket::shutdown): Ditto. * net.cc: Various formatting cleanups throughout. (get_inet_addr): Move to fhandler_socket.cc. (cygwin_bind): Move base functionality to appropriate fhandler_socket method. (cygwin_connect): Ditto. (cygwin_listen): Ditto. (cygwin_accept): Ditto. (cygwin_getsockname): Ditto. (cygwin_getpeername): Ditto. (cygwin_recvfrom): Ditto. (cygwin_recvmsg): Ditto. (cygwin_sendto): Ditto. (cygwin_sendmsg): Ditto. (cygwin_shutdown): Ditto.
2002-06-24* fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.Christopher Faylor
* fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
2002-06-10 * fhandler.h (fhandler_socket::fixup_after_fork): Revert patch fromCorinna Vinschen
2002-06-04. * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto. (fhandler_socket::dup): Ditto. * net.cc (fdsock): Make sockets explicitely noninheritable on NT.
2002-06-08coerceChristopher Faylor
2002-06-08* fhandler_socket.cc (fhandler_socket::fstat): Don't assume that socket isChristopher Faylor
unix-domain socket. * times.cc (hires_ms::prime): Set init flag. * times.cc (hires_ms::prime): Adjust epoch of initime_us from 1601 to 1970.
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-06-04 * fhandler.h (class fhandler_socket): Add private methodCorinna Vinschen
fixup_after_fork (bool, HANDLE). * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Move functionality to new private method. Add closing parent socket if not called from dup(). Create method new calling private method with appropriate parameter. (fhandler_socket::fixup_after_exec): Call private method fixup_after_fork with appropriate parameter. (fhandler_socket::dup): Ditto.
2002-05-24* dtable.cc (dtable::build_fhandler_from_name): Just pass posix path along toChristopher Faylor
set_name via return_and_clear_normalized_path. (dtable::build_fhandler): New method with const char * argument. (dtable::reset_unix_path_name): Eliminate. (dtable::dup_worker): Use correct build_fhandler method. * mmap.cc (mmap_record::alloc_fh): Ditto. * dtable.h (dtable::build_fhandler): New method. (dtable::reset_unix_path_name): Eliminate. * fhandler.cc (fhandler_base::set_name): Assume that unix_name has already been cmalloced. (fhandler_base::reset_unix_path_name): Eliminate. (fhandler_base::~fhandler_base): Coercion for cfree. * fhandler.h (fhandler_base::unix_path_name): Make const char *. (fhandler_base::win32_path_name): Ditto. (fhandler_base::reset_unix_path_name): Eliminate. * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate const char *ness of win32_path_name. * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name requirements. * path.cc (path_conv::return_and_clear_normalized_path): New method. (path_conv::clear_normalized_path): Eliminate. (path_conv::~path_conv): Ditto. (path_conv::check): Accommodate new build_fhandler method. * path.h (path_conv::~path_conv): Eliminate. (path_conv::clear_normalized_path): Ditto. (path_conv::return_and_clear_normalized_path): Declare new method.
2002-03-05* fhandler_socket.cc (fhandler_socket::close): Respond to signals whileChristopher Faylor
looping, waiting for socket to close. Superstitiously clear last error when WSAEWOULDBLOCK.
2002-02-25 * cygwin.din (fstat64): New symbol.Corinna Vinschen
(ftruncate64): Ditto. (lseek64): Ditto. (lstat64): Ditto. (mmap64): Ditto. (seekdir64): Ditto. (stat64): Ditto. (telldir64): Ditto. (truncate64): Ditto. * dir.cc (telldir64): New function. (telldir): Call telldir64(). (seekdir64): New function. (seekdir): Call seekdir64(). * fhandler.h: Redefine all methods using __off32_t to use __off64_t. * fhandler.cc: Use __off64_t and struct __stat64 throughout. * fhandler_clipboard.cc: Ditto. * fhandler_disk_file.cc: Ditto. * fhandler_dsp.cc: Ditto. * fhandler_floppy.cc: Ditto. * fhandler_mem.cc: Ditto. * fhandler_random.cc: Ditto. * fhandler_socket.cc: Ditto. * fhandler_tape.cc: Ditto. * fhandler_zero.cc: Ditto. * pipe.cc: Ditto. * glob.c: Ditto, call lstat64 and stat64 in Cygwin. * mmap.cc: Use __off64_t throughout. (mmap64): New function. * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64. * syscalls.cc (lseek64): New function. (stat64_to_stat32): Ditto. (fstat64): Ditto. (stat64): Ditto. (lstat64): Ditto. (ftruncate64): Ditto. (truncate64): Ditto. (_fstat): Call fstat64. (_stat): Call stat64. (cygwin_lstat): Rename to avoid declaration problem. Call lstat64. (stat_worker): Use struct __stat64. (access): Ditto. (ftruncate): Call ftruncate64. (truncate): Call truncate64. * wincap.cc: Set flag has_64bit_file_access appropriately. * wincap.h: Add flag has_64bit_file_access. * winsup.h (ILLEGAL_SEEK): Define as __off64_t. (stat_dev): Declare using struct __stat64. (stat_worker): Ditto. * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin. (struct __stat64): Ditto. (struct stat): Revert definition with explicitly sized datatypes. Eliminate sized field names. * include/cygwin/types.h (blksize_t): New type. (__blkcnt32_t): Ditto. (__blkcnt64_t): Ditto. (blkcnt_t): Ditto.
2002-02-09 * dtable.cc (dtable::dup2): Revert previous patch.Corinna Vinschen
* fhandler.h: Ditto. (fhandler_socket::recv): Define new method. (fhandler_socket::send): Ditto. * fhandler_socket.cc (fhandler_socket::recv): New method. (fhandler_socket::send): Ditto. (fhandler_socket::read): Call fhandler_socket::recv() now. (fhandler_socket::write): Call fhandler_socket::send() now. * net.cc (class wsock_event): Move definition to wsock_event.h. (fdsock): Revert previous patch. (cygwin_recv): Move implementation to fhandler_socket::recv(). (cygwin_send): Move implementation to fhandler_socket::send(). * wsock_event.h: New file.
2002-02-08 * dtable.cc (dtable::dup2): Store fd for fhandler_socket.Corinna Vinschen
* fhandler.h (fhandler_base::set_fd): New virtual method. (fhandler_base::get_fd): Ditto. (fhandler_socket::set_fd): Ditto. (fhandler_socket::get_fd): Ditto. * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead of native Winsock recv. (fhandler_socket::write): Call cygwin_send instead of native Winsock send. * net.cc (fdsock): Store fd in fhandler_socket.
2002-01-01 * fhandler.h (fhandler_socket::sun_path): New private member.Corinna Vinschen
(fhandler_socket::set_sun_path): New method. (fhandler_socket::get_sun_path): Ditto. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize sun_path to NULL. (fhandler_socket::~fhandler_socket): Free sun_path if needed. (fhandler_socket::set_sun_path): New method. * net.cc (cygwin_bind): Set sun_path to path of local socket file. (cygwin_getsockname): Add code to return correct sockaddr for unix domain sockets.
2001-11-05Eliminate excess whitespace.Christopher Faylor
2001-10-30 * fhandler_socket.cc (fhandler_socket::close): Add error handling.Corinna Vinschen
Fixed ChangeLog entries.
2001-10-30 * (fhandler_socket::dup): Revert previous change.Corinna Vinschen
2001-10-30* dtable.cc (dtable::dup2): Add some debugging. Use methods from passed inChristopher Faylor
class rather than cygheap->fdtab. * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Add more debugging output. (fhandler_socket::dup): Allocate new space for prot_info_ptr for duplicated entry. * syscalls.cc (stat_worker): Always delete fh if it has been created.
2001-10-29* fhandler.h (fhandler_serial::fhandler_serial): Change to only accept unitChristopher Faylor
argument. * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto. (fhandler_serial::open): Avoid else when previous clause is a return(). * path.cc (get_devn): Alias /dev/ttyS0 -> /dev/com1, etc. (get_device_number): Reallow standalone "com1" as a valid name for /dev/com1.
2001-10-24Ensure that all fhandler_*::read definitions are __stdcall throughout.Christopher Faylor
* fhandler.cc (fhandler_base::set_inheritance): Be more defensive in debugging code. * fhandler.h: Adjust regparms throughout to reflect passing 'this' parameter. * fhandler_console.cc (fhandler_console::read): Remove unneeded test. Only honor "key down" events. * miscfuncs.cc (strcasestr): Reorganize for efficient code use. (check_null_empty_str_errno): Ditto. (__check_null_invalid_struct_errno): Ditto. (__check_invalid_read_ptr_errno): Ditto. * syscalls.cc (_read): Return 0 when length == 0, as per Single UNIX Specification.
2001-10-22Remove 'cb' parameter and modify fhandler_* constructors throughout.Christopher Faylor
* dtable.cc (dtable::build_fhandler): Remove debugging output which uses 'cb'. * exec.cc (execvp): New function. (execvpe): Ditto. * fhandler.cc (fhandler_base::fhandler_base): Use constructor initialization. * fhandler.h (fhandler_tty_common::fhandler_tty_common): Ditto. * fhandler_clipboard.cc (fhandler_dev_clipboard::fhandler_dev_clipboard): Ditto. * fhandler_console.cc (fhandler_console::fhandler_console): Ditto. * fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Ditto. * fhandler_serial.cc (fhandler_serial::fhandler_serial): Ditto. * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Ditto. (fhandler_tty_slave::fhandler_tty_slave): Ditto. (fhandler_pty_master::fhandler_pty_master): Ditto. * fhandler_windows.cc (fhandler_windows::fhandler_windows): Ditto.
2001-10-14* autoload.cc (load_wsock32): Declare dummy function to force loading ofChristopher Faylor
winsock. * fhandler.cc (fhandler_base::set_inheritance): Make debugging output more verbose. * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Force loading of winsock32 if winsock2 not available. * net.cc (set_socket_inheritance): Use DuplicateHandle in all cases to set inheritance correctly. (fdsock): Use winsock2_active macro to determine when to set socket inheritance. Remove fdtab resource locking since this function should already be protected. (cygwin_accept): Simplify logic. Ensure that fdtab unlock is not called inappropriately. (cygwin_rcmd): Use fdtab locking. (cygwin_rresvport): Ditto. (cygwin_rexec): Ditto. * select.cc (peek_socket): Set errno appropriately if winsock select fails. * winsup.h: Declare check_pty_fds. * syscalls.cc (check_pty_fds): Rename from check_ttys_fds. Also check pty master. (setsid): Use check_pty_fds. * dtable.cc (dtable::dec_console_fds): Add check on pty fds.
2001-10-13* fhandler_dsp.cc (fhandler_dsp::ioctl): Return 0 for successfulChristopher Faylor
SNDCTL_DSP_GETBLKSIZE operation. Remove obsolete 'name' arg from fhandler_* constructors throughout. * winsup.h (winsock_active): New macro. (winsock2_active): Ditto. * autoload.cc (wsock_init): Use new macros to decide if winsock or winsock2 is loaded. (nonexist_wsock32): Dummy function to force winsock load. (nonexist_ws2_32): Dummy function to force winsock2 load. * fhandler.h (fhandler_socket::fstat): Declare new method. Currently unused. * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): Check that winsock2 is active before trying WSADuplicateSocketA. (fhandler_socket::fixup_after_fork): Add extra check for winsock2_active. Otherwise use iffy procedures for Windows 95. (fhandler_socket::fixup_after_exec): Add debugging. (fhandler_socket::dup): Add debugging. (fhandler_socket::fstat): New method. (fhandler_socket::set_close_on_exec): Attempt to perform iffy stuff on Windows 95. * errno.cc (_sys_nerr): Work around compiler strangeness. * pinfo.cc (winpids::add): Add extra element at end of allocated array for setting to NULL. (winpids::enumNT): Ditto. (winpids::init): Don't modify pidlist if it hasn't been allocated (possibly due to malloc problem).
2001-10-13* autoload.cc (wsock_init): Reorganize slightly to accomodate a new compiler.Christopher Faylor
2001-10-04* dcrt0.cc (dll_crt0_1): Don't close hexec_proc if it is NULL.Christopher Faylor
* fork.cc (vfork): Add debugging statements. * path.cc (get_device_number): Make static. Rewrite to inspect both unix and windows paths. (get_raw_device_number): Just check for parts of raw device that we care about. (get_devn): New function, pulled from get_device_number. (win32_device_name): Accomodate arg changes to get_device_number. (mount_info::get_device_number): Call get_device_number on translated Windows path. * spawn.cc (spawn_guts): Don't treat P_VFORK differently from P_NOWAIT. Add handle to child's shared region to child so that it will be preserved if the parent goes away. * fhandler.h: Throughout, simplify to one open method for all fhandler classes, requiring a path_conv first element. * fhandler.cc (fhandler_base::open): Remove obsolete method. Generalize to require path_conv * as first argument. (fhandler_disk_file::open): Remove obsolete method. (fhandler_disk_file::open): Use path_conv pointer rather than reference. * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Use new open method. (fhandler_dev_clipboard::open): Accomodate new argument for open methods. * fhandler_console.cc (fhandler_console::open): Ditto. (fhandler_console::dup): Use new open method. (fhandler_console::fixup_after_fork): Ditto. (fhandler_console::fixup_after_exec): Ditto. * fhandler_dsp.cc (fhandler_dev_dsp::open): Accomodate new argument for open methods. * fhandler_floppy.cc (fhandler_dev_floppy::open): Ditto. * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. * fhandler_random (fhandler_dev_random::open): Ditto. * fhandler_raw.cc (fhandler_dev_raw::open): Ditto. * fhandler_serial.cc (fhandler_serial::open): Ditto. * fhandler_tape.cc (fhandler_dev_tape::open): Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. (fhandler_pty_master::open): Ditto. * fhandler_windows.cc (fhandler_windows::open): Ditto. * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. * fhandler_socket.cc (fhandler_socket::set_connect_secret): Accomodate new argument for open methods. * syscalls.cc (_open): Ditto. (stat_worker): Ditto.
2001-10-01Add "path.h" include throughout, where needed. Use new path_conv methods andChristopher Faylor
operators to simplify testing for directory and attributes, throughout. * path.h (path_conv::exists): New method. (path_conv::has_attribute): Ditto. (path_conv::isdir): Ditto. (path_conv::DWORD &): New operator. (path_conv::int &): Ditto. * dir.cc (rmdir): Eliminate a goto. * dtable.cc (dtable::build_fhandler): Accept opt and suffix info for path_conv.check. Return fh == NULL on path_conv error. Pass unit to set_name as appropriate. (dtable::reset_unix_path_name): New method. * dtable.h (dtable): Declare new method. Reflect arg changes to build_fhandler. * fhandler.cc (fhandler_disk_dummy_name): Eliminate. (fhandler_base::set_name): Expect paths to be NULL. Build unix_path_name from win32_path_name when it is a device. (fhandler_base::reset_unix_path_name): New method. (fhandler_base::raw_read): Report EISDIR when ERROR_INVALID_FUNCTION or ERROR_INVALID_PARAMETER and reading a directory. (fhandler_disk_file::fstat): Don't call stat_dev since we should now never be calling fhandler_disk_file methods with devices. (fhandler_base::fhandler_base): Clear {unix,win32}_path_name. (fhandler_base::~fhandler_base): Always free {unix,win32}_path_name. (fhandler_disk_file::fhandler_disk_file): Remove set_no_free_names kludge. (fhandler_disk_file::open): Ditto. * fhandler.h (fhandler_base::no_free_names): Eliminate. (fhandler_base::set_no_free_names): Ditto. * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Don't set unix_path_name here. * path.cc (fchdir): Lock fd table throughout. Use new dtable::reset_unix_path_name method to reset path. * syscalls.cc (stat_worker): Reorganize to always call fstat method. Pass path_conv method to fhandler_*::open. (chroot): Elminate a goto.
2001-09-20 * fhandler_socket.cc (fhandler_socket::fixup_after_exec): CloseCorinna Vinschen
socket only when not using Winsock2.
2001-09-20 * fhandler.h (fhandler_socket::fixup_after_exec): Remove inlineCorinna Vinschen
implementation. (fhandler_dev_raw::fixup_after_exec): Ditto. * fhandler_raw.cc (fhandler_dev_raw::fixup_after_fork): Don't duplicate buffer on fork to avoid memory leak. (fhandler_dev_raw::fixup_after_exec): New implementation equal to former fixup_after_fork() implementation. * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Do nothing when not using Winsock2. (fhandler_socket::fixup_after_exec): New implementation. (fhandler_socket::set_close_on_exec): Never call set_inheritance().
2001-09-19 * fhandler_socket.cc (fhandler_socket::fhandler_socket): RevertCorinna Vinschen
memory allocation to use cmalloc again.
2001-09-08* cygheap.h (init_cygheap): Move heap pointers here.Christopher Faylor
* include/sys/cygwin.h (perprocess): Remove heap pointers. * dcrt0.cc (__cygwin_user_data): Reflect obsolete perprocess stuff. (_dll_crt0): Don't initialize heap pointers. (cygwin_dll_init): Ditto. (release_upto): Use heap pointers from cygheap. * heap.h: Ditto. * fork.cc (fork_parent): Ditto. Don't set heap pointers in ch. (fork_child): Remove obsolete sigproc_fixup_after_fork. * shared.cc (memory_init): Reorganize so that cygheap initialization is called prior to regular heap since regular heap uses cygheap now. * sigproc.cc (proc_subproc): Eliminate zombies allocation. (sigproc_init): Move zombies alloation here. Don't free up array on fork, just reuse it. (sigproc_fixup_after_fork): Eliminate. * sigproc.h: Ditto. * include/cygwin/version.h: Reflect change to perprocess structure.
2001-09-07* fhandler_socket.cc (fhandler_socket::fhandler_socket): Ensure thatChristopher Faylor
prot_info_ptr is zeroed for later use.
2001-09-06Remove initialization of static or global values to zero, throughout. ThisChristopher Faylor
just needlessly grows the size of the DLL. * tty.cc (tty::alive): Make inuse handle non-inheriting on open, just for thread safety.
2001-09-05 * fhandler_socket.cc (fhandler_socket::close): Change 2MSL valueCorinna Vinschen
according to MSDN.
2001-08-16* fhandler_socket.cc (fhandler_socket::create_secret_event): RelaxEgor Duda
security of secret_event so AF_UNIX socket clients can connect to servers even if running under a different user account. (fhandler_socket::check_peer_secret_event): Ditto.
2001-08-15 * fhandler.cc (fhandler_base::is_nonblocking): New method.Corinna Vinschen
(fhandler_base::set_nonblocking): Ditto. * fhandler.h (fhandler_base): Declare new methods `is_nonblocking' and `set_nonblocking'. * fhandler_socket.cc (fhandler_socket::ioctl): Use `set_nonblocking'. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Use `is_nonblocking'. (fhandler_tty_slave::read): Ditto. (fhandler_tty_slave::ioctl): Use `set_nonblocking'. (fhandler_pty_master::ioctl): Ditto. * net.cc (cygwin_sendto): Fallback to winsock 1 functionality in case of nonblocking IO. (cygwin_recvfrom): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * syscalls.cc (_read): Use `is_nonblocking'.
2001-08-14 * fhandler.cc (fhandler_base::fcntl): Use new O_NONBLOCK_MASK define.Corinna Vinschen
* fhandler.h: Move definitions of O_NOSYMLINK, O_DIROPEN and OLD_O_NDELAY from winsup.h to here. Add O_NONBLOCK_MASK define. * fhandler_socket.cc (fhandler_socket::close): Add hack to allow a graceful shutdown even if shutdown() hasn't been called by the application. Add debug output. (fhandler_socket::ioctl): Set fhandler's NONBLOCK flag according to FIONBIO setting. (fhandler_socket::fcntl): Use new O_NONBLOCK_MASK define. Actually set `request' before using it. * fhandler_tty.cc: Use new O_NONBLOCK_MASK define throughout. (fhandler_tty_slave::ioctl): Set fhandler's NONBLOCK flag according to FIONBIO setting. (fhandler_pty_master::ioctl): Ditto. * net.cc (wsock_event::prepare): Compare WSACreateEvent return code with `WSA_INVALID_EVENT' according to MSDN. * syscalls.cc (_read): Use new O_NONBLOCK_MASK define.