Commit Graph

87 Commits

Author SHA1 Message Date
Corinna Vinschen 88429768bb * strace.cc (strace::vprntf): Move prntf functionality to this function
adding an va_list interface to strace.
        (strace::printf): Calls strace::vprntf now.
        (strace_printf): New function providing an extern "C" interface to
        trace output.
        * include/sys/strace.h: Make plain C clean.
        (class strace): Add `vprntf' method.
2001-02-26 09:50:24 +00:00
Christopher Faylor f97e7d754c * cygwin.din: Export rand48 functions.
* thread.cc (MTinterface::Init): Remove the initialization of `reent_data'.
* dcrt0.cc: Add the initalizer to the declaration of `reent_data'.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 35.
2001-02-20 02:53:55 +00:00
Corinna Vinschen 9182099c10 * autoload.cc: Add LoadDLLinitfunc for iphlpapi.dll.
Add LoadDLLfuncEx statements for GetIfTable@12 and GetIpAddrTable@12.
        * fhandler_socket.cc (fhandler_socket::ioctl): Move variable
        definitions to the beginning of the function to allow better debugging.
        Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU.
        * net.cc: Include iphlpapi.h.
        (get_2k_ifconf): Rewritten. Uses IP Helper API now.
        (get_nt_ifconf): Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC
        and SIOCGIFMTU.
        (get_95_ifconf): Ditto. Renamed from `get_9x_ifconf'.
        (get_ifconf): Name loopback `lo' instead of `lo0' as in Linux.
        Add handling for SIOCGIFHWADDR, SIOCGIFMETRIC and SIOCGIFMTU.
        Call `get_95_ifconf' only on Windows 95, `get_nt_ifconf' only
        on Windows NT < Service Pack 3, `get_2k_ifconf otherwise.
        * include/asm/socket.h: Add defines for SIOCGIFHWADDR, SIOCGIFMETRIC
        and SIOCGIFMTU.
        * include/cygwin/if.h: Add `ifr_hwaddr', `ifr_metric' and `ifr_mtu'.
        (struct ifreq): Add `ifru_hwaddr'.
2001-02-07 22:50:50 +00:00
Corinna Vinschen 8344351113 * include/sys/resource.h: Fix typo. 2001-01-31 12:24:24 +00:00
Corinna Vinschen 44e6d951c7 * include/sys/resources.h: Add RLIMIT_NLIMITS and RLIM_NLIMITS. 2001-01-31 12:21:23 +00:00
Christopher Faylor 4f42df7bc4 * include/cygwin/version.h: Bump version to 1.3.0. 2001-01-30 23:19:19 +00:00
Christopher Faylor ae6c8e4fc2 * include/cygwin/version.h: Bump API version. 2001-01-28 06:26:50 +00:00
Christopher Faylor c65a318355 * include/cygwin/version.h: Bump API to reflect setlogmask. 2001-01-22 20:29:24 +00:00
Corinna Vinschen 55ae1dff87 Patch suggested by Ren� M�ller Fonseca <fonseca@mip.sdu.dk>
* include/sys/socket.h: Change prototype to have 2nd parameter `const'.
        * net.cc (cygwin_bind): Change 2nd parameter to `const'.
2001-01-09 16:00:58 +00:00
Christopher Faylor 077ec4cb37 * pinfo.cc (codepage_init): Move function.
* environ.cc (codepage_init): To here.
* exceptoins.cc (SIG_NONMASKABLE): Remove SIGCONT from consideration since it
is supposed to be maskable.
* signal.cc (sigaction): Ditto.
* sigproc.cc (wait_sig): Ditto.
* winsup.h: Eliminate global declaration of codepage_init.
2001-01-08 04:02:02 +00:00
Christopher Faylor 1bdc5f1fab Wed Jan 3 09:20:20 2001 Jason Tishler <jt@dothill.com>
* include/cygwin/version.h: Fix typo in CYGWIN_VERSION_DLL_COMBINED
	macro.
