summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_proc.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-10-30 21:05:18 +0000
committerChristopher Faylor <me@cgf.cx>2002-10-30 21:05:18 +0000
commit831d6fa520ed43d055924607a2d9be7fcc3813e9 (patch)
treef79c2bc5524f448accc0d407fc5b3b5c8ff9e0f4 /winsup/cygwin/fhandler_proc.cc
parent4c8eba2cf384878e76b5d13acf0d7b22db531463 (diff)
downloadcygnal-831d6fa520ed43d055924607a2d9be7fcc3813e9.tar.gz
cygnal-831d6fa520ed43d055924607a2d9be7fcc3813e9.tar.bz2
cygnal-831d6fa520ed43d055924607a2d9be7fcc3813e9.zip
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_proc.cc')
-rw-r--r--winsup/cygwin/fhandler_proc.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index 86c3c81fb..f887e8cb7 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -327,7 +327,7 @@ fhandler_proc::fill_filebuf ()
uname (&uts_name);
bufalloc = strlen (uts_name.sysname) + 1 + strlen (uts_name.release) +
1 + strlen (uts_name.version) + 2;
- filebuf = (char *) cmalloc (HEAP_BUF, bufalloc);
+ filebuf = (char *) realloc (filebuf, bufalloc);
filesize = __small_sprintf (filebuf, "%s %s %s\n", uts_name.sysname,
uts_name.release, uts_name.version);
}
@@ -335,15 +335,13 @@ fhandler_proc::fill_filebuf ()
}
case PROC_UPTIME:
{
- if (!filebuf)
- filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 80);
+ filebuf = (char *) realloc (filebuf, bufalloc = 80);
filesize = format_proc_uptime (filebuf, bufalloc);
break;
}
case PROC_STAT:
{
- if (!filebuf)
- filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 2048);
+ filebuf = (char *) realloc (filebuf, bufalloc = 2048);
filesize = format_proc_stat (filebuf, bufalloc);
break;
}
@@ -354,16 +352,14 @@ fhandler_proc::fill_filebuf ()
* Windows 95/98/me does have the KERNEL/CPUUsage performance counter
* which is similar.
*/
- if (!filebuf)
- filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 16);
+ filebuf = (char *) realloc (filebuf, bufalloc = 16);
filesize = __small_sprintf (filebuf, "%u.%02u %u.%02u %u.%02u\n",
0, 0, 0, 0, 0, 0);
break;
}
case PROC_MEMINFO:
{
- if (!filebuf)
- filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 2048);
+ filebuf = (char *) realloc (filebuf, bufalloc = 2048);
filesize = format_proc_meminfo (filebuf, bufalloc);
break;
}