History log of /freebsd-10.0-release/lib/libc/gen/setproctitle.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 117102 01-Jul-2003 alfred

Don't segfault if setproctitle(3) is called with NULL initially.
The old buffer was not being initialized and a later str*() op on
it would cause a crash if it wasn't initialized by a previous
call to setproctitle(3) with an actual string.

Noticed by: Ashley Penney <ashp@unloved.org>


# 108163 21-Dec-2002 bbraun

Reduce libc's memory footprint by lazily allocating memory used internally
by setproctitle().

Reviewed by: jkh


# 93399 29-Mar-2002 markm

Do not use __progname directly (except in [gs]etprogname(3)).
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.


# 90039 31-Jan-2002 obrien

Fix SCM ID's.


# 69560 03-Dec-2000 jdp

When recording the original arguments, stop short if we encounter
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.


# 69558 03-Dec-2000 jdp

When recording the original arguments, don't (ab)use "nargc" for
iterating over the arguments. Doing so wipes out the value which
is about to be stored into the ps_strings structure.


# 64094 01-Aug-2000 ps

If the format string passed to setproctitle begins with a '-'
character, skip the program name when setting the process title.
Ansified with extreme prejudice.

Reviewed by: peter


# 53297 17-Nov-1999 brian

Make setproctitle(NULL) restore all of the original arguments
(if it's able).


# 53239 16-Nov-1999 phk

Introduce commandline caching in the kernel.

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.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 41875 16-Dec-1998 bde

Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This is
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.


# 35491 28-Apr-1998 dg

Oops, revert part of a diff that wasn't supposed to have been committed.


# 35490 28-Apr-1998 dg

Cache the results of the ps_strings sysctl so that it doesn't have to be
redone for every call of setproctitle().


# 22993 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# 17141 12-Jul-1996 jkh

General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>


# 14236 24-Feb-1996 peter

If the two recently added sysctl variables exist, use those rather than
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.


# 13039 26-Dec-1995 peter

Bring in an initial version of setproctitle().. This is intended to
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.