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
2005-12-05revert accidental checkinChristopher Faylor
2005-12-05Remove unneeded whitespace.Christopher Faylor
* cygtls.cc (_cygtls::set_state): Delete. (_cygtls::reset_exception): Ditto. (_cygtls::init_thread): Set initialized state directly here. (_cygtls::push): Remove exception argument. Don't treat exceptions specially. * cygtls.h (_cygtls::push): Ditto. (_cygtls::isinitialized): Don't treat exceptions specially. (_cygtls::reset_exception): Delete. (_cygtls::set_state): Ditto. (_cygtls::handle_exceptions): Don't push ebp on the stack prior to calling sig_send. Just set incyg instead. (_cygtls::interrupt_setup): Accommodate _cygtls::push argument change. (_cygtls::interrupt_now): Ditto. (setup_handler): Don't treat exceptions specially. * gendef (longjmp): Always zero incyg flag.
2005-10-21* dir.cc (rmdir): Eliminate nonsensical code.Christopher Faylor
* fork.cc (fork): Move exit debug_printf to last statement.
2005-10-13* dir.cc (mkdir): Abandon use of PC_WRITABLE.Christopher Faylor
(rmdir): Ditto. * path.h (PC_WRITABLE): Delete. * path.cc (path_conv::check): Remove PC_WRITABLE accommodations. Revisit later.
2005-09-29 * dir.cc (mkdir): Check for trailing /. or /.. component.Corinna Vinschen
(rmdir): Ditto. * path.cc (has_dot_last_component): New function. * path.h (has_dot_last_component): Add declaration.
2005-08-28*dir.cc (readdir_r): Invert sense on error-test.Christopher Faylor
2005-08-23* dir.cc (readdir_worker): Make static. Only add '.' and '..' when readdirChristopher Faylor
fails due to ENMFILE. * fhandler_disk_file.cc (fhandler_disk_file::readdir): Only close handle on error != ENMFILE.
2005-08-20* cygerrno.h (geterrno_from_win_error): Change declaration to default to usingChristopher Faylor
GetLastError and EACCESS. * cygwin.din: Export readdir_r. * include/cygwin/version.h: Bump API version number to 138. * syscalls.cc (readdir_worker): New function, renamed from old readdir() function. (readdir): Use readdir_worker. (readdir_r): New function. * fhandler.h (fhandler_base::readdir): Accommodate second argument indicating dirent buffer. (fhandler_disk_file::readdir): Ditto. (fhandler_cygdrive::readdir): Ditto. (fhandler_proc::readdir): Ditto. (fhandler_netdrive::readdir): Ditto. (fhandler_registry::readdir): Ditto. (fhandler_process::readdir): Ditto. * fhandler.cc (fhandler_base::readdir): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::readdir): Ditto. * fhandler_cygdrive.cc (fhandler_cygdrive::readdir): Ditto. * fhandler_proc.cc (fhandler_proc::readdir): Ditto. * fhandler_netdrive.cc (fhandler_netdrive::readdir): Ditto. * fhandler_registry.cc (fhandler_registry::readdir): Ditto. * fhandler_process.cc (fhandler_process::readdir): Ditto.
2005-08-19* fhandler.h (dirent_states): Add dirent_isroot, dirent_saw_cygdrive,Christopher Faylor
dirent_saw_dev. * dir.cc (opendir): Don't zero __flags here. Push that responsibility to opendir methods. (seekdir): Preserve dirent_isrrot in __flags. (rewinddir): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set dirent_isroot appropriately. (fhandler_disk_file::readdir): Fill in "cygdrive" and "dev" if it is the root dir and they are missing. * fhandler_process.cc (fhandler_process::opendir): Set __flags here. * fhandler_virtual.cc (fhandler_virtual::opendir): Set __flags here.
2005-07-03Replace valid memory checks with new myfault class "exception handling", almostChristopher Faylor
everywhere. Leave some thread.cc stuff alone for now. * cygtls.h: Kludge some definitions to avoid including a problematic windows header. (_cygtls::_myfault): New entry. (_cygtls::_myfault_errno): Ditto. (_cygtls::fault_guarded): New function. (_cygtls::setup_fault): Ditto. (_cygtls::return_from_fault): Ditto. (_cygtls::clear_fault): Ditto. (myfault): New class. * exceptions.cc (handle_exceptions): Handle case of guarded fault in system routine. * gendef: Add another entry point for setjmp that the compiler doesn't know about and won't complain about. * gentls_offsets: Just include windows.h rather than kludging a HANDLE def. * miscfuncs.cc (check_null_str): Delete. (check_null_empty_str): Ditto. (check_null_empty_str_errno): Ditto. (check_null_str_errno): Ditto. (__check_null_invalid_struct): Ditto. (__check_null_invalid_struct_errno): Ditto. (__check_invalid_read_ptr): Ditto. (__check_invalid_read_ptr_errno): Ditto. (dummytest): New function. (check_iovec_for_read): Delete. (chec_iovec): Rename from check_iovec_for_write. Take a read/write parameter. * tlsoffsets.h: Regenerate. * winsup.h: Remove check_* declarations. (check_iovec_for_read): Delete declaration. Turn into a define instead. (check_iovec_for_write): Ditto. (check_iovec): New declaration. * thread.h: Use ifdef guard name consistent with other header files.
2005-05-25* fhandler.h (fhandler_base::mkdir): New virtual method.Christopher Faylor
(fhandler_base::rmdir): Ditto. (fhandler_disk_file:mkdir): New method. (fhandler_disk_file:rmdir): Ditto. * dir.cc (mkdir): Implement with fhandlers. (rmdir): Ditto. * fhandler.cc (fhandler_base::mkdir): New virtual method. (fhandler_base::rmdir): Ditto. (fhandler_disk_file::mkdir): New method. (fhandler_disk_file::rmdir): Ditto. fhandler_random.cc: white space.
2005-05-13Remove PC_FULL from path_conv usage throughout.Christopher Faylor
* path.h (enum pathconv_arg): Change PC_FULL to PC_NOUILL. * path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL. (cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path.
2005-05-13* cygtls.cc (_cygtls::remove): Eliminate compiler warning.Christopher Faylor
* dir.cc (mkdir): Check path for writability. (rmdir): Ditto. Remove check for special directories. * path.cc (path_conv::check): Set PATH_RO for virtual devices. Set error if read-only and asked for writability. * path.h (pathconv_arg): Add PC_WRITABLE. (path_types): Add PATH_RO. (path_conv::isro): Add (currently unused) check for read-only filesystem. Return "ENOSHARE" when we know a share doesn't exist. * include/sys/mount.h: Add MOUNT_RO flag. * autoload.cc (WNetGetResourceInformationA): Import. * fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual existence of remote system rather than always assuming that it exists.
2005-03-17* dir.cc: Rename opendir_* to dirent_* throughout.Christopher Faylor
(opendir_states): Move and rename. * fhandler.h (dirent_states): to here. * fhandler_disk_file.cc (fhandler_disk_file::readdir): Use raw readdir when skipping through entries since it is keeping track of "." and "..". (fhandler_cygdrive::seekdir): Use fhandler_disk_file::readdir to do everything. * fhandler_virtual.cc (fhandler_virtual::opendir): Set flag indicating that we provide . and .. (fhandler_virtual::seekdir): Ditto. (fhandler_virtual::rewinddir): Ditto. * fhandler_registry.cc (fhandler_registry::rewinddir): Ditto.
2004-05-28* path.cc (chdir): Always use the normalized_path as posix_cwd, except if itChristopher Faylor
starts with a drive. Also perform whitespace cleanup.
2004-05-03 * dir.cc (writable_directory): Remove.Corinna Vinschen
(mkdir): Remove call to writable_directory. * syscalls.cc (unlink): Ditto. (rename): Ditto. * winsup.h (writable_directory): Remove declaration.
2004-04-17 * autoload.cc (NtCreateFile): Add.Corinna Vinschen
* dir.cc (mkdir): Change set_file_attribute call to indicate that NT security isn't used. * fhandler.cc (fhandler_base::open_9x): New method, created from fhandler_base::open. (fhandler_base::open): Rearrange to use NtCreateFile instead of CreateFile. * fhandler.h (enum query_state): Redefine query_null_access to query_stat_control. query_null_access isn't allowed in NtCreateFile. (fhandler_base::open_9x): Declare. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use query_stat_control first, query_read_control if that fails. (fhandler_disk_file::fchmod): Call enable_restore_privilege before trying to open for query_write_control. Don't fall back to opening for query_read_control. (fhandler_disk_file::fchown): Ditto. (fhandler_disk_file::facl): Only request restore privilege and query access necessary for given cmd. * fhandler_raw.cc (fhandler_dev_raw::open): Call fhandler_base::open instead of opening device here. * ntdll.h (NtCreateFile): Declare. * path.cc (symlink_worker): Change set_file_attribute call to indicate that NT security isn't used. * sec_acl.cc (getacl): Fix bracketing. * sec_helper.cc (enable_restore_privilege): New function. * security.cc (str2buf2uni_cat): New function. (write_sd): Don't request restore permission here. * security.h (set_process_privileges): Drop stale declaration. (str2buf2uni): Declare. (str2buf2uni_cat): Declare. (enable_restore_privilege): Declare. * syscalls.cc (fchown32): Return immediate success on 9x.
2004-04-14 * dir.cc (mkdir): Call set_file_attribute with additional handleCorinna Vinschen
argument. * fhandler.cc (fhandler_base::fchmod): New method. * fhandler.h: Declare fchmod method in fhandler_base, fhandler_disk_file and fhandler_virtual. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): New method. (fhandler_base::open_fs): Call set_file_attribute with additional handle argument. * fhandler_virtual.cc (fhandler_virtual::fchmod): New method. * path.cc (symlink_worker): Call set_file_attribute with additional handle argument. * security.cc (get_nt_object_security): New function. (get_nt_object_attribute): Call get_nt_object_security. (set_nt_attribute): Add handle argument. Call get_nt_object_security first, read_sd only if that fails. (set_file_attribute): Add handle argument. * security.h (set_file_attribute): Declare with additional handle argument. * syscalls.cc (stat_suffixes): Move to beginning of file. (chown_worker): Call set_file_attribute with additional handle argument. (chmod): Reorganize to call fhandler's fchmod method eventually. (fchmod): Ditto.
2004-03-202004-03-19 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet
* dir.cc (rmdir): Reorganize error handling to reduce indentation.
2004-03-142004-03-14 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet
* dir.cc (rmdir): Construct real_dir with flag PC_FULL. Use a loop instead of recursion to handle the current directory.
2003-11-26 * dir.cc (mkdir): Use local security_descriptor. CallCorinna Vinschen
set_security_attribute appropriately. * external.cc (cygwin_internal): Ditto. * fhandler.cc (fhandler_base::open): Ditto. * fhandler_socket.cc (fhandler_socket::bind): Ditto. * path.cc (symlink_worker): Ditto. * sec_acl.cc (setacl): Ditto. Call read_sd appropriately. (getace): Ditto. * sec_helper.cc (security_descriptor::malloc): New method. (security_descriptor::realloc): New method. (security_descriptor::free): New method. * security.cc (read_sd): Get security_descriptor as parameter instead of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check. Allocate the security_descriptor buffer according to size returned by a call to GetFileSecurity. Return buffer size on success. (write_sd): Get security_descriptor as parameter instead of PSECURITY_DESCRIPTOR and a size. (get_nt_attribute): Use local security_descriptor. (get_nt_object_attribute): Ditto in case of type == SE_REGISTRY_KEY. Allocate security_descriptor buffer according to size returned by a call to RegGetKeySecurity. (alloc_sd): Make static. Get security_descriptor as parameter instead of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check. (set_security_attribute): Get security_descriptor as parameter instead of PSECURITY_DESCRIPTOR and a size. (set_nt_attribute): Use local security_descriptor. (check_file_access): Ditto. * security.h: Add class security_descriptor. (read_sd): Change declaration to get security_descriptor as parameter instead of PSECURITY_DESCRIPTOR and a size. (write_sd): Ditto. (set_security_attribute): Ditto. (alloc_sd): Remove declaration. * thread.cc (semaphore::semaphore): Use local security_descriptor. Call set_security_attribute appropriately.
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-11* dir.cc (rmdir): Add more samba workarounds.Christopher Faylor
2003-09-11* fhandler_disk_file.cc (num_entries): Take . and .. into account if they doChristopher Faylor
not exist since cygwin simulates them. (fhandler_cygdrive::fstat): Ditto. (fhandler_cygdrive::readdir): Don't do any specific tests on __d_position when seeing if a drive exists.
2003-09-09* dir.cc (readdir): Reinstate setting of old ino field for legacy applications.Christopher Faylor
* dirent.h (dirent): Rename unused field to __ino32. * passwd.cc (getpwnam_r): Initialize pw_comment field.
2003-09-08Throughout, remove __d_u.__d_data fields from DIR structure.Christopher Faylor
* include/sys/dirent.h (dirent): Remvoe old_d_ino. (DIR): Make __d_dirhash a 64 bit value. Remove __d_data and __d_u. Add __flags. * dir.cc (opendir_states): New enum. (opendir): Clear new DIR __flags field. (readdir): Fill in '.' and '..' entries if we hit EOF and we haven't seen them already. Nuke setting of old_d_ino. (rewinddir): Reset DIR __flags field. (seekdir64): Ditto. * fhandler_disk_file.cc (fhandler_cygdrive::fhandler_cygdrive): Remove special handling of "." and ".." since they are now handled automatically.
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-05-12 Replace ino_t by __ino64_t throughout.Corinna Vinschen
2003-05-11* dir.cc (readdir): Fill out new old_d_ino field.Christopher Faylor
* fhandler.h (fhandler_base::namehash): Define as ino_t. (fhandler_base::get_namehash): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Accommodate new 64 bit st_ino. * fhandler_socket.cc (fhandler_socket::fstat): Ditto. * path.cc (hash_path_name): Return ino_t. * syscalls.cc (stat64_to_stat32): Convert 64 bit inode to 32 bit. * winsup.h (hash_path_name): Declare as returning ino_t. * include/cygwin/stat.h (__stat32): Use 32 bit st_ino. (__stat64): Use 64 bit st_ino. * include/cygwin/types.h (__ino64_t): Define. (__ino32_t): Ditto. (ino_t): Define appropriately.
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.
2002-09-23More GNUify non-GNU formatted functions calls throughout.Christopher Faylor
2002-06-05* dir.cc (rmdir): Streamline. Detect attempts to remove directories fromChristopher Faylor
"read-only" virtual devices. (Suggested by Pavel Tsekov) * syscalls.cc (unlink): Detect attempts to remove directories from "read-only" virtual devices. (From Pavel Tsekov)
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-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-01* fhandler_disk_file.cc (readdir): Move inode calculation into caller.Christopher Faylor
(fhandler_cygdrive::readdir): Add "." and "..". * dir.cc (readdir): Move inode calculation here so that fhandler readdirs can benefit.
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-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-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.
2002-01-13Add copyright stuffChristopher Faylor
2002-01-06* dir.cc (opendir): Guarantee release of alloced fhandler structure on error.Christopher Faylor
2002-01-04* dir.cc (opendir): Don't attempt to call sub-opendir if ENOENT.Christopher Faylor
2001-12-06* dir.cc (opendir): Detect error return from build_fhandler_from_name.Christopher Faylor
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-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-10-05Add second path_conv * argument to fstat()s throughout.Christopher Faylor
* fhandler.h: Change read and fstat to regparm/stdcall throughout. (fhandler_base::fstat): Just declare. Don't define. (fhandler_disk_file::fstat_helper): Declare. * fhandler.cc (fhandler_base::fstat): Move here from fhandler.h, adapt from former stat_dev(). (fhandler_disk_file::fstat): Move most of the disk-file-specific logic from stat_worker to here. Use fstat_helper to derive final fstat output. (fhandler_disk_file::fstat_helper): New method, renamed from former fstat method. (num_entries): Moved here from syscalls.cc. * fhandler_mem.cc (fhandler_dev_mem::fstat): Use base class to initialize most stuff. Invert has_physical_mem_access test for establishing permissions. * fhandler_raw.cc (fhandler_dev_raw::fstat): Eliminate unneed test and memory clearing. Use base class to initialize most stuff. * syscalls.cc (stat_dev): Eliminate. (stat_worker): Simply call fstat method to generate fstat output. Move all device specific code to appropriate fstats. * dir.cc (opendir): Pass correct arg to stat_worker to allow following symlinks.
2001-10-05* syscalls.cc (stat_worker): Make global. Accept path_conv parameter forChristopher Faylor
passing information back to caller. * winsup.h: Declare stat_worker. * dir.cc (opendir): Use stat_worker rather than stat and pass path_conv parameter to stat_worker for later inspection. * syslog.cc (syslog): Teach syslog about syslog priorities other than LOG_ERR, LOG_WARNING and LOG_INFO * path.cc (path_conv::check): Don't perform file system or rootdir checks on devices.