1 .\" OpenBSD: setproctitle.3,v 1.4 1996/10/08 01:20:08 michaels Exp
2 .\" $Id: setproctitle.3,v 1.2 2000/12/14 09:58:54 ysato Exp $
4 .\" Copyright (c) 1994, 1995 Christopher G. Demetriou
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\" must display the following acknowledgement:
17 .\" This product includes software developed by Christopher G. Demetriou
18 .\" for the NetBSD Project.
19 .\" 3. The name of the author may not be used to endorse or promote products
20 .\" derived from this software without specific prior written permission
22 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 .\" Japanese Version Copyright (c) 2000 Yuichi SATO
34 .\" all rights reserved.
35 .\" Translated Thu Dec 14 18:22:51 JST 2000
36 .\" by Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
40 .Os "Linux NetKit (0.17)"
44 .\"O .Nd set process title
45 .Nd ¥×¥í¥»¥¹¤Î¥¿¥¤¥È¥ë¤òÀßÄꤹ¤ë
48 .Fd #include <stdlib.h>
50 .Fn setproctitle "const char *fmt" "..."
54 .\"O function sets the invoking process's title.
55 .\"O The process title is set to the last component of the program
56 .\"O name, followed by a colon and the formatted string specified
61 .\"O is NULL, the colon and formatted string are omitted.
62 .\"O The length of a process title is limited to 2048 bytes.
65 ¤Ï¡¢µ¯Æ°¤·¤Æ¤¤¤ë¥×¥í¥»¥¹¤Î¥¿¥¤¥È¥ë¤òÀßÄꤹ¤ë¡£
66 ¥×¥í¥»¥¹¤Î¥¿¥¤¥È¥ë¤Ï¡¢¥×¥í¥°¥é¥à̾¤«¤é¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤ò¼è¤êµî¤Ã¤¿Ì¾Á°¤Ë¡¢
69 ¤Ë»ØÄꤵ¤ì¤¿½ñ¼°Éդʸ»úÎó¤ò³¤±¤¿¤â¤Î¤Ë¤Ê¤ë¡£
71 ¤¬ NULL ¤Î¾ì¹ç¡¢¥³¥í¥ó¤È¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤¿Ê¸»úÎó¤Ï¾Êά¤µ¤ì¤ë¡£
72 ¥×¥í¥»¥¹¤Î¥¿¥¤¥È¥ë¤ÎŤµ¤Ï¡¢2048 ¥Ð¥¤¥È¤Þ¤Ç¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£
75 .\"O Set the process title to the program name, with no further information:
76 ¥×¥í¥»¥¹¤Î¥¿¥¤¥È¥ë¤ò¡¢Â¾¤Î¾ðÊó¤ò´Þ¤Þ¤Ê¤¤¡¢¥×¥í¥°¥é¥à̾¤Î¤ß¤ËÀßÄꤹ¤ë:
77 .Bd -literal -offset indent
81 .\"O Set the process title to the program name, an informational string,
82 .\"O and the process id:
83 ¥×¥í¥»¥¹¤Î¥¿¥¤¥È¥ë¤ò¡¢¥×¥í¥°¥é¥à̾¡¦¾ðÊ󤬽ñ¤«¤ì¤¿Ê¸»úÎó¡¦
84 ¥×¥í¥»¥¹ ID ¤ò³¤±¤¿¤â¤Î¤ËÀßÄꤹ¤ë:
85 .Bd -literal -offset indent
86 setproctitle("foo! (%d)", getpid());
97 .\"O function first appeared in NetBSD 0.9a.
99 ¤Ï NetBSD 0.9a ¤Ç½é¤á¤ÆÅо줷¤¿¡£