aboutsummaryrefslogtreecommitdiff
path: root/procfs/process.c
Commit message (Collapse)AuthorAgeFilesLines
* procfs: Port to x86_64Sergey Bugaev2023-05-101-9/+9
| | | | Message-Id: <20230508213136.608575-36-bugaevc@gmail.com>
* procfs: Fix process creation time in /proc/pid/statSergey Bugaev2023-04-181-1/+1
| | | | | | | | | | | | This was always showing up as 0, because apparently we need to query creation_time for the task, not a thread. Here's a before vs after comparison: $ cat /proc/self/stat ~/procfs/self/stat 11151 (cat) S 26571 11151 26571 0 0 0 0 0 0 0 1 0 0 0 20 0 2 0 0 154783744 251 0 134443008 134477480 0 0 0 0 0 0 0 21001 0 0 0 0 0 0 0 11151 (cat) S 26571 11151 26571 0 0 0 0 0 0 0 1 0 0 0 20 0 2 0 168174516295 154783744 260 0 134443008 134477480 0 0 0 0 0 0 0 21001 0 0 0 0 0 0 0 Message-Id: <20230418104902.12263-1-bugaevc@gmail.com>
* Fix accessing bit 31Samuel Thibault2023-02-151-3/+3
| | | | | Shifting (signed) 1 to left 31 positions is undefined behavior. So make this an unsigned so it becomes defined behavior.
* Fix *printf specifier for user space mach ports.Flavio Cruz2022-12-061-1/+1
| | | | | mach_port_t are mach_port_name_t and thus require %u instead of %lu. Message-Id: <Y42RELMbulK4xaKM@reue>
* procfs: fix getting last_processor fieldSamuel Thibault2019-10-311-1/+1
| | | | | * procfs/process.c (entries): Add PSTAT_THREAD_SCHED in `needs' field of entry for process_file_gc_stat.
* procfs: Fix asprintf formatSamuel Thibault2019-10-311-1/+1
| | | | | | | | Last_processor is an int in the proc info, and there aren't really plans for machines with more than 4 billion processors. * procfs/process.c (process_file_gc_stat): Make last_processor unsigned instead of long unsigned.
* proc: add support for last_processorAlmudena Garcia2019-10-311-1/+11
| | | | | | | | | | | | | | | Read last_processor (new member) from thread_info structures, and fill stat structure with this. * configure.ac: Check whether thread_sched_info structure includes `last_processor' member. * proc/info.c (S_proc_getprocinfo) [HAVE_STRUCT_THREAD_SCHED_INFO_LAST_PROCESSOR]: Set `last_processor' field. * procfs/process.c (process_file_gc_stat) [HAVE_STRUCT_THREAD_SCHED_INFO_LAST_PROCESSOR]: Set last processor proc field to `thsi->last_processor'. [!HAVE_STRUCT_THREAD_SCHED_INFO_LAST_PROCESSOR]: Set last processor proc field to 0.
* Implement /proc/<pid>/exeSamuel Thibault2018-01-081-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by adding proc_set/get_exe to the proc server, making exec call proc_set_exe, and libps call proc_get_exe. procfs can then just retrieve the information to make the "exe" symlink. * hurd/process.defs (proc_set_exe, proc_get_exe): New RPCs. * hurd/process_request.defs: Likewise. * hurd/process_reply.defs: Add skips for proc_set_exe and proc_get_exe RPCs. * proc/proc.h (struct proc): Add `exe' field. * proc/info.c (S_proc_set_exe, S_proc_get_exe): New functions. * proc/mgt.c (process_has_exited): Free p->exe. (S_proc_child): Duplicate parent `exe' into child's `exe'. * exec/exec.c (do_exec): Call proc_set_exe when a filename is available. * libps/ps.h (struct proc_stat): Add `exe_vm_alloced', `exe', and `exe_len' field. (PSTAT_EXE): New macro. (PSTAT_USER_BASE): Change value to make room. (proc_stat_exe, proc_stat_exe_len): New macros. * libps/procstat.c (proc_stat_set_flags): Handle PSTAT_EXE case by calling proc_get_exe. * libps/spec.c (ps_get_exe): New function. (ps_exe_getter): New structure. (ps_fmt_spec): Add "Exe" specification. * procfs/process.c (process_file_symlink_make_node, process_file_gc_exe): New functions. (procfs_dir_entry): Add "exe" entry. * startup/startup.c (launch_core_servers): Set exe paths for startup, auth, proc, and fs servers. (frob_kernel_process): Set exe path for kernel task. (S_startup_essential_task): Set exe path for exec server.
* fix compiler warnings in hurd/procfsFlavio Cruz2015-12-291-2/+2
| | | | | | | | procfs: Fix compiler warnings. * include/sys/procfs.h: Change uintptr_t to vm_address_t. * procfs/process.c: Fix format strings. * procfs/rootdir.c: Add missing casts.
* procfs: Fix typos in comments (found by codespell)Stefan Weil2015-01-031-2/+2
| | | | Signed-off-by: Stefan Weil <sw@weilnetz.de>
* procfs: implement /proc/N/mapsJustus Winter2014-09-291-1/+103
| | | | | | | Fixes https://savannah.gnu.org/bugs/?32770 . * procfs/process.c (process_file_gc_maps): New function. (entries): Use the new function to implement /proc/N/maps.
* procfs: fix typo in commentJustus Winter2014-09-181-1/+1
| | | | * procfs/process.c (process_stat_make_node): Fix typo in comment.
* Prepare the procfs translator to be merged into the Hurd sourcesJustus Winter2014-06-151-0/+414
Move the procfs translator to its own subdirectory 'procfs'. This is the last commit to this repository. Development of the procfs translator will continue in the main Hurd repository. * procfs/Makefile: Replace the standalone Makefile with the one from the Debian packaging repository.