summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
Commit message (Collapse)AuthorAgeFilesLines
* * fhandler.h (fhandler_base::ftruncate): Define new virtual method.Corinna Vinschen2005-02-021-3/+11
| | | | | | | | (fhandler_disk_file::ftruncate): Ditto. * fhandler.cc (fhandler_base::ftruncate): New method. * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto. * syscalls.cc (ftruncate64): Move functionality into fhandlers. Call fhandler method from here.
* * fhandler.cc (fhandler_base::get_proc_fd_name): Don't generateCorinna Vinschen2005-02-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | "device:" entry. * fhandler.h (fhandler_socket::open): New method. (fhandler_pipe::open): New method. * fhandler_proc.cc (fhandler_proc::exists): Return -2 in case of /proc/self. * fhandler_process.cc (fhandler_process::exists): Return -2 in case of symlinks, -3 for pipes and -4 for sockets. (fhandler_process::fstat): Handle pipes and sockets. (fhandler_process::open): Handle opening /proc/<pid>/fd. (fhandler_process::fill_filebuf): Generate empty names for non exisiting file descriptors. * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): Always generate "socket:[number]" strings as on Linux. (fhandler_socket::open): New method. (fhandler_socket::fstat): Always return socket type. * path.cc (symlink_info::set): Remove unused second parameter. (path_conv::check): Handle pipes and sockets in /proc. Set correct device type for AF_LOCAL sockets. * pinfo.cc (_pinfo::commune_recv): Generate empty names for non exisiting file descriptors. (_pinfo::fd): Ditto. * pipe.cc (fhandler_pipe::open): New method.
* * path.h (path_conv::set_name): Declare new function.Christopher Faylor2005-01-311-0/+9
| | | | | | * path.cc (path_conv::set_name): Define new function. * fhandler.h (fhandler_dev_null::open): Declare new function. * fhandler.cc (fhandler_dev_null::open): Define new function.
* * cygheap.h (class cygheap_fdenum): New class to enumerate usedCorinna Vinschen2005-01-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fhandlers. * dtable.h (class dtable): Add cygheap_fdenum as friend class. * fhandler.h (fhandler_base::get_proc_fd_name): New virtual method to return a name for /proc/<pid>/fd. (fhandler_socket::get_proc_fd_name): Ditto. (fhandler_pipe::get_proc_fd_name): Ditto. (fhandler_virtual::opendir): Make virtual method. (fhandler_process::opendir): New method. * fhandler.cc (fhandler_base::get_proc_fd_name): New method. * fhandler_process.cc: Include ctype.h. (PROCESS_FD): Define. (process_listing): Add "fd". (fhandler_process::exists): Fix comment. Return 1 in case of "fd" directory. Handle files below "fd". (fhandler_process::fstat): Drop "self" handling. Set correct link count for directories. (fhandler_process::opendir): New method to handle "fd" directory. (fhandler_process::readdir): Add "fd" handling. (fhandler_process::open): Drop "self" handling. (fhandler_process::fill_filebuf): Ditto. Add "fd" handling. Fix "maps" output string. * fhandler_registry.cc (fhandler_registry::fstat): Set correct link count for directories. * fhandler_socket.cc (fhandler_socket::get_proc_fd_name): New method. * path.cc (symlink_info::set): Fix thinko. * pinfo.cc (_pinfo::commune_recv): Rename pathbuf to path throughout. Drop local path variable in PICOM_FIFO case. Fix debug output. Close handles as early as possible. Add PICOM_FDS and PICOM_FD handling. (_pinfo::commune_send): Add PICOM_FDS and PICOM_FD handling. (_pinfo::fd): New method. (_pinfo::fds): New method. * pinfo.h (enum picom): Add PICOM_FDS and PICOM_FD. (_pinfo::fd): Declare. (_pinfo::fds): Declare. * pipe.cc (fhandler_pipe::get_proc_fd_name): New method.
* * fhandler_disk_file.cc (fhandler_disk_file::facl): Pretend successfulCorinna Vinschen2005-01-141-2/+37
| | | | | | | SETACL if no acls are available. * fhandler.cc (fhandler_base::facl): Implement to return sensible values on GETACL and GETACLCNT. Pretend successful SETACL. * fhandler_virtual.cc (fhandler_virtual::facl): Ditto.
* * fhandler.cc (fhandler_base::fchmod): Do the right thing when changing an "onChristopher Faylor2004-12-261-0/+5
| | | | | | | | | disk" device or fifo. (fhandler_base::fchown): Ditto for changing ownership. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Accommodate device files on ntfs partitions. * path.cc (path_conv::check): Use isfs function to figure out if a path exists on a filesystem to make sure that device files are caught.
* * path.h (path_conv::set_normalized_path): Add second argument and fill it inChristopher Faylor2004-12-231-2/+2
| | | | | | | throughout. * path.cc (path_conv::check): Declare, set and use "strip_tail". (path_conv::set_normalized_path): Add and use second argument, replacing all tail stripping tests.
* * fhandler.cc (fhandler_base::puts_readahead): Fix end-condition.Bas van Gompel2004-12-121-1/+1
|
* * fhandler.cc (fhandler_base::read): Remove superfluous check inBas van Gompel2004-12-051-2/+1
| | | | __small_printf format for strace.
* * fhandler.cc (fhandler_base::read): Don't debug_printf garbage whenBas van Gompel2004-12-051-0/+1
| | | | copied_chars is zero.
* 2004-11-20 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2004-11-201-1/+0
| | | | | * fhandler.cc (fhandler::write): Remove debug_printf. * pipe.cc (fhandler_pipe::create): Edit syscall_printf format.
* * exceptions.cc: (ctrl_c_handler): Do nothing while a Cygwin subprocess isChristopher Faylor2004-09-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | starting. * child_info.h (init_child_info): Remove pid argument from declaration. * cygheap.h (init_cygheap::pid): New element. * dcrt0.cc (dll_crt0_0): Eliminate handling of now-noexistent cygpid parameter in child_info struct. Set forkee to 'true' rather than cygpid since the pid value was never used. (dll_crt0_1): Ditto. (_dll_crt0): Ditto. * fork.cc (fork_child): Don't wait for sigthread. This is handled in the fork call now. (fork_parent): Remove obsolete pid argument from init_child_info call. Don't do anything special with cygpid when DEBUGGING. (fork): Delay all signals during fork. (fork_init): Don't do anything special when DEBUGGING. * pinfo.cc (set_myself): Remove pid parameter. Use new pid field in cygheap. (pinfo_init): Don't pass pid argument to set_myself. * sigproc.cc (sig_send): Wait for dwProcessId to be non-zero as well as sendsig. (init_child_info): Eliminate handling of pid. (wait_sig): Implement method to temporarily hold off sending signals. * sigproc.h (__SIGHOLD): New enum. (__SIGNOHOLD): Ditto. * spawn.cc (spawn_guts): Remove obsolete pid argument from init_child_info call.
* * fhandler.cc (fhandler_base::dup): Use debug_printf.Corinna Vinschen2004-09-101-2/+2
|
* * fhandler.cc (fhandler_base::write): In the lseek_bug case, set EOFCorinna Vinschen2004-08-281-16/+21
| | | | before zero filling. Combine similar error handling statements.
* * fhandler.cc (fhandler_base::open): Set shared flags to 0 whenCorinna Vinschen2004-08-191-1/+1
| | | | opening a tape device.
* 2004-08-14 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2004-08-141-3/+8
| | | | | * fhandler.cc (fhandler_base::open_9x): Set file attributes for new files.
* * fhandler.cc (fhandler_base::open): Remove 9x specific code.Corinna Vinschen2004-06-171-9/+0
|
* 2004-06-17 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2004-06-171-23/+12
| | | | | | | | | | | | | | | * fhandler.cc (fhandler_base::open_9x): Do not check for null name. Move debug_printf to common code line. (fhandler_base::open): Ditto. Initialize upath. Remove second argument of pc.get_nt_native_path. * path.h (path_conv::get_nt_native_path): Remove second argument. * path.cc (path_conv::get_nt_native_path): Ditto. Call str2uni_cat. * security.h (str2buf2uni_cat): Delete declaration. (str2uni_cat): New declaration. * security.cc (str2buf2uni): Get length from sys_mbstowcs call. (str2buf2uni_cat): Delete function. (str2uni_cat): New function. * miscfuncs.cc (sys_mbstowcs): Add debug_printf.
* * fhandler.cc (fhandler_base::open): Substitute FILE_SUPERSEDE withCorinna Vinschen2004-06-171-1/+1
| | | | FILE_OVERWRITE_IF.
* * autoload.cc (IsDosDeviceName_U): Define.Christopher Faylor2004-06-031-4/+8
| | | | | | * ntdll.h (IsDosDeviceName_U): Declare. * fhandler.cc (fhandler_base::open): Check to see if win32_name is a dos device and just call the 9x open if so.
* revert accidental checkinChristopher Faylor2004-06-031-4/+5
|
* * winbase.h (ilockincr): More changes from the inexplicable world of gcc asmChristopher Faylor2004-06-031-5/+4
| | | | | magic. (ilockdecr): Ditto.
* * path.cc (chdir): Always use the normalized_path as posix_cwd, except if itChristopher Faylor2004-05-281-18/+18
| | | | | | starts with a drive. Also perform whitespace cleanup.
* * fhandler.cc (fhandler_base::open): Set file attributes to correctCorinna Vinschen2004-05-111-0/+2
| | | | | value when creating files. * path.h (class path_conv): Add write accessor for file_attributes.
* * fhandler.cc (fhandler_base::open): Call path_conv::get_nt_native_pathCorinna Vinschen2004-04-301-20/+2
| | | | | | | for evaluating NT path. * path.cc (normalize_posix_path): Remove trailing dots and spaces. (path_conv::get_nt_native_path): New function. * path.h (class path_conv): Declare get_nt_native_path method.
* * fhandler.cc (fhandler_base::open): Fix NT native path evaluationCorinna Vinschen2004-04-301-10/+15
| | | | to allow opening serial ports.
* * syscalls.cc (lseek64): Fix debug_printf format string.Corinna Vinschen2004-04-211-0/+1
| | | | | | (truncate64): Ditto. * fhandler.cc (fhandler_base::lseek): Force res to -1 on error.
* * fhandler_disk_file.cc (fhandler_base::open_fs): ChangeCorinna Vinschen2004-04-201-8/+1
| | | | | | | | | | | | | | | | set_file_attribute call to indicate that NT security isn't used. (fhandler_disk_file::fchmod): Rearrange to isolate 9x related statements. Do not set FILE_ATTRIBUTE_SYSTEM. (fhandler_disk_file::fchown): Check noop case first. * fhandler.cc (fhandler_base::open9x): Remove ntsec related statements. (fhandler_base::set_name): Do not set namehash. * fhandler.h (fhandler_base::get_namehash): Compute and set namehash if needed. * syscalls.cc (access): Verify that fh is not NULL. Do not set PC_FULL. (chmod): Ditto. (chown_worker): Ditto. (stat_worker): Ditto. Verify if the path exists.
* * fhandler.cc (fhandler_base::open): Remove special DEV_FLOPPY_MAJORCorinna Vinschen2004-04-201-5/+1
| | | | | | | treatment. * fhandler_raw.cc (fhandler_dev_raw::open): Simplify write-only case. * fhandler_tape.cc (fhandler_dev_tape::raw_write): Add accidentally dropped condition.
* * fhandler.cc (fhandler_base::open): Add FILE_READ_ATTRIBUTES whenCorinna Vinschen2004-04-201-1/+1
| | | | only GENERIC_WRITE access is requested.
* * errno.cc (errmap): Handle ERROR_IO_PENDING.Corinna Vinschen2004-04-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fhandler.cc (fhandler_base::open): Make tape I/O asynchronous. * fhandler.h (class fhandler_dev_tape): Add mt_evt member. * fhandler_tape.cc (mtinfo_drive::initialize): Initialize async_writes. (mtinfo_drive::close): Handle async writes. (mtinfo_drive::read): Add mt_evt parameter. Use overlapped I/O. (mtinfo_drive::async_wait): New function. (mtinfo_drive::write): Add mt_evt parameter. Use overlapped I/O. Handle async writes. (mtinfo_drive::_set_pos): Handle async writes. (mtinfo_drive::set_partition): Ditto. (mtinfo_drive::prepare): Ditto. (mtinfo_drive::get_status): Drop useless "else". Handle async_writes flag. (mtinfo_drive::set_options): Handle async_writes flags. (fhandler_dev_tape::close): Close mt_evt handle. (fhandler_dev_tape::raw_read): Create mt_evt handle and use in call to mtinfo_drive::read. (fhandler_dev_tape::raw_write): Create mt_evt handle and use in call to mtinfo_drive::write. * mtinfo.h (MTINFO_VERSION): Bump. (enum dirty_state): Add async_write_pending state. (class mtinfo_drive): Add OVERLAPPED struct "ov". Add async_writes flag. (mtinfo_drive::async_wait): Add declaration. (mtinfo_drive::read): Add mt_evt parameter. (mtinfo_drive::write): Ditto. * registry.cc (load_registry_hive): Call enable_restore_privilege instead of set_process_privilege.
* * autoload.cc (NtCreateFile): Add.Corinna Vinschen2004-04-161-40/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * fhandler.cc (fhandler_base::open): Simplify access evaluationCorinna Vinschen2004-04-141-21/+30
| | | | | | | | | | | | | | | | | | | | | | | expression. (fhandler_base::facl): New method. * fhandler.h: Declare facl method in fhandler_base, fhandler_disk_file and fhandler_virtual. * fhandler_disk_file.cc (fhandler_disk_file::facl): New method. * fhandler_virtual.cc (fhandler_virtual::facl): New method. * sec_acl.cc: Remove forward declaration for aclsort32 and acl32. (setacl): Remove static. Add and use handle parameter. (getacl): Ditto. (acl_worker): Reorganize to call fhandler's facl method eventually. (facl32): Ditto. * security.cc (get_nt_object_security): Remove static. * security.h: Add extern declarations for get_nt_object_security, aclsort32, acl32, getacl and setacl. Apply missing syscalls.cc patch and ChangeLog of previous check in. * syscalls.cc (chown_worker): Reorganize to call fhandler's fchown method eventually. (fchown): Ditto.
* * fhandler.cc (fhandler_base::open): Accomodate query_write_controlCorinna Vinschen2004-04-141-1/+19
| | | | | | | | | | | | | | | | | | | query_state. (fhandler_base::fchown): New method. * fhandler.h: Declare fchown method in fhandler_base, fhandler_disk_file and fhandler_virtual. (enum query_state): Add query_write_control. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Set query_state to query_write_control. Only remove FILE_ATTRIBUTE_READONLY if not setting security descriptor. (fhandler_disk_file::fchown): New method. * fhandler_virtual.cc (fhandler_virtual::fchown): New method. * sec_acl.cc (setacl): Call write_sd with additional handle attribute. * security.cc (write_sd): Take handle argument. Only request owner if getting SE_RESTORE_NAME privilege failed. Only open file if NtSetSecurityObject failed or handle is NULL. (set_nt_attribute): Call write_sd with additional handle attribute. * security.h (write_sd): Declare with additional handle argument.
* * dir.cc (mkdir): Call set_file_attribute with additional handleCorinna Vinschen2004-04-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* * fhandler.cc (rootdir): Add and use second argument.Corinna Vinschen2004-04-101-18/+22
| | | | | | | * winsup.h (rootdir): Add second argument in declaration. * path.cc (fs_info::update): Modify call to rootdir. * syscalls.cc (check_posix_perm): Ditto. (statfs): Ditto. Move syscall_printf near top.
* * Use new unified status_flag accessor methods from classes fhandler_*,Corinna Vinschen2004-04-101-31/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tty_min, mtinfo and fs_info thoroughout. * fhandler.h: Redefine all set_close_on_exec methods to take a bool argument. (enum conn_state): Rename from connect_state. (class fhandler_base): Rename some status flags to align with accessor method names. Drop encoded flag entirely. Unify status accessor methods. Const'ify all read accessor methods. (class fhandler_socket): Ditto. (class fhandler_dev_raw): Ditto. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Use fs.fs_is_fat() instead of evaluating FATness of file system here. (fhandler_disk_file::opendir): Drop call to set_encoded(). (fhandler_disk_file::readdir): Use pc.isencoded() directly. * mtinfo.h (class mtinfo_drive): Const'ify all read accessor methods. * path.cc (fsinfo_cnt): Add. (fs_info::update): Accomodate class changes. Evaluate file system name specific flags right here. Add thread safety for reading and writing global fsinfo array. * path.h (enum path_types): Drop values for flags kept in fs already. (struct fs_info): Move status informatin into private struct type status_flags. Add accessor methods. Remove path and file system name string arrays in favor of status bits. (class path_conv): Use new fs_info status information where appropriate. (path_conf::fs_has_ea): Rename from fs_fast_ea. (path_conf::fs_has_acls): New method. (path_conf::root_dir): Remove. (path_conf::volname): Remove. * syscalls (statfs): Evaluate root dir locally. * tty.h (class tty_min): Unify status accessor methods. Const'ify all read accessor methods.
* * fhandler.cc (fhandler_base::write): Use bool parameter in calls toCorinna Vinschen2004-04-091-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set_did_lseek. (fhandler_base::fhandler_base): Accomodate new status and open_status constructor. * fhandler.h: Remove status bit enumerator. (FHDEVN): Remove. (FHISSETF): Remove. (FHSETF): Remove. (FHCLEARF): Remove. (FHCONDSETF): Remove. (FHSTATOFF): Remove. (UNCONNECTED, CONNECT_PENDING, CONNECTED): Substitute by enum connect_state. (fhandler_base::status): Define as bitfield struct type status_flags. Remove unused flags entirely. Accomodate all status access methods. (open_status): Define as bitfield struct type status_flags. (fhandler_socket): Move socket related status bits to here. Redefine had_connect_or_listen to be part of these status bits. Accomodate related access methods. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Use pc.issymlink instead of dropped method get_symlink_p. (fhandler_base::open_fs): Remove setting dropped status flags. * fhandler_socket.cc: Use values from enum connect_state throughout. (fhandler_socket::fhandler_socket): Initialize status bits. * fhandler_virtual.cc (fhandler_virtual::open): Remove setting dropped status flags. * net.cc: Use values from enum connect_state throughout. * select.cc: Ditto. * shared_info.h: Protect struct console_state using _FHANDLER_H_ instead of FHDEVN.
* * fhandler.cc (fhandler_base::open): Set query access mode accordingCorinna Vinschen2004-04-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | to query_open setting. (fhandler_base::fhandler_base): Initialize query_open. * fhandler.h (FH_QUERYOPEN): Drop. (enum query_state): Add. (class fhandler_base): Add query_open member. (fhandler_base::get_query_open): Redefine to use query_open. (fhandler_base::set_query_open): Ditto. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Remove O_DIROPEN from open_flags since it's added in open_fs anyway. Remove query_open_already. Use new query_open settings. Rearrange slightly. (fhandler_base::fstat_helper): Add get_io_handle as parameter to get_file_attribute. * security.cc (get_nt_object_attribute): Make returning an int. Return -1 on error, 0 otherwise. (get_file_attribute): Take an object handle as argument. Move down to allow calling get_nt_object_attribute in case a non-NULL handle is given. * security.h (get_file_attribute): Add handle to argument list. * syscalls.cc (chown_worker): Accomodate new definition of get_file_attribute.
* white space fixupChristopher Faylor2004-03-231-3/+3
|
* * Makefile.in (clean): Clean libserver, too.Christopher Faylor2004-02-171-2/+0
| | | | | | | | * fhandler.cc (fhandler_base::~fhandler_base): Remove path_conv cleanup. * syscalls.cc (chroot): Ditto. * path.cc (path_conv::~path_conv): Define new destructor. (conv_path_list_buf_size): Remove explicit path_conv cleanup. * path.h (path_conv::~path_conv): Declare new destructor.
* * debug.h (console_printf): Define for non-debugging condition.Christopher Faylor2004-02-091-1/+1
| | | | | | | | | | | | | | * cygtls.h (_threadinfo::lock): Remove wait argument. (_threadinfo::interrupt_setup): Remove retaddr argument. * exceptions.cc (_threadinfo::interrupt_setup): Ditto. (_threadinfo::interrupt_now): Accommodate change to interrupt_setup argument. (setup_handler): Ditto. Always lock sig stack prior to determining interrupt method. * gendef (_sigfe): Correct thinko regarding cmpxchg. (_sigbe): Ditto. (_threadinfo::lock): Ditto. (_threadinfo::pop): Eliminate left-over stack unlock. * sigproc.cc (proc_subproc): Chnage debugging output to printed warning.
* Throughout, change name from set_inheritance to set_no_inheritance to betterChristopher Faylor2004-02-021-2/+2
| | | | | | reflect input arguments of this function. * cygheap.h (CYGHEAPSIZE): Increase size of cygheap to something closer to the 21st century.
* * fhandler.cc (fhandler_base::fhaccess): Avoid always setting errno to EACCESSChristopher Faylor2004-01-251-14/+17
| | | | when return value is < 0. Rely on errno being set properly.
* * fhandler.h (fhandler_base::fhaccess): Return int for compatibility withChristopher Faylor2004-01-241-11/+14
| | | | | | | access. * fhandler.cc (fhandler_base::fhaccess): Return int. Use consistent variable name for exit value. Exit at bottom, printing debugging information, like other cygwin functions.
* * cygheap.cc (init_cygheap::close_ctty): Protect YA vforkism.Christopher Faylor2004-01-241-1/+86
| | | | | | | | | | | | | | | | | | | | | | | * fhandler.h (fhandler_base::has_acls): Make pass through for path_conv method. (fhandler_base::isremote): Ditto. (fhandler_base::is_fs_special): Ditto. (fhandler_base::has_attribute): Ditto. Define new function. (fhandler_base::fhaccess): Declare new function based on access_worker. (fhandler_base::set_has_acls): Eliminate obsolete function. (fhandler_base::set_isremote): Ditto. * fhandler.cc (fhandler_base::fhaccess): Move from syscalls.cc and into fhandler_base class. Use fhandler methods to access data rather than path_conv stuff. (fhandler_base::device_access_denied): Use fhaccess method. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. (fhandler_base::open_fs): Remove calls to obsolete functions. * fhandler_virtual.cc (fhandler_virtual::open): Ditto. * winsup.h (access_worker): Remove obsolete access_worker declaration. *syscalls.cc (access_worker): Move function to fhandler.cc. (access): Use fhaccess method. * pinfo.cc (_pinfo::set_ctty): Clarify debugging output. * sigproc.cc (sig_dispatch_pending): Ditto. * syscalls.cc (setsid): Perform minor rearrangement.
* * configure.in: Remove NEWVFORK default.Christopher Faylor2004-01-231-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure: Regenerate. * dcrt0.cc: Conditionalize vfork stuff throughout. * dtable.cc: Ditto. * perthread.h: Ditto. * pipe.cc (fhandler_pipe::close): Ditto. * spawn.cc (spawnve): Ditto. * syscalls.cc (setsid): Ditto. * exceptions.cc (sigpacket::process): Use macro to refer to vfork pid. * debug.cc (verify_handle): Define new function. * debug.h (VerifyHandle): Define new macro. (verify_handle): Declare new function * fhandler.cc (fhandler_base::dup): Verify that dup'ed handle is not supposed to be in use. (fhandler_base::set_inheritance): Ditto. (fhandler_base::fork_fixup): Ditto. * fhandler_socket.cc (fhandler_socket::dup): Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * net.cc (set_socket_inheritance): Ditto. * pinfo.cc (pinfo_fixup_after_exec): Ditto. * sigproc.cc (proc_subproc): Ditto. (sig_send): Ditto. * spawn.cc (spawn_guts): Ditto. * thread.cc (pthread::init_mainthread): Ditto. * pipe.cc (fhandler_pipe::close): Close read_state with ForceCloseHandle since it was protected. (fhandler_pipe::fixup_after_exec): Protect read_state handle. (fhandler_pipe::dup): Correctly close open handles on error condition. Verify that dup'ed handle is not supposed to be in use. (fhandler_pipe::create): Protect read_state.
* * fhandler.cc (fhandler_base::open): Revert isfs change.Christopher Faylor2004-01-221-2/+2
|
* * fhandler.cc (fhandler_base::open): Use major numbers rather than deviceChristopher Faylor2004-01-211-5/+5
| | | | | | | | numbers to control special behavior for devices which take units. * fhandler_raw.cc (fhandler_dev_raw::writebuf): Ditto. (fhandler_dev_raw::fstat): Ditto. (fhandler_dev_raw::open): Ditto. (fhandler_dev_raw::ioctl): Ditto.
* * winsup.h (access_worker): Declare with added fhandler_base parameter.Christopher Faylor2003-12-151-1/+1
| | | | | | | | | * syscalls.cc (access_worker): Accommodate extra fhandler_base argument. Use it instead of stat_worker to determine stat information, when appropriate. * fhandler.cc (fhandler_base::device_access_denied): Pass fhandler pointer to access_worker so that it can use the proper method for determining stat information. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.