2001-01-03 14:44:13 +00:00
Corinna Vinschen 8a93913d26 * cygwin.din: Add symbols for `getrlimit' and `setrlimit'.
* exceptions.cc (stackdump): Avoid creating stackdump when
        `rlim_core' is 0.
        * resource.cc: New global variable `rlim_core'.
        (getrlimit): New function.
        (setrlimit): Ditto.
        include/cygwin/version.h: Bump minor API version to 32 due to
        adding `getrlimit' and `setrlimit'.
        include/sys/resource.h: Add defines, types and prototypes for
        `getrlimit' and `setrlimit'.
2000-12-27 00:13:57 +00:00
Christopher Faylor 48c4679d55 * include/cygwin/version.h: Bump DLL minor version number to 8. 2000-12-25 18:37:44 +00:00
Corinna Vinschen 947411367d * net.cc (cygwin_rexec): Eliminate superfluous call to
`set_socket_inheritance'.
        * include/sys/socket.h: Add SUS defines for option values to `shutdown'.
2000-12-11 19:45:54 +00:00
Christopher Faylor 67bd6fb222 * include/sysexits: New file. 2000-12-10 22:19:50 +00:00
Corinna Vinschen 81e615de98 * winsup/cygwin/include/sys/uio.h: readv: Correct prototype
writev: ditto.
2000-12-06 22:42:26 +00:00
Corinna Vinschen fdb352765e * include/sys/uio.h: Include <sys/cdefs.h>. Use __BEGIN_DECL and
__END_DECL.
        Add declarations for `readv' and `writev'.
