Commit Graph

3839 Commits

Author SHA1 Message Date
Corinna Vinschen 494139ffe3 * net.cc (cygwin_setsockopt): Ignore errors when setting IP_TOS on
Windows 2000 and above. Clarify the comment about IP_TOS and move
	to the place where the magic happens.
	(get_ifconf): Remove unused code.
	* wincap.h (wincaps::has_disabled_user_tos_setting): New element.
	* wincap.cc: Implement above element throughout.
2006-01-13 10:18:31 +00:00
Corinna Vinschen 0ae86d187c * Update copyrights. 2006-01-12 15:53:51 +00:00
Christopher Faylor 9287bcd534 * fhandler_console.cc (set_console_state_for_spawn): Fix to recognize ttys >=
0.
2006-01-12 05:17:12 +00:00
Christopher Faylor 750874d33d * fhandler.h (set_console_state_for_spawn): Whackamole the argument back to a
bool.
* spawn.cc (spawn_guts): Ditto, i.e., once again call
set_console_state_for_spawn with an indication of whether we're about to start
a cygwin process.
* fhandler_console.cc (set_console_state_for_spawn): Don't set the console
state if we know we're starting a cygwin process or if we're using a "real"
tty.
2006-01-12 05:03:15 +00:00
Christopher Faylor 9156ef9120 copyright 2006-01-12 04:52:51 +00:00
Christopher Faylor 904305952b copyright 2006-01-12 04:41:06 +00:00
Corinna Vinschen b773a592d3 * dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
* init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker.
	Call wincap.init here before doing anything else.  Use wincap.is_wow64
	to determine if we're running in a WOW64 emulator.
	* mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's
	apparently not supported.
	(mmap64): Don't create mappings beyond EOF, which would need to use
	AT_ROUND_TO_PAGE, on WOW64.
	* wincap.cc (wincap): Throw into the .cygwin_dll_common section.
	(wincapc::init): Determine if running in WOW64 and set wow_64 flag.
	* wincap.h (class wincapc): Add wow64 member.
	(wincapc::is_wow64): New method.
2006-01-10 18:11:32 +00:00
Christopher Faylor 23de77b72b * fhandler_proc.cc (format_proc_cpuinfo): Avoid leading whitespace in model
name.
2006-01-10 16:49:28 +00:00
Christopher Faylor 4c8650efd8 . 2006-01-10 14:49:20 +00:00
Christopher Faylor 5da5f949d8 * spawn.cc (spawn_guts): Reorganize slightly so that 16 bit check is done prior
to check for command.com/cmd.com.  Don't bother setting CREATE_SUSPENDED flag
for a MS-DOS process since it doesn't work anyway.  Avoid calling remember()
when the child process has already exited.
(av::fixup): Explicitly set cygexec flag to falseon a 16 bit process.
2006-01-10 02:39:22 +00:00
Corinna Vinschen 104fffd24d * include/getopt.h (getopt_long_only): Declare. 2006-01-09 12:41:54 +00:00
Corinna Vinschen 6c5da6783c * cygwin.din: Export getsubopt.
* include/cygwin/version.h: Bump API minor version.
2006-01-09 12:37:08 +00:00
Christopher Faylor 0b7094d95d * fhandler_tty.cc (fhandler_tty_slave::dup): Don't assign a controlling
terminal to a process when duped.  Linux doesn't do this, so we won't either.
2006-01-08 21:34:00 +00:00
Christopher Faylor 3e45d281b3 * environ.cc (spenvs[]): windir -> WINDIR. 2006-01-08 20:10:51 +00:00
Christopher Faylor b5c8e33120 * fhandler_console.cc (fhandler_console::need_invisible): Remove duplicate
test.
2006-01-07 18:00:19 +00:00
Christopher Faylor 85c804ec4b * fhandler.h (set_console_state_for_spawn): Eliminate argument from
declaration.
* fhandler.cc (set_console_state_for_spawn): Eliminate argument from
definition.  Always check for invisible console.
(fhandler_console::need_invisible): Don't do anything if the windows station is
already not visible.
* spawn.cc (spawn_guts): Accommodate change of argument to
set_console_state_for_spawn.
2006-01-07 17:57:26 +00:00
Christopher Faylor 1b00002744 * sigproc.cc (no_signals_available): Use existence of signal thread handle to
figure out if we can actually send signals rather than relying on my_sendsig.
(hwait_sig): Make static.
(sigproc_init): Don't set my_sendsig to anything special.  Use new global
static hwait_sig.
(wait_sig): Set hwait_sig to NULL when we are exiting.
2006-01-05 22:38:51 +00:00
Christopher Faylor b39b8c14fa * include/getopt.h: Accommodate recent unfortunate newlib changes. 2006-01-05 17:35:14 +00:00
Christopher Faylor 4cf4fd4d1c (fix ChangeLog and check in remaining files)
* sigproc.cc (sigproc_init): Move clearing of sync_startup here to lessen the
likelihood of trying to deal with non-cygwin threads in dll_entry.
* fhandler_console: Fix set_console_state_for_spawn comment.
2006-01-05 16:26:22 +00:00
Christopher Faylor 32f0697595 * cygtls.cc (_cygtls::remove): Don't output debugging info if this isn't a
cygwin thread.
2006-01-05 16:23:19 +00:00
Christopher Faylor c29df6c375 * spawn.cc (spawn_guts): Invert the argument to set_console_state_for_spawn. 2006-01-05 16:21:14 +00:00
Christopher Faylor 4c3faa85ce * fhandler_console.cc (fhandler_console::need_invisible): Only try to open
"CygwinInvisible" windows station if opening of default station fails.  Use
CloseWindowStation to close window station handle.
2006-01-05 03:58:19 +00:00
Christopher Faylor faec62caaf * fhandler_console.cc (fhandler_console::need_invisible): Open up the security
of the newly created windows station.
2006-01-05 00:49:17 +00:00
Christopher Faylor 01b7635538 * path.cc (dot_special_chars): Add ", <, >, and |. 2006-01-04 16:20:30 +00:00
Christopher Faylor d58ca0b320 * fhandler_console.cc (beep): Use MB_OK which is documented as using the
default bell rather than -1 which seems to behave differently on different
versions of Windows.
2006-01-04 04:47:19 +00:00
Christopher Faylor 4c15746236 * fhandler_process.cc (fhandler_process::readdir): Add missing argument to
syscall_printf.
* fhandler_console.cc (fhandler_console::need_invisible): Use made-up name for
windows station rather than asking Windows to create one for us.
* spawn.cc (spawn_guts): Don't mess with console if we're detaching.
2006-01-04 03:43:55 +00:00
Christopher Faylor adcff8d159 * dir.cc (readdir_worker): Minor code cleanup.
* fhandler_console.cc (beep): Use a more Windows-generic wav file if the beep
is missing.  Use a more foolproof way to find out whether we should be
recreating the missing key.
* registry.h (reg_key::_disposition): New field.
(reg_key::created): New function.
* registry.cc (reg_key::reg_key): Set _disposition to zero by default.
(reg_key::build_key): Fill in _disposition field.
2006-01-03 17:44:26 +00:00
Christopher Faylor 825d0b9385 * dir.cc (readdir_worker): Ensure that saw_dot flags are updated when not
handling inodes.
2006-01-03 15:42:56 +00:00
Christopher Faylor e76625eadb * fhandler_console.cc (beep): New function. Restores missing "Default Beep",
if necessary.
(fhandler_console::write_normal): Use beep().
2006-01-03 01:15:29 +00:00
Christopher Faylor 29b35f7a84 * dcrt0.cc (_dll_crt0): Move more leftover debugging stuff.
(cygwin_dll_init): Remove unneeded initializations.  Call _dll_crt0 rather than
dll_crt0_1.
* dcrt0.cc (_dll_crt0): Move more leftover debugging stuff.
(cygwin_dll_init): Remove unneeded initializations.  Call _dll_crt0 rather than
dll_crt0_1.
2006-01-02 15:48:29 +00:00
Corinna Vinschen 8584a9df5f * syslog.cc: Include sys/un.h instead of sys/socket.h.
(syslogd_inited): Convert to enum type noting the exact result of
	trying to connect to syslog daemon.  Use this way throughout.
	(connect_syslogd): New static function taking over the task to
	connect to syslog socket.  Use correct struct sockaddr_un instead of
	struct sockaddr.
	(try_connect_syslogd): Call connect_syslogd.  If write fails on
	connection oriented socket, try to reconnect to syslog socket and
	try to write again.
2006-01-02 13:05:57 +00:00
Corinna Vinschen d05c10aecd Bump copyright dates. 2006-01-02 13:01:42 +00:00
Christopher Faylor 3bfd1c5e8c * pinfo.cc (pinfo::exit): Swap signal and normal exit value when not started
from a cygwin process - just like the good-old-days of B20.
2006-01-02 03:14:56 +00:00
Christopher Faylor 68f62c98f9 add copyright 2006-01-02 02:57:54 +00:00
Christopher Faylor d0d1b89700 add missing ChangeLog entry 2006-01-02 02:55:50 +00:00
Christopher Faylor 7a32aefe79 * cygtls.cc (_cygtls::remove): Remove left over debugging cruft which caused
this function to always return prematurely.
2006-01-02 02:55:14 +00:00
Christopher Faylor 4eab146fc7 * exceptions.cc (sigpacket::process): Pass actual reference to signal's
sigaction structure to setup_handler.
2006-01-01 17:15:01 +00:00
Christopher Faylor a14d65557a * exceptions.cc (_cygtls::interrupt_setup): Implement SA_RESETHAND.
* include/cygwin/signal.h: Define SA_ONESHOT and SA_NOMASK.
* dcrt0.cc (get_cygwin_startup_info): Remove commented out code.
2006-01-01 16:51:29 +00:00
Corinna Vinschen a89b700926 * syslog.cc (vklog): Never log kernel messages using the vsyslog
interface.
2006-01-01 16:17:55 +00:00
Corinna Vinschen cceba5593d * syslog.cc (vsyslog): Decrement len if trailing \n has been removed.
Add \n when writing to stderr if LOG_PERROR option is set.
2005-12-31 14:16:49 +00:00
Corinna Vinschen 1b68dd91cf * include/cygwin/in.h: Drop including stdint.h. Move definition
of in_port_t and in_addr_t to top of file and use throughout. Use
	sa_family_t type where appropriate.
	(struct in6_addr): Change `unsigned char' to `uint8_t'.
	(struct sockaddr_in6): Add sin6_scope_id member. Add comments.
	* include/cygwin/socket.h: Include stdint.h.  Move definition of
	socklen_t to top of file.  Define sa_family_t.  Define struct
	sockaddr_storage as per SUSv3.
	* include/sys/un.h: Include cygwin/socket.h.  Use sa_family_t type.
