summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/devices.h
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: Drop definition and usage of _mode_t in favor of __mode_tCorinna Vinschen2016-04-151-2/+1
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Remove /dev/mem, /dev/kmem, /dev/port support.Corinna Vinschen2013-07-151-3/+0
| | | | | | | | | | | | | | * Makefile.in (DLL_OFILES): Drop fhandler_mem.o. (fhandler_mem_CFLAGS): Remove rule. * devices.in (enum fh_devices): Remove FH_MEM, FH_KMEM and FH_PORT. * devices.cc: Regenerate. * dtable.cc (fh_alloc): Drop handling for FH_MEM, FH_KMEM and FH_PORT. * fhandler.h (class fhandler_dev_mem): Remove. * fhandler_mem.cc: Remove file. * globals.cc (ro_u_pmem): Remove. * mmap.cc (fhandler_dev_mem::mmap): Remove. (fhandler_dev_mem::munmap): Remove. (fhandler_dev_mem::fixup_mmap_after_fork): Remove.
* * Merge in cygwin-64bit-branch.Corinna Vinschen2013-04-231-16/+14
|
* Throughout, update copyrights to reflect dates which correspond to main-branchChristopher Faylor2013-01-211-1/+2
| | | | checkins. Regularize copyright format.
* * devices.h (lives_in_dev): New field.Christopher Faylor2012-04-021-1/+3
| | | | | | | | | | | | | | | | (dev_on_fs): Set bit size. (is_dev_resident): Define new method. * devices.in: Use different method for labelling requested name for dev storage: prefix it with a ='. Use an actual ':' to denote an internal device. (exists_console): Avoid repeated test. (exists_ntdev_silent): Rename from the less-descriptive exists_ntdevs. (dev_dev_storage): Delete unneeded define. * gendevices: Add a flag to each line denoting whether the device lives in /dev space. (generate): Handle special ":" case here for internal devices. Parse =something_dev as requiring a storage location. Tack the rest of the line back onto the reformulated "$rest". * devices.cc: Regenerate.
* * devices.h (device::get_device): New method.Corinna Vinschen2012-04-021-0/+1
| | | | | | * fhandler_dev.cc (fhandler_dev::readdir): Set st_ino to device number. * syscalls.cc (fhandler_base::stat_fixup): Ditto. Fix link count for CD-ROM devices. Fix typo in comment.
* * devices.h (FH_CYGDRIVE): Define as DEV_VIRTFS_MAJOR class device.Corinna Vinschen2012-04-021-3/+3
| | | | | | | | | (DEV_CYGDRIVE_MAJOR): Remove. (iscygdrive_dev): Define. * dtable.cc (fh_alloc): Accommodate above change. * path.cc (path_conv::check): Use iscygdrive_dev to check for cygdrive. * syscalls.cc (fhandler_base::set_ino_and_dev): Drop check for DEV_CYGDRIVE_MAJOR from conditional.
* * devices.h (FH_DEV): Define as DEV_VIRTFS_MAJOR class device.Corinna Vinschen2012-04-021-3/+1
| | | | | | | (DEV_DEV_MAJOR): Remove. * dtable.cc (fh_alloc): Accommodate above change. * syscalls.cc (set_ino_and_dev): Drop check for DEV_DEV_MAJOR from conditional.
* * devices.h (device::exists_func): Redefine field.Christopher Faylor2012-04-011-12/+13
| | | | | | | | | | | | (device::dev_on_fs): Remove unneeded bit field. Just make a normal boolean. (device::exists): Redefine function. * devices.in: Move previous functions earlier since they are now only defined static. Rename some functions due to an as-yet unresolved bug in gendevices. Rename posix part of internal-only devices with a double-slash. gendevices will eventuall translate that to a ":". (device::parse): Rework to use dev pointer and dev_storage_end. * devices.cc: Regenerate. * gendevices: Translate "// to ": after shilka processing.
* * devices.cc: Regenerate.Corinna Vinschen2012-03-311-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | * devices.h (device::exists_func): New member function pointer, replacing noexpose. (device::expose): Remove. (device::exists_never): Declare. (device::exists_ptys): Declare. (device::exists_cons): Declare. (device::exists_console): Declare. (device::exists_nt_dev): Declare. (device::exists): Declare. * devices.in (dev_storage): Replace former noexpose values with pointers to matching exists_XXX method. (device::exists_never): New method. (device::exists_ptys): New method. (device::exists_cons): New method. (device::exists_console): New method. (device::exists_nt_dev): New method. (device::exists): New method. * fhandler_dev.cc (fhandler_dev::readdir): Replace call to device::expose with call to device::exists and drop all further existence filtering since it's done in device::exists now. * path.cc (path_conv::check): Replace call to device::expose with call to device::exists.
* (Interim checkin while we work on this)Christopher Faylor2012-03-311-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * devices.cc: Regenerate. * devices.h (device::noexpose): New field. (device::dev_on_fs): Make a bit field. (get_major): Use proper type for declaration. (expose): New field. (ext_dev_storage): Delete declaration. (dev_storage_size): Ditto. (dev_storage): New declaration. (dev_storage_end): Ditto. * devices.in: Mark /dev/ptym*, /dev/com*, /dev/pipe, /dev/fifo, and "/dev" as "no expose". * fhandler.h (fhandler_dev::lastrealpos): Delete declaration. (fhandler_dev::devidx): Declare new field. * fhandler_disk_file.cc: Move fhandler_dev functions into fhandler_dev.cc. * fhandler_dev.cc: Add includes needed for functions moved from fhandler_disk_file.cc. (dev_storage_scan_start): Define place to start listing devices. (dev_storage_size): Define size of array to scan. (fhandler_dev::fhandler_dev): Move here from fhandler_disk_file.cc. (fhandler_dev::opendir): Ditto. (fhandler_dev::readdir): Just check devidx for non-NULL to determine when to go to disk for /dev content. Use dev_storage rather than ext_dev_storage. Iterate over dev_storage using devidx pointer. Use accessor functions rather than raw references to the device struct. Only increment dir->__d_position when we are actually going to be returning something. Add debug_printf for exit. (fhandler_dev::rewinddir): Set devidx as appropriate depending on whether there's a /dev on disk or not. * gendevices: Don't mark dev_storage static but do put it in the _RDATA section. * path.cc (path_conv::check): Use new "device::expose()" function to decide to forbid programs from referencing internal device types.
* * devices.h (DEV_TTY_MAJOR): Define, use throughout where appropriate.Corinna Vinschen2012-03-301-20/+22
| | | | | | | (DEV_VIRTFS_MAJOR): Ditto. * fhandler_dev.cc (fhandler_dev::readdir): Add comments. Tweak tests for invisible devices. Don't print comX devices, only ttySX. Drop requirement to call stat64.
* * Makefile.in (DLL_OFILES): Add fhandler_dev.o.Corinna Vinschen2012-03-291-2/+11
| | | | | | | | | | | | | | | | | | | | | | | * devices.h (DEV_DEV_MAJOR): Define. (FH_DEV): Redefine in terms of DEV_DEV_MAJOR. (ext_dev_storage): Declare. (dev_storage_size): Declare. (dev_dev_storage): Declare. (dev_dev): Define. (isdev_dev): Define. * devices.in (dev_dev_storage): Activate. (ext_dev_storage): Define as externally available pointer to dev_storage. (dev_storage_size): Define to contain number of dev_storage elements. * dir.cc (rmdir): Handle /dev as always not empty. * dtable.cc (fh_alloc): Handle DEV_DEV_MAJOR. * fhandler.h (fhandler_dev): New class, derived from fhandler_disk_file. (fhandler_union): Add fhandler_dev member. * fhandler_disk_file.cc (class __DIR_mounts): Handle /dev directory to make sure it always exists. * fhandler_dev.cc: New file implementing /dev. * globals.cc (ro_u_dev): New R/O unicode string. * path.cc (path_conv::check): Handle FH_DEV device.
* Throughout change TTY_* to PTY_*, tty_* to pty_*, and ttym_* to ptmx_*.Christopher Faylor2011-10-201-9/+9
| | | | | | | | | | | | | | | | * devices.cc: Regenerate. * dtable.cc: (fh_alloc): Preserve /dev/tty name when that's what we opened. (build_fh_pc): Preserve any existing name. * fhandler.cc (fhandler_base::open_with_arch): Ditto. * fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Force the name to /dev/ptmx while preserving other pty master device information. * path.h (cfree_maybe): New macro. (path_conv::operator =): Free any allocated strings in target. (path_conv::free_strings): Delete unused function. * sigproc.cc (proc_terminate): Remove previous accommodation for execed processes since it didn't have the desired effect. Change comment to a FIXME. * spawn.cc (chExeced): Mark NO_COPY. (exe_suffixes): Ditto.
* * cygerrno.h (__set_errno): Modify debugging output to make searching straceChristopher Faylor2011-10-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | logs easier. Throughout, change /dev/tty* to /dev/pty*. Throughout, add flags argument to fhandler_*::dup methods. * devices.in: Rename (temporarily?) /dev/ttyN to /dev/ptyN. Add /dev/ptymN devices for pty masters. * devices.cc: Regenerate. * devices.h (MAX_CONSOLES): Set to max number supported by devices.in. (fh_devices::FH_PTMX): Rename from FH_PTYM. (device::operator int): Return by reference. * dtable.cc (fh_alloc): Take pc as an argument rather than just the device. This makes debugging easier since more information is available. Actually implement handling for already-allocated pty master devices. Make different decisions when generating fhandler for not-opened devices. Add kludge to deal with opening /dev/tty. (cnew_no_ctor): New macro. (build_fh_pc): Make debugging output more verbose. Use new clone() fhandler interface to duplicate archetypes. Reset last term opened. (dtable::dup_worker): Use Use new clone() fhandler interface to duplicate archetypes. Pass flags to child dup handler. (dtable::dup3): Set O_NOCTTY flag if newfd is not stdin/stdout/stderr. * fhandler.cc (fhandler_base::reset): Rename from operator =() and reduce functionality and sense of copy direction. (fhandler_base::open_with_arch): Use published interface to query io_handle(). Use new copyto() fhandler method to copy from/to found archetype. * fhandler.h: Throughout, delete size(), add copyout, clone, and fhandler_* (void *) methods. (fhandler_base::reset): Rename from operator =(). (fhandler_termios::is_dev_tty): Delete. (fhandler_termios): change "protected" region to "private". (fhandler_termios::is_dev_tty): Delete. (fhandler_termios): Rearrange protected/public. (fhandler_termios::fhandler_termios): Remember last fhandler_termios "opened". (fhandler_termios::~fhandler_termios): Forget last fhandler_termios opened. (ioctl): Rename from ioctl_termios. Take a void * argument. Reflect argument change in pinfo::set_ctty. (fhandler_console::dup): Declare new function. Set ctty here if appropriate. (fhandler_pty_master::from_master): Privatize. (fhandler_pty_master::to_master): Ditto. (fhandler_pty_master::dwProcessId): Ditto. (fhandler_pty_master::fhandler_pty_master): Add an `int' argument. (fhandler_pty_master::open_setup): Declare new function. (fhandler_pty_master::~fhandler_pty_master): Declare new method. (fhandler_nodevice): Remove commented out function declaration. * fhandler_console.cc: Use get_ttyp() instead of tc() throughout. (fhandler_console::dup): Define new function to set controlling ctty on dup, as appropriate. (fhandler_console::ioctl): Reflect ioctl_termios name change. (fhandler_console::setup): Rename from get_tty_stuff. (fhandler_console::open_setup): Reflect argument change in pinfo::set_ctty. (fhandler_console::fhandler_console): Set _tc here. * fhandler_termios.cc (handler_termios::ioctl): Rename. Take a void * arg like other ioctl functions. * fhandler_tty.cc (fhandler_pty_slave::dup): Call myself->set_ctty to potentially reset the controlling terminal. (fhandler_pty_slave::ioctl): Reflect name/arg change for ioctl_termios. (fhandler_pty_slave::fhandler_pty_slave): Take a "unit" argument. Call setup() here so that we will know the unit number of this fhandler as soon as possible. Set the unit as appropriate. (handler_pty_master::open): Move most stuff to constructor and open_setup. (handler_pty_slave::open_setup): Reflect argument change in pinfo::set_ctty. (handler_pty_master::open_setup): Define new function. (fhandler_pty_master::cleanup): Clear handles as a flag that the destructor does not have to do "close" operations. (fhandler_pty_master::close): Ditto. (fhandler_pty_master::~fhandler_pty_master): Define new method. (fhandler_pty_master::ioctl): Reflect name/arg change for ioctl_termios. (fhandler_pty_master::setup): Allocate tty here. Rely on handles being returned from allocated test rather than opening them here. Avoid setting _need_nl here since it is already zeroed in the constructor. Set up device information with DEV_TTYM_MAJOR. * path.h (path_conv &operator =): Take a const argument. (path_conv::dup): Ditto. (pathconv_arg::PC_OPEN): New enum. (pathconv_arg::PC_CTTY): Ditto. (path_types::PATH_CTTY): Ditto. (path_types::PATH_OPEN): Ditto. (path_conv::isopen): New method. (path_conv::isctty_capable): Ditto. * path.cc (path_conv::check): Set PATH_OPEN and PATH_CTTY as appropriate. * pipe.cc (fhandler_pipe::open): Use copyto to copy pipe handle. * syscall.cc (open): Reinstate fd > 2 check to disallow resetting ctty on non-std* handles. * tty.cc (tty_list::allocate): Pass out handles for allocated tty. use `not_allocated' to find unallocated ttys. Avoid keeping the lock since the allocation of the tty should be sufficient to prevent multiple access. (tty::not_allocated): Clarify comment. Rename. Return handles when an unused tty is found. Simply test for existing tty. (tty::exists): Rewrite to use `not_allocated'. * tty.h (NTTYS): Reset down to actual number supported by devices.in. (tty::not_allocated): Declare new function. (tty_list::allocate): Pass out read/write tty handles. Zero them when not found. * fhandler_proc.cc: Reflect name change from FH_PTYM -> FH_PTMX. * pinfo.h (pinfo::set_ctty): Reduce/reorder arguments passed in. * pinfo.cc (pinfo::set_ctty): Ditto. Just use tc() built into the passed-in fhandler_termios pointer. Return true if ctty is assigned. * syscalls.cc (open): Call build_fh_pc with PC_OPEN flag. Set PC_CTTY if appropriate. (stat_worker): Remove is_dev_tty () stuff.
* * devices.h (fh_devices): Define DEV_MISC_MAJOR, DEV_MEM_MAJOR,Yaakov Selkowitz2011-08-191-12/+16
| | | | | | | | DEV_SOUND_MAJOR. Use throughout. * fhandler_proc.cc (proc_tab): Add /proc/devices and /proc/misc virtual files. (format_proc_devices): New function. (format_proc_misc): New function.
* Rename FH_BAD to FH_NADA throughout.Christopher Faylor2011-06-121-2/+7
| | | | | | | | | | | | | | | | | | * devices.h (FH_ERROR): New value. (iscons_dev): Extend to detect all the console device types. * devices.in: Set aside storage for FH_ERROR. * dtable.cc (dtable::init_std_file_from_handle): Use iscons_dev to detect when device is a console. (fh_alloc): Pass device to console constructor. (build_fh_pc): Short circuit when we detect that the constructor saw an error. * fhandler.h (fhandler_console::fhandler_console): Accept fh_devices parameter. (get_tty_stuff): Change to void. * fhandler_console (fhandler_console::set_unit): Set device to FH_ERROR on attempt to access anything other than the current console. (fhandler_console::get_tty_stuff): Change to void return. (fhandler_console::open): Return EPERM on FH_ERROR device type. (fhandler_console::fhandler_console): Set the device type appropriately before calling get_tty_stuff and rely on that function to reset it if necessary.
* * autoload.cc: Call _api_fatal in asm.Christopher Faylor2011-05-281-14/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * child_info.h: Redefine CURR_CHILD_INFO_MAGIC. (child_info_fork::abort): Rename from handle_failure. Change arguments. * cygtls.h (_local_storage::ttybuf): New field. * dcrt0.cc (vapi_fatal): Split api_fatal. Add "in forked process" to message when appropriate. (api_fatal): Use vapi_fatal. * devices.h: Make multiple inclusion safe. (fh_devices): Add FH_CONS* stuff. Reorder slightly. (device): Eliminate anonymous union. Add more ways to access minor/major. (device::setunit): Accommodate no-longer-anonymous union. (device::is_fs): Ditto. (device::is_fs_special): Ditto. (device::major): New function. (device::minor): Ditto. (device::is_device): New function. (device::not_device): Ditto. (device::operator int): New operator. (device::operator fh_devices): Ditto. (device::operator bool): Ditto. (device::operator DWORD): Ditto. (device::operator =): Ditto. (isproc_dev): New function. (isprocsys_dev): Ditto. (iscons_dev): Ditto. (istty_slave_dev): Ditto. * devices.in: Add new "/dev/cons*" strings. Accommodate no-longer-anonymous union throughout. (BRACK): Use more precise method for initialization. * devices.cc: Regenerate. * dtable.cc (dtable::stdio_init): Use get_cttyp instead of get_tty. (dtable::find_archetype): Use new DWORD operator in device to test archetypes. (dtable::init_std_file_from_handle): Use different method to initialize 'dev'. Adapt to different ctty handling and accommodate /dev/cons*. (fh_alloc): Accommodate no-longer-anonymous union. Adapt to new /dev/cons*. (build_fh_pc): Make debugging output more useful. * exceptions.cc (ctrl_c_handler): Use get_cttyp instead of get_tty. * external.cc (fillout_pinfo): Accommodate new cons* stuff. * fhandler.cc (fhandler_base::read): Eliminate is_slow() test. * fhandler.h (fhandler_base::*): Adapt to changes in device.h. (fhandler_*::is_slow): Delete. ( fhandler_proc::get_proc_fhandler): Return fh_devices type. * fhandler_console.cc (open_shared_console): New function. (console_unit): New class. (console_unit::console_unit): New constructor. (enum_windows): New function. Declare as friend to console_unit. (fhandler_console::set_unit): New function. (fhandler_console::get_tty_stuff): Call set_unit to set the unit number and determine if initialization is needed. Eliminate flags parameter. (tty_list::get_cttyp): Rename (sorta) from get_tty. Return pointer to correct tty_min. (fhandler_console::open): Adapt to elimination of argument to get_tty_stuff. (fhandler_console::output_tcsetattr): Properly detect error condition. (fhandler_console::fixup_after_fork_exec): Adapt to get_tty_stuff() setting tc automatically. * fhandler_proc.cc: Use FH_BAD rather than 0 throughout where using fh_devices enum. (fhandler_proc::get_proc_fhandler): Return fh_devices. Adapt to devices.h changes. * fhandler_process.cc: Adapt to devices.h changes. Use FH_BAD rather than 0 throughout where using fh_devices enum. * fhandler_procnet.cc: Ditto. * fhandler_procsys.cc: Ditto. * fhandler_procsysvipc.cc: Ditto. * fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): Ditto. * fhandler_termios.cc (handler_termios::bg_check): Use tc->ttyname() rather than assuming that we can construct a tty. * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Just return get_minor() of dev. (fhandler_pty_master::process_slave_output): Add slightly more debugging info. (fhandler_tty_slave::fhandler_tty_slave): Change name from ntty to unit. (fhandler_pty_master::open): Ditto. (fhandler_tty_slave::ioctl): Adapt to change which causes ctty to represent a complete device. (fhandler_tty_master::init_console): Add debugging for failure path. (fhandler_pty_master::setup): Use get_unit() to retrieve unit number rather than relying on raw ntty. (fhandler_pty_master::setup): Ditto. * fhandler_virtual.h (virt_tab_t): Redefine fhandler as fh_devices. * fork.cc: Remove obsolete vfork stuff. (frok::child): Don't assume that a ctty == 0 is valid. * mount.cc (mount_info::conv_to_win32_path): Adapt to device struct changes. (mount_info::conv_to_win32_path): Ditto. * path.cc (path_conv::check): Retrive major/minor numbers via a method rather than accessing them directly from device. Rely on dev operators to set/retrieve device information as required by device struct change. * path.h (isproc_dev): Move to devices.h. (isprocsys_dev): Ditto. (isvirtual_dev): Ditto. (path_conv:{isdevice,isfifo,isspecial,iscygdrive,issocket,get_devn,get_unitn}): Use device methods to access/manipulate devices. * pinfo.cc (pinfo::exit): Don't assume that ctty == 0 is valid. Use iscons_dev to determine if a device is a console. (_pinfo::_ctty): Use device::parse to generate tty/cons name. (_pinfo::set_ctty): Don't assume that ctty == 0 is valid. Remove redundant info from debugging. * shared.cc (offsets): Remove console offset. * shared_info.h (shared_locations): Ditto. * syscalls.cc (umask): Use device methods to manipulate device information. (ctermid): Use device::parse to generate term device name. * tlsoffsets.h: Regenerate. * tty.cc (ttyslot): Return minor number of ctty since ctty now represents a full device. (tty::create_master): Set ctty to a complete device. (tty_list::attach): Rework to detect new /dev/cons* stuff. (tty_list::terminate): Adapt to changes to ctty. (tty_list::init): Adapt to change to setntty - pass in device major number. (tty::exists): Use get_unit() to retrive tty unit number. (tty::open_mutex): Ditto. (tty::open_inuse): Ditto. (tty::create_inuse): Ditto. (tty::get_event): Ditto. (tty_min::ttyname): Define new function. * tty.h (tty_min::ntty): Redefine as fh_devices. (tty::exists): Use get_unit() to retrive tty unit number. (tty::open_mutex): Ditto. (tty::open_inuse): Ditto. (tty::create_inuse): Ditto. (tty::get_event): Ditto. (tty_min::ttyname): Declare new function. (tty::getntty): Declare as const. (tty_list::operator []): Assure that only minor part of argument is used. * dll_init.cc (dll_list::alloc): Detect mismatch of data segments early issuing an explicit error message if necessary. * heap.cc (heap_init): Adapt to changes from fork->handle_failure to fork->abort. * pinfo.h (EXITCODE_FORK_FAILED): New enum. (from Ryan Johnson) * sigproc.cc (child_info_fork::abort): Rename from handle_failure. Change arguments to allow passing in a printf-like message. * winsup.h (api_fatal): Delete macro definition. (api_fatal): Redefine from __api_fatal. (vapi_fatal): Declare new function. * include/sys/strace.h (strace_vprintf): Define new macro. * ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemHandleInformation.
* * cygheap.cc (cygheap::close_ctty): Close ctty via close_with_arch().Christopher Faylor2011-05-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * debug.cc (close_handle): Call debugger on failure. * devices.in (device::tty_to_real_device): Delete. * devices.h (device::tty_to_real_device): Ditto. * devices.cc: Regenerate. * dtable.cc: Delete old ifdef'ed vfork code. (dtable::release): Don't handle archetype here. (dtable::init_std_file_from_handle): Consolidate console tests. Generate major/minor for tty ASAP. Fix incorrect setting of DEV_TTYS* for serial. (fh_alloc): New function derived from build_fh_pc. Pass current tty when building tty. (build_pc_pc): Use fh_alloc to create. Set name from fh->dev if appropriate. Generate an archetype or point to one here. (dtable::dup_worker): Deal with archetypes. Rely on = operator copying whole class rather than just fhandler_base. (dtable::fixup_after_exec): Call close_with_arch to handle closing of fhandlers with archetypes. * fhandler.cc (fhandler_base::operator =): Call memcpy with fhandler's size() rather than sizeof fhandler_base. (fhandler_base::open_with_arch): New function. Handles opening of fhandler's with archetypes, dealing with usecounts, etc. (fhandler_base::close_with_arch): Ditto for close. * fhandler.h: Many changes for archetypes. (fhandler_base::set_name): Set both normalized path and regular path. (fhandler_base::open_with_arch): New function. (fhandler_base::open_setup): Ditto. (fhandler_base::use_archetype): Ditto. (fhandler_base::_archetype_usecount): Ditto. (fhandler_*::size): Ditto. (fhandler_dev_tape::open): Remove virtual decoration. (fhandler_console::use_archetype): New function. Return true. (fhandler_console::open_setup): New function. (fhandler_console::dup): Delete. (fhandler_tty_slave::fhandler_tty_slave): Redeclare to take an argument. (fhandler_tty_slave::use_archetype): New function. Return true. (fhandler_tty_slave::cleanup): New function. (fhandler_pty_master::use_archetype): New function. Return true. (fhandler_pty_master::cleanup): New function. (fhandler_pty_master::is_tty_master): New function. Return false. (fhandler_tty_master::is_tty_master): New function. Return true. (fhandler_dev_dsp::fhandler_dev_dsp): New function. Return true. (report_tty_counts): Only report on archetype's usecount if there is one. * fhandler_console.cc (fhandler_console::get_tty_stuff): Remove handling of setsid, set_ctty, set_flags, and manage_console_count. (fhandler_console::open_setup): New function. Implement functionality removed from get_tty_stuff. (fhandler_console::dup): Delete. (fhandler_console::output_tcsetattr): Set errno on error. (fhandler_console::fhandler_console): Set device early. (fhandler_console::init): Use open_with_arch to open console handles. (fhandler_console::fixup_after_fork_exec): Nuke most of the stuff for dealing with console handles. * fhandler_dsp.cc (fhandler_dev_dsp::open): Remove archetype handling. (fhandler_dev_dsp::write): Ditto. (fhandler_dev_dsp::read): Ditto. (fhandler_dev_dsp::close): Ditto. (fhandler_dev_dsp::dup): Ditto. (fhandler_dev_dsp::ioctl): Ditto. (fhandler_dev_dsp::fixup_after_fork): Ditto. (fhandler_dev_dsp::fixup_after_exec): Ditto. * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Add a little more debugging. (fhandler_tty_common::__release_output_mutex): Ditto. (fhandler_pty_master::process_slave_output): Ditto. Don't do signal handling or pthread_cancel handling in the tty master thread. (process_output): Minor reorg. (fhandler_tty_slave::fhandler_tty_slave): Set device based on new ntty argument. (fhandler_tty_slave::open): Remove archetype handling. Move some processing into open_setup(). (fhandler_tty_slave::open_setup): New function. (fhandler_tty_slave::cleanup): New function. (fhandler_tty_slave::close): Remove archetype handling. Move some processing into cleanup(). (fhandler_tty_slave::init): Rename argument from f to h. Open device using open_with_arch(). Remove archetype handling. (fhandler_pty_master::dup): Ditto. (fhandler_pty_master::open): Ditto. (fhandler_pty_master::close): Ditto. Move some handling to cleanup(). (fhandler_pty_master::cleanup): New function. (fhandler_tty_master::init_console): Give unique name to captive console fhandler. * pinfo.cc (_pinfo::set_ctty): Rename argument from arch to fh. Eliminate archetype assumption. * syscalls.cc (close_all_files): Use close_with_arch for closing. (open): Use open_with_arch() rather than open(). (close): Use close_with_arch() rather than close().
* * devices.h: Renumber internal devices so that FH_PROCESS is part ofCorinna Vinschen2011-04-201-10/+12
| | | | | | the /proc family of virtual devices. (FH_PROC_MAX_MINOR): Define. * path.h (isproc_dev): Use FH_PROC_MAX_MINOR rather than FH_PROC.
* * devices.h (fh_devices): Define FH_PROC_MIN_MINOR.Yaakov Selkowitz2011-04-041-15/+18
| | | | | | Reorder major-0 devices so that all /proc directories fall between FH_PROC and FH_PROC_MIN_MINOR. * path.h (isproc_dev): Redefine accordingly.
* Implement /proc/sysvipc/*Yaakov Selkowitz2011-04-011-0/+1
| | | | | | | | | | | | | * devices.in (dev_procsysvipc_storage): Add. * devices.cc: Regenerate. * devices.h (fh_devices): Add FH_PROCSYSVIPC. * dtable.cc (build_fh_pc): Add case FH_PROCSYSVIPC. * fhandler.h (class fhandler_procsysvipc): Declare. (fhandler_union): Add __procsysvipc. * fhandler_proc.cc (proc_tab): Add sysvipc virt_directory. * fhandler_procsysvipc.cc: New file. * Makefile.in (DLL_OFILES): Add fhandler_procsysvipc.o. * path.h (isproc_dev): Add FH_PROCSYSVIPC to conditional.
* * Makefile.in (DLL_OFILES): Add fhandler_procsys.o.Corinna Vinschen2010-09-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * devices.h (enum fh_devices): Add FH_PROCSYS. * devices.in (dev_procsys_storage): New device. * devices.cc: Regenerate. * dtable.cc (build_fh_pc): Add code to allocate fhandler_procsys. * fhandler.h (proc_len): Convert to size_t. (procsys): Declare. (procsys_len): Declare. (enum virtual_ftype_t): Move here from fhandler_virtual.h. Add members supported by fhandler_procsys. (fhandler_virtual::exists): Return virtual_ftype_t. Change in all derived classes. (class fhandler_procsys): New class. (fhandler_union): Add fhandler_procnet and fhandler_procsys members. * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Use ro_u_proc. (fhandler_base::fstat_by_handle): Don't copy attributes if file is an NT device. (fhandler_base::fstat_by_name): Ditto. * fhandler_netdrive.cc (fhandler_netdrive::exists): Return virtual_ftype_t. * fhandler_proc.cc (proc_tab): Sort alphabetically. Use _VN macro to store length. (proc_len): Change to size_t. (proc_tab_cmp): New static function. (virt_tab_search): New function to search entry in virt_tab_t arrays. Use throughout in /proc and sibling classes instead of loop. (fhandler_proc::exists): Return virtual_ftype_t. * fhandler_process.cc (process_tab): Sort alphabetically. Use _VN macro to store length. (fhandler_process::exists): Return virtual_ftype_t. (fhandler_process::open): Simplify code. * fhandler_procnet.cc (procnet_tab): Sort alphabetically. Use _VN macro to store length. (fhandler_procnet::exists): Return virtual_ftype_t. (fhandler_procnet::open): Simplify. * fhandler_procsys.cc: New file. * fhandler_registry.cc (fhandler_registry::exists): Return virtual_ftype_t. * fhandler_virtual.cc (fhandler_virtual::exists): Ditto. * fhandler_virtual.h (enum virtual_ftype_t): Move to fhandler.h. (virt_tab_t): Add name_len member. (_VN): New macro. (virt_tab_search): Declare. * mount.cc (mount_info::conv_to_win32_path): Fix comment. Backslashify isprocsys_dev paths. * ntdll.h (STATUS_OBJECT_TYPE_MISMATCH): Define (STATUS_INSTANCE_NOT_AVAILABLE): Define. (STATUS_PIPE_NOT_AVAILABLE): Define. (STATUS_INVALID_PIPE_STATE): Define. (STATUS_PIPE_BUSY): Define. (SYMBOLIC_LINK_QUERY): Define. (NtOpenSymbolicLinkObject): Declare. (NtQuerySymbolicLinkObject): Declare. * path.cc (path_conv::check): Accommodate fact that exists method returns virtual_ftype_t now. Add cases for new virtual_ftype_t types. (cygwin_conv_path): Add GLOBALROOT prefix to native device paths. Make sure to strip \\?\ prefix only for actual filesystem-based paths, not for all paths. * path.h (isproc_dev): Add FH_PROCSYS. (isprocsys_dev): Define.
* * devices.h (FH_PROCESSFD): New device type.Corinna Vinschen2009-01-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dtable.cc (build_fh_pc): Add case for FH_PROCESSFD. * fhandler.h (class fhandler_virtual): Drop bufalloc member. * fhandler_virtual.h: New header. * fhandler_proc.cc: Remove types proc_type_t and proc_tab_t in favor of types virt_type_t and virt_tab_t from fhandler_virtual.h. Change prototypes of format_XXX functions accordingly. (proc_tab): Drop size member info. (fhandler_proc::fill_filebuf): Don't allocate filebuf here. Allocate it in the format_XXX functions. * fhandler_process.cc: Reorganize global process content data into a new struct virt_tab_t. Accommodate throughout. (format_process_winexename): New function. (format_process_winpid): New function. (format_process_exename): New function. (format_process_root): New function. (format_process_cwd): New function. (format_process_cmdline): New function. (format_process_ppid): New function. (format_process_uid): New function. (format_process_pgid): New function. (format_process_sid): New function. (format_process_gid): New function. (format_process_ctty): New function. (format_process_fd): New function. * fhandler_procnet.cc (fhandler_procnet::fill_filebuf): Don't use bufalloc. * fhandler_registry.cc (fhandler_registry::fill_filebuf): Define bufalloc locally. * fhandler_virtual.cc (fhandler_virtual::fhandler_virtual): Drop initialization of bufalloc. (fhandler_virtual::dup): Drop copying bufalloc.
* * Makefile.in (DLL_OFILES): Add fhandler_procnet.o.Corinna Vinschen2007-01-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | * autoload.cc (GetAdaptersAddresses): Define. * devices.h (FH_PROCNET): Define new device. * devices.in (dev_procnet_storage): Add "/proc/net" entry. * devices.cc: Regenerate. * dir.cc (readdir_worker): Use isproc_dev macro. * dtable.cc (build_fh_pc): Add FH_PROCNET. * fhandler.h (class fhandler_procnet): New class. * fhandler_proc.cc: Add "net" subdirectory handling. * fhandler_procnet.cc: New file handling "/proc/net" directory. * path.cc (isvirtual_dev): Move to path.h. * path.h (isproc_dev): New macro to identify /proc files by device. (isvirtual_dev): Moved here. Define using isproc_dev. * syscalls.cc (unlink): Use isproc_dev macro. * wincap.h (wincapc::has_gaa_prefixes): New element. (wincapc::has_gaa_on_link_prefix): New element. * wincap.cc: Implement above elements throughout. (wincapc::init): Check XP for service pack and set has_gaa_prefixes appropriately. * include/cygwin/in6.h: Include asm/byteorder.h.
* * devices.h: Add additional SCSI disk block device numbers perCorinna Vinschen2006-11-231-0/+114
| | | | | | | | | | http://www.kernel.org/pub/linux/docs/device-list/devices.txt up to 128 devices. * devices.in: Ditto. (device::parsedisk): Add additonal else-if cases for decoding base and drive indices. * devices.cc: Regenerate. * dtable.cc (build_fh_pc): Add additional DEV_SD{2..7}_MAJOR cases.
* * devices.h (_major): Revert previous ill-advised change.Christopher Faylor2005-12-021-2/+2
| | | | (_minor): Ditto.
* * devices.h (_minor): Coerce argument to proper type before manipulating.Christopher Faylor2005-12-011-2/+3
| | | | | | | | | | | | | | | | | | | | | (_major): Ditto. (device::is_fs_special): New function. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set the size to 0 for devices rather than reporting the size of the symlink. (fhandler_disk_file::readdir): Use is_fs_special to determine if .lnk should be stripped. * path.cc: Rename symlink_info::is_symlink to symlink_info::issymlink throughout. (symlink_info::isdevice): New field. (path_conv::check): Use 'isdevice' to determine if just-parsed entity is a device rather than relying on non-zero major/minor. (symlink_info::parse_device): Set isdevice to true if we've discovered a device. (symlink_info::check): Clear isdevice field prior to processing. Use isdevice to control debugging output. (symlink_info::set): Set isdevice to false. * path.h (path_conv::is_fs_special): New function. * devices.cc: Regenerate.
* * cygheap.h (cygheap_types): Add HEAP_COMMUNE.Christopher Faylor2005-08-241-0/+1
| | | | | | | | | | | | | | | | | | | | | * fhandler_proc.cc: Use cygheap rather than user heap for allocation of filebuf throughout. * fhandler_registry.cc: Ditto. * fhandler_virtual.cc: Ditto. * fhandler_process.cc: Ditto. (get_mem_values): Use malloc/realloc/free rather than new. * pinfo.cc (_pinfo::commune_send): Allocate on cygwin heap rather than user heap. Avoid calling ReadFile when correct number of characters have been read or suffer buffer corruption. (_pinfo::fd): Allocate on cygwin heap rather than user heap. (_pinfo::fds): Ditto. (_pinfo::root): Ditto. (_pinfo::cwd): Ditto. (_pinfo::cmdline): Ditto. * devices.h (FH_DEV): New define. * devices.in: Detect lone /dev. * devices.cc: Regenerate. * path.cc (path_conv::check): Treat FH_DEV as a special case.
* * fhandler.h (fhandler_cygdrive::seekdir): Delete declaration.Christopher Faylor2005-05-191-2/+0
| | | | | | | | | | (fhandler_cygdrive::seekdir): Delete. * fhandler.h (fhandler_cygdrive::iscygdrive_root): Delete method. (fhandler_cygdrive::telldir): Delete declaration. * fhandler_disk_file.cc: Remove all uses of fhandler_cygdrive::iscygdrive_root. (fhandler_disk_file::mkdir): New method. (fhandler_disk_file::rmdir): Ditto. (fhandler_cygdrive::telldir): Delete.
* * Makefile.in (DLL_OFILES): Add fhandler_mailslot.o.Corinna Vinschen2005-05-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * devices.h (FH_KMSG): Define new device. * devices.in: Add "/dev/kmsg" entry. * devices.cc: Regenerate. * dtable.cc (build_fh_pc): Handle case FH_KMSG. * fhandler.h (class fhandler_mailslot): New class. (class select_stuff): Add device_specific_mailslot pointer. * fhandler_mailslot.cc: New file. * select.cc (peek_mailslot): New function. (verify_mailslot): Ditto. (struct mailslotinf): New stuct to handle select on mailslots. (thread_mailslot): New function. (start_thread_mailslot): Ditto. (mailslot_cleanup): Ditto. (fhandler_mailslot::select_read): New method. * syslog.cc (klog_guard): New muto. (dev_kmsg): Local mailslot for kernel message device. (vklog): New function. (klog): Ditto. * winsup.h (vklog): Declare. (klog): Ditto. * include/sys/syslog.h: Define _PATH_KLOG.
* * Makefile.in (DLL_O_FILES): Add fhandler_netdrive.o.Christopher Faylor2005-05-061-0/+4
| | | | | | | | * fhandler_netdrive.cc: Placeholder file for future development. * devices.h (FH_NETDRIVE): Define new virtual device type. (netdrive_dev): Define. * devices.in (dev_netdrive_storage): Define. * devices.cc: Regenerate.
* * devices.h: Switch FH_ZERO and FH_PORT as on Linux. Add FH_FULL.Corinna Vinschen2005-02-231-2/+3
| | | | | | | | | | * devices.in: Add /dev/full. * devices.cc: Regenerate. * dtable.cc (build_fh_pc): Add FH_FULL. * fhandler.cc (fhandler_base::fstat): Set FH_FULL permission bits correctly. * fhandler_zero.cc (fhandler_dev_zero::write): Set errno to ENOSPC and return -1 if device is FH_FULL.
* copyrightChristopher Faylor2005-02-201-1/+1
|
* * cygthread.cc (cygthread::terminate_thread): Wait briefly for notificationChristopher Faylor2005-02-011-0/+1
| | | | | | | | | | | | | | event in the event that the thread was actually in the process of exiting. * pipe.cc (fhandler_pipe::dup): read_state is not supposed to be inheritable. Fix that. * path.cc (path_conv::check): Set symlen = 0 to avoid a compiler warning. * devices.h (devices::parsedisk): Declare new function. * devices.in (devices::parsedisk): Define new function. * dtable.cc (dtable::init_std_file_from_handle): Use device numbers rather than name. * fhandler_proc.cc (format_proc_partitions): Use parsedisk to generate disk names from numeric codes. (This was broken on two of my systems previously and is still broken now)
* * devices.cc (device::isfs): Return true for the logical case of devn == FH_FS.Christopher Faylor2004-12-301-1/+1
|
* Substitute 0x7fffffff and 0xffffffff by INT32_MAX and UINT32_MAXCorinna Vinschen2003-12-031-1/+1
| | | | throughout, except in assembler code.
* Eliminate use of sigframe and sigthread throughout.Christopher Faylor2003-11-281-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (DLL_OFILES): Add sigfe.o. Remove reliance on cygwin.def from cygwin0.dll dependency since dependence on sigfe.o implies that. Generate def file on the fly using 'gendef'. * configure.in: Don't auto-generate cygwin.def. * configure: Regenerate. * cygwin.din: Add SIGFE stuff where appropriate. * dcrt0.cc (dll_crt0_1): Initialize cygwin tls early in process startup. Set _main_tls to address of the main thread's cygwin tls. * debug.h: Remove now unneeded WFSO and WFMO declarations. * exceptions.cc (_last_thread): Define. (set_thread_state_for_signals): New function. (reset_thread_exception_for_signals): Ditto. (init_thread_for_signals): Ditto. (delete_thread_for_signals): Ditto. (capture_thread_for_signals): Ditto. (handle_exceptions): Set return address explicitly for exceptions prior to calling sig_send. (interrupt_on_return): Eliminate. (setup_handler): Add preliminary implementation for dealing with thread-specific signals by querying _main_tls. (signal_exit): Use cygthread::main_thread_id instead of mainthread.id. (call_signal_handler_now): For now, just handle the main thread. * fork.cc (vfork): Save and restore main _my_tls. * gendef: New file. Generates def file and sigfe.s file. * gentls_offsets: New file. Generates offsets for perl to use in sigfe.s. * how-signals-work.txt: Mention that info is obsolete. * init.cc (dll_entry): Initialize cygwin tls storage here. * miscfuncs.cc (low_priority_sleep): Make a C function for easier calling from asm. * perthread.h (vfork_save::tls): New element. * signal.cc (nanosleep): Replace previous use of sigframe.call_signal_handler_now with straight call to call_signal_handler_now. (abort): Ditto. * syscalls.cc (readv): Ditto. * termios.cc (tcsetattr): Ditto. * wait.cc (wait4): Ditto. * sigproc.cc (sig_dispatch_pending): Ditto. (sig_send): Ditto. * sigproc.h: Declare call_signal_handler_now. * thread.cc (pthread::thread_init_wrapper): Initialize cygwin tls. Remove obsolete and unworking signal stuff. * thread.h (verifyable_object::sigs): Eliminate. (verifyable_object::sigmask): Eliminate. (verifyable_object::sigtodo): Eliminate. (verifyable_object::exit): Make attribute noreturn. (verifyable_object::thread_init_wrapper): Ditto. (pthread_null::exit): Ditto. * winbase.h (__stackbase): Always define. * winsup.h (low_priority_sleep): Declare as a "C" function. * include/cygwin/version.h: Bump API version to reflect sigwait export. * include/sys/queue.h: Protect SLIST_ENTRY from previous declaration. * signal.cc (sigwait): Implement. * select.cc (fhandler_base::ready_for_read): Add debugging output. * devices.h: Define more device pointers via their storage. * devices.in: Don't parse things like /dev/inet/tcp, as they really have no meaning. * devices.cc: Regenerate. * gendevices: Set proper protection for output file. * cygtls.h: New file. * gendef: New file. * gentls_offsets: New file. * tlsoffsets.h: New file. Autogenerated. * config/i386/longjmp.c: Remove. File subsumed by gendef output. * config/i386/makefrag: Remove obsolete file. * fhandler.cc: Remove spurious access_worker declaration. * spawn.cc (spawnve): Make debugging output more accurate. * cygwin-gperf: Remove. * devices.cc: Remove.
* * Makefile.in: Add YA method for generating devices.cc.Christopher Faylor2003-10-011-29/+13
| | | | | | | | | | | | | | | | | | * child_info.h: YA update of another magic number. * gendevices: New file. * devices.in: New file. * devices.cc: Regenerate. * devices.shilka: Remove. * devices.h: Correctly define device pointers. (device): Remove now obsolete fields. (device::native): Renamed from device::fmt. * dtable.cc (build_fh_dev): Simplify in light of new unit parsing scheme. (build_fh_pc): Ditto. * path.cc (win32_device_name): Ditto. * fhandler.h (fhandler_base::get_native_name): Reflect renaming of fmt to native. * fhandler_tty.cc (fhandler_tty_mster::init): Initialize slave device prior to reporting unit.
* * devices.h (enum fh_devices): Remove DEV_RAWDRIVE_MAJOR andCorinna Vinschen2003-09-301-3/+0
| | | | | | | | | FH_RAWDRIVE. * devices.shilka (dev_rawdrive_storage): Remove. (unit_devices): Remove pointer to dev_rawdrive_storage. (uniq_devices): Remove rawdrive entry. * dtable.cc (build_fh_pc): Remove DEV_RAWDRIVE_MAJOR case. * path.cc (win32_device_name): ditto.
* * sigproc.cc (proc_subproc): Restrict permissions on ppid_handle.Christopher Faylor2003-09-281-1/+1
| | | | | | | | * devices.shilka (device::parse): Restore check for tty in unit handling, but without the previous typo. * devices.cc: Regenerate. * devices.h (DEV_CYGDRIVE_MAJOR): Change major number to one used by linux for "user-mode virtual block device".
* * devices.h: Move a few device major numbers. Fix typo of FH_UDP.Corinna Vinschen2003-09-281-5/+5
| | | | | | | | | * device.shilka: Remove /dev/hd device entries, rename all device_hd* to device_sd*. (device::parse): Disallow units outside lower and upper bounds. * dtable.cc (build_fh_pc): Fix typo of FH_UDP. * path.cc (win32_device_name): Fix win32 name creation to match new device handling.
* * devices.cc: New file.Christopher Faylor2003-09-251-75/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * include/cygwin/in.h (sockaddr_in): Fix typo.Christopher Faylor2003-02-131-0/+90
|
* remove errnoneously added filesChristopher Faylor2003-01-161-129/+0
|
* merge from trunkChristopher Faylor2003-01-161-0/+129
|
* remove from trunkChristopher Faylor2002-12-281-122/+0
|
* * Makefile.in: Add devices.gperf.Christopher Faylor2002-12-281-0/+122
* devices.h: New file. * devices.gperf: Ditto.