diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-09-17 19:45:51 +0200 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-09-17 19:45:51 +0200 |
| commit | fa00e45d586b096f485c06a83f968d2d3c6dc7e7 (patch) | |
| tree | d50f7bfab3ce3b9fa9b34cd6a268710bbe1f7a38 /procfs/process.c | |
| parent | d3befb2c2bba6c6fb19a0c94931be9e625eb05a1 (diff) | |
| parent | dc017ca300b2271706c0b167ac5f678b069e5003 (diff) | |
Merge branch 'master' of git.debian.org:/git/pkg-hurd/hurd
Conflicts:
debian/changelog
Diffstat (limited to 'procfs/process.c')
| -rw-r--r-- | procfs/process.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/procfs/process.c b/procfs/process.c index c5ef7d8a..269a18bb 100644 --- a/procfs/process.c +++ b/procfs/process.c @@ -116,6 +116,26 @@ process_file_gc_stat (struct proc_stat *ps, char **contents) thread_basic_info_t thbi = proc_stat_thread_basic_info (ps); const char *fn = args_filename (proc_stat_args (ps)); + vm_address_t start_code = 1; /* 0 would make killall5.c consider it + a kernel process, thus use 1 as + default. */ + vm_address_t end_code = 1; + process_t p; + error_t err = proc_pid2proc (ps->context->server, ps->pid, &p); + if (! err) + { + boolean_t essential = 0; + proc_is_important (p, &essential); + if (essential) + start_code = end_code = 0; /* To make killall5.c consider it a + kernel process that is to be + left alone. */ + else + proc_get_code (p, &start_code, &end_code); + + mach_port_deallocate (mach_task_self (), p); + } + /* See proc(5) for more information about the contents of each field for the Linux procfs. */ return asprintf (contents, @@ -152,7 +172,9 @@ process_file_gc_stat (struct proc_stat *ps, char **contents) timeval_jiffies (thbi->creation_time), /* FIXME: ... since boot */ (long unsigned) tbi->virtual_size, (long unsigned) tbi->resident_size / PAGE_SIZE, 0L, - 0L, 0L, 0L, 0L, 0L, + start_code, + end_code, + 0L, 0L, 0L, 0L, 0L, 0L, 0L, (long unsigned) proc_stat_thread_rpc (ps), /* close enough */ 0L, 0L, |
