OSDN Git Service

1223f39f94cbc8d5fadf2be0afa70567d518368a
[linuxjm/LDP_man-pages.git] / draft / man3 / dprintf.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Text fragments inspired by Martin Schulze <joey@infodrom.org>.
24 .\"
25 .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
26 .\" Translated Sat 12 Jan 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
27 .\"
28 .TH DPRINTF 3 2010-09-15 "GNU" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .SH 名前
31 .\"O dprintf, vdprintf \- print to a file descriptor
32 dprintf, vdprintf \- ファイルディスクリプターに文字出力する
33 .\"O .SH SYNOPSIS
34 .SH 書式
35 .B #include <stdio.h>
36 .sp
37 .BI "int dprintf(int " fd ", const char *" format ", ...);"
38 .sp
39 .BI "int vdprintf(int " fd ", const char *" format ", va_list " ap );
40 .sp
41 .in -4n
42 .\"O Feature Test Macro Requirements for glibc (see
43 .\"O .BR feature_test_macros (7)):
44 glibc 向けの機能検査マクロの要件
45 .RB ( feature_test_macros (7)
46 参照):
47 .in
48 .sp
49 .BR dprintf (),
50 .BR vdprintf ():
51 .PD 0
52 .ad l
53 .RS 4
54 .TP 4
55 .\"O Since glibc 2.10:
56 glibc 2.10 以降:
57 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
58 .TP
59 .\"O Before glibc 2.10:
60 glibc 2.10 より前:
61 _GNU_SOURCE
62 .RE
63 .ad
64 .PD
65 .\"O .SH DESCRIPTION
66 .SH 説明
67 .\"O The functions
68 .\"O .BR dprintf ()
69 .\"O and
70 .\"O .BR vdprintf ()
71 .\"O (as found in the glibc2 library) are exact analogs of
72 .\"O .BR fprintf (3)
73 .\"O and
74 .\"O .BR vfprintf (3),
75 .\"O except that they output to a file descriptor
76 .\"O .I fd
77 .\"O instead of to a
78 .\"O .I stdio
79 .\"O stream.
80 (glibc2 ライブラリにおける)
81 .BR dprintf ()
82 関数と
83 .BR vdprintf ()
84 関数とは、それぞれ
85 .BR fprintf (3)
86 関数と
87 .BR vfprintf (3)
88 関数とにちょうど対応するが、
89 これらは
90 .I stdio
91 ストリームではなくファイルディスクリプター
92 .I fd
93 に対して出力を行う。
94 .\"O .SH "CONFORMING TO"
95 .SH 準拠
96 .\"O These functions are GNU extensions that are nowadays specified in
97 .\"O POSIX.1-2008.
98 これらの関数は GNU による拡張であり、
99 現在では POSIX.1-2008 で規定されている。
100 .\"O .\" .SH NOTES
101 .\" .SH 注意
102 .\"O .\" These functions are GNU extensions, not in C or POSIX.
103 .\"O .\" Clearly, the names were badly chosen.
104 .\"O .\" Many systems (like MacOS) have incompatible functions called
105 .\"O .\" .BR dprintf (),
106 .\"O .\" usually some debugging version of
107 .\"O .\" .BR printf (3),
108 .\"O .\" perhaps with a prototype like
109 .\"O .\" 
110 .\"O .\" .BI "void dprintf(int level, const char *" format ", ...);"
111 .\"O .\" 
112 .\"O .\" where the first parameter is a debugging level (and output is to
113 .\"O .\" .IR stderr ).
114 .\" これらの関数は GNU の拡張であり、C や POSIX のものではない。
115 .\" 見てわかるとおり、名前の付け方はあまり良くない。
116 .\" 多くのシステム (MacOS など) には、
117 .\" .BR dprintf ()
118 .\" という名前の、これとは互換でない関数があり、
119 .\" たいていはなんらかのデバッグ用の
120 .\" .BR printf (3)
121 .\" になっている。プロトタイプは
122 .\" 
123 .\" .BI "void dprintf(int level, const char *" format ", ...);"
124 .\" 
125 .\" で、最初のパラメータはデバッグレベルになっている
126 .\" (また出力は
127 .\" .I stderr
128 .\" に行われる)。
129 .\"O .\" Moreover,
130 .\"O .\" .BR dprintf ()
131 .\"O .\" (or
132 .\"O .\" .BR DPRINTF )
133 .\"O .\" is also a popular macro name for a debugging printf.
134 .\"O .\" So, probably, it is better to avoid this function in programs
135 .\"O .\" intended to be portable.
136 .\"O .\" 
137 .\"O .\" A better name would have been
138 .\"O .\" .BR fdprintf ().
139 .\" さらに、
140 .\" .BR dprintf ()
141 .\" (あるいは
142 .\" .BR DPRINTF )
143 .\" はデバッグ処理用の printf のマクロとしても良く用いられる。
144 .\" したがって恐らく、移植性を必要とするプログラムでは、
145 .\" この関数は用いないほうが良いだろう。
146 .\" 
147 .\" より良い名前は
148 .\" .BR fdprintf ()
149 .\" だったかと思われる。
150 .\"O .SH "SEE ALSO"
151 .SH 関連項目
152 .BR printf (3)