summaryrefslogtreecommitdiff
path: root/libps
AgeCommit message (Collapse)Author
2010-12-25Fix NULL dereferenceSamuel Thibault
* libps/spec.c (ps_emit_user_name): Do not dereference pw when it is NULL, dereference u instead.
2010-09-18Obtain number of ports in proc and libpsantrik
Add (and implement) a proc RPC to obtain the number of Mach ports used by the target task. Add infrastructure in libps to read this information. * hurd/process.defs (proc_getnports): New RPC. * hurd/process_request.defs (proc_getnports_request): New RPC. * libps/procstat.c (proc_stat_set_flags): Call proc_getnports RPC if needed. * libps/ps.h (proc_stat): New `num_ports' field. (PSTAT_NUM_PORTS): New macro. (proc_stat_num_ports): New macro. * libps/spec.c (ps_get_num_ports): New function. (ps_num_ports_getter): New variable. (specs): New entry for `ps_num_ports_getter'. * proc/info.c (S_proc_getnports): New function.
2010-08-31Document incoherency for storage of task_events_infoSamuel Thibault
It doesn't produce any bug ATM just because GNU Mach does not support it. * libps/ps.h (struct proc_stat): Document that task_events_info is currently actually fetched into proc_info.
2010-08-26libps (proc_stat_set_flags): Fix pointer signedness warningJeremie Koenig
* libps/procstat.c (proc_stat_set_flags): Cast &ps->umask into (int*) before calling ps_msg_get_init_int.
2010-08-26Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault
2010-08-26libps (fetch_procinfo): Fix non-set flag PSTAT_TASK_EVENTSJeremie Koenig
The fetch_procinfo function failed to set the PSTAT_TASK_EVENTS when those has been retreived. It should be noted that GNU Mach does not support the TASK_EVENTS_INFO flavor, so this is of minor importance. The new code also checks that all the requested proc server flags related to a given proc_stat flags have been returned before setting the proc_stat flag in question. * libps/procstat.c (fetch_procinfo): Add map array containing `ps_flags_t' and `procinfo' flags. Use it in a loop to check for flags in `need' and `have' and set them in `pi_flags'. Likewise to check for flags in `pi_flags' and set them in `have'.
2010-08-26libps (_proc_stat_free): Fix memory leakJeremie Koenig
The thread_waits field was never freed; this change adds the code to do so if the corresponding flag is set. Users are also warned of the consequences, namely, that they should not free process proc_stats before all their associated thread ones are gone, since the latter may reference the former's thread_waits field. However, with the normal interface (ie. ps_context_free), all proc_stats are freed at once, so this is not an issue. * libps/procstat.c (_proc_stat_free): Free ps->thread_waits if PSTAT_THREAD_WAITS flag is set. * libps/ps.h (_proc_stat_free): Document that thread proc_stats must be freed before process proc_stat can be.
2010-08-26libps: Fix deadly typoJeremie Koenig
PSTAT_PROCINFO is a set of flags, some of which can be obtained in alternative ways. In this case, _proc_stat_free will try to deallocate an uninitialised field. PSTAT_PROC_INFO is the flag we want. * libps/procstat.c (_proc_stat_free): Use PSTAT_PROC_INFO instead of PSTAT_PROCINFO.
2009-11-17Fix ps -o command and such hangSamuel Thibault
* libps/fmt.c (_fmt_create): Put NUL terminator only when there is room for it. When there is not it is there already anyway.
2009-07-11Switch to the new ChangeLog style.Thomas Schwinge
* ChangeLog: Wipe out content, and add instructions about how to get it back. * auth/ChangeLog: Remove file. * benchmarks/ChangeLog: Likewise. * boot/ChangeLog: Likewise. * bsdfsck/ChangeLog: Likewise. * config/ChangeLog: Likewise. * console-client/ChangeLog: Likewise. * console/ChangeLog: Likewise. * daemons/ChangeLog: Likewise. * defpager/ChangeLog: Likewise. * doc/ChangeLog: Likewise. * exec/ChangeLog: Likewise. * ext2fs/ChangeLog: Likewise. * fatfs/ChangeLog: Likewise. * fstests/ChangeLog: Likewise. * ftpfs/ChangeLog: Likewise. * hostmux/ChangeLog: Likewise. * hurd/ChangeLog: Likewise. * include/ChangeLog: Likewise. * init/ChangeLog: Likewise. * isofs/ChangeLog: Likewise. * libcons/ChangeLog: Likewise. * libdirmgt/ChangeLog: Likewise. * libdiskfs/ChangeLog: Likewise. * libfshelp/ChangeLog: Likewise. * libftpconn/ChangeLog: Likewise. * libhurdbugaddr/ChangeLog: Likewise. * libihash/ChangeLog: Likewise. * libiohelp/ChangeLog: Likewise. * libnetfs/ChangeLog: Likewise. * libpager/ChangeLog: Likewise. * libpipe/ChangeLog: Likewise. * libports/ChangeLog: Likewise. * libps/ChangeLog: Likewise. * libshouldbeinlibc/ChangeLog: Likewise. * libstore/ChangeLog: Likewise. * libthreads/ChangeLog: Likewise. * libtrivfs/ChangeLog: Likewise. * login/ChangeLog: Likewise. * mach-defpager/ChangeLog: Likewise. * nfs/ChangeLog: Likewise. * nfsd/ChangeLog: Likewise. * pfinet/ChangeLog: Likewise. * pflocal/ChangeLog: Likewise. * proc/ChangeLog: Likewise. * release/ChangeLog: Likewise. * serverboot/ChangeLog: Likewise. * storeio/ChangeLog: Likewise. * sutils/ChangeLog: Likewise. * term/ChangeLog: Likewise. * tmpfs/ChangeLog: Likewise. * trans/ChangeLog: Likewise. * ufs-fsck/ChangeLog: Likewise. * ufs-utils/ChangeLog: Likewise. * ufs/ChangeLog: Likewise. * usermux/ChangeLog: Likewise. * utils/ChangeLog: Likewise.
2004-03-01auth/Marcus Brinkmann
2003-08-17 Marcus Brinkmann <marcus@gnu.org> * auth.c: Include <stddef.h>. (pending_users, pending_server): Change type to struct hurd_ihash, initialize with HURD_IHASH_INITIALIZER. (struct pending): Change type of member LOCP to hurd_ihash_locp_t. (S_auth_user_authenticate): Use hurd_ihash_* functions instead ihash_*. (S_auth_server_authenticate): Likewise. (main): Do not allocate the hash tables. console-client/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * vga-dynafont.c: Include <stddef.h>. (struct mapped_character): Change type of LOCP to hurd_ihash_locp_t. (struct dynafont): Change type of CHARMAP to struct hurd_ihash. (dynafont_new): Use hurd_ihash_init instead of ihash_create. Remove variable ERR. Call hurd_ihash_add instead of ihash_add. (dynafont_free): Call hurd_ihash_destroy, no ihash_free. (dynafont_lookup_internal): Use hurd_ihash_find, not ihash_find. (dynafont_lookup_internal): Call hurd_ihash_locp_remove instead ihash_locp_remove, and hurd_ihash_add instead ihash_add. (dynafont_change_font): Likewise. Clean out LOCP if character is unmapped. ftpfs/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ftpfs.h: Include <hurd/ihash.h>. (struct ftpfs): Change type of INODE_MAPPINGS to struct hurd_ihash. (struct ftpfs_dir_entry): Change type of INODE_LOCP to hurd_ihash_locp_t. * node.c (ftpfs_create_node): Call hurd_ihash_add, not ihash_add. (netfs_node_norefs): Call hurd_ihash_locp_remove, not ihash_locp_remove. * fs.c: Include <stddef.h>. (ftpfs_create): Call hurd_ihash_init, not hurd_ihash_create. Call hurd_ihash_destroy on error. libihash/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ihash.c: Rewritten. * ihash.h: Rewritten. * Makefile (SRCS): Remove sizes.c. (LCLHDRS): Remove priv.h. * primes.c, sizes.c, priv.h: Files removed. 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ports.h (struct port_bucket): Change type of HTABLE to struct hurd_ihash. (struct port_info): Change type of HENTRY to hurd_ihash_locp_t. * lookup-port.c (ports_lookup_port): Use hurd_ihash_find instead ihash_find. * bucket-iterate.c (_ports_bucket_class_iterate): Use HURD_IHASH_ITERATE instead ihash_iterate. * inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Likewise. * inhibit-bucket-rpcs.c (ports_inhibit_bucket_rpcs): Likewise. * create-internal.c (_ports_create_port_internal): Use hurd_ihash_add instead ihash_add. * import-port.c (ports_import_port): Likewise. * reallocate-from-external.c (ports_reallocate_from_external): Likewise. * reallocate-port.c (ports_reallocate_port): Likewise. * transfer-right.c (ports_transfer_right): Likewise. * create-bucket.c: Include <stddef.h>. (ports_create_bucket): Use hurd_ihash_init instead hurd_ihash_create. * class-iterate.c: Do not include <hurd/ihash.h>. * claim-right.c (ports_claim_right): Call hurd_ihash_locp_remove instead ihash_locp_remove. * complete-deallocate.c (_ports_complete_deallocate): Likewise. * destroy-right.c (ports_destroy_right): Likewise. * reallocate-from-external.c (ports_reallocate_from_external): Likewise. * reallocate-port.c (ports_reallocate_port): Likewise. * transfer-right.c (ports_transfer_right): Likewise. libps/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * ps.h (struct ps_context): Change type of members procs, ttys, ttys_by_cttyid and users to struct hurd_ihash. * context.c (ps_context_create): Remove variables err_procs, err_ttys, err_ttys_by_cttyid and err_users. Use hurd_ihash_init instead of ihash_create. Call hurd_ihash_set_cleanup and the hurd_ihash_cleanup_t type instead of ihash_set_cleanup. (ps_context_free): Call hurd_ihash_destroy instead of ihash_free. (lookup): Call hurd_ihash_find instead ihash_find, hurd_ihash_add instead ihash_add. (ps_context_find_proc_stat): Take pointer of hash object. (ps_context_find_tty): Likewise. (ps_context_find_tty_by_cttyid): Likewise. (ps_context_find_user): Likewise. libpthread/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * sysdeps/hurd/pt-key.h (PTHREAD_KEY_MEMBERS): Change type of THREAD_SPECIFICS to hurd_ihash_t. * sysdeps/hurd/pt-setspecific.c (pthread_setspecific): Call hurd_ihash_create instead ihash_create, and hurd_ihash_add instead ihash_add. * sysdeps/hurd/pt-getspecific.c (pthread_getspecific): Call hurd_ihash_find instead of ihash_find. * sysdeps/hurd/pt-destroy-specific.c (__pthread_destroy_specific): Call hurd_ihash_find instead of ihash_find, hurd_ihash_remove instead of ihash_remove, and hurd_ihash_free instead of ihash_free. proc/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * proc.h: Include <hurd/ihash.h>. (struct proc): Change type of members p_pidhashloc and p_taskhashloc to hurd_ihash_locp_t. (struct pgrp): Likewise for pg_hashloc. (struct session): Likewise for s_hashloc. * hash.c: Change type of pghash, pidhash, taskhash and sidhash to struct hurd_ihash and initialize them with HURD_IHASH_INITIALIZER. Include stddef.h. (pid_find): Call hurd_ihash_find instead ihash_find. (pid_find_allow_zombie): Likewise. (task_find): Likewise. (task_find_nocreate): Likewise. (pgrp_find): Likewise. (session_find): Likewise. (add_proc_to_hash): Call hurd_ihash_add instead ihash_add. (add_pgrp_to_hash): Likewise. (add_session_to_hash): Likewise. (remove_pgrp_from_hash): Call hurd_ihash_locp_remove instead ihash_locp_remove, and provide hash table pointer. (remove_proc_from_hash): Likewise. (remove_session_from_hash): Likewise. (prociterate): Use HURD_IHASH_ITERATE instead ihash_iterate. trans/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * fakeroot.c: Include <stddef.h>. (struct netnode): Change type of member idport_locp to hurd_ihash_locp_t. (idport_ihash): Change type to struct hurd_ihash and initialize with HURD_IHASH_INITIALIZER. (new_node): Call hurd_ihash_add instead of ihash_add. (netfs_node_norefs): Call hrd_ihash_locp_remove instead ihash_locp_remove. (netfs_S_dir_lookup): Call hurd_ihash_find instead ihash_find. utils/ 2003-08-17 Marcus Brinkmann <marcus@gnu.org> * rpctrace.c: Include <stddef.h>. (struct traced_info): Change type of LOCP to hurd_ihash_locp_t. (msgid_ihash): Change type to struct hurd_ihash, and initialize with HURD_IHASH_INITIALIZER, don't set cleanup here. (traced_names): Likewise. (main): Call hurd_ihash_set_cleanup for msgid_ihash. Don't create traced_names. (parse_msgid_list): Call hurd_ihash_add instead ihash_add. (new_send_wrapper): Likewise. (msgid_info): Likewise. Call hurd_ihash_find instead ihash_find. (rewrite_right): Likewise. (traced_dropweak): Call hurd_ihash_locp_remove instead ihash_locp_remove.
2002-06-09.Roland McGrath
2002-06-092002-06-09 Roland McGrath <roland@frob.com>Roland McGrath
* Makefile (installhdrs): List just ps.h, not common.h as well.
2002-06-05.Roland McGrath
2002-06-052002-06-05 Roland McGrath <roland@frob.com>Roland McGrath
* procstat.c (fetch_procinfo): Use PI_FETCH_TASKEVENTS. (add_preconditions): PSTAT_TASK_EVENTS no longer needs PSTAT_TASK. (PSTAT_PROCINFO_TASK): Add PSTAT_TASK_EVENTS to the mask. (PSTAT_PROCINFO_MERGE): Here too. (proc_stat_set_flags): Don't use task_info for PSTAT_TASK_EVENTS.
2002-06-052002-06-04 James A. Morrison <ja2morri@uwaterloo.ca>Marcus Brinkmann
* spec.c (sprint_frac_value): Added case for values between 1000 and 1023. Make VALUE, FRAC size_t's and return a value of type size_t. (ps_emit_nice_int): Removed function. Replaced by ... (ps_emit_nice_size_t): ... this. New Function. (ps_cmp_size_ts): New function. (ps_vsize_getter): Return a size_t instead of an int. (ps_rsize_getter): Likewise. (ps_get_rmem_frac): MEM_SIZE is now a size_t. (specs): Use ps_emit_nice_size_t instead of ps_emit_nice_int and use ps_cmp_size_ts instead of ps_cmp_ints for RSize and VSize.
2002-05-13.Roland McGrath
2002-05-132002-05-13 Roland McGrath <roland@frob.com>Roland McGrath
* ps.h (proc_stat_state_tags): Make decl extern, not common.
2002-05-08.Roland McGrath
2002-05-082002-05-07 Roland McGrath <roland@frob.com>Roland McGrath
* context.c (ps_context_find_tty_by_cttyid): int -> mach_port_t * proclist.c (proc_stat_list_add_all): unsigned -> size_t (proc_stat_list_add_login_coll): Likewise. (proc_stat_list_add_session): Likewise. (proc_stat_list_add_fn_pids): Likewise. (proc_stat_list_add_id_fn_pids): Likewise.
2002-05-082002-05-07 Roland McGrath <roland@frob.com>Roland McGrath
* host.c (ps_host_basic_info): int -> size_t (ps_host_basic_info, ps_host_load_info): Likewise. * ps.h: Update decls. (struct proc_stat): unsigned -> size_t for task_events_info_size, args_len, env_len. * procstat.c (summarize_thread_waits): Fix argument type.
2001-12-31.Roland McGrath
2001-12-312001-12-31 Roland McGrath <roland@frob.com>Roland McGrath
* host.c (ps_get_host): Use mach_port_t instead of host_t. * ps.h: Update decl.
2001-12-22.Roland McGrath
2001-12-222001-12-22 Roland McGrath <roland@frob.com>Roland McGrath
* spec.c (ps_emit_wait): Remove local extern decls for functions actually defined static.
2001-10-012001-10-01 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* filters.c (ps_own_filter): Add const to type. (ps_not_leader_filter): Likewise. (ps_unorphaned_filter): Likewise. (ps_ctty_filter): Likewise. (ps_parent_filter): Likewise. (ps_alive_filter): Likewise. Submitted by Maurizio Boriani <baux@debian.org>.
2001-03-31.Roland McGrath
2001-03-312001-03-29 Neal H Walfield <neal@cs.uml.edu>Roland McGrath
* host.c: Fix comments. (ps_host_basic_info): Make INITIALIZED static; otherwise we never cache BUF. Do not initalize static variables to 0. (ps_host_sched_info): Likewise. * ps.h: Doc fix.
2001-02-26.Roland McGrath
2001-02-262001-02-25 Roland McGrath <roland@frob.com>Roland McGrath
* user.c: Include <string.h> for decls of built-ins.
2000-02-11.Roland McGrath
2000-02-112000-02-11 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* context.c (ps_context_find_tty_by_cttyid): Use the ttys_by_cttyid hash table, not the ttys hash table.
2000-01-25.Roland McGrath
2000-01-252000-01-25 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* tty.c (struct ps_tty_abbrev): Add const to member types. (ps_tty_abbrevs): Make const. (ps_tty_short_name): Clean up type usage, add consts. Include null terminator in calculation for short_name allocation size. Save lengths and use memcpy instead of using strcpy and strcat.
1999-12-22.Roland McGrath
1999-12-221999-12-22 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* Makefile (HURDLIBS): Add shouldbeinlibc.
1999-07-11.Roland McGrath
1999-07-111999-07-10 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* common.h: Add #include <sys/mman.h> for munmap decl.
1999-07-031999-07-03 Thomas Bushnell, BSG <tb@mit.edu>Thomas Bushnell
* common.h (VMFREE): Use munmap instead of vm_deallocate. * procstat.c (merge_procinfo): Likewise.
1999-06-02.Roland McGrath
1999-06-021999-06-02 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* ps.h (PSTAT_ENV): New macro. (struct proc_stat): New members `env', `env_len', `env_vm_alloced'. (proc_stat_env, proc_stat_env_len): New accessor macros. (PSTAT_USER_BASE): Increase value to leave more room for additions. * procstat.c (proc_stat_set_flags): Handle environment. (_proc_stat_free): Likewise. * spec.c (ps_get_env, ps_env_getter): New function and constant. (specs): New spec "Env" using ps_env_getter and ps_emit_args.
1999-05-29.Roland McGrath
1999-05-291999-05-29 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* context.c (ps_context_free): Don't call ihash_free on PC->procs twice! Instead, call it on ttys, ttys_by_cttyid, and users.
1999-05-291999-05-29 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* spec.c (ps_emit_past_time, ps_emit_minutes): Fix return type of getter fn (int to void). * spec.c (ps_get_start_time, ps_start_time_getter): New function and constant to report task_basic_info.creation_time time stamp via "start_time" spec. (specs): Add "Start" fmt for it.
1998-10-20Add braces to silence gcc warnings.Roland McGrath
1997-06-08.Miles Bader
1997-06-08(ps_emit_wait):Miles Bader
Provide slightly better abbreviations for various port types.
1997-05-23fix typoThomas Bushnell
1997-05-23Fri May 23 13:13:18 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>Thomas Bushnell
* procstat.c (summarize_thread_basic_info): Don't include the kernel's idle threads in the summation. (summarize_thread_sched_info): Likewise. (summarize_thread_states): Likewise. (summarize_thread_waits): Likewise.
1997-03-01.Miles Bader