diff options
author | Christopher Faylor <me@cgf.cx> | 2004-12-18 19:37:44 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-12-18 19:37:44 +0300 |
commit | b25e8b65c27642806ba9f6cc6a75373bdc17c337 (patch) | |
tree | ed6cc0986ad588a76f402a80eff9b8f82647826e /winsup/cygwin/fhandler_process.cc | |
parent | a9c42bde0b7455de5d6882264efb7e96a3781678 (diff) |
* fhandler_proc.cc (proc_listing): Add entry for "self".
(proc_fhandlers): Add entry for "self".
* fhandler_process.cc (fhandler_process::fstate): Handle "self".
(fhandler_process::open): Handle "self".
Diffstat (limited to 'winsup/cygwin/fhandler_process.cc')
-rw-r--r-- | winsup/cygwin/fhandler_process.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index e56b85357..004233d3a 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -107,7 +107,10 @@ fhandler_process::fstat (struct __stat64 *buf) int file_type = exists (); (void) fhandler_base::fstat (buf); path += proc_len + 1; - pid = atoi (path); + if (path_prefix_p ("self", path, 4)) + pid = getpid (); + else + pid = atoi (path); pinfo p (pid); if (!p) { @@ -167,7 +170,10 @@ fhandler_process::open (int flags, mode_t mode) const char *path; path = get_name () + proc_len + 1; - pid = atoi (path); + if (path_prefix_p ("self", path, 4)) + pid = getpid (); + else + pid = atoi (path); while (*path != 0 && !isdirsep (*path)) path++; @@ -313,7 +319,8 @@ fhandler_process::fill_filebuf () strcpy (filebuf, "<defunct>"); else { - mount_table->conv_to_posix_path (p->progname, filebuf, 1); + charplus x (p->progname); + mount_table->conv_to_posix_path (x, filebuf, 1); int len = strlen (filebuf); if (len > 4) { |