.\" OpenBSD: setproctitle.3,v 1.4 1996/10/08 01:20:08 michaels Exp .\" $Id: setproctitle.3,v 1.2 2000/12/14 09:58:54 ysato Exp $ .\" .\" Copyright (c) 1994, 1995 Christopher G. Demetriou .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by Christopher G. Demetriou .\" for the NetBSD Project. .\" 3. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" Japanese Version Copyright (c) 2000 Yuichi SATO .\" all rights reserved. .\" Translated Thu Dec 14 18:22:51 JST 2000 .\" by Yuichi SATO .\" .Dd April 13, 1994 .Dt SETPROCTITLE 3 .Os "Linux NetKit (0.17)" .Sh 名前 .Nm setproctitle .Nd プロセスのタイトルを設定する .Sh 書式 .Fd #include .Ft void .Fn setproctitle "const char *fmt" "..." .Sh 説明 .Fn setproctitle は、起動しているプロセスのタイトルを設定する。 プロセスのタイトルは、プログラム名からディレクトリ部分を取り去った名前に、 コロンを挟んで .Va fmt に指定された書式付き文字列を続けたものになる。 .Va fmt が NULL の場合、コロンとフォーマットされた文字列は省略される。 プロセスのタイトルの長さは、2048 バイトまでに制限されている。 .Sh 例 プロセスのタイトルを、他の情報を含まない、プログラム名のみに設定する: .Bd -literal -offset indent setproctitle(NULL); .Ed .Pp プロセスのタイトルを、プログラム名・情報が書かれた文字列・ プロセス ID を続けたものに設定する: .Bd -literal -offset indent setproctitle("foo! (%d)", getpid()); .Ed .Sh 関連項目 .Xr ps 1 , .Xr w 1 , .Xr printf 3 .Sh 履歴 .Fn setproctitle は NetBSD 0.9a で初めて登場した。