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
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-06-06 * cygwin.din: Add vsyslog.Corinna Vinschen
* fhandler.cc (fhandler_base::write): Only make file sparse if the seeked area is >= 128K. * syslog.cc (vsyslog): New function, overtaking functionality from syslog. (syslog): Just call vsyslog. * include/cygwin/version.h: Bump API minor. * include/sys/syslog.h: Add vsyslog declaration.
2003-06-02* fhandler.cc (fhandler_base::write): Correct minor printf formatting styleChristopher Faylor
glitch.
2003-05-26 * fhandler.cc (is_at_eof): Fix conditional. Use INVALID_FILE_SIZECorinna Vinschen
instead of numeric constant.
2003-05-26 * fhandler.h: Rename FH_W95LSBUG flag to FH_LSEEKED.Corinna Vinschen
(fhandler_base::set_did_lseek): Rename from set_check_win95_lseek_bug. (fhandler_base::get_did_lseek): Rename from get_check_win95_lseek_bug. (fhandler_base::set_fs_flags): New method. (fhandler_base::get_fs_flags): Ditto. * fhandler.cc (fhandler_base::write): Make 64 bit clean. Convert file to a "sparse" file when writing after a long lseek (>64K) beyond EOF. (fhandler_base::lseek): Call set_did_lseek() instead of set_check_win95_lseek_bug(). (fhandler_base::fhandler_base): Initialize fs_flags to 0. * fhandler_disk_file.cc (fhandler_disk_file::open): Don't create files as "sparse" unconditionally. Set fs_flags member.
2003-04-01 * fhandler.cc (fhandler_base::fstat): Set the uid and gid fieldsCorinna Vinschen
from the current effective ids. * fhandler_socket.cc (fhandler_socket::fstat): Keep the uid and gid set by fhandler_base::fstat. * security.cc (get_nt_attribute): Do not test wincap.has_security (). (get_nt_object_attribute): Ditto. (get_file_attribute): Add test for wincap.has_security (). (get_object_attribute): Ditto.
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-21* fhandler.cc (fhandler_base::open): Move some filesystem specific stuff.Christopher Faylor
(fhandler_disk_file::open): Accept some filesystem specific stuff. * sigproc.cc (wait_for_sigthread): Become slightly more thread safe. (sig_send): Don't assume that signal thread is ready.
2002-12-202002-12-19 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet
* fhandler.cc (fhandler_base::open): Use "flags" rather than "mode" in Win9X directory code.
2002-12-14* fhandler.cc (fhandler_base::read): Signal event, if necessary, and raw_readChristopher Faylor
hasn't done so.
2002-12-14* fhandler.cc (fhandler_base::raw_read): Reset priorities to minimize windowChristopher Faylor
where thread termination may cause data loss. (fhandler_base::read): Always return at end of function. Just set len to copied_chars when len is zero. Return immediately after raw_read if len <= 0. Remove in_len setting and just check end instead. Fix CRLF handling at end of buffer.
2002-12-14Throughout, change fhandler_*::read and fhandler_*::raw_read to void functionsChristopher Faylor
whose second arguments are both the lenght and the return value. * fhandler.cc (fhandler_base::read): Rework slightly to use second argument as input/output. Tweak CRLF stuff. (fhandler_base::readv): Accommodate fhandler_*::read changes. * cygthread.h (cygthread::detach): Declare as taking optional handle argument. (cygthread::detach): When given a handle argument, wait for the handle to be signalled before waiting for thread to detach. Return true when signal detected.
2002-11-012002-10-31 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet
* fhandler.cc (fhandler_base::open): Verify pc isn't NULL.
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-09-19Cleanup calls to CreateFile throughout.Christopher Faylor
* dcrt0.cc (__api_fatal): Correctly check for failing return from CreateFile. * assert.cc (__assert): Don't check return value from CreateFile for NULL. * fhandler_console.cc (set_console_state_for_spawn): Ditto. * fork.cc (fork_parent): Ditto.
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-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-07-14* dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a compilerChristopher Faylor
warning. * shared.cc (memory_init): Remove debug_init call. * debug.h (handle_list): Change "clexec" to "inherited". * debug.cc: Remove a spurious declaration. (setclexec): Conditionalize away since it is currently unused. (add_handle): Use inherited field rather than clexec. (debug_fixup_after_fork_exec): Ditto. Move debugging output to delete_handle. (delete_handle): Add debugging output. * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting inheritance in debugging table since the handle was never protected anyway. (fhandler_base::fork_fixup): Ditto. * exceptions.cc (debugger_command): Revert.
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-03* dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode if noneChristopher Faylor
specified. * fhandler.cc (fhandler_base::init): Make bin argument a guarantee rather than a suggestion. * path.cc (path_conv::check): Load flag returned from cygwin_conv_to_win32_path into path_flags.
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-20* fhandler.cc (fhandler_base::set_flags): Change priority of "linked in"Christopher Faylor
default binmode setting so that it has priority over optional setting.
2002-06-06 * fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member ofCorinna Vinschen
st_atim, st_mtim, and st_ctim fields. * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto. * fhandler_process.cc (fhandler_process::fstat): Ditto. * glob.c (stat32_to_STAT): Copy across the whole st_atim, st_mtime, and st_ctim fields. * syscalls.cc (stat64_to_stat32): Ditto. * times.cc (to_timestruc_t): New function. (time_as_timestruc_t): New function. * winsup.h: Add to_timestruc_t and time_as_timestruc_t functions. * include/cygwin/stat.h: Replace time_t with timestruc_t throughout for all file times, removing the st_spare1, st_spare2, and st_spare3 fields in the process. Add macros to access tv_sec fields by old names. * include/cygwin/types.h: Typedef timespec_t and timestruc_t as struct timespec.
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-06-04* fhandler.cc (fhandler_base::open): Don't set binmode if already set. Don'tChristopher Faylor
check for file. Files should already be set. Report on binary mode for debugging. (fhandler_base::fhandler_base): Don't set default binmode here. That's for later. * fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set binmode, ever, for console. * fhandler_disk_file.cc (fhandler_disk_file::open): Always set the binary mode to the value derived from mount table. * path.cc (mount_info::conv_to_win32_path): Default to binmode if path does not translate into anything in the mount table.
2002-06-02Remove unneeded sigproc.h includes throughout.Christopher Faylor
* fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument. * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search for given pid. (fhandler_proc::readdir): Assume that pid exists if it shows up in the winpid list. * fhandler_process.cc (fhandler_process::open): Simplify search for given pid. Call fill_filebuf with pinfo argument. (fhandler_process::fill_filebuf): Pass pinfo here and assume that it exists. * pinfo.h (pinfo::remember): Define differently if sigproc.h is not included. * dll_init.cc (dll_list::detach): Don't run destructor on exit.
2002-06-02* fhandler.cc (fhandler_base::fstat): Move dev and ino calculation into caller.Christopher Faylor
* syscalls.cc (stat_worker): Calculate dev and ino calculation here, if zero. * fhandler_proc.cc (fhandler_proc::fhandler_proc): Minor reorg for debugging. * fhandler_process.cc (fhandler_process::exists): Return 0 on nonexistence. (fhandler_process::fstat): Simplify pid logic. * fhandler_tape.cc (fhandler_dev_tape::fstat): Minor reformatting.
2002-06-01remove accidentally checked in test version.Christopher Faylor
2002-06-01* fhandler_console.cc (fhandler_console::open): Reinstate setting of flags.Christopher Faylor
2002-06-01* fhandler.cc (fhandler_base::open): Make default open mode == binmode.Christopher Faylor
(fhandler_base::init): Set open flags based on derived binmode argument.
2002-05-31* fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call fstat_by_nameChristopher Faylor
if fd is not opened to allow fstat_by_name to properly set errno. * fhandler.cc (binmode): Default to binmode when mode is not known.
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-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-05-17* fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with highChristopher Faylor
order part of 64 bit address on OS's which do not support that kind of operation. Otherwise Windows 95 will become confused.
2002-05-02* path.h (pathconv_arg): Add PC_POSIX.Christopher Faylor
(path_conv): Add normalized_path field. * path.cc (path_conv::~path_conv): New destructor. (path_conv::check): Set normalized_path, where appropriate. * dtable.cc (build_fhandler_from_name): Use normalized path from path_conv. * syscalls.cc (chroot): Ditto. * cygheap.h: Remove path_prefix_p declaration. Christopher Faylor <cgf@redhat.com> (minor fixups) * Makefile.in: Add fhandler_proc.o, fhandler_registry.o, fhandler_process.o and fhandler_virtual.o. * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC, FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix path. * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS. Add class declarations for fhandler_virtual, fhandler_proc, fhandler_registry and fhandler_virtual. Update fhandler_union accordingly. * fhandler_proc.cc: New file. Add implementation for fhandler_proc. * fhandler_virtual.cc: New file. Add implementation for fhandler_virtual. * fhandler_process.cc: New file. Add implementation for fhandler_process. * fhandler_registry.cc: New file. Add implementation for fhandler_registry. * path.cc: Add isproc and isvirtual_dev macros. * path.cc (path_conv::check): Add check for virtual devices. * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to empty Win32 paths. * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic isvirtual_dev macro. Force setting of posix path for virtual fhandlers. * path.h: Add externally visible path_prefix_p and normalized_posix_path prototypes.
2002-04-09 * fhandler.cc (fhandler_base::open): Set read-only bit inCorinna Vinschen
file_attributes when adequate.
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-20* fhandler.cc (fhandler_base::puts_readahead): Remove default parameterChristopher Faylor
setting. Newer gcc's complain about this. (fhandler_base::set_readahead_valid): Ditto. * fhandler_dsp.cc (Audio::open): Ditto. (fhandler_dev_dsp::open): Ditto.
2002-02-10 * (child_info.h, cygheap.h, dcrt0.cc, dir.cc, fhandler.cc, fhandler.h,Corinna Vinschen
fhandler_clipboard.cc, fhandler_disk_file.cc, fhandler_dsp.cc, fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc, fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc, pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc, security.h, spawn.cc, syscalls.cc, thread.h, uinfo.cc, winsup.h): Change usage of uid_t to __uid16_t, gid_t to __gid16_t and off_t to __off32_t throughout. Use INVALID_UID, INVALID_GID and INVALID_SEEK instead casting -1 to the appropriate type. * winsup.h: Define INVALID_UID, INVALID_GID and INVALID_SEEK. * include/cygwin/acl.h: Define internal __aclent16_t and __aclent32_t types. Don't declare acl functions when compiling Cygwin. * include/cygwin/grp.h: Declare getgrgid() and getgrnam() with correct types for internal usage.
2002-01-14 * dir.cc: Use INVALID_FILE_ATTRIBUTES instead of "(DWORD) -1"Corinna Vinschen
for file attributes throughout. * fhandler.cc: Ditto. * fhandler_disk_file.cc: Ditto. * path.cc: Ditto. * path.h: Ditto. * syscalls.cc: Ditto. * times.cc (utimes): Use path_conv::isdir() instead of explicit GetFileAttributes() call.
2001-11-24* dtable.cc (dtable::vfork_parent_restore): Add debugging statement.Christopher Faylor
* exceptions.cc (try_to_debug): Spin only as long as we don't have a debugger attached. * fhandler.h (fhandler_base::set_nohandle): New method. (fhandler_base::get_nohandle): New method. * fhandler.cc (fhandler_base::dup): Avoid duplicating handle if there is no handle. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set nohandle flag on dummy fd. * Makefile.in: Make intermediate library for eventual inclusion in libcygwin.a * fhandler.h (fhandler_pipe::fhandler_pipe): Remove default argument setting since it is no longer used. * miscfuncs.cc (check_null_str): New function. (+check_null_str_errno): Ditto. * net.cc: Add defensive buffer checking throughout. (cygwin_sendto): Protect against invalid fd. (cygwin_recvfrom): Ditto. (cygwin_getpeername): Ditto. (cygwin_recv): Ditto. (cygwin_send): Ditto. * winsup.h: Declare a new function. * select.cc (set_bits): Fix conditional for setting fd in exceptfds. * dtable.cc (dtable::build_fhandler): Create fhandler_pipe using correct device type. * path.cc (get_devn): Set correct pipe device type from device name.
2001-11-22* path.cc (conv_path_list): Fix wild indexing into path due to conflictingChristopher Faylor
methods for setting src pointer. * dir.cc (opendir): Only pass path_conv argument to opendir, since name is already part of the fhandler. * dtable.cc (dtable::build_fhandler): Accomodate new FH_CYGDRIVE type. * fhandler.cc (fhandler_base::opendir): Nuke name argument. * fhandler.h: Add FH_CYGDRIVE to "device" enum. (fhandler_base::opendir): Nuke name argument. (fhandler_disk_file::opendir): Ditto. (fhandler_disk_file::fhandler_disk_file): Declare new method which passes devtype through. (fhandler_cygdrive): Add elements for tracking drives. (fhandler_cygdrive::set_drives): Declare new method. (fhandler_cygdrive::iscygdrive_root): Declare new method. (fhandler_cygdrive::opendir): Declare new method. (fhandler_cygdrive::readdir): Declare new method. (fhandler_cygdrive::telldir): Declare new method. (fhandler_cygdrive::seekdir): Declare new method. (fhandler_cygdrive::rewinddir): Declare new method. (fhandler_cygdrive::closedir): Declare new method. (fhandler_cygdrive::fstat): Declare new method. * fhandler_disk_file.cc (fhandler_disk_file::fhandler_disk_file): Define new method which passes devtype through. (fhandler_disk_file::open): Tweak debug output. (fhandler_disk_file::opendir): Nuke first argument. Use info from path_conv and class rather than calling fstat. (fhandler_cygdrive::set_drives): New method. (fhandler_cygdrive::iscygdrive_root): New method. (fhandler_cygdrive::opendir): New method. (fhandler_cygdrive::readdir): New method. (fhandler_cygdrive::telldir): New method. (fhandler_cygdrive::seekdir): New method. (fhandler_cygdrive::rewinddir): New method. (fhandler_cygdrive::closedir): New method. (fhandler_cygdrive::fstat): New method. * path.cc (iscygdrive_device): Assume cygdriveness is already verified. (path_conv::check): Treat FH_CYGDRIVE "method" as a special case, setting file attributes as needed. (mount_info::conv_to_win32_path): Allow stand-alone /cygdrive, meaning "the directory which contains all of the drives on the system". (fillout_mntent): Use cyg_tolower for conversions. (mount_info::cygdrive_win32_path): Replace unused argument with unit number. * shared_info.h (mount_info::cygdrive_win32_path): Reflect argument change.
2001-11-21* Makefile.in (DLL_OFILES): Add fhandler_disk_file.o.Christopher Faylor
* cygheap.h (cygheap_fdnew::operator =): New operator. * dir.cc: Add invalid struct checking throughout. Use methods for all directory manipulation throughout. * fhandler.cc: Move fhandler_disk_file stuff to own file. (fhandler_base::opendir): New method. (fhandler_base::readdir): New method. (fhandler_base::telldir): New method. (fhandler_base::seekdir): New method. (fhandler_base::rewinddir): New method. (fhandler_base::closedir): New method. * fhandler_disk_file.cc: New file. * fhandler.h (fhandler_base): Declare new virtual methods. (fhandler_disk_file): Ditto. (fhandler_cygdrive): New class. * path.cc (conv_path_list): Use strccpy to break apart path.
2001-11-15 * fhandler.cc (fhandler_disk_file::fstat): Add setting access timeCorinna Vinschen
and creation time to last modification time for files on filesystems not supporting multiple timestamps. (fhandler_disk_file::fstat_helper): Set access time and creation time in incoming Windows structure instead of in stat buf to avoid incorrectly overwriting Epoch timestamp.
2001-11-14 * dir.cc (mkdir): Add HIDDEN file attribute if file has leading dotCorinna Vinschen
and HIDDEN_DOT_FILES is defined. * fhandler.cc (fhandler_base::open): Ditto. * path.cc (symlink): Ditto. * syscalls.cc (_rename): Ditto and remove HIDDEN file attribute if new filename does not begin with a dot.
2001-11-05Eliminate excess whitespace.Christopher Faylor
2001-11-03* fhandler.cc (fhandler_base::read): Return just read ahead characters if slowChristopher Faylor
device. * fhandler.h (fhandler_base::set_eof): New virtual method. (fhandler_pipe::set_eof): New method. * pipe.cc (fhandler_pipe::fhandler_pipe): Clear saweof flag. (fhandler_pipe::read): Return immediately if hit eof. (fhandler_pipe::hit_eof): Return true if saweof flag is set. * select.cc (peek_pipe): Don't call PeekNamedPipe if we couldn't grab the guard mutex.
2001-11-02* dtable.cc (dtable::build_fhandler): Issue internal error on unknown device.Christopher Faylor
* fhandler.cc (fhandler_base::close): Show both name and handle in debugging output. * fhandler.h (fhandler_base::get_guard): New virtual method. (fhandler_pipe::get_guard): New method. (fhandler_socket::ready_for_read): Delete declaration. (fhandler_pipe::ready_for_read): Ditto. (fhandler_serial::ready_for_read): Ditto. (fhandler_console::ready_for_read): Ditto. (fhandler_tty_common::ready_for_read): Ditto. (fhandler_windows::ready_for_read): Ditto. (struct select_record::peek): Declare new method. * select.cc (MAKEready): Delete. (peek_pipe): Use get_guard method to retrieve potential guard mutex handle. (fhandler_base::ready_for_read): Rewrite as generic ready-for-read handler. Should only be called for "slow" devices. (fhandler_socket::ready_for_read): Delete definition. (fhandler_pipe::ready_for_read): Ditto. (fhandler_serial::ready_for_read): Ditto. (fhandler_console::ready_for_read): Ditto. (fhandler_tty_common::ready_for_read): Ditto. (fhandler_windows::ready_for_read): Ditto. (fhandler_pipe::select_read): Fill in new peek record in select_record structure. (fhandler_console::select_read): Ditto. (fhandler_tty_common::select_read): Ditto. (fhandler_serial::select_read): Ditto. (fhandler_socket::select_read): Ditto. (fhandler_socket::select_read): Ditto. (fhandler_tty_slave::ready_for_read): Check for tty not open. Set errnos appropriately. * syscalls.cc (_read): Allow ready_for_read to set errno. * pinfo.cc (pinfo::init): Return spawn/NO_WAIT process as valid if it is initializing. * sigproc.cc (getsem): Adjust wait for process to initialize downward to avoid huge waits.