* external.cc (cygwin_internal): Implement CW_CMDLINE.

* pinfo.h (SIGCOMMUNE): New signal type.
(commune_result): New structure for commune functions.
(picom): New enum for commune functions.
(_pinfo::hello_pid): New.  Pid who's communicating with me.
(_pinfo::tothem): New.  Handle of communicating pipe.
(_pinfo::fromthem): Ditto.
(_pinfo::commune_recv): Declare.
(_pinfo::commune_send): Declare.
(_pinfo::alive): Declare.
(_pinfo::cmdline): Declare.
(_pinfo::lock): Declare.
* pinfo.cc (set_myself): Initialize new _pinfo lock.
(_pinfo::alive): Define.  Determines if process still exists.
(_pinfo::commune_recv): Define.  Receive info from another cooperating process.
(_pinfo::commune_send): Define.  Send info to another cooperating process.
(_pinfo::cmdline): Define.  Determine command line of a given process.
* include/sys/cygwin.h (CW_CMDLINE): Define.
*sigproc.cc (talktome): Communicate with any processes who want to talk to me.
(wait_sig): Honor __SIGCOMMUNE.
* fhandler.cc (fhandler_virtual::fixup_after_exec): Declare.
* fhandler_proc.cc: Use malloc/free/realloc throughout rather than cmalloc
since buffers don't need to be propagated to subprocesses.
* fhandler_registry.cc: Ditto.
* fhandler_virtual.cc: Ditto.
(fhandler_virtual::fixup_after_exec): Define.
* fhandler_process.cc: Ditto for malloc/free/realloc.
(process_listin): Add "cmdline".
(fhandler_process::fill_filebuf): Implement PROCESS_CMDLINE.
* miscfuncs.cc (isalpha_array): New array populated with xor values for alpha
characters to switch from one case to another.
* string.h (cygwin_strcasematch): New asm implementation of case match.
* string.h (cygwin_nstrcasematch): New asm implementation of counted case
match.
This commit is contained in:
Christopher Faylor
2002-10-30 21:05:18 +00:00
parent 4c8eba2cf3
commit 831d6fa520
13 changed files with 434 additions and 38 deletions

View File

@@ -34,10 +34,17 @@ fhandler_virtual::fhandler_virtual (DWORD devtype):
fhandler_virtual::~fhandler_virtual ()
{
if (filebuf)
cfree (filebuf);
free (filebuf);
filebuf = NULL;
}
void
fhandler_virtual::fixup_after_exec (HANDLE)
{
if (filebuf)
filebuf = NULL;
}
DIR *
fhandler_virtual::opendir (path_conv& pc)
{
@@ -143,7 +150,7 @@ fhandler_virtual::dup (fhandler_base * child)
if (!ret)
{
fhandler_virtual *fhproc_child = (fhandler_virtual *) child;
fhproc_child->filebuf = (char *) cmalloc (HEAP_BUF, filesize);
fhproc_child->filebuf = (char *) malloc (filesize);
fhproc_child->bufalloc = fhproc_child->filesize = filesize;
fhproc_child->position = position;
memcpy (fhproc_child->filebuf, filebuf, filesize);
@@ -156,7 +163,7 @@ int
fhandler_virtual::close ()
{
if (filebuf)
cfree (filebuf);
free (filebuf);
filebuf = NULL;
bufalloc = (size_t) -1;
cygwin_shared->delqueue.process_queue ();