2005-12-31 13:07:43 +00:00
Christopher Faylor b0cc168954 * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Use strace
method rather than accessing field directly.
(fhandler_tty_common::__release_output_mutex): Ditto.
2005-12-29 21:10:50 +00:00
Christopher Faylor 5d97040501 *** cygwin DLL Changes:
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
(child_info::dwProcessId): Delete.
(child_info::straced): New variable.
(child_info::handle_fork): New member function.
* dcrt0.cc (in_forkee): New global variable.
(__cygwin_user_data::forkee): Mark as obsolete.
(do_global_ctors): Use in_forkee rather than user_data->forkee.
(get_cygwin_startup_info): Ditto.  Deal with new straced field to allow strace
to deal with children of attached processes.
(initial_env): Accommodate changes to strace::hello.
(child_info_fork::handle_fork): Rename from plain old 'handle_fork'.  Move
alloc_stack() call elsewhere.
(dll_crt0_0): Fill out more of user_data.  Reference handle_fork via fork_info.
Add some debugging output.
(_dll_crt0): Don't wait for sync thread if sync_startup is invalid.  Zero
sync_startup here.  Call alloc_stack() here, if appropriate.
(dll_crt0_1): Use in_forkee rather than user_data->forkee.
(dll_crt0): Ditto.
* malloc_wrapper.cc (malloc_init): Ditto.
* dll_init.cc (in_forkee): Remove local static version of this variable.
(dll_list::load_after_fork): Don't set in_forkee here.
* external.cc (cygwin_internal): Use strace method rather than accessing field
directly.
* fhandler.cc (fhandler_base::read): Ditto.
* fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Ditto.
* fork.cc (frok::parent): Invoke strace write_childpid to communicate with
potential strace.
(child_copy): Add more detail to debugging output.
* init.cc (calibration_id): New static variable.
(prime_threads): Set sync_startup to invalid handle if we already know about
thread_func_ix.  Use static calibration_id to hold calibration thread id.
* munge_threadfunc (munge_threadfunc): Don't try to debug if we don't find
threadfunc_ix.
(dll_entry): Avoid calling munge_threadfunc and _cygtls::remove on non-cygwin
threads invoked during process startup.
* pinfo.cc (set_myself): Always call strace.hello here regardless of DEBUGGING.
* sigproc.cc (child_info::child_info): Remove spurious handling of dwProcessId.
Set straced as appropriate.
* spawn.cc (spawn_guts): Rename ciresrv to ch.  Invoke strace write_childpid to
communicate with potential strace.
* strace.cc: Include child_info.h.
(strace::hello): Remove inited test.  Use active() method to test if strace has
been activated.  Handle case where we are started before
(mypid): New function.
(strace::vsprntf): Try to deal more intelligently with case where progname may
not be filled out.  Put pid in parentheses if it is a windows pid rather than a
cygwin pid.  myself has been filled out.
(strace::write_childpid): New function for notifying strace about the creation
of children.
(strace::vprntf): Use strace method rather than accessing field directly.
(strace_printf): Ditto.
(strace::wm): Ditto.
* winsup.h (in_forkee): Declare.
* include/sys/strace.h (strace::write_childpid): Declare new function.
(strace::attached): Define new function.
(strace::active): Ditto.
(strace::active_val): Ditto.
(_STRACE_ON): Delete.
(_STRACE_OFF): Ditto.
(define_strace0): Use strace method rather than accessing field directly.
(strace_printf_wrap): Ditto.
(strace_printf_wrap1): Ditto.