2000-12-05 16:08:48 +00:00
Christopher Faylor e0cdea91fe * include/cygwin/version.h: Bump DLL minor version number to 7. 2000-11-26 19:46:17 +00:00
Corinna Vinschen 2e68f6b47e * include/cygwin/version.h: Bump minor API version due to adding
inet_aton.
2000-11-25 10:29:49 +00:00
Christopher Faylor 099efae038 * spawn.cc (spawn_guts): YA tweak for dealing with arcane rules of quoting in
"normal" Microsoft programs.
* child_info.h: Bump fork magic number.
* include/sys/mount.h: Add an entry for mixed mode.
2000-11-20 19:35:45 +00:00
Christopher Faylor 466ebd61d3 remove include/rapi.h 2000-11-09 18:07:16 +00:00
Christopher Faylor 9bc846bd3d * environ.cc (_addenv): malloc space for setenv if cygwin1.dll is used in
conjunction with older binaries.
(environ_init): Ditto.
* external.cc (get_cygdrive_info): New function.
* external.cc (get_cygdrive_prefixes): Change to use get_cygdrive_info but toss
the user and system flags.
* external.cc (cygwin_internal): Add new CW_GET_CYGDRIVE_INFO case.
* path.cc (mount_info::get_cygdrive_prefixes): Remove method.
* path.cc (mount_info::get_cygdrive_info): New method.  Actually,
get_cygdrive_info is really an enhanced version of get_cygdrive_prefixes
renamed to get_cygdrive_info that also gets the user and system flags.
* shared_info.h (get_cygdrive_prefixes): Remove method.
* shared_info.h (get_cygdrive_info): New method.
* include/cygwin/version.h: Bump minor API version due to adding
CW_GET_CYGDRIVE_INFO to cygwin_internal.
* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_CYGDRIVE_INFO.
2000-11-08 20:36:37 +00:00
Christopher Faylor 442a3c7821 Update copyright. 2000-11-07 02:21:33 +00:00
Christopher Faylor a98b1584c2 * path.cc (mount_info::read_cygdrive_info_from_registry): Use
CYGWIN_INFO_CYGDRIVE_PREFIX, CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX, and
CYGWIN_INFO_CYGDRIVE_FLAGS.
* path.cc (mount_info::write_cygdrive_info_to_registry): Use
CYGWIN_INFO_CYGDRIVE_PREFIX and CYGWIN_INFO_CYGDRIVE_FLAGS.
* path.cc (mount_info::remove_cygdrive_info_from_registry): Ditto.
* path.cc (mount_info::get_cygdrive_prefixes): Use CYGWIN_INFO_CYGDRIVE_PREFIX.
* include/cygwin/version.h: Add CYGWIN_INFO_CYGDRIVE_FLAGS,
CYGWIN_INFO_CYGDRIVE_PREFIX, and CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX.
2000-11-06 16:40:29 +00:00
Christopher Faylor bb5d559a73 * pinfo.cc (pinfo::init): Reverse order of setting status and pid info in an
execed process to avoid a race.
* sigproc.cc (wait_subproc): Print more info when a WFSO error occurs.
* automode.c: New file.
* syscalls.cc (close_all_files): Streamline slightly.
* cygheap.cc (ccalloc): Clear *entire* allocated array.
2000-11-03 04:27:03 +00:00
Christopher Faylor f745abc7a0 * include/cygwin/version.h: Bump DLL minor version number to 6. 2000-10-30 01:53:02 +00:00
Christopher Faylor 75a57bf04a Whitespace cleanup.
* configure.in: Eliminate subdir stuff.
* configure: Regenerate.
* include/getopt.h (option): Make name field 'const'.
2000-10-28 05:41:44 +00:00
Christopher Faylor 4c45a89744 * exceptions.cc (signal_exit): Kill any executing child process if we're dying.
* path.h: Remove unneeded extern.
* spawn.cc (std_suffixes): Make static.  Don't set dwProcessId here since it
makes the process unsignalable.  Set strace flag that this is an execed process
stub.
* strace.cc (strace::vsprntf): Use strace flag to indicate when to visually
flag that this is an exec stub.
* include/sys/strace.h (strace): Add 'execing' flag.
2000-10-24 02:25:27 +00:00
Christopher Faylor 166b2571ce * Makefile.in: Remove some obsolete stuff.
* dcrt0.cc (dll_crt0_1): Call signal_fixup_after_exec where appropriate.  Set
myself->uid from parent version.  Just use ThreadItem Init method.  Close or
store hexec_proc as appropriate.
(_dll_crt0): Store user_data->forkee here so that proper tests can be made
subsequently.
(do_exit): Remove hExeced stuff.
* environ.cc (environ_init): Accept environ count as well as environ pointer.
* environ.h: Reflect above change.
* pinfo.cc (pinfo_init): Ditto.  Accept environ count.
(fixup_in_spawned_child): Remove.
* spawn.cc (spawn_guts): Move signal code to dll_crt0_1.  Don't suspend execing
process since it is no longer necessary.  Store envc.
* exceptions.cc (signal_fixup_after_exec): New function.
(call_handler): Remove hExeced test.
* child_info.h (cygheap_exec_info): Store envc as well as envp.
(child_info_spawn): Store hexec_proc so that it can be closed in child.
* path.cc (normalize_posix_path): Avoid intermediate use of temporary cwd buf.
(normalize_win32_path): Ditto.
(cwdstuff::get_initial): Always set lock.
* sigproc.h: Remove hExeced.
* strace.cc (strace::vsprntf): Modify to accomodate for lack of hExeced.
* thread.cc (MTinterface::Init): Merge Init1 and ClearReent into this method.
(MTinterface::Init1): Eliminate.
(MTinterface::ClearReent): Eliminate.
* thread.h: Reflect above changes.
* include/sys/strace.h (strace): Make microseconds() public.  Make various
functions 'regparm', throughout.
* pinfo.h (_pinfo): Inline simple signal manipulation functions.  Requires
inclusion of thread.h which was removed from .cc files, where appropriate.
throughout.
* pinfo.cc: Eliminate signal manipulation functions.
(_pinfo::exit): Calculate total rusage for exiting process here.
* cygheap.cc (size2bucket): Eliminate.
(init_buckets): Ditto.
(_cmalloc): Calculate size and bits in a loop rather than going through a
function call.
(_crealloc): Use stored array index to calculate allocated size.
* spawn.cc (spawn_guts): Use _pinfo exit method to exit, calculating cpu usage.
2000-10-16 23:55:58 +00:00
Christopher Faylor 1dc16fc74b * exceptions.cc (set_console_handler): Don't allocate
console_handler_thread_waiter.  It is obsolete.
(ctrl_c_handler): Don't use console_handler_thread_waiter.
* path.cc (hash_path_name): Fix handling of relative names.  Make case
insensitive.
* path.h (suffix_info): Use initializers.
* pinfo.h (_pinfo): Avoid initializers for null case.
* resource.cc (fill_rusage): Zero rest of rusage structure.
* security.cc (set_process_privileges): Don't reopen parent process.  Just use
hMainProc.
* signal.cc (signal): Track when a signal handler has been used.
(sigaction): Ditto.
* sigproc.cc (pchildren): Use default initializer.
(zombies): Ditto.
(sigproc_terminate): Avoid closing handles that will be closed on exit anyway.
(wait_sig): Send signal to "parent" on EXECing, not FORKing.
(wait_subproc): Send SIGCHLD here rather than in proc_wait to avoid potential
muto conflicts.
* sigproc.h (sigthread): Don't initialize to zero.  It's the default.
* spawn.cc (spawn_guts): Fill in resources from exec parent prior to
termination.
* sync.h (muto): Don't initialize to zero.
* syscalls.cc (close_all_files): Use one lock around entire loop and call
fhandler close/release stuff directly.
(_read): Don't use ready_for_read if there are not signal handlers active.
* dcrt0.cc (dll_crt0_1): Fix display of "title".
(do_exit): Use pinfo exit method to exit.
(__api_fatal): Ditto.
* exceptions.cc (signal_exit): Ditto.
* fork.cc (fork_child): Remove debugging stuff.  Use pinfo_fixup_after fork in
place of exec_fixup_after_fork.
* pinfo.cc (pinfo_fixup_after_fork): New method.
(pinfo_fixup_in_spawned_child): Ditto.
(_pinfo::exit): New method.
(_pinfo::init): Remove recursion.  Detect pathological case where pinfo
structure already exists for new pid.
* pinfo.h (_pinfo): Reorganize slightly.  Add new method and new function
declarations.
* sigproc.cc (proc_exists): Previous simplification was a little to simple.
Try harder to detect if a process exists.
(proc_terminate): Use PID_EXITED setting to determine if process is still
around.
(WFSO): Remove debugging statement.
(WFMO): Ditto.
* spawn.cc (exec_fixup_after_fork): Eliminate.
(spawn_guts): Always set old_title to NULL.  Is it really needed?  Move
hexec_proc to pinfo.cc.  Call pinfo_fixup_in_spawned_child to eliminate handle
link after a spawn.
* include/sys/cygwin.h: Remove PID_NOT_IN_USE.  Add PID_EXITED.
2000-10-15 01:37:07 +00:00
Corinna Vinschen 7d9688b793 * cygwin.din: Add symbol hstrerror.
* net.cc: Change meaning of member `s' of struct host_errmap.
        (set_host_errno): Fix error in loop condition.
        (hstrerror): Ditto.
        (herror): Add appropriate functionality.
        * include/netdb.h: Add declaration of hstrerror.
        * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 29.
2000-10-14 08:55:44 +00:00
Christopher Faylor cbe4c8e234 Add comment. 2000-10-14 01:03:01 +00:00
Christopher Faylor 1daf97f97e * include/netinet/tcp.h: Remove winsock.h include.
* include/sys/cygwin.h: Move windows specific reference within conditional.
2000-10-05 03:12:36 +00:00
Corinna Vinschen 95436d7cdb * include/sys/mman.h: Add missing MAP_FAILED macro. 2000-10-04 23:17:01 +00:00
Christopher Faylor f7925ed552 Dummy file to accomodate programs which include
it unconditionally.
2000-09-06 02:21:44 +00:00
Christopher Faylor 3c2c374555 * dcrt0.cc (dll_crt0_1): Move set_os_type.
(_dll_crt0): To here.
(cygwin_dll_init): And here.
* external.cc (fillout_pinfo): Use more foolproof method for scanning for pids.
* pinfo.cc (set_myself): Eliminate myself_identity.init.
* sigproc.cc (wait_sig): Do it here instead to reduce the amount of time where
there could potentially be two processes with the same pid.
* spawn.cc (spawn_guts): Eliminate duplicate initialization.
* include/sys/cygwin.h: Mark unused PID_* elements.
2000-08-26 01:36:20 +00:00
Christopher Faylor 239b06b864 * external.cc (cygwin_internal): Add CW_INIT_EXCEPTIONS to allow cygwin
exception handling on threads not created by cygwin.
* sigproc.cc (proc_terminate): Don't release pinfo structs since we are
exiting.
* include/sys/cygwin.h: Add CW_INIT_EXCEPTIONS.
2000-08-25 02:27:42 +00:00
Christopher Faylor 78b8497ba3 * include/cygwin/core_dump.h: New file, contains structures used in cygwin core
core files.
* include/sys/procfs.h: New file, needed to autoconfigure cygwin core dumps
support in bfd.
2000-08-24 18:39:27 +00:00
Christopher Faylor 123469a0e9 * include/sys/cygwin.h (strace_printf_wrap): Force printing when
_STRACE_SYSTEM.
(strace_printf_wrap1): Ditto.
2000-08-24 17:23:35 +00:00
Christopher Faylor c19e7ba723 * include/sys/cygwin.h: Protect class definitions. 2000-08-23 14:53:25 +00:00
Christopher Faylor d6483e830f * include/sys/cygwin.h: Declare some thread classes.
* include/mntent.h: Avoid declaring functions.
2000-08-22 15:12:29 +00:00
Christopher Faylor 6b85369f82 Update copyright. 2000-08-21 18:27:38 +00:00
DJ Delorie d3bff3131f * include/cygwin/cygwin_dll.h (DECLARE_CYGWIN_DLL): hinstance,
not handle. (reverse of previous diff)
2000-08-21 18:15:50 +00:00
DJ Delorie 20ffb3ee16 * include/cygwin/cygwin_dll.h (DECLARE_CYGWIN_DLL): handle,
not hinstance.
2000-08-21 17:47:52 +00:00
Corinna Vinschen e82d75cc2b * poll.cc: Add bounds checking for file descriptors. Return POLLNVAL
if fd is invalid. Return POLLERR for each valid fd if cygwin_select
        returned with error.
        include/sys/poll.h: Change POLLERR comment according to above change.
2000-08-11 12:51:47 +00:00
Christopher Faylor 709262970f * include/cygwin/cygwin_dll.h: Remove extraneous (and incorrect) declarations. 2000-08-07 04:13:34 +00:00
Christopher Faylor 20d7f75837 * strace.cc (strace::prntf): Make second argument the function name, rather
than use special format options.
(strace::vprntf): Ditto.
(getfunc): New function.
* include/sys/strace.h: Reflect above changes.
* smallprint.c (__small_vsprintf): Eliminate '%F' formatting.
* pinfo.cc (set_myself): Modify for new strace::prntf parameter.
* errno.cc (seterrno_from_win_error): Ditto.
* fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto.
* fhandler_tty.cc (fhandler_tty_common::__release_output_mutex): Ditto.
2000-08-02 19:26:01 +00:00
Christopher Faylor ad8dea13f0 * include/sys/strace.h: Fix strace definition. 2000-08-02 15:24:45 +00:00
Christopher Faylor a5a965ff62 * strace.h: Add kludgy workarounds to avoid using deprecated methods for
variable argument macros when possible.
* sigproc.cc: Throughout, use sigproc_printf rather than sip_printf.
* strace.cc (strace::prntf): Remove 'active' check, since callers are supposed
to ensure this.
(__system_printf): Remove.  Subsumed by strace::prntf.
* winsup.h: Define "NEW_MACRO_VARARGS" to indicate when to use new macro
varargs capability.
2000-08-02 03:42:31 +00:00
Christopher Faylor 84c7d40932 * include/cygwin/version.h: Bump DLL minor version number to 5 due to all of
the changes below.  Redefine process structure to avoid a fixed size table.
Redefine pinfo/_pinfo classes.  Use these throughout.
* dcrt0.cc (dll_crt0_1): Accomodate set_myself argument change.
(__api_fatal): Accomodate _pinfo::record_death argument change.
* exceptions.cc (really_exit): Ditto.
(sig_handle_tty_stop): Use pinfo constructor to access process info.
(events_init): Don't create pinfo_mutex since it is no longer required.
* external.cc (fillout_pinfo): Use winpids class to iterate over all system
pids.
(cygwin_internal): lock_pinfo_for_update and unlock_pinfo are now noops.
* fhandler_termios.cc (fhandler_termios::set_ctty): Use pinfo constructor to
access process info.
* fork.cc (fork): Reorganize to initialize child info after the child has
started since that is when we know the child's winpid, which is necessary to
allocate the pinfo shared memory.
* mmap.cc (recreate_mmaps_after_fork): Change arg type to _pinfo.
* pinfo.cc: Rename pinfo methods to _pinfo throughout.  Eliminate pinfo_list
stuff.
(set_myself): Accept a pid argument now.  Call pinfo initializer to initialize
myself.  Detect when this is an "execed" process and create an "indirect" pid
block.
(pinfo_init): Accomodate set_myself arg change.
(procinfo): Remove.
(pinfo::lock_pinfo): Remove.
(pinfo::unlock_pinfo): Remove.
(pinfo::init): New method.  Allocates shared memory space for process pinfo
structure.
(pinfo::record_death): Don't call locking functions.
(cygwin_winpid_to_pid): Simplify by using new pinfo constructor.
(EnumProcessesW95): New function for iterating over processes on Windows 95.
(winpids::winpids): New constructor for winpids class.  Sets up a list of
process ids.
(enum_init): Initialize w95/wnt pid enumerators.
* shared.cc (shared-info::initialize): Remove pid initialization.
* shared.h: Move pinfo stuff into pinfo.h.
(class shared_info): Remove pinfo_list element.
* signal.cc (kill_worker): Use pinfo constructor to access process info.
(kill_pgrp): Ditto.  Use winpids methods to access list of processes.
* sigproc.cc: Throughout, modify to use _pinfo where appropriate.
(proc_exists (pid_t)): New function.  Determines if a process exists based on
the pid.
(proc_exists (_pinfo *p): Use new proc_exists function above.
(proc_subproc): Copy pinfo stuff around rather than _pinfo pointers.  Try to be
careful about releasing shared memory when we don't need it anymore.  Remove
pinfo locks.
(remove_zombies): Remove pinfo memory when zombie is going away.
* sigproc.h: Reflect _pinfo/pinfo changes in sigproc.cc.
* spawn.cc (spawn_guts): Eliminate pinfo *child argument.  Reorganize to only
initialize child pinfo after process has been started and we know the windows
pid.
(_spawnve): Reflect spawn_guts changes.
* syscalls.cc (setpgid): Use pinfo constructor to access process info.
(getpgid): Ditto.
(internal_getlogin): Use _pinfo.
* winsup.h: Eliminate pinfo_mutex.  Eliminate spawn_guts declaration since it
is static now.  Reflect set_myself argument change.
* include/sys/cygwin.h: Add some PID_* enums to accomodate new pinfo stuff.
* include/cygwin/version.h: Update minor version for cygdrive changes below.
2000-07-29 16:24:59 +00:00