.\" Copyright (C) 2006 Michael Kerrisk .\" .\" Permission is hereby granted, free of charge, to any person obtaining .\" a copy of this software and associated documentation files (the .\" "Software"), to deal in the Software without restriction, including .\" without limitation the rights to use, copy, modify, merge, publish, .\" distribute, sublicense, and/or sell copies of the Software, and to .\" permit persons to whom the Software is furnished to do so, subject to .\" the following conditions: .\" .\" The above copyright notice and this permission notice shall be .\" included in all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. .\" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY .\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, .\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE .\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. .\" .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI all rights reserved. .\" Translated 2006-03-13, Akihiro MOTOKI .\" .TH INVOCATION_NAME 3 2006-04-29 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O program_invocation_name, program_invocation_short_name \- \ .\"O obtain name used to invoke calling program program_invocation_name, program_invocation_short_name \- \ プログラムの起動に使われた名前を取得する .\"O .SH SYNOPSIS .SH 書式 .nf .\"O .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _GNU_SOURCE" " /* feature_test_macros(7) 参照 */" .B #include .BI "extern char *" program_invocation_name ; .BI "extern char *" program_invocation_short_name ; .fi .\"O .SH DESCRIPTION .SH 説明 .\"O .I program_invocation_name .\"O contains the name that was used to invoke the calling program. .\"O This is the same as the value of .\"O .I argv[0] .\"O in .\"O .IR main (), .\"O with the difference that the scope of .\"O .I program_invocation_name .\"O is global. .I program_invocation_name は、呼び出し元プログラムの起動に使用された名前を保持する。 内容は .IR main () の .I argv[0] の値と同じだが、 .I program_invocation_name の方はスコープがグローバルである点が異なる。 .\"O .I program_invocation_short_name .\"O contains the basename component of name that was used to invoke .\"O the calling program. .\"O That is, it is the same value as .\"O .IR program_invocation_name , .\"O with all text up to and including the final slash (/), if any, removed. .I program_invocation_short_name は、呼び出し元プログラムの起動に使用された名前の basename 部分を 保持する。つまり、この変数の内容は、最後のスラッシュ (/) とそれより前の 部分がある場合、 .I program_invocation_name からこの部分を削除したものとなる。 .\"O These variables are automatically initialized by the glibc run-time .\"O startup code. これらの変数は glibc のランタイム・スタートアップ・コードで 自動的に初期化される。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O These variables are GNU extensions, and should not be .\"O used in programs intended to be portable. これらの変数は GNU の拡張であり、 移植性が必要なプログラムでは使用すべきでない。 .\"O .SH NOTES .SH 備考 .\"O The Linux-specific .\"O .I /proc/[number]/cmdline .\"O file provides access to similar information. Linux 独自のファイル .I /proc/[number]/cmdline でも同様の情報を得ることができる。 .\"O .SH SEE ALSO .SH 関連項目 .BR proc (5)