OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / original / 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 .TH DPRINTF 3 2008-08-06 "GNU" "Linux Programmer's Manual"
26 .SH NAME
27 dprintf, vdprintf \- print to a file descriptor
28 .SH SYNOPSIS
29 .B #define _GNU_SOURCE
30 .br
31 .B #include <stdio.h>
32 .sp
33 .BI "int dprintf(int " fd ", const char *" format ", ...);"
34 .sp
35 .BI "int vdprintf(int " fd ", const char *" format ", va_list " ap );
36 .SH DESCRIPTION
37 The functions
38 .BR dprintf ()
39 and
40 .BR vdprintf ()
41 (as found in the glibc2 library) are exact analogs of
42 .BR fprintf (3)
43 and
44 .BR vfprintf (3),
45 except that they output to a file descriptor
46 .I fd
47 instead of to a
48 .I stdio
49 stream.
50 .SH "CONFORMING TO"
51 These functions are GNU extensions that are nowadays specified in
52 POSIX.1-2008
53 .\" .SH NOTES
54 .\" These functions are GNU extensions, not in C or POSIX.
55 .\" Clearly, the names were badly chosen.
56 .\" Many systems (like MacOS) have incompatible functions called
57 .\" .BR dprintf (),
58 .\" usually some debugging version of
59 .\" .BR printf (3),
60 .\" perhaps with a prototype like
61 .\"
62 .\" .BI "void dprintf(int level, const char *" format ", ...);"
63 .\"
64 .\" where the first argument is a debugging level (and output is to
65 .\" .IR stderr ).
66 .\" Moreover,
67 .\" .BR dprintf ()
68 .\" (or
69 .\" .BR DPRINTF )
70 .\" is also a popular macro name for a debugging printf.
71 .\" So, probably, it is better to avoid this function in programs
72 .\" intended to be portable.
73 .\"
74 .\" A better name would have been
75 .\" .BR fdprintf ().
76 .SH "SEE ALSO"
77 .BR printf (3),
78 .BR feature_test_macros (7)