OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[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)