From owner-svn-src-head@FreeBSD.ORG Fri Aug 8 22:30:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3FEA4AFA for ; Fri, 8 Aug 2014 22:30:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD982740 for ; Fri, 8 Aug 2014 22:30:42 +0000 (UTC) Received: from wblock (uid 1265) (envelope-from wblock@FreeBSD.org) id 239a by svn.freebsd.org (DragonFly Mail Agent v0.9+); Fri, 08 Aug 2014 22:30:42 +0000 From: Warren Block Date: Fri, 8 Aug 2014 22:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269743 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e54f92.239a.3d3730af@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Aug 2014 22:30:42 -0000 Author: wblock (doc committer) Date: Fri Aug 8 22:30:41 2014 New Revision: 269743 URL: http://svnweb.freebsd.org/changeset/base/269743 Log: Update the comments in exec.h with help from jilles. PR: 180970 Submitted by: Carlos Jacobo Puga Medina Reviewed by: jilles MFC after: 1 week Modified: head/sys/sys/exec.h Modified: head/sys/sys/exec.h ============================================================================== --- head/sys/sys/exec.h Fri Aug 8 22:08:51 2014 (r269742) +++ head/sys/sys/exec.h Fri Aug 8 22:30:41 2014 (r269743) @@ -39,12 +39,17 @@ #define _SYS_EXEC_H_ /* - * The following structure is found at the top of the user stack of each - * user process. The ps program uses it to locate argv and environment - * strings. Programs that wish ps to display other information may modify - * it; normally ps_argvstr points to the argv vector, and ps_nargvstr - * is the same as the program's argc. The fields ps_envstr and ps_nenvstr - * are the equivalent for the environment. + * Before ps_args existed, the following structure, found at the top of + * the user stack of each user process, was used by ps(1) to locate + * environment and argv strings. Normally ps_argvstr points to the + * argv vector, and ps_nargvstr is the same as the program's argc. The + * fields ps_envstr and ps_nenvstr are the equivalent for the environment. + * + * Programs should now use setproctitle(3) to change ps output. + * setproctitle() always informs the kernel with sysctl and sets the + * pointers in ps_strings. The kern.proc.args sysctl first tries p_args. + * If p_args is NULL, it then falls back to reading ps_strings and following + * the pointers. */ struct ps_strings { char **ps_argvstr; /* first of 0 or more argument strings */ @@ -55,6 +60,7 @@ struct ps_strings { /* * Address of ps_strings structure (in user space). + * Prefer the kern.ps_strings or kern.proc.ps_strings sysctls to this constant. */ #define PS_STRINGS (USRSTACK - sizeof(struct ps_strings)) #define SPARE_USRSPACE 4096