OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / original / man3 / dprintf.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
2 .\" Text fragments inspired by Martin Schulze <joey@infodrom.org>.
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .TH DPRINTF 3 2010-09-15 "GNU" "Linux Programmer's Manual"
27 .SH NAME
28 dprintf, vdprintf \- print to a file descriptor
29 .SH SYNOPSIS
30 .B #include <stdio.h>
31 .sp
32 .BI "int dprintf(int " fd ", const char *" format ", ...);"
33 .sp
34 .BI "int vdprintf(int " fd ", const char *" format ", va_list " ap );
35 .sp
36 .in -4n
37 Feature Test Macro Requirements for glibc (see
38 .BR feature_test_macros (7)):
39 .in
40 .sp
41 .BR dprintf (),
42 .BR vdprintf ():
43 .PD 0
44 .ad l
45 .RS 4
46 .TP 4
47 Since glibc 2.10:
48 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
49 .TP
50 Before glibc 2.10:
51 _GNU_SOURCE
52 .RE
53 .ad
54 .PD
55 .SH DESCRIPTION
56 The functions
57 .BR dprintf ()
58 and
59 .BR vdprintf ()
60 (as found in the glibc2 library) are exact analogs of
61 .BR fprintf (3)
62 and
63 .BR vfprintf (3),
64 except that they output to a file descriptor
65 .I fd
66 instead of to a
67 .I stdio
68 stream.
69 .SH CONFORMING TO
70 These functions are GNU extensions that are nowadays specified in
71 POSIX.1-2008.
72 .\" .SH NOTES
73 .\" These functions are GNU extensions, not in C or POSIX.
74 .\" Clearly, the names were badly chosen.
75 .\" Many systems (like MacOS) have incompatible functions called
76 .\" .BR dprintf (),
77 .\" usually some debugging version of
78 .\" .BR printf (3),
79 .\" perhaps with a prototype like
80 .\"
81 .\" .BI "void dprintf(int level, const char *" format ", ...);"
82 .\"
83 .\" where the first argument is a debugging level (and output is to
84 .\" .IR stderr ).
85 .\" Moreover,
86 .\" .BR dprintf ()
87 .\" (or
88 .\" .BR DPRINTF )
89 .\" is also a popular macro name for a debugging printf.
90 .\" So, probably, it is better to avoid this function in programs
91 .\" intended to be portable.
92 .\"
93 .\" A better name would have been
94 .\" .BR fdprintf ().
95 .SH SEE ALSO
96 .BR printf (3)
97 .SH COLOPHON
98 This page is part of release 3.79 of the Linux
99 .I man-pages
100 project.
101 A description of the project,
102 information about reporting bugs,
103 and the latest version of this page,
104 can be found at
105 \%http://www.kernel.org/doc/man\-pages/.