]>
Commit | Line | Data |
---|---|---|
fea681da MK |
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. | |
c13182ef | 11 | .\" |
fea681da MK |
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. | |
c13182ef | 19 | .\" |
fea681da MK |
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 | .\" | |
cd17119c | 25 | .TH DPRINTF 3 2010-09-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
26 | .SH NAME |
27 | dprintf, vdprintf \- print to a file descriptor | |
28 | .SH SYNOPSIS | |
fea681da MK |
29 | .B #include <stdio.h> |
30 | .sp | |
31 | .BI "int dprintf(int " fd ", const char *" format ", ...);" | |
32 | .sp | |
33 | .BI "int vdprintf(int " fd ", const char *" format ", va_list " ap ); | |
cd17119c MK |
34 | .sp |
35 | .in -4n | |
36 | Feature Test Macro Requirements for glibc (see | |
37 | .BR feature_test_macros (7)): | |
38 | .in | |
39 | .sp | |
40 | .BR dprintf (), | |
41 | .BR vdprintf (): | |
ea91c3fd MK |
42 | .PD 0 |
43 | .ad l | |
44 | .RS 4 | |
45 | .TP 4 | |
46 | Since glibc 2.10: | |
47 | _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L | |
48 | .TP | |
cd17119c MK |
49 | Before glibc 2.10: |
50 | _GNU_SOURCE | |
ea91c3fd MK |
51 | .RE |
52 | .ad | |
53 | .PD | |
fea681da MK |
54 | .SH DESCRIPTION |
55 | The functions | |
e511ffb6 | 56 | .BR dprintf () |
fea681da | 57 | and |
e511ffb6 | 58 | .BR vdprintf () |
d9bfdb9c | 59 | (as found in the glibc2 library) are exact analogs of |
fb186734 | 60 | .BR fprintf (3) |
fea681da | 61 | and |
fb186734 | 62 | .BR vfprintf (3), |
fea681da MK |
63 | except that they output to a file descriptor |
64 | .I fd | |
7f4d0823 MK |
65 | instead of to a |
66 | .I stdio | |
67 | stream. | |
2b2581ee | 68 | .SH "CONFORMING TO" |
db546f6c MK |
69 | These functions are GNU extensions that are nowadays specified in |
70 | POSIX.1-2008 | |
7f4d0823 MK |
71 | .\" .SH NOTES |
72 | .\" These functions are GNU extensions, not in C or POSIX. | |
73 | .\" Clearly, the names were badly chosen. | |
74 | .\" Many systems (like MacOS) have incompatible functions called | |
75 | .\" .BR dprintf (), | |
76 | .\" usually some debugging version of | |
77 | .\" .BR printf (3), | |
78 | .\" perhaps with a prototype like | |
a1d5601b | 79 | .\" |
7f4d0823 | 80 | .\" .BI "void dprintf(int level, const char *" format ", ...);" |
a1d5601b | 81 | .\" |
c4bb193f | 82 | .\" where the first argument is a debugging level (and output is to |
7f4d0823 MK |
83 | .\" .IR stderr ). |
84 | .\" Moreover, | |
85 | .\" .BR dprintf () | |
86 | .\" (or | |
87 | .\" .BR DPRINTF ) | |
88 | .\" is also a popular macro name for a debugging printf. | |
89 | .\" So, probably, it is better to avoid this function in programs | |
90 | .\" intended to be portable. | |
a1d5601b | 91 | .\" |
7f4d0823 MK |
92 | .\" A better name would have been |
93 | .\" .BR fdprintf (). | |
fea681da | 94 | .SH "SEE ALSO" |
0a4f8b7b | 95 | .BR printf (3) |