*** cygwin utils changes:
* strace.cc (nprocesses): Make static global.
(quiet): New variable.
(strace_active): Ditto.
(add_child): Increment nprocesses here.  Don't add a child if it is already
added (windows bug?).  Report on child if not quiet.
(get_child): Just return NULL if child not found.
(remove_child): Report on child if not quiet.
(attach_process): Don't complain if given a windows process.  Use windows pid
in error.
(handle_output_debug_string): Issue error if trying to manipulate a process
that we don't know about.  Handle _STRACE_CHILD_PID - attach to reported child
when we get this.
(proc_child): Move nprocesses to file scope.  Report on exceptions.
(longopts): Implement "--quiet".
(opts): Implement "-q".
(main): Manipulate quiet flag.
* utils.sgml (strace): Add words describing '-q'.
2005-12-29 20:46:34 +00:00
Christopher Faylor 77ae8757f7 * environ.cc (win_env::add_cache): Don't add variables to the environment
during initialization.
2005-12-29 03:46:56 +00:00
Corinna Vinschen 20e84812d2 * exceptions.cc (_cygtls::handle_exceptions): Drop redundant `break'. 2005-12-27 20:47:49 +00:00
Corinna Vinschen de6c4c6a5f * ChangeLog: Add linebreaks. 2005-12-27 20:23:48 +00:00
Corinna Vinschen a5912e6dbc * exceptions.cc (inside_kernel): Rename from interruptible.
Accommodate change throughout file.
2005-12-27 20:20:09 +00:00
Corinna Vinschen 4f12275501 * exceptions.cc (interruptible): New function, code stripped from
_cygtls::interrupt_now.
	(_cygtls::handle_exceptions): Handle STATUS_DATATYPE_MISALIGNMENT as
	SIGBUS error.  Differ between unmapped memory (SEGV_MAPERR) and access
	violation (SEGV_ACCERR) in case of STATUS_ACCESS_VIOLATION.  Write
	kernel log message in case of uncatched STATUS_ACCESS_VIOLATION.
	(_cygtls::interrupt_now): Just call interruptible now instead of
	evaluating interruptibility here.
2005-12-27 20:07:59 +00:00
Corinna Vinschen 19556072f6 Add missing ChangeLog entry. 2005-12-27 20:01:29 +00:00
Corinna Vinschen 9e68bb7b50 * path.cc (path_conv::check): Rework loop removing trailing dots
and spaces.

	* syslog.cc (vklog): Set facility to LOG_KERN if not set.
2005-12-27 18:10:49 +00:00
Christopher Faylor 192af6e283 white space 2005-12-26 21:23:05 +00:00
Christopher Faylor a16b738dd5 * dcrt0.cc (__api_fatal): Simplify to just use strace mechamisms.
(do_exit): Move minimal_printf...
* pinfo.cc (pinfo::exit): ...into here.
* strace.cc (strace::vprntf): Guarantee output to the console when
system_printf/api_fatal.
* heap.cc (heap_init): Wait a second before issuing an error when
ERROR_INVALID_ADDRESS since this is probably due to a CTRL-C handler sneaking
in, using the memory that we want to use for the heap, and, eventually exiting.
2005-12-26 19:34:59 +00:00
Christopher Faylor c675040a06 typo 2005-12-25 18:15:02 +00:00
Christopher Faylor dcd0465b2b * cygtls.cc (_cygtls::handle_threadlist_exception): Make an error fatal.
* cygtls.h (sockaddr_in): Use header rather than defining our own structure.
* exceptions.cc (_cygtls::interrupt_setup): Use exact contents of sa_mask
rather than assuming tht current sig should be masked, too.
(_cygtls::call_signal_handler): Use more aggressive locking.
* gendef (_sigbe): Wait until later before releasing incyg.
(_sigreturn): Remove more arguments to accommodate quasi-sa_sigaction support.
(_sigdelayed): Push arguments for sa_sigaction.  More work needed here.
* signal.cc (sigaction): Implement SA_NODEFER.
* tlsoffsets.h: Regenerate.

* sigproc.cc (wait_sig): Use default buffer size of Windows 9x complains.
* pinfo.cc (_onreturn::dummy_handle): Remove.
(_onreturn::h): Make this a pointer.
(_onreturn::~_onreturn): Detect whether pointer is NULL rather than value is
NULL.
(_onreturn::_onreturn): Set h to NULL initially.
(_onreturn::no_close_p_handle): Set h to NULL.
(winpids::add): Initialize onreturn with value from p.hProcess immediately.
2005-12-23 22:50:20 +00:00
Christopher Faylor ede284de5f * fork.cc (fork): Honor error return from sig_send. Don't continue with fork
if we couldn't suspend signals.
* sigproc.cc (sig_send): Set sigCONT event when we see __SIGNOHOLD.
(wait_sig): Remove holding_signals.  Create pipe with a buffer which will
theoretically cause blocking if there is nothing reading on the pipe.  Wait for
sigCONT at end of loop when we have a __SIGHOLD.
2005-12-23 01:24:14 +00:00
Corinna Vinschen 52792a770d * fhandler.h (fhandler_base::issymlink): New method.
* syscalls.cc (open): Handle O_NOFOLLOW flag.
	* include/fcntl.h (_FNOFOLLOW): New define.
	(O_NOFOLLOW): Ditto.
	* include/cygwin/version.h: Bump API minor number.
2005-12-22 16:45:15 +00:00
Christopher Faylor de935f6d9f whitespace cleanup to force snapshot. 2005-12-22 05:57:54 +00:00
Christopher Faylor 718dee922f * pinfo.cc (winpids::add): Increment nelem when winpid is true since we don't
care if it's a cygwin process in that case.
2005-12-22 05:26:14 +00:00
Christopher Faylor 3962fad137 fix ya typo 2005-12-22 05:23:51 +00:00
Christopher Faylor 67cd42db4c * pinfo.cc (winpids::release): Fix typo. 2005-12-22 05:11:44 +00:00
Christopher Faylor f3ea02b1cf * pinfo.cc (pinfo::init): Clarify comment slightly.
(_onreturn): New helper class.
(winpids:add): Remove copied stuff.  Try to put process handle into pinfo in
question and use _onreturn class to control when to close it.
(winpids::release): Remove use of copied array.  Free procinfo when hProc is
NULL.  Otherwise call release and call CloseHandle on hProc.
* pinfo.h (winpids::copied): Remove throughout class.
2005-12-22 03:16:36 +00:00
Christopher Faylor 9981546a7c * pinfo.cc (pinfo::init): Remove spurious low_priority_sleep. 2005-12-21 19:39:53 +00:00
Christopher Faylor 01032746d1 * spawn.cc (spawn_guts): Hide the window whenever ctty == -1, not just when we
have no console.
2005-12-21 17:20:43 +00:00
Christopher Faylor 247ac234f4 * cygheap.cc (init_cygheap::manage_console_count): Revert previous change.
Handle this a different way.
* external.cc (cygwin_internal): Accommodate extra hook_or_detect_cygwin
argument.
* hookapi.cc (cygwin_internal): Fill in subsys variable with the subsystem of
the executable.
* spawn.cc (av::iscui): New variable.
(spawn_guts): Hide window when we don't have a console and this isn't
NT/XP/2003.
(av::fixup): Set iscui flag.
* winsup.h (hook_or_detect_cygwin): Accommodate extra argument.
2005-12-21 17:14:34 +00:00
Christopher Faylor d4c8d84da6 * cygheap.cc (init_cygheap::manage_console_count): Don't call FreeConsole on
9x/Me.
2005-12-21 16:09:25 +00:00
Corinna Vinschen 2df1714182 * (fhandler_disk_file::fchown): Remove execute bits from "sensible"
permissions.  Use same setting as in symlink.
2005-12-21 13:37:28 +00:00
Corinna Vinschen 0786c42a9c * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix inode number
debug output.
	(fhandler_disk_file::fchown): Always set sensible permission values
	when creating the ACL for symlinks.
2005-12-21 13:01:27 +00:00
Corinna Vinschen c5a3166fc5 * winsup.h (flush_file_buffers): Define as inline function.
* miscfuncs.cc (flush_file_buffers): Remove.
2005-12-20 20:34:28 +00:00
Corinna Vinschen 56c07aa2ce * winsup.h (flush_file_buffers): Declare new function.
(FLushFileBuffers): New define.
	* miscfuncs.cc (flush_file_buffers): Define new function.
2005-12-20 20:19:55 +00:00
Christopher Faylor 7c578a4fa0 * fhandler.h (fhandler_termios::fixup_after_exec): Make non-inlined.
* fhandler_termios.cc (fhandler_termios::fixup_after_exec): Don't call
fixup_after_fork if close_on_exec'ed.
2005-12-20 18:14:42 +00:00
Christopher Faylor 98da134d62 * cygtls.h (_cygtls::interrupt_now): Subsume interruptible().
(interruptible): Delete.
(setup_handler): Remove interruptible call and just use return from
interrupt_now.
2005-12-20 00:31:50 +00:00
Christopher Faylor 7a01aa546d * fhandler.h (set_console_state_for_spawn): Add an argument to the declaration.
* fhandler_console.cc (set_console_state_for_spawn): Ditto for the definition.
Only set invisible console for non-cygwin process.  Remove debugging leftover.
* spawn.cc (spawn_guts): Pass argument denoting whether this is a cygwin
process to set_console_state_for_spawn and only call this function when
exec'ing.
2005-12-19 19:04:14 +00:00
Corinna Vinschen edd79f2da4 * mmap.cc (fhandler_dev_zero::mmap): Call VirtualFree(MEM_RELEASE)
with zero length parameter, otherwise it fails.
	(fhandler_dev_zero::munmap): Ditto.
2005-12-19 15:25:23 +00:00
Christopher Faylor 1219debe0c fix minor typo. 2005-12-19 05:08:20 +00:00
Christopher Faylor 65438ec635 * fhandler.h (fhandler_pipe::fixup_in_child): Declare new function.
(fhandler_console::invisible_console): Declare new variable.
(fhandler_console::need_invisible): Ditto.
(fhandler_console::has_a): Ditto.
* fhandler_console.cc (set_console_state_for_spawn): Eliminate return value.
Set up an invisible console if necessary prior to spawning.
(fhandler_console::invisible_console): Define.
* fhandler_tty.cc (fhandler_tty_slave::open): Use
fhandler_console::invisible_console to setup an invisible console.
* pipe.cc (fhandler_pipe::fixup_in_child): Define new function from
fixup_after_exec.
(fhandler_pipe::fixup_after_exec): Use fixup_in_child when appropriate.
(fhandler_pipe::fixup_after_fork): Ditto.
* spawn.cc (handle): Reorganize and modernize a little.
(spawn_guts): Rely on set_console_state_for_spawn to set the console into the
right state but don't create the process with "detached" flag if we have no
controlling tty since that confuses 'cmd'.
* dtable.cc (dtable::stdio_init): Don't set console as controlling terminal if
we have an invisible console.
* sigproc.cc (child_info::sync): Use correct name in ForceCloseHandle1.
2005-12-19 04:34:13 +00:00
Christopher Faylor ca9271d1b6 * include/sys/dirent.h: Change __deprecated_d_ino to __invalid_d_ino throughout
to make things a little clearer.
* dir.cc (readdir_worker): Reflect above change.
2005-12-19 04:00:41 +00:00
Christopher Faylor ad02bb70e3 * winsup.h (child_copy): Change prototype to match new functionality.
* cygheap.cc (cygheap_fixup_in_child): Accommodate new child_copy arguments.
* dcrt0.cc (dll_data_start): Move definition here from fork.
(dll_data_end): Ditto.
(dll_bss_start): Ditto.
(dll_bss_end): Ditto.
(handle_fork): New function.  Called when forked to deal with fork issues and
copy data to this process from the parent.
(dll_crt0_0): Call handle_fork when _PROC_FORK condition.
(dll_crt0): Don't copy user_data when we've forked.  Don't zero first element
of main_environment ever.
(cygwin_dll_init): Ditto.
* fork.cc (child_copy): Rename from fork_copy and change arguments so that each
pair of things to copy gets its own descriptor.
(frok::child): Remove fixup_mmaps_after_fork call here.  Move to handle_fork in
dcrt0.cc.
(frok::parent): Use child_copy rather than fork_copy and accommodate changes in
parameters.
* exceptions.cc (setup_handler): Delay test of whether we're locked until after
GetThreadContext has been called since there are apparently cases where
SuspendThread does not cause an immediate thread suspension.
2005-12-17 04:36:39 +00:00
Christopher Faylor 6ba157bb2e * init.cc (dll_entry): Call prime_threads after dll_crt0_0 to avoid conflicts
between heap allocation and thread stack allocation.
2005-12-16 20:40:03 +00:00
Christopher Faylor fd01d14ab1 * hookapi.cc (putmem): Remove query of previous memory protection since we get
that for free the first time we call VirtualProtect.
2005-12-16 18:10:10 +00:00
Corinna Vinschen 8b1ba065a6 * mmap.cc (fhandler_dev_zero::fixup_mmap_after_fork): Use
system_printf like any other fixup_mmap_after_fork.
2005-12-15 09:04:28 +00:00
Corinna Vinschen 64ee06c782 Fix unforgivable spelling error in ChangeLog. 2005-12-14 20:04:16 +00:00
Corinna Vinschen ba31e832be * fhandler.cc (ACCFLAGS): Remove macro.
(fhandler_base::get_default_fmode): Use O_ACCMODE instead of ACCFLAGS
	and or'ed read/write flags.
	(fhandler_base::open_9x): Use O_ACCMODE instead of or'ed read/write
	flags.
	(fhandler_base::open): Ditto.
	* fhandler_disk_file.cc (fhandler_base::open_fs): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::open): Ditto.
	* fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
2005-12-14 16:38:22 +00:00
Corinna Vinschen e3d14af155 * fhandler.cc (fhandler_base::open_9x): Handle O_SYNC and O_DIRECT
flags.
	(fhandler_base::open): Ditto.
	* fhandler_floppy.cc (fhandler_dev_floppy::open): Don't allocate devbuf
	in O_DIRECT case.
	* fhandler_raw.cc (fhandler_dev_raw::ioctl): Don't allow buffer
	changes in O_DIRECT case.  Allow returning a buffer size 0, which
	indicates O_DIRECT.
	* fhandler_tape.cc (fhandler_dev_tape::open): Use O_SYNC flag to
	hand down the !buffer_writes case.  Don't allocate devbuf in O_DIRECT
	case.
	(fhandler_dev_tape::raw_read): Don't mess with devbuf if it's NULL.
	* include/fcntl.h: Define _FDIRECT, O_DIRECT, O_DSYNC and O_RSYNC.
	* include/cygwin/version.h: Bump API minor version.
2005-12-14 15:54:33 +00:00
Christopher Faylor 2c8fd40695 * cygtls.cc (_cygtls::remove): Don't bother if we're exiting.
* sigproc.cc (_cygtls::remove_wq): Ditto.
2005-12-13 16:01:57 +00:00
Christopher Faylor 1f3a4b8496 * fhandler_tty.cc (fhandler_tty::open): Enhance comment. 2005-12-13 14:47:18 +00:00
Corinna Vinschen 4c848934fe * fhandler_tty.cc (fhandler_tty::open): Close newly created window
station after switching to original window station.
2005-12-13 09:07:12 +00:00
Christopher Faylor 82f423291b * fhandler_tty.cc (fhandler_tty::open): Add a comment. 2005-12-13 05:43:30 +00:00
Christopher Faylor 56b5372519 * times.cc (hires_ms::usecs): Subtract from slop from system time or we'll
always end up priming the pump.
2005-12-13 02:55:11 +00:00
Christopher Faylor d090ee8081 * times.cc (systime): Correct precision referenced in comment.
* fhandler_tty.cc (fhandler_tty_slave::open): Don't free original windows
station since that will cause strange problems displaying fonts.  Reset windows
station to original station after creating console.
* times.cc (hires_ms::usecs): Only reprime when calculated time is less than
system time.
2005-12-13 02:02:51 +00:00
Christopher Faylor 678a9510df * pinfo.cc (winpids::add): Don't copy procinfo when there is no cygwin process
associated with the pid, i.e., procinfo == NULL.
2005-12-13 00:54:32 +00:00
Christopher Faylor c9da5a2183 * times.cc (hires_ms::usecs): Correct order when checking if high precision
time is <= current time.
2005-12-13 00:43:46 +00:00
Christopher Faylor a300f5fd14 correct ChangeLog 2005-12-12 19:10:02 +00:00
Christopher Faylor 363934dc9b * pinfo.cc (size_copied): New convenience macro.
(winpids::add): Alias the element that we are working on for slightly better
clarity.  Honor the "make_copy" flag.
(winpids::release): Free and zero procinfo field if it was allocated via
malloc.
(winpids::~winpids): Free copied array.
* pinfo.h (class pinfo): Make winpids class a friend.
(winpids::make_copy): New field.
(winpids::copied): New array.
(winpids::reset): Reset npids after releasing pinfos or suffer a memory leak.
(winpids::winpids): Try harder to allocate all fields in the class.
2005-12-12 18:43:31 +00:00
Corinna Vinschen 75a22c880a * autoload.cc (GetSystemTimes): Remove. 2005-12-12 14:27:16 +00:00
Corinna Vinschen e96abae130 * fhandler_proc.cc (format_proc_uptime): Drop usage of GetSystemTimes.
Use NtQuerySystemInformation to evaluate uptime and idle_time from
	all CPU's processor times.  Fallback to GetTickCount.
2005-12-12 12:18:14 +00:00
Corinna Vinschen 2193d02b4d * mmap.cc (gen_create_protect): Always generate WRITECOPY protection
for private maps.
	(fixup_mmaps_after_fork): Fix calculation of WRITECOPY protection for
	VirtualProtect.  Add some words to the comment.
2005-12-12 10:00:32 +00:00
Christopher Faylor 4989ff286d fix typo. 2005-12-11 17:30:53 +00:00
Christopher Faylor 9b020020ec * dirent.h: Change the rest of the d_ino's to __deprecated_d_ino. 2005-12-10 23:25:24 +00:00
Christopher Faylor 3ab689126c * malloc.cc: Update to version 2.8.3.
* cygmalloc.h (MSPACE): Remove unneeded definition.
2005-12-10 17:09:58 +00:00
Corinna Vinschen 7d6fde96de * fhandler_raw.cc (fhandler_dev_raw::ioctl): Only allow 0, 1 or a
multiple of 512 as new buffersize.
2005-12-08 10:55:29 +00:00
Corinna Vinschen ddd62ccbd4 * fhandler_socket.cc (fhandler_socket::recvfrom): Mask flags with
MSG_WINMASK for Windows socket calls.
	(fhandler_socket::recvmsg): Ditto.
	(fhandler_socket::sendmsg): Ditto.
2005-12-08 10:13:57 +00:00
Christopher Faylor 6c9a5ebbfc * hires.h (hires_ms::initime_ms): Delete.
(hires_ms::initime_us): Just define as LONGLONG.
(hires_ms::uptime): New function.
* select.cc (select_stuff::wait): Use gtod for timing to attempt to avoid
windows 32 bit wraparound.
* times.cc (systime): New function.
(times): Replace GetTickCount with gtod.uptime.
(hires_us::prime): Use systime() to calculate system time rather than calling
GetSystemTimeAsFileTime directly.
(hires_ms::prime): Ditto.  Eliminate initime_ms.
(hires_ms::usecs): Try harder to detect wraparound.
* fhandler_proc.cc (format_proc_partitions): Set drive_size to zero to avoid a
compiler warning.
2005-12-07 22:28:49 +00:00
Corinna Vinschen c09178b052 * fhandler_proc.cc (format_proc_partitions): Use modern IOCTLs
to determine drive size as far as possible.
2005-12-07 20:32:27 +00:00
Corinna Vinschen db58e35d94 * fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix INVALID_PARAMETER
condition.  Only copy devbuf to buf if buf is non-NULL.
2005-12-07 19:01:29 +00:00
Corinna Vinschen bb4e8382c5 * fhandler_raw.cc (fhandler_dev_raw::ioctl): Fix setting devbuf
when rd_parm is 0 or 1.
2005-12-07 18:35:29 +00:00
Corinna Vinschen 46bcbf8ce0 * fhandler_floppy.cc (fhandler_dev_floppy::lseek): Fix test for
valid file position at EOM.
2005-12-07 18:11:10 +00:00
Christopher Faylor 383840a908 * include/cygwin/stdlib.h: Guard compilation of *unsetenv* in newlib. 2005-12-07 15:17:43 +00:00
Corinna Vinschen 5a101414ed * exceptions.cc (_cygtls::handle_exceptions): In case of a
STATUS_ACCESS_VIOLATION, check if the page is a mmaped page beyond
	a file's EOF.  Generate SIGBUS instead of SIGSEGV then.
	* mmap.cc (__PROT_ATTACH): New define.
	(__PROT_FILLER): Ditto.
	(fh_anonymous): Rename from fh_paging_file;
	(fh_disk_file): New global static variable.
	(attached): New inline function.
	(filler): Ditto.
	(gen_create_protect): Split off from gen_protect to use the file's
	access mode to create mapping always with maximum allowed protections.
	(gen_protect): Accomodate pages attached beyond EOF.  Use symbolic
	values instead of numerics when possible.  Drop create parameter.
	(gen_access): Use file's access mode instead of protection.
	(CreateMapping9x): Create named mapping names so that different
	creation access modes result in different mappings.
	(CreateMappingNT): Only reserve attached pages, don't commit them.
	(MapViewNT): Ditto.  Set AT_ROUND_TO_PAGE for all non-NULL base
	addresses.
	(mmap_func_t): Define CreateMapping and MapView function pointers
	with additional openflags parameter.
	(class mmap_record): Add openflags member.
	(mmap_record::mmap_record): Add openflags parameter.
	(mmap_record::get_openflags): New accessor.
	(mmap_record::attached): Call global attached function.
	(mmap_record::filler): Call global filler function.
	(mmap_record::gen_create_protect): Call global gen_create_protect
	function.
	(mmap_record::gen_protect): Drop create parameter.
	(mmap_record::alloc_fh): Set fhandler's access flags.
	(list::search_record): Accomodate filler pages.
	(list::set): Use inode number as hash value.
	(map::get_list_by_fd): Check hash value against file's inode number.
	(mmap_is_attached_page): New function to evaluate if a given address
	is on a attached page.  Called from _cygtls::handle_exceptions.
	(mmap_worker): New function to do mapping and bookkeeping in a
	single call.
	(mmap64): Use roundup2 to round length to pagesize alignment.
	Initialize global fhandlers.  Simplify anonymous initialization.
	Add SUSv3 compatible check of file open mode vs. requested protection.
	Try creating new file handles to allow maximum page protection.
	Allow creating attached pages in case of mapping beyond EOF.
	Close new file handle if one has been created.
	(munmap): Align len to pagesize.
	(msync): Rework argument checks. Align len to pagesize.
	(mprotect): Ditto.  Accomodate attached pages.
	(mlock): Use roundup/rounddown macros instead of homemade expressions.
	(munlock): Add page alignment as in mlock.
	(fhandler_dev_zero::munmap): Fix unmapping of non-private mappings.
	(fhandler_dev_zero::fixup_mmap_after_fork): Accomodate filler pages.
	(fixup_mmaps_after_fork): Don't fail if attached pages couldn't be
	created in child.  Avoid superfluous call to VirtualFree.  Check for
	original allocation protection to fix PAGE_WRITECOPY protection.
	* ntdll.h: Revert deletion of AT_ROUND_TO_PAGE define.
	* winsup.h (mmap_is_attached_page): Declare.
2005-12-07 11:16:47 +00:00
Christopher Faylor e5a0cf2415 * include/cygwin/stdlib.h: New file.
* environ.cc (unsetenv): Change to return -1 on input error.
* include/cygwin/version.h: Add more description to latest api bump.
2005-12-05 22:30:03 +00:00
Christopher Faylor c34aee9b23 * dir.cc (readdir_workdir): Only fill out d_ino when linked into older app.
* include/cygwin/version.h: Bump api minor number to 147, reflecting
obsolescence of d_ino.
(CYGWIN_VERSION_USER_API_VERSION_COMBINED): New convenience macro.
(CYGWIN_VERSION_CHECK_FOR_NEEDS_D_INO): New convenience macro.
2005-12-05 21:02:53 +00:00
Christopher Faylor 4535b5961f revert accidental checkin 2005-12-05 20:30:40 +00:00
Christopher Faylor 09b0109620 Remove unneeded whitespace.
* cygtls.cc (_cygtls::set_state): Delete.
(_cygtls::reset_exception): Ditto.
(_cygtls::init_thread): Set initialized state directly here.
(_cygtls::push): Remove exception argument.  Don't treat exceptions specially.
* cygtls.h (_cygtls::push): Ditto.
(_cygtls::isinitialized): Don't treat exceptions specially.
(_cygtls::reset_exception): Delete.
(_cygtls::set_state): Ditto.
(_cygtls::handle_exceptions): Don't push ebp on the stack prior to calling
sig_send.  Just set incyg instead.
(_cygtls::interrupt_setup): Accommodate _cygtls::push argument change.
(_cygtls::interrupt_now): Ditto.
(setup_handler): Don't treat exceptions specially.
* gendef (longjmp): Always zero incyg flag.
2005-12-05 20:20:18 +00:00
Corinna Vinschen 9fc0d14410 * environ.cc (spenvs): Add "windir" as an "always export" variable
to accomodate WinSock on Windows 95.
2005-12-04 21:47:03 +00:00
Christopher Faylor 3829215776 fix description 2005-12-04 19:24:10 +00:00
Christopher Faylor 49085f6f16 * include/exceptions.h (exception_list): Revert previous change. Windows
doesn't care.
(exception_handler): Use real exception_list parameter type rather than void *
* tlsoffsets.h: Regenerate.
* cygtls.h (_cygtls::handle_exceptions): Use real exception_list parameter type
rather than void *.
(handle_threadlist_exception): Ditto.
(init_exception_handler): Ditto.
* cygtls.cc (_cygtls::handle_threadlist_exception ): Ditto.
(_cygtls::init_exception_handler): Add kludge to terminate linked list with a
loop, which seems to solve problem of RtlUnwind causing problems
* exceptions.cc (rtl_unwind): Use real exception_list parameter type rather
than void *.
(_cygtls::handle_exceptions): Ditto.
2005-12-03 05:01:51 +00:00
Christopher Faylor 087f4a61d2 Add missing ChangeLog entry. 2005-12-03 04:24:34 +00:00
Christopher Faylor f153e6b280 * cygtls.h (_cygtls::el): New field.
(_cygtls::handle_exceptions): New function declaration.
(_cygtls::handle_threadlist_exception): Ditto.
(_cygtls::init_exception_handler): Ditto.
(_cygtls::init_threadlist_exceptions): Remove arg from declaration.
* cygtls.cc (_cygtls::call2): Don't initialize exceptions here.
(_cygtls::init_thread): Do it here instead and use member function.
(_cygtls::handle_threadlist_exception): Move into _cygtls class.
(_cygtls::init_exception_handler): Ditto.  Rely on existence of 'el' memmber in
_cygtls.
(_cygtls::init_threadlist_exceptions): Ditto.
* dcrt0.cc (dll_crt0_1): Remove exception_list definition and setting since it
now commonly resides in the tls.
* exceptions.cc (init_exception_handler): Move to cygtls.cc.
(init_exceptions): Ditto.
(rtl_unwind): New, safe wrapper function for RtlUnwind.
(_cygtls::handle_exceptions): Move to _cygtls.  Call rtl_unwind to unwind
frames and eliminate copying of structures.  Put address of failing instruction
in si_addr, not the address on the stack.  Return 0 to indicate that we've
handled this exception.
* external.cc (cygwin_internal): Make CW_INIT_EXCEPTIONS a no-op.
* sigproc.cc (wait_sig): Accommodate argument change to
_cygtls::init_threadlist_exceptions.
* tlsoffsets.h: Regenerate.
* include/exceptions.h (exception_list): Add more stuff to the exception list.
Apparently windows needs this?
(init_exceptions): Remove bogus declaration.
* include/cygwin/signal.h (SI_USER): Redefine as zero as per SUSv3.
* thread.cc (pthread_kill): Set si_pid and si_uid.
* timer.cc (timer_thread): Set si_code to SI_TIMER.
2005-12-03 04:23:35 +00:00
Christopher Faylor e7f6a31bb0 * dcrt0.cc (getstack): Try harder to modify memory.
(alloc_stack): Alloc page prior to stack top, too.
2005-12-02 03:12:06 +00:00
Christopher Faylor 032295a988 * devices.h (_major): Revert previous ill-advised change.
(_minor): Ditto.
2005-12-02 00:37:21 +00:00
Christopher Faylor 8b3c84227f * exceptions.cc (handle_exceptions): Translate a guard page exception to a
"SIGBUS".
2005-12-01 20:52:00 +00:00
Corinna Vinschen b534221080 * mmap.cc: Make debug output more consistently. Fix some comments.
(gen_protect): Convert to inline function.
	(gen_access): Ditto.
	(mmap_record::gen_protect): Add create parameter as in global function.
	(mmap_record::alloc_page_map): Change condition so that always the
	correct protection setting is set after mapping has been established.
	(mmap64): For anonymous mappings set offset always to 0.
	(fixup_mmaps_after_fork): Always call fixup_mmap_after_fork method
	with the MAP_FIXED flag set.
2005-12-01 20:35:13 +00:00
Christopher Faylor c57b13f9f8 * devices.h (_minor): Coerce argument to proper type before manipulating.
(_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.
2005-12-01 17:33:59 +00:00
Christopher Faylor 1740d2580b * times.cc (hires_ms::prime): Remove debugging stuff.
(hires_ms::usecs): Ditto.
2005-11-30 18:14:07 +00:00
Corinna Vinschen b0c3293ecc * mmap.cc (list::try_map): New method, implementing trying to map
within another already existing map, moved from mmap64 here.
	(mmap64): Just call try_map now.
	(fhandler_dev_zero::fixup_mmap_after_fork): Always create new private
	map with PAGE_READWRITE protection.
	(fixup_mmaps_after_fork): Fix comment.
2005-11-30 15:05:48 +00:00
Corinna Vinschen e4809ddd20 * include/cygwin/version.h: Bump API minor version. 2005-11-29 18:25:36 +00:00
Corinna Vinschen a020c74a8d * fhandler.h (fhandler_dev_zero::mmap): Add method.
(fhandler_dev_zero::munmap): Ditto.
	(fhandler_dev_zero::msync): Ditto.
	(fhandler_dev_zero::fixup_mmap_after_fork): Ditto.
	* mmap.cc: Implement anonymous mapping using fhandler_dev_zero class.
	Implement private anonymous maps using VirtualAlloc/VirtualFree.  Fix
	or add some more comments.
	(fh_paging_file): Change to type fhandler_dev_zero.
	(priv): New static inline function to avoid having lots of flag bit
	tests in the code.  Use throughout were appropriate.
	(fixed): Ditto.
	(anonymous): Ditto.
	(noreserve): Ditto.
	(autogrow): Ditto.
	(gen_protect): Never generate PAGE_WRITECOPY protection for
	private anonymous maps.
	(gen_access): Drop FILE_MAP_EXECUTE handling since it's not supported
	correctly on 9x.
	(VirtualProt9x): Move comment from mmap64 here.
	(mmap_record::mmap_record): Gegerate correct device entry for
	anonymous maps, though unused right now.
	(mmap_record::priv): Call global priv function.
	(mmap_record::fixed): Call global fixed function.
	(mmap_record::anonymous): Call global anonymous function.
	(mmap_record::noreserve): Call global noreserve function.
	(mmap_record::autogrow): Call global autogrow function.
	(list::anonymous): New method.  Use throughout were appropriate.
	(mmap_record::compatible_flags): Drop now useless ifdef.
	(mmap_record::alloc_page_map): Accomodate private anonymous maps.
	(mmap_record::map_pages): Accomodate MAP_NORESERVE mappings.
	(mmap_record::unmap_pages): Accomodate private anonymous maps.
	(mmap64): Simplify argument check.  Don't remove the MAP_PRIVATE flag
	for anonymous mappings on 9x anymore since that's now handled
	gracefully.
	(mprotect): Accomodate MAP_NORESERVE mappings.  Fix case when
	non-mmap areas are just MEM_RESERVEd.
	(fhandler_dev_zero::mmap): Implement anonymous mapping here.
	(fhandler_dev_zero::munmap): Ditto.
	(fhandler_dev_zero::msyn): Ditto.
	(fhandler_dev_zero::fixup_mmap_after_fork): Ditto.
	(fixup_mmaps_after_fork): Accomodate private anonymous maps.  Enhance
	debug output in case VirtualProtect fails.
	* include/sys/mman.h: Really define MAP_NORESERVE now.
2005-11-29 16:28:05 +00:00
Corinna Vinschen f90e23f271 * autoload.cc (NtCreateSection): Define.
* cygheap.cc (_csbrk): Call getpagesize instead of getshmlba.
	* dcrt0.cc (dll_crt0_0): Call mmap_init.
	* external.cc (cygwin_internal): Call getpagesize instead of getshmlba.
	* fhandler.h (fhandler_base::mmap): Change access to prot parameter.
	(fhandler_base::fixup_mmap_after_fork): Ditto.
	(fhandler_disk_file::mmap): Ditto.
	(fhandler_disk_file::fixup_mmap_after_fork): Ditto.
	(fhandler_dev_mem::mmap): Ditto.
	(fhandler_dev_mem::fixup_mmap_after_fork): Ditto.
	* fhandler_mem.cc (fhandler_dev_mem::write): Call getsystempagesize
	instead of getpagesize.
	(fhandler_dev_mem::read): Ditto.
	(fhandler_dev_mem::fstat): Ditto.
	(fhandler_dev_mem::mmap): Move to mmap.cc.
	(fhandler_dev_mem::munmap): Ditto.
	(fhandler_dev_mem::msync): Ditto.
	(fhandler_dev_mem::fixup_mmap_after_fork): Ditto.
	* fhandler_proc.cc (format_proc_meminfo): Call getsystempagesize
	instead of getpagesize.
	* fhandler_process.cc (format_process_stat): Ditto.
	(format_process_status): Ditto.
	(get_mem_values): Ditto.
	* mmap.cc: Fix formatting.  Try to make more readable and modular.
	Take advantage of pagesize==granularity.
	(gen_protect): New static function to evaluate Windows
	protection bits from POSIX protection and flags.
	(gen_access): Ditto for Windows access mode.
	(VirtualProt9x): Wrapper function to call VirtualProtect on 9x.
	(VirtualProtNT): Ditto for NT.
	(VirtualProtEx9x): Ditto for VirtualProtectEx on 9x.
	(VirtualProtExNT): Ditto for NT.
	(CreateMapping9x): Wrapper function for creating a mapping handle on 9x.
	(CreateMappingNT): Ditto for NT.
	(MapView9x): Wrapper function to map a view on 9x.
	(MapViewNT): Ditto for NT.
	(mmap_funcs_9x): Structure containing function pointers to wrapper
	functions for 9x.
	(mmap_funcs_nt): Ditto for NT.
	(mmap_func): Pointer to wrapper functions used in subsequent code.
	(mmap_init): Initialize mmap_func depending on OS.
	(class mmap_record): Use sensible member names.  Add POSIX protection
	member. Drop Windows access flags member.  Constify more methods.
	Use accessors instead of direct member access inside of own methods.
	(mmap_record::gen_protect): Class wrapper to evaluate matching
	Windows protection bits.
	(mmap_record::gen_access): Ditto for Windows access flags.
	(mmap_record::compatible_flags): New function to check if flags are
	compatible with flags of existing map.
	(list::add_record): Drop offset and length arguments.
	(class map): Change counters to unsigned.  Match usage throughout.
	(mmapped_areas): Convert from pointer to global struct.
	(mmap_record::alloc_page_map): Simplify.
	(mmap_record::map_pages): Ditto.
	(mmap_record::fixup_page_map): Delete.
	(mmap64): Simplify.  Add workaround for Windows 98 bug.  Fix bug on
	NT that existing anonymous mappings weren't searched for a match.
	(munmap): Add workaround for Windows 98 bug.
	(msync): Simplify.
	(mprotect): Handle existing maps correctly.
	(mlock): Add local pagesize variable and enlightening comment.
	(fhandler_disk_file::mmap): Main functionality now in CreateMapping/
	MapView wrapper functions.
	(fhandler_disk_file::fixup_mmap_after_fork): Call MapView wrapper.
	(fhandler_dev_mem::mmap): Moved from fhandler_mem.cc.  Simplify by
	calling MapViewNT.
	(fhandler_dev_mem::munmap): Moved from fhandler_mem.cc.
	(fhandler_dev_mem::msync): Ditto.
	(fhandler_dev_mem::fixup_mmap_after_fork): Ditto.  Call MapViewNT.
	(fixup_mmaps_after_fork): Restructure and hopefully speed up loop for
	setting protection and memory content on MAP_PRIVATE maps.
	* ntdll.h (AT_ROUND_TO_PAGE): Remove define.
	(AT_EXTENDABLE_FILE): Add define.
	(NtCreateSection): Add prototype.
	* syscalls.cc (getpagesize): Return granularity as pagesize now.
	(getsystempagesize): New function to retrieve "real" pagesize.
	(getshmlba): Delete since it's replaced by getpagesize now.
	* wincap.h (wincaps::has_mmap_alignment_bug): New element.
	* wincap.cc: Implement above element throughout.
	* winsup.h (getshmlba): Drop prototype.
	(getsystempagesize): Add prototype.
	(mmap_init): Ditto.
	* include/sys/mman.h: (Not yet) define MAP_NORESERVE.
2005-11-28 22:32:29 +00:00
Corinna Vinschen 87b69d9243 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't rely on
has_acl() state for evaluating inodes.  Temporarily(?) enable "real"
	inodes for remote drives.
2005-11-28 10:06:33 +00:00
Christopher Faylor 2cf13b63be * heap.cc: Remove spurious getpagesize declaration.
* exceptions.cc (ctrl_c_handler): Distinguish CTRL-BREAK from CTRL-C in some
cases.
2005-11-25 19:53:52 +00:00
Christopher Faylor 24fb449f37 * autoload.cc (CloseWindowStation): Define. 2005-11-24 02:34:49 +00:00
Christopher Faylor 819dbaebd6 * fhandler_tty.cc (fhandler_tty_slave::open): Reset the current windows station
whenever ctty == -1 regardles of whetehr there's a windows station already
assigned.  Close the old windows station in this situation.
* pinfo.cc (_pinfo::set_ctty): Reinstate incrementing of console count when
recording ctty so that the current tty is always around.
2005-11-24 02:34:31 +00:00
Christopher Faylor 9cd22f86fc * strptime.cc (_strptime): Fix gcc warnings. 2005-11-18 19:43:02 +00:00
Christopher Faylor 6381783f61 * memmem.cc: Move from here.
* lib/memmem.cc: Move to here.
2005-11-18 19:39:53 +00:00
Corinna Vinschen 19e7c3a068 * libc: Add subdirectory.
* Makefile.in (VPATH): Add libc subdir.
	(DLL_OFILES): Add strptime.o and timelocal.o.
	* cygwin.din: Export timelocal and timegm.
	* localtime.cc: Define STD_INSPIRED unconditionally.
	* include/cygwin/time.h (timelocal): Add declaration.
	(timegm): Ditto.
	* include/cygwin/version.h: Bump API minor version.
	* libc/strptime.cc: New file.
	* libc/timelocal.cc: New file.
	* libc/timelocal.h: New file.
2005-11-18 17:48:23 +00:00
Christopher Faylor bc293af0e5 * include/cygwin/sys_time.h: Move futimes and lutimes declaration here from
newlib.
2005-11-18 16:08:33 +00:00
Christopher Faylor 4c57fb4960 * times.cc (timezone): Put back (void).
* include/cygwin/time.h: Add more cygwin stuff from newlib.
2005-11-18 15:57:16 +00:00
Christopher Faylor 808139f1af * include/cygwin/sys_time.h: Rename from include/cygwin/time.h.
* include/cygwin/time.h: New file.
2005-11-18 15:45:51 +00:00
Christopher Faylor 7912bcbf36 * fork.cc (fork): Move top-of-stack calculation later.
* pinfo.cc (_pinfo::set_ctty): Use __ctty to print current console in debugging
output.
2005-11-17 16:36:00 +00:00
Corinna Vinschen 0f46c31745 * fhandler_tty.cc (fhandler_tty_slave::open): Don't expect that
service applications have no window station attached.
2005-11-17 16:17:17 +00:00
Christopher Faylor 9a858ffa7f * times.cc (hires_ms::prime): Don't escalate the priority. 2005-11-16 05:12:11 +00:00
Christopher Faylor 409d1d50fd * include/sys/elf64.h: Fix types to reflect linux usage. 2005-11-14 20:34:33 +00:00
Christopher Faylor 548d0080af * fhandler.h (fhandler_console::fixup_after_fork_exec): Define with additional
bool parameter.
(fhandler_console::fixup_after_exec): Accommodate fixup_after_fork_exec's
parameter.
(fhandler_console::fixup_after_fork): Ditto.
* fhandler_console.cc (fhandler_console::fixup_after_fork_exec): Avoid opening
new console only when close_on_exec AND execing.
2005-11-14 14:15:51 +00:00
Christopher Faylor 5a0826c3f8 * fhandler.h (fhandler_console::fixup_after_fork_exec): Declare new function.
(fhandler_console::fixup_after_fork): Use fixup_after_fork_exec.
(fhandler_console::fixup_after_exec): Ditto.
* fhandler_console.cc (fhandler_console::fixup_after_fork): Delete definition.
(fhandler_console::fixup_after_fork_exec): Rename from fixup_after_exec.
* pinfo.cc (_pinfo::set_ctty): Don't play with console count here.
* syscalls.cc (close_all_files): Don't close cygheap ctty if hExeced since the
child will be copying information from us.
(setsid): Use myctty() rather than raw ctty #.
2005-11-14 05:36:16 +00:00
Christopher Faylor 59297e0464 * cygheap.h (init_cygheap::manage_console_count): Declare new function.
(init_cygheap::console_count): Renamed from open_fhs.  Make private.
* cygheap.cc (init_cygheap::manage_console_count): Define new function.
* dtable.cc (dtable::fixup_after_exec): Always call fixup_after_exec on
elements of fd even when they are about to be closed.
* fhandler.h (report_tty_counts): Remove open_fhs from debugging output.
* fhandler_console.cc (fhandler_console::open): Use manage_console_count rather
than manipulating count directly.
(fhandler_console::close): Ditto.
(fhandler_console::fixup_after_fork): Ditto.
(fhandler_console::fixup_after_exec): Ditto.  Don't close handles if
close_on_exec.
* fhandler_tty.cc (fhandler_tty_slave::open): Use manage_console_count() rather
than manipulating count directly.  Reflect change in arguments to
report_tty_counts().
(fhandler_tty_slave::close): Ditto for both.
(fhandler_tty_slave::dup): Ditto for both.
(fhandler_tty_slave::ioctl): Use myctty() rather than raw ctty #.
(fhandler_tty_slave::fixup_after_fork): Reflect change in arguments to
report_tty_counts().
(fhandler_tty_master::init_console): Use manage_console_count() rather than
manipulating count directly.
* fhandler_clipboard.cc (fhandler_dev_clipboard::fixup_after_exec): Don't
perform any operations if close_on_exec.
* fhandler_dsp.cc (fhandler_dev_dsp::fixup_after_exec): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::fixup_after_exec): Ditto.
* fhandler_serial.cc (fhandler_serial::fixup_after_exec): Ditto.
* pinfo.h (_pinfo::_ctty): Declare new function.
(myctty): Declare new macro.
(__ctty): Declare new macro.
* pinfo.cc (_pinfo::_ctty): Define new function.
(_pinfo::set_ctty): Use manage_console_count() rather than manipulating count
directly.
* signal.cc (kill_pgrp): Use myctty() and __ctty() macros rather than raw ctty
#.
* syscalls.cc (setsid): Ditto.  Use manage_console_count() rather than
manipulating count directly.
2005-11-14 04:28:45 +00:00
Corinna Vinschen 6ba3f6bb2d * fhandler_socket.cc (fhandler_socket::recvfrom): Just return 0 (EOF)
in case of WSAESHUTDOWN.
	(fhandler_socket::recvmsg): Ditto.
	* poll.cc (poll): Set revents to POLLIN instead of POLLHUP. Add comment.
2005-11-13 16:24:40 +00:00
Christopher Faylor ecb908f699 * cygheap.h (init_cygheap::_gtod): Remove.
* cygwin.din: Export clock_getres and clock_setres.
* hires.h (hires_ms::minperiod): Delete declaration.
(hires_ms::began_period): Ditto.
(hires_ms::prime): Make void.
(hires_ms::resolution): Just define here.
(hires_ms::usecs): Remove unneeded argument.
(gtod): Redeclare as a variable.
* timer.cc (timer_thread): Eliminate argument to gtod.usecs().
(timer_tracker::gettime): Ditto.
(timer_tracker::settime): Ditto.
* times.cc (gettimeofday): Ditto.
(hires_ms::began_period): Delete declaration.
(hires_us::prime): Remove debugging.
(hires_ms::prime): Make void.  Eliminate period stuff.
(hires_ms::usecs): Eliminate argument to gtod.usecs().
(hires_ms::resolution): New function.
(clock_getres): Ditto.
(clock_setres): Ditto.
* version.h: Bump API version to 143.
* include/cygwin/time.h: New file.
2005-11-11 16:42:15 +00:00
Christopher Faylor b600843ae4 * times.cc (hires_ms::prime): Comment out call to timeBeginPeriod for now.
(hires_ms::usecs): Call prime if haven't called began_period().
* param.h: Don't define stuff that is already defined in endian.h.
2005-11-11 04:07:30 +00:00
Christopher Faylor c845f0c182 * include/endian.h: Remove USE_BSD ifdef since it is never defined on Cygwin. 2005-11-10 21:17:15 +00:00
Corinna Vinschen 11b2d6cf16 Fix dates. 2005-11-10 10:36:45 +00:00
Corinna Vinschen 2d5067835e * syslog.cc (setlogmask): Don't mask the mask.
(vsyslog): Fix priority check.
2005-11-10 10:34:49 +00:00
Corinna Vinschen 03ea3f832e * include/cygwin/signal.h: Add missing sigrelse prototype. 2005-11-10 09:12:22 +00:00
Christopher Faylor 8eb445cfd3 * fhandler_base.cc (fhandler_base::readv): Free buf, not a pointer into the
middle of buf.
2005-11-08 23:25:55 +00:00
Christopher Faylor 14f7b567cc fix entry 2005-11-08 22:08:59 +00:00
Christopher Faylor 42cd8528aa * memmem.cc: New file.
* include/cygwin/version.h: Bump API version number to 142.
* cygwin.din: Export memmem.
2005-11-08 22:08:39 +00:00
Christopher Faylor 1f99dd3ecf * environ.cc (spenvs): Make "SYSTEMDRIVE" an "always export". 2005-11-08 16:32:09 +00:00
Corinna Vinschen 39f7ae0616 * times.cc (futimes): Redirect to utimes_worker if given file
descriptor is opened R/O.
2005-11-07 17:08:08 +00:00
Christopher Faylor 2b91e0dac4 * dcrt0.cc (dll_crt0_0): Initialize security data first so that it can be used
by subsequent handle creation.
2005-11-06 14:02:33 +00:00
Christopher Faylor 72319550c1 * cygheap.h (init_cygheap::_gtod): New hires_ms element.
* hires.h (hires_ms::minperiod): Remove static designation.
(hires::began_period): New field.
* signal.cc: Include headers required for cygheap.h now that gtod lives in the
cygheap.
* timer.c: Ditto.
* times.cc (gtod): Delete variable.
(gtod::minperiod): Ditto.
(gtod::began_period): Define.
(hires_ms::prime): Add more debugging output.  Call timeBeginPeriod only when
!began_period.
2005-11-04 20:45:56 +00:00
Christopher Faylor f359a29fc8 * times.cc (hires_ms::prime): More debugging.
(hires_ms::usecs): Ditto.
2005-11-04 17:38:32 +00:00
Christopher Faylor 86548162b0 * times.cc (stupid_printf): Define and use throughout -- temporarily. 2005-11-04 02:01:45 +00:00
Christopher Faylor 314f743e1e * times.cc (hires_ms::prime): Add lots of temporary debugging output. 2005-11-03 14:59:23 +00:00
Christopher Faylor 369adcf72f * times.cc (hires_ms::minperiod): Make copy-on-fork.
(gettimeofday): Remove temporary debugging.
(hires_us::prime): Add lots of temporary debugging output.
2005-11-03 02:41:51 +00:00
Christopher Faylor 1c2812f80e * times.cc (gettimeofday): Add temporary debugging output. 2005-11-02 18:28:40 +00:00
Christopher Faylor b7bb9f5fde * include/sys/cygwin.h: Define CYGWIN_SIGNAL_STRING.
* exceptins.cc (sigpacket::process): Send a _CYGWIN_SIGNAL_STRING to gdb if the
process is being debugged.  A WIP.
2005-11-01 05:55:30 +00:00
Christopher Faylor 0dc249751d * exceptions.cc (signal_exit): Eliminate setting of main thread priority since
process lock should make that unnecessary.
* fork.cc (stack_base): Eliminate.
(frok::parent): Subsume stack_base and just set stack stuff here.  Report on
priority class in debugging output.
* spawn.cc (spawn_guts): Report on priority class in debugging output.
2005-10-29 20:33:59 +00:00
Christopher Faylor f02b22dcee * fork.cc (frok::child): Change order of cleanup prior to return.
(fork): Save more of the stack.
* gendef: Fix some comments.
* sigproc.cc (wait_sig): Clarify debug output.
2005-10-29 15:19:34 +00:00
Christopher Faylor c85263884a * child_info.h (CHILD_INFO_MAGIC): Reset. 2005-10-29 15:05:55 +00:00
Christopher Faylor 6573722005 * pinfo.cc (_pinfo::fds): Lock fdtab while enumerating. 2005-10-24 15:42:14 +00:00
Corinna Vinschen 6485bf0b33 * spawn.cc (spawn_guts): Don't leave the function with return inside
pthread cleanup brackets.
2005-10-24 15:17:54 +00:00
Christopher Faylor 16bbf0cc57 * cygheap.h (cygheap_fdenum): Remove start_fd stuff.
(cygheap_fdenum::rewind): Ditto.
* pipe.cc (fhandler_pipe::open): Lock fdtab while enumerating.
* times.cc (utimes_worker): Ditto.
2005-10-24 15:09:07 +00:00
Christopher Faylor 0f9a8fc652 add missing ChangeLog entry 2005-10-24 00:02:05 +00:00
Christopher Faylor 82c925af80 * cygheap.h (cygheap_fdenum::cygheap_fdenum): Record locked state or suffer
deadlocks.
(class locked_process): Move to another header.
* sync.h (lock_process): Define here.
* cygtls.cc (_cygtls::fixup_after_fork): Reset spinning state as well as
stacklock state.
* dcrt0.cc (lock_process::locker): Define.
(dtable::lock_cs): Delete.
* dtable.cc (dtable_init): Eliminate call to init_lock().
(dtable::fixup_after_fork): Ditto.
(dtable::init_lock): Delete definition.
* dtable.h (dtable::init_lock): Delete declaration.
(dtable::lock): Use process lock rather than dtable-specific lock.
(dtable::unlock): Ditto.
* sigproc.cc (sigproc_init): Minor change to debugging output.
* times.cc (utime_worker): Use build_fh_pc rather than reinterpreting the posix
path name again.  Return any error from path_conv immediately.
2005-10-23 23:47:45 +00:00
Corinna Vinschen c2c020d1fb * fhandler_socket.cc (fhandler_socket::connect): Don't restrict
WSAEINVAL -> WSAEISCONN conversion to nonblocking sockets.
	(fhandler_socket::accept): Use event driven technique to implement
	interuptible accept.
	(fhandler_socket::wait): Allow FD_ACCEPT handling.
	* net.cc (cygwin_accept): Remove workaround for allowing blocking
	accept.  That's entirely in fhandler_socket::accept now.
2005-10-22 16:02:15 +00:00
Corinna Vinschen 152a9caf58 * fhandler.h (class fhandler_socket): Add timeout parameter to wait()
method.
	* fhandler_socket.cc (fhandler_socket::connect): Use event driven
	technique (prepare/wait/release) to implement interuptible connect.
	(fhandler_socket::wait): Add timeout parameter.  Allow FD_CONNECT
	handling.
	* net.cc (cygwin_connect): Remove braindead workaround for allowing
	blocking connect.  That's entirely in fhandler_socket::connect now.
2005-10-22 15:11:49 +00:00
Corinna Vinschen 88d30f0b2f * include/cygwin/version.h: Fix typo. 2005-10-22 10:28:02 +00:00
Christopher Faylor a591389de3 * dir.cc (rmdir): Eliminate nonsensical code.
* fork.cc (fork): Move exit debug_printf to last statement.
2005-10-21 14:08:19 +00:00
Corinna Vinschen 81bd1ca723 * cygwin.din (futimes): Export.
(lutimes): Export.
	* times.cc (utimes_worker): Created from utimes, add nofollow flag
	to implement utimes and lutimes.
	(utimes): Just call utimes_worker.
	(lutimes): New function.
	(futimes): Ditto.
	* include/cygwin/version.h: Bump API minor version.
2005-10-20 14:26:23 +00:00
Christopher Faylor 0cdcb2345a * sigproc.cc (child_info::sync): Move check for !wr_proc_pipe lower.
* spawn.cc (spawn_guts): Correct check for top-level process.
2005-10-19 22:25:46 +00:00
Christopher Faylor fece95f7f3 * sigproc.cc (child_info::sync): Move check for !wr_proc_pipe lower.
* spawn.cc (spawn_guts): Correct check for top-level process.
2005-10-19 22:13:04 +00:00
Corinna Vinschen c928a06464 * autoload.cc: Revert loading rcmd, rexec, rresvport and inet_network
from wsock32.dll since these symbols are not exported from ws2_32.dll.
2005-10-19 19:55:31 +00:00
Christopher Faylor b27f0b2cf9 * times.cc (utimes): Only consider fds opened with write access. 2005-10-19 17:11:25 +00:00
Christopher Faylor 5a90915d41 * fhandler_disk_file.cc (fhandler_base::utimes_fs): Use existing handle if
fhandler has one.
* times.cc (utimes): Scan open fds for matching paths and use existing fhandler
if one exists.
2005-10-19 16:50:43 +00:00
Christopher Faylor b3982520d3 * pinfo.cc (_pinfo::dup_proc_pipe): Make warning more severe by actually
printing it.
(_pinfo::alert_parent): Fix comment.  Don't send to parent if we are in an exec
stub.
2005-10-19 14:19:37 +00:00
Christopher Faylor b72a5c0767 * cygtls.cc (handle_threadlist_exception): Improve diagnostic output.
* sigproc.cc (child_info::sync): Only clear hProcess when execing.
(wait_sig): Protect readsig handle.
2005-10-19 00:22:08 +00:00
Corinna Vinschen 1f5c3042d5 * autoload.cc (NtLockVirtualMemory): Import.
(NtUnlockVirtualMemory): Import.
	(GetProcessWorkingSetSize): Import.
	(SetProcessWorkingSetSize): Import.
	* cygwin.din (mlock): Export.
	(munlock): Export.
	* mmap.cc (mlock): New function.
	(munlock): Ditto.
	* ntdll.h (STATUS_WORKING_SET_QUOTA): Define.
	(LOCK_VM_IN_WSL): Define.
	(LOCK_VM_IN_RAM): Define.
	(NtLockVirtualMemory): Declare.
	(NtUnlockVirtualMemory): Declare.
	* sysconf.cc (sysconf): Implement _SC_MEMLOCK_RANGE.
	* wincap.h: Implement has_working_virtual_lock throughout.
	* wincap.cc: Ditto.
	* include/cygwin/version.h: Bump API minor version.
	* include/sys/mman.h (mlock): Declare,
	(munlock): Declare.
2005-10-18 18:51:33 +00:00
Christopher Faylor a93b4154f1 * sigproc.cc (child_info::sync): Use correct name when closing to prevent
warnings when DEBUGGING.
* spawn.cc (spawn_guts): Set myself.hProcess to pi.hProcess since this may have
been zeroed by the previous sync.
2005-10-18 15:13:13 +00:00
Christopher Faylor 4116609aca * sigproc.cc (child_info::sync): Fix typo which caused hProcess to never be
cleared.  Only clear hProcess when not forking.
2005-10-18 04:20:46 +00:00
Christopher Faylor 267e201dae Change process_lock to lock_process throughout. Change all calls to new
cygthread to handle extra argument, throughout.
* cygthread.h (cygthread::callproc): Declare new method.
(cygthread::cygthread): Add optional length argument to allow copying arguments
to executing thread.
* cygthread.cc (cygthread::callproc): Define new method.
(cygthread::stub): Use callfunc to invoke thread func to allow potentially
allocating stack memory which will be returned.
(cygthread::simplestub): Ditto.
(cygthread::cygthread): Accept arglen argument.  Reset ev here prior to
activating thread.  Wait for ev after activating thread if we're copying
contents to the thread.  Wait until the end before setting h, to allow thread
synchronization.
(cygthread::release): Don't reset ev here.  Rely on that happening the next
time the thread is activated.
* pinfo.h (commune_process): Rename declaration from _pinfo::commune_process.
* pinfo.cc (commune_process): Ditto for definition.  Modify slightly to allow
running as a separate cygthread.
* sigproc.cc (child_info::sync): Always wait for both subproc_ready and any
hProcess if we have a cygwin parent.
(talktome): Change argument to be a pointer to siginfo_t.  Contiguously
allocate whole siginfo_t structure + any needed extra for eventual passing to
commune_process thread.
(wait_sig): Accommodate change in talktome argument.
* pipe.cc (fhandler_pipe::fixup_after_exec): Remove debugging.
2005-10-17 23:27:00 +00:00
Corinna Vinschen 8b00a766ff * autoload.cc: Never load wsock32.dll. Load all wsock32 function
from ws2_32.  Rearrange symbol order accordingly.  None of the ws2_32
	functions is optional right now.
	(wsadata): Move from net.cc here.  Define NO_COPY.
	(wsock_init): Drop unused symbols ws2_32_handle and wsock32_handle.
	(load_wsock32): Remove.
	(WSACleanup): Remove.
	* fhandler_socket.cc: Drop Winsock 1 accommodations throughout.
	(fhandler_socket::readv): Accomodate new POSIX style struct msghdr.
	(fhandler_socket::writev): Ditto.
	(fhandler_socket::recvmsg): Ditto. Handle "old" applications using
	former struct msghdr correctly.
	* net.cc: Drop Winsock 1 accommodations throughout.
	(wsadata): Move definition to autoload.cc.
	(set_socket_inheritance): Remove.
	(convert_ws1_ip_optname): New static function to convert Winsock1
	IPPROTO_IP option values into Winsock2 IPPROTO_IP option values.
	(cygwin_setsockopt): Remove wrong and incomplete cleartext printing
	of optname.  For "old" applications, convert optname from Winsock1
	to Winsock2 values before using them.  Add comment to describe the
	IP_TOS weirdness on W2K and above.
	(cygwin_getsockopt): Remove wrong and incomplete cleartext printing
	of optname.  For "old" applications, convert optname from Winsock1
	to Winsock2 values before using them.
	* select.cc (start_thread_socket): Forget about winsock2_active.
	* winsup.h (wsock32_handle): Remove declaration.
	(ws2_32_handle): Ditto.
	(netapi32_handle): Ditto.
	(wsadata): Ditto.
	(winsock2_active): Remove definition.
	* include/cygwin/socket.h: Change formatting slightly.
	(socklen_t): Move definition up in file.
	(struct msghdr): Convert to POSIX style.
	(struct cmsghdr): New type.
	(CMSG_ALIGN): New macro.
	(CMSG_LEN): Ditto.
	(CMSG_SPACE): Ditto.
	(CMSG_FIRSTHDR): Ditto.
	(CMSG_NXTHDR): Ditto.
	(CMSG_DATA): Ditto.
	(SCM_RIGHTS): Ditto.
	(struct OLD_msghdr): Define old msghdr structure for Cygwin internal
	purposes.
	(MSG_TRUNC): New macro.
	(MSG_CTRUNC): Ditto.
	(IP_OPTIONS): Redefine IPPROTO_IP option values to Winsock2 values.
	Keep Winsock1 values for Cygwin internal purposes.
	* include/cygwin/version.h: Bump API minor version.
	(CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR): Define to check for
	applications using old struct msghdr.
	(CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES): Define to check for
	applications using old Winsock1 IPPROTO_IP values.
2005-10-17 21:22:18 +00:00
Christopher Faylor 0fa52a6cdf Check in previously ChangeLoged entry. 2005-10-17 03:20:20 +00:00
Christopher Faylor fd1165e29a * Makefile.in (MKDIRP): Just use raw $(INSTALL) rather than $(INSTALL_DATA).
Create directories with 755 permissions.
2005-10-14 02:15:12 +00:00
Christopher Faylor bf1550b6f8 * dir.cc (mkdir): Abandon use of PC_WRITABLE.
(rmdir): Ditto.
* path.h (PC_WRITABLE): Delete.
* path.cc (path_conv::check): Remove PC_WRITABLE accommodations.  Revisit
later.
2005-10-12 20:38:38 +00:00
Corinna Vinschen 48882f9a07 * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Convert an
ERROR_INVALID_FUNCTION into an ERROR_FILE_NOT_FOUND.  Add comment
	to explain why.
2005-10-12 12:54:34 +00:00
Christopher Faylor d9b8d62966 * Makefile.in: Make sure that directories are created prior to copying to them. 2005-10-11 18:27:05 +00:00
Christopher Faylor f2e8d7b0f0 * net.cc (cygwin_gethostbyname): Remove debugging. 2005-10-11 16:35:31 +00:00
Corinna Vinschen bf2d5da310 * syslog.cc (try_connect_syslogd): Add priority parameter. Use writev
to add the priority to the message in a syslog conformant way.
	(vsyslog): If facility isn't set in the priority, use default facility
	as given in call to openlog. Fix agressive use of spaces in syslog
	output. Call try_connect_syslogd with priority parameter.
2005-10-11 16:28:08 +00:00
Christopher Faylor 143bf87846 * (symlink_info::set_error): Change to return bool if input error should be
ignored.
(symlink_info::check): Treat path as a normal file if set_error returns false.
2005-10-11 16:06:10 +00:00
Christopher Faylor fa35a1ee5c * cygheap.h (class process_lock): New class.
* dtable.h (class dtable): Add class process_lock as a friend.
* dcrt0.cc (get_exit_lock): Delete.
(do_exit): Use process_lock class instead of get_exit_lock.
* exceptions.cc (signal_exit): Ditto.
* pinfo.cc (pinfo::exit): Ditto.
(_pinfo::commune_process): Set process lock around this whole function.
(_pinfo::commune_request): Use process_lock rather than myself.lock.
* pinfo.h (pinfo::_lock): Delete.
(pinfo::initialize_lock): Delete.
(pinfo::lock): Delete.
(pinfo::unlock): Delete.
* winsup.h (get_exit_lock): Delete declaration.
2005-10-03 17:23:54 +00:00
Corinna Vinschen 77bb159309 * uname.cc (uname): Disable use of GetNativeSystemInfo. 2005-10-03 09:24:42 +00:00
Christopher Faylor 0cb6fc5d30 * dcrt0.cc (get_exit_lock): Use myself.lock rather than exit_lock.
* exceptions.cc (exit_lock): Delete.
(events_init): Don't init exit_lock.
* (_pinfo::commune_process): Add per-PICOM debugging.
* sigproc.cc (talktome): Add some temporary debugging statements.
* fhandler_proc.cc (format_proc_cpuinfo): Cosmetic change.
(format_proc_partitions): Ditto.
* syscalls.cc (locked_append): Ditto.
2005-10-02 00:13:41 +00:00
Christopher Faylor f5cfdc0fa4 * dcrt0.cc (do_exit): Don't set ES_SET_MUTO here. Call get_exit_lock()
instead.
(get_exit_lock): New function.  Grabs the lock and sets initial exit_state.
* exceptions.cc (try_to_debug): Use low_priority_sleep.
(sigpacket::process): Avoid handler if this is an exec stub.
(signal_exit): Use get_exit_lock rather than manipulating the exit_lock
critical section directly.
* pinfo.cc (pinfo::exit): Ditto.
* winsup.h (get_exit_lock): Declare.
(exit_lock): Delete declaration.
2005-09-30 23:52:13 +00:00
Corinna Vinschen 3498288eff Fix typo. 2005-09-30 11:03:35 +00:00
Corinna Vinschen 3c92c79b84 * fhandler_disk_file.cc: Change calls to pc.set_attributes into
calls to pc.file_attributes throughout.
	* path.h (class path_conv): Remove superfluous set_attributes method.
2005-09-30 11:02:47 +00:00
Corinna Vinschen 8afc05fa90 * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Use
fhandler method to access majoer device number.  Add comment to
	explain floppy weirdness.
2005-09-30 10:54:45 +00:00
Corinna Vinschen 251436268e * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Also use
attributes stored in this->pc if call to GetFileInformationByHandle
	failed.
2005-09-30 10:27:14 +00:00
Corinna Vinschen 04f3d97fe4 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Only write
attributes if call to GetFileInformationByHandle was successful.
2005-09-30 08:05:42 +00:00
Christopher Faylor 40c7d132ef * fork.cc (frok::parent): Simplify error messages. Don't issue an error when
child.remember fails.
(fork): When appropriate, build up an error message from grouped.error.
2005-09-30 00:18:30 +00:00
Corinna Vinschen f859ca87a7 * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Don't call
EX ioctls on floppy drives.
2005-09-29 16:57:09 +00:00
Corinna Vinschen f6c9ff6646 * dir.cc (mkdir): Check for trailing /. or /.. component.
(rmdir): Ditto.
	* path.cc (has_dot_last_component): New function.
	* path.h (has_dot_last_component): Add declaration.
2005-09-29 16:23:22 +00:00
Corinna Vinschen 9a7b0aad2a * crt0.cc: Remove PPC considerations.
(WinMainCRTStartup): Add symbol as alias to mainCRTStartup.
2005-09-29 14:28:22 +00:00
Christopher Faylor 350e5fc23d Fix typo. 2005-09-28 23:24:57 +00:00
Christopher Faylor 0730fa0763 Change name from commune_recv to commune_process throughout. Change name from
commune_send to commune_request throughout.
* pinfo.h (PICOM_EXTRASTR): New flag.
(PICOM_FIFO): Define with new flag.
(_pinfo::hello_pid): Delete.
(_pinfo::tothem): Delete.
(_pinfo::fromthem): Delete.
(_pinfo::commune_process): Rename from commune_recv.  Add a siginfo_t argument
to declaration.
(_pinfo::commune_request): Rename from commune_send.  Change DWORD to
__uint32_t in declaration.
* pinfo.cc (_pinfo::commune_process): Rename from commune_recv.  Add siginfo_t
argument.  Use information from argument rather than reading from another pipe.
Synchronize with other process's commune event.
(_pinfo::commune_request): Rename from commune_send.  Change DWORD to __uint32
in argument.  Fill out information in new siginfo_t element and rely on
extended operation of sig_send rather than trying to deal with synchronization
issues here.  Use process handle and read pipe information filled out by
sig_send to gather information from the other process.
* sigproc.cc (sig_send): Take special action if "communing" to ensure
synchronization with the other process and to return information about the
other process to the caller.
(talktome): Accept a siginfo_t and handle arguments.  Read additional
information from the signal pipe when _si_commune._si_code has the
PICOM_EXTRASTR flag set.
(wait_sig): Pass the transmitted siginfo_t struct and the pipe handle to
talktome.  Close pipe read handle as soon as possible after we detect that
we're exiting.
2005-09-28 22:56:47 +00:00
Christopher Faylor 503490bb9f * hookapi.cc (hook_or_detect_cygwin): Correct inverted test for whether to
allocate a buffer by always allocating a buffer.
2005-09-28 20:20:57 +00:00
Corinna Vinschen f098767559 * fhandler.h (class fhandler_dev_raw): Delete current_position and
eof_detected status flag.  Delete is_eom and is_eof methods.
	Move drive_size, bytes_per_sector, eom_detected status flag, as well
	as the methods read_file, write_file, raw_read and raw_write to ...
	(class fhandler_dev_floppy): ... here. Remove is_eom and is_eof
	methods.  Add dup method.
	* fhandler_floppy.cc (IS_EOM): New macro.
	(fhandler_dev_floppy::is_eom): Remove.
	(fhandler_dev_floppy::is_eof): Remove.
	(fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags.
	(fhandler_dev_floppy::get_drive_info): Only call EX functions on
	systems supporting them and stop suffering strange delays.
	(fhandler_dev_floppy::read_file): Move here, drop setting
	current_position.
	(fhandler_dev_floppy::write_file): Move here, drop setting
	current_position.
	(fhandler_dev_floppy::open): Rearrange comment.
	(fhandler_dev_floppy::dup): New method.
	(fhandler_dev_floppy::get_current_position): New inline method.  Use
	instead of former current_position were appropriate.
	(fhandler_dev_floppy::raw_read): Move here.  Drop EOF handling.
	(fhandler_dev_floppy::raw_write): Move here.  Drop EOF handling.
	(fhandler_dev_floppy::lseek): Remove useless conditions.  Convert
	sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call.
	(fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case
	to here.
	* fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove.
	(fhandler_dev_raw::is_eof): Remove.
	(fhandler_dev_raw::write_file): Remove.
	(fhandler_dev_raw::read_file): Remove.
	(fhandler_dev_raw::raw_read): Remove.
	(fhandler_dev_raw::raw_write): Remove.
	(fhandler_dev_raw::dup): Drop copying removed members.
	(fhandler_dev_raw::ioctl): Drop blocksize testing.
	* wincap.h: Implement has_disk_ex_ioctls throughout.
	* wincap.cc: Ditto.
	(wincap_vista): Preliminary wincaps for Windows Vista/Longhorn.
	(wincapc::init): Add Vista/Longhorn handling.
2005-09-28 19:33:18 +00:00
Corinna Vinschen dcb091caaf Revert erroneous checkin. 2005-09-28 19:22:25 +00:00
Corinna Vinschen 1204c515fe * fhandler.h (class fhandler_dev_raw): Delete current_position and
eof_detected status flag.  Delete is_eom and is_eof methods.
	Move drive_size, bytes_per_sector, eom_detected status flag, as well
	as the methods read_file, write_file, raw_read and raw_write to ...
	(class fhandler_dev_floppy): ... here. Remove is_eom and is_eof
	methods.  Add dup method.
	* fhandler_floppy.cc (IS_EOM): New macro.
	(fhandler_dev_floppy::is_eom): Remove.
	(fhandler_dev_floppy::is_eof): Remove.
	(fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags.
	(fhandler_dev_floppy::get_drive_info): Only call EX functions on
	systems supporting them and stop suffering strange delays.
	(fhandler_dev_floppy::read_file): Move here, drop setting
	current_position.
	(fhandler_dev_floppy::write_file): Move here, drop setting
	current_position.
	(fhandler_dev_floppy::open): Rearrange comment.
	(fhandler_dev_floppy::dup): New method.
	(fhandler_dev_floppy::get_current_position): New inline method.  Use
	instead of former current_position were appropriate.
	(fhandler_dev_floppy::raw_read): Move here.  Drop EOF handling.
	(fhandler_dev_floppy::raw_write): Move here.  Drop EOF handling.
	(fhandler_dev_floppy::lseek): Remove useless conditions.  Convert
	sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call.
	(fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case
	to here.
	* fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove.
	(fhandler_dev_raw::is_eof): Remove.
	(fhandler_dev_raw::write_file): Remove.
	(fhandler_dev_raw::read_file): Remove.
	(fhandler_dev_raw::raw_read): Remove.
	(fhandler_dev_raw::raw_write): Remove.
	(fhandler_dev_raw::dup): Drop copying removed members.
	(fhandler_dev_raw::ioctl): Drop blocksize testing.
	* wincap.h: Implement has_disk_ex_ioctls throughout.
	* wincap.cc: Ditto.
	(wincap_vista): Preliminary wincaps for Windows Vista/Longhorn.
	(wincapc::init): Add Vista/Longhorn handling.
2005-09-28 19:02:53 +00:00
Christopher Faylor 280fdd0b67 * dcrt0.cc (getstack): New function.
(alloc_stack): Use tls stuff for stack info rather than calling VirtualQuery.
(dll_crt0_0): Initialize _impure_ptr stuff much earlier.  Move
init_console_handler here.
* fork.cc (class frok): New class renamed from local fork() struct.
(stack_base): Change argument type.  Use tls stuff to determine stack info
rather than calling VirtualQuery.
(frok::child): Rename from fork_child.  Eliminate now unneeded arguments.
(frok::parent): Rename from fork_parent and ditto.  Set error and errno as
appropriate.  Fixup impersonation in cleanup, if needed.  Try harder to set
errno appropriately.
(fork): Define "grouped" as a frok type.  Deal with errors from fork_parent
here.
* init.cc (dll_entry): Remove init_console_handler call.
2005-09-28 15:18:49 +00:00
Christopher Faylor 9edadc960e * pinfo.cc (_pinfo::dup_proc_pipe): Ignore error if the child process has just
gone away.
2005-09-28 13:55:04 +00:00
Christopher Faylor 43634a4158 * init.cc (prime_threads): Make this static, as it should be.
(dll_entry): Apply cosmetic changes to define closer to the way MSDN suggests.
2005-09-28 02:43:29 +00:00
Corinna Vinschen 22704a8da3 * pthread.cc (mangle_sem_name): Use cygheap->shared_prefix instead
of fiddling with wincap.has_terminal_services manually.
2005-09-27 20:34:19 +00:00
Corinna Vinschen f1cdab8563 * cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely
since hProcImpToken isn't initialized here.
	* shared.cc (open_shared): Always print mapname instead of name in
	debug output.
2005-09-27 19:04:38 +00:00
Christopher Faylor e0be0a1d50 * strace.cc (strace::vsprntf): Avoid printing a zero pid. 2005-09-27 18:54:32 +00:00
Corinna Vinschen 91049bd9cd * init.cc (dll_entry): Call IsWow64Process with GetCurrentProcess
as process handle since hMainProc isn't initialized here.
2005-09-27 17:44:29 +00:00
Corinna Vinschen 357d430185 * fhandler_floppy.cc (fhandler_dev_floppy::get_drive_info): Always
try IOCTL_DISK_GET_DRIVE_GEOMETRY_EX and
	IOCTL_DISK_GET_PARTITION_INFO_EX ioctls first, to allow access to GPT
	partitioned disks.  Fall back to old non-EX ioctls otherwise.
	Add comment to explain NT4 weirdness.
2005-09-27 15:33:02 +00:00
Corinna Vinschen 6c22c79f73 * errno.cc (errmap): Map ERROR_SEEK and ERROR_SECTOR_NOT_FOUND. 2005-09-26 15:27:15 +00:00
Christopher Faylor a3d5219c5f * exceptions.cc (_cygtls::call_signal_handler): Minor cleanup. 2005-09-26 14:58:16 +00:00
Corinna Vinschen b470a0e81f * fhandler.h (class fhandler_dev_raw): Add drive information members
drive_size, current_position and bytes_per_sector.
	(fhandler_dev_floppy::get_drive_info): Declare.
	* fhandler_floppy.cc (fhandler_dev_floppy::is_eom): Define ERROR_SEEK
	and ERROR_SECTOR_NOT_FOUND as end-of-medium conditions.
	(fhandler_dev_floppy::get_drive_info): New method to have one function
	retrieving drive info.
	(fhandler_dev_floppy::open): Call get_drive_info to get drive
	information right from the start.
	(fhandler_dev_floppy::lseek): Use and set drive information members.
	Especially keep track of current_position.
	(fhandler_dev_floppy::ioctl): Ditto.
	* fhandler_raw.cc (fhandler_dev_raw::write_file): Keep track of
	current_position.
	(fhandler_dev_raw::read_file): Ditto.
	(fhandler_dev_raw::raw_read): Never try to read beyond end-of-medium.
	(fhandler_dev_raw::dup): Handle new drive information members.
2005-09-26 14:55:40 +00:00
Christopher Faylor d5f4ee62b7 * exceptions.cc (handle_exceptions): Just si_code to SI_KERNEL first and let it
be overridden.
* exceptions.cc (_cygtls::call_signal_handler): Call signal handler with extra
siginfo_t * and void * parameters when SA_SIGINFO flag is set.
* signal.cc (signal): Clear SA_SIGINFO flag.
(sigqueue): Fix incorrect setting of si_code.
* sigproc.cc (signal_fixup_after_exec): Clear SA_SIGINFO flag when setting
handler to SIG_DFL.
2005-09-26 14:51:48 +00:00
Christopher Faylor 683cc8189c * pinfo.cc (proc_waiter): Properly fill out si_code as according to SUSv3.
* exceptions.cc (handle_exceptions): Properly fill out si_code as according to
SUSv3.
2005-09-26 13:47:27 +00:00
Christopher Faylor f086715060 * exceptions.cc (handle_exceptions): Properly fill out si_code. 2005-09-26 13:23:47 +00:00
Christopher Faylor 529649f983 * sigproc.cc (wait_sig): Cosmetic change.
* pinfo.cc (pinfo::exit): Don't explicitly remove myself since some other
thread may still be using it.
2005-09-26 01:27:36 +00:00
Christopher Faylor 6f96c53642 * sigproc.cc (sigproc_terminate): More reversion of always-exit-from-sigthread
change.
2005-09-24 19:17:49 +00:00
Christopher Faylor 5cbcdfa9dd * shared.cc (open_shared): Add crucial bit of debugging info. 2005-09-23 23:56:17 +00:00
Christopher Faylor 5e477e9a9b Semi-reversion of always-exit-from-sigthread change of 2005-09-15.
* exceptions.cc (sigpacket::process): Eliminate return after call to reinstated
noreturn function.
(signal_exit): Allow function to exit when a captive process has been
terminated.
* pinfo.cc (pinfo::exit): Enter exit_lock here.  Once again exit here under
control of exit_lock.
* sigproc.cc (sig_send): Don't wait for completion if process is exiting.
Remove special __SIGEXIT accommodations.
(wait_sig): Just exit the thread when a __SIGEXIT has been detected.  Don't
exit the process.
2005-09-23 23:37:52 +00:00
Christopher Faylor 1b19d74296 * net.cc (cygwin_gethostbyname): Remove debugging cruft. 2005-09-23 23:25:25 +00:00
Christopher Faylor 0017e72675 * pinfo.cc (pinfo::exit): Call ExitProcess if called from signal thread. 2005-09-23 20:05:50 +00:00
Christopher Faylor 0c75486267 * tlsoffsets.h: Regenerate. 2005-09-23 19:24:03 +00:00
Christopher Faylor 08c7ea264b * pinfo.cc (pinfo::exit): Eliminate use of _my_tls.thread_handle. 2005-09-23 19:23:26 +00:00
Christopher Faylor 255e7e559e * cygtls.h (struct _cygtls::thread_handle): Remove/revert.
* sigproc.h (struct sipacket::thread_handle): Put thread_handle here.
* sigproc.cc (sigproc_terminate): Move setting of thread_handle...
(sig_send): ...to here.  Put it in packet being sent.  Only close pack.wakeup
when we're waiting for completion.
(wait_sig): Use thread_handle directly from received packet.
2005-09-23 15:18:22 +00:00
Christopher Faylor 85b0face89 * tlsoffsets.h: Regenerate. 2005-09-23 03:40:57 +00:00
Christopher Faylor 936e4018b6 * cygheap.cc (cygheap_fixup_in_child): It's not just for exec.
* cygtls.h (struct _cygtls::thread_handle): New field.
* dcrt0.cc (exit_lock): Remove declaration.
* winsup.h (exit_lock): Add declaration.
* exceptions.cc (sigpacket::process): Properly return after signal_exit.
* pinfo.cc (pinfo::exit): Only exit the process if _my_tls.thread_handle has
not been filled out -- which should be an impossible event.
* sigproc.cc (sigproc_terminate): Fillout _my_tls.thread_handle to provide
something for wait_sig to wait for.  Use the siginfo_t version of sig_send and
fill out the tls argument with _my_tls.
(wait_sig): Wait for the thread specified in pack.tls or (for now) complain
bitterly if it doesn't exit.
2005-09-23 03:35:41 +00:00
Christopher Faylor 4340c43955 * pinfo.cc (set_myself): Call strace.hello unconditionally when DEBUGGING.
(pinfo::init): Sleep and issue debugging output before looping when a
PID_EXITED is found.
2005-09-22 21:10:07 +00:00
Corinna Vinschen b30dbbe2c3 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Fix copy/paste
bug.
2005-09-22 17:53:38 +00:00
Christopher Faylor 378017d7c2 * strace.cc (strace::vsprntf): Avoid accessing myself->pid if !myself. 2005-09-22 17:06:48 +00:00
Christopher Faylor 7e7a719a8e * include/sys/strace.h (_STRACE_ON): Remove semicolon from definition.
(_STRACE_OFF): Remove semicolon from definition.
2005-09-22 16:41:36 +00:00
Corinna Vinschen f3810c7281 * fhandler.h (fhandler_base::fstat_helper): Declare with additional
file attributes argument.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Use
	file attributes evaluated from NtQueryFileInformation or
	FileInformationByHandle in call to fstat_helper.
	Set pc.fileattr from just evaluated file attributes here.
	(fhandler_base::fstat_by_name): Use file attributes evaluated from
	FindFileFirst or default attribute in call to fstat_helper.
	Set pc.fileattr from just evaluated file attributes here.
	(fhandler_base::fstat_helper): Use file attributes given as argument,
	not file attributes stored in this fhandler, since this information
	is potentially wrong.  Add comment to explain this.
	* path.h (has_attribute): New global inline function.
	(path_conv::set_attributes): New method to change fileattr.
2005-09-22 15:52:02 +00:00
Christopher Faylor faf4210542 * cygthread.cc (cygthread::operator new): Just use getenv() to look for
CYGWIN_FREERANGE_NOCHECK since the Windows environment may be truncated by
being previously execed.
2005-09-21 19:29:50 +00:00
Christopher Faylor e15e9fc9a7 * spawn.cc (av::fixup): Just blindly run any file if it has a .bat or .cmd
extension.
2005-09-20 18:32:23 +00:00
Christopher Faylor c529909f45 * dcrt0.cc (do_exit): Only call sigproc_terminate from one location --
pinfo::exit.
* pinfo.cc (pinfo::exit): Move sigproc_terminate later so that signals can be
processed while waiting for hExeced child.
(pinfo::maybe_set_exit_code_from_windows): Set exit code from sigExeced if it
is non-zero.  Set exit_state to ES_EXEC_EXIT prior to waiting for captive
process exit code.
* exceptions.cc (sigExeced): New global variable.
(signal_exit): Remove noreturn attribute from declaration.
(signal_exit): Just terminate captive process and return if hExeced on the
theory that the exit will be subsequently handled in the main thread.
* sigproc.cc (sigproc_terminate): Eliminate test for ES_SIGPROCTERMINATE and
use ES_FINAL instead.
(sig_send): Use no_signals_available instead of duplicate test.
* winsup.h (ES_EXEC_EXIT): New enum.
(ES_SIGPROCTERMINATE): Delete.
2005-09-20 02:06:57 +00:00
Christopher Faylor e60ec8bf96 white space changes to force new snapshot 2005-09-19 15:50:56 +00:00