OSDN Git Service

673d7dac8a9292b708af4473cb4834fa40a79aae
[linuxjm/LDP_man-pages.git] / draft / man3 / program_invocation_name.3
1 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" Permission is hereby granted, free of charge, to any person obtaining
4 .\" a copy of this software and associated documentation files (the
5 .\" "Software"), to deal in the Software without restriction, including
6 .\" without limitation the rights to use, copy, modify, merge, publish,
7 .\" distribute, sublicense, and/or sell copies of the Software, and to
8 .\" permit persons to whom the Software is furnished to do so, subject to
9 .\" the following conditions:
10 .\"
11 .\" The above copyright notice and this permission notice shall be
12 .\" included in all copies or substantial portions of the Software.
13 .\"
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 .\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 .\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 .\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 .\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 .\"
22 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved.
23 .\" Translated 2006-03-13, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
24 .\"
25 .TH INVOCATION_NAME 3 2006-04-29 "GNU" "Linux Programmer's Manual"
26 .\"O .SH NAME
27 .SH 名前
28 .\"O program_invocation_name, program_invocation_short_name \- \
29 .\"O obtain name used to invoke calling program
30 program_invocation_name, program_invocation_short_name \- \
31 プログラムの起動に使われた名前を取得する
32 .\"O .SH SYNOPSIS
33 .SH 書式
34 .nf
35 .\"O .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
36 .BR "#define _GNU_SOURCE" "         /* feature_test_macros(7) 参照 */"
37 .B #include <errno.h>
38
39 .BI "extern char *" program_invocation_name ;
40 .BI "extern char *" program_invocation_short_name ;
41 .fi
42 .\"O .SH DESCRIPTION
43 .SH 説明
44 .\"O .I program_invocation_name
45 .\"O contains the name that was used to invoke the calling program.
46 .\"O This is the same as the value of
47 .\"O .I argv[0]
48 .\"O in
49 .\"O .IR main (),
50 .\"O with the difference that the scope of
51 .\"O .I program_invocation_name
52 .\"O is global.
53 .I program_invocation_name
54 は、呼び出し元プログラムの起動に使用された名前を保持する。
55 内容は
56 .IR main ()
57
58 .I argv[0]
59 の値と同じだが、
60 .I program_invocation_name
61 の方はスコープがグローバルである点が異なる。
62
63 .\"O .I program_invocation_short_name
64 .\"O contains the basename component of name that was used to invoke
65 .\"O the calling program.
66 .\"O That is, it is the same value as
67 .\"O .IR program_invocation_name ,
68 .\"O with all text up to and including the final slash (/), if any, removed.
69 .I program_invocation_short_name
70 は、呼び出し元プログラムの起動に使用された名前の basename 部分を
71 保持する。つまり、この変数の内容は、最後のスラッシュ (/) とそれより前の
72 部分がある場合、
73 .I program_invocation_name
74 からこの部分を削除したものとなる。
75
76 .\"O These variables are automatically initialized by the glibc run-time
77 .\"O startup code.
78 これらの変数は glibc のランタイム・スタートアップ・コードで
79 自動的に初期化される。
80 .\"O .SH "CONFORMING TO"
81 .SH 準拠
82 .\"O These variables are GNU extensions, and should not be
83 .\"O used in programs intended to be portable.
84 これらの変数は GNU の拡張であり、
85 移植性が必要なプログラムでは使用すべきでない。
86 .\"O .SH NOTES
87 .SH 備考
88 .\"O The Linux-specific
89 .\"O .I /proc/[number]/cmdline
90 .\"O file provides access to similar information.
91 Linux 独自のファイル
92 .I /proc/[number]/cmdline
93 でも同様の情報を得ることができる。
94 .\"O .SH SEE ALSO
95 .SH 関連項目
96 .BR proc (5)