summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/setproctitle.c
Commit message (Collapse)AuthorAgeFilesLines
* Reduce libc's memory footprint by lazily allocating memory used internallybbraun2002-12-211-9/+22
| | | | | | by setproctitle(). Reviewed by: jkh
* Do not use __progname directly (except in [gs]etprogname(3)).markm2002-03-291-2/+5
| | | | | | Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland.
* Fix SCM ID's.obrien2002-02-011-2/+3
|
* When recording the original arguments, stop short if we encounterjdp2000-12-041-0/+10
| | | | | | | | a NULL argument. Some programs change the contents of the argv array, typically to remove some special arguments. They shorten argv by storing a NULL where an argument pointer used to be. Such programs core dumped if they called setproctitle(), because it would try to apply strlen() to a NULL pointer.
* When recording the original arguments, don't (ab)use "nargc" forjdp2000-12-041-3/+4
| | | | | iterating over the arguments. Doing so wipes out the value which is about to be stored into the ps_strings structure.
* If the format string passed to setproctitle begins with a '-'ps2000-08-011-24/+9
| | | | | | | character, skip the program name when setting the process title. Ansified with extreme prejudice. Reviewed by: peter
* Make setproctitle(NULL) restore all of the original argumentsbrian1999-11-171-17/+44
| | | | (if it's able).
* Introduce commandline caching in the kernel.phk1999-11-161-0/+9
| | | | | | | | | | | This fixes some nasty procfs problems for SMP, makes ps(1) run much faster, and makes ps(1) even less dependent on /proc which will aid chroot and jails alike. To disable this facility and revert to previous behaviour: sysctl -w kern.ps_arg_cache_limit=0 For full details see the current@FreeBSD.org mail-archives.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This isbde1998-12-161-8/+7
| | | | | | | | an unimprovement here. I thought it would be an improvement, as in libkvm, but here we can access the strings directly. Use sysctlbyname() instead of sysctl() and trust it to give a nonzero address if it succeeds.
* Oops, revert part of a diff that wasn't supposed to have been committed.dg1998-04-281-2/+2
|
* Cache the results of the ps_strings sysctl so that it doesn't have to bedg1998-04-281-10/+12
| | | | redone for every call of setproctitle().
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* General -Wall warning cleanup, part I.jkh1996-07-121-2/+1
| | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu>
* If the two recently added sysctl variables exist, use those rather thanpeter1996-02-241-10/+17
| | | | | | | the statically compiled PS_STRINGS and USRSTACK variables. This prevents programs using setproctitle from coredumping if the kernel VM is increased, and stops libkvm users (w, ps, etc) from needing to be recompiled if only the VM layout changes.
* Bring in an initial version of setproctitle().. This is intended topeter1995-12-261-0/+119
replace the dozen other various hacks in the code that do all sorts of crude things including spamming the envrionment strings with the new argv string. This version is mainly inspired by the sendmail version, with a couple of ideas taken from the NetBSD implementation as well.
OpenPOWER on IntegriCloud