OSDN Git Service

e6ab82b05bae666349a51cc269747e21f7cc8b9b
[linuxjm/LDP_man-pages.git] / po4a / stdio / po / stdio.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-04-25 05:37+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man3/asprintf.3:25
21 #, no-wrap
22 msgid "ASPRINTF"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/asprintf.3:25
27 #, no-wrap
28 msgid "2001-12-18"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/asprintf.3:25 build/C/man3/ctermid.3:24 build/C/man3/dprintf.3:25 build/C/man3/fclose.3:42 build/C/man3/fcloseall.3:24 build/C/man3/fflush.3:43 build/C/man3/fgetwc.3:16 build/C/man3/fmemopen.3:6 build/C/man3/fopen.3:42 build/C/man3/fputwc.3:14 build/C/man3/fread.3:43 build/C/man3/fseek.3:40 build/C/man3/getline.3:24 build/C/man3/gets.3:25 build/C/man3/getw.3:23 build/C/man3/popen.3:38 build/C/man3/printf.3:34 build/C/man3/puts.3:24 build/C/man3/remove.3:31 build/C/man3/scanf.3:50 build/C/man3/wprintf.3:14
33 #, no-wrap
34 msgid "GNU"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man3/asprintf.3:25 build/C/man3/ctermid.3:24 build/C/man3/dprintf.3:25 build/C/man3/fclose.3:42 build/C/man3/fcloseall.3:24 build/C/man3/ferror.3:42 build/C/man3/fflush.3:43 build/C/man3/fgetwc.3:16 build/C/man3/flockfile.3:23 build/C/man3/fmemopen.3:6 build/C/man3/fmtmsg.3:9 build/C/man3/fopen.3:42 build/C/man3/fopencookie.3:24 build/C/man3/fpurge.3:23 build/C/man3/fputwc.3:14 build/C/man3/fread.3:43 build/C/man3/fseek.3:40 build/C/man3/fseeko.3:23 build/C/man3/getline.3:24 build/C/man3/gets.3:25 build/C/man3/getw.3:23 build/C/man2/link.2:31 build/C/man2/llseek.2:26 build/C/man2/lseek.2:45 build/C/man3/lseek64.3:23 build/C/man2/open.2:52 build/C/man3/perror.3:30 build/C/man2/pipe.2:36 build/C/man3/popen.3:38 build/C/man3/printf.3:34 build/C/man3/puts.3:24 build/C/man2/read.2:35 build/C/man2/readlink.2:41 build/C/man2/readv.2:30 build/C/man3/remove.3:31 build/C/man2/rename.2:32 build/C/man2/rmdir.2:30 build/C/man3/scanf.3:50 build/C/man3/setbuf.3:46 build/C/man3/stdin.3:9 build/C/man3/stdio.3:37 build/C/man3/stdio_ext.3:23 build/C/man2/symlink.2:32 build/C/man7/symlink.7:35 build/C/man3/tempnam.3:23 build/C/man3/tmpfile.3:29 build/C/man3/tmpnam.3:25 build/C/man2/unlink.2:32 build/C/man3/unlocked_stdio.3:23 build/C/man3/wprintf.3:14 build/C/man2/write.2:39
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man3/asprintf.3:26 build/C/man3/ctermid.3:25 build/C/man3/dprintf.3:26 build/C/man3/fclose.3:43 build/C/man3/fcloseall.3:25 build/C/man3/ferror.3:43 build/C/man3/fflush.3:44 build/C/man3/fgetwc.3:17 build/C/man3/flockfile.3:24 build/C/man3/fmemopen.3:7 build/C/man3/fmtmsg.3:10 build/C/man3/fopen.3:43 build/C/man3/fopencookie.3:25 build/C/man3/fpurge.3:24 build/C/man3/fputwc.3:15 build/C/man3/fread.3:44 build/C/man3/fseek.3:41 build/C/man3/fseeko.3:24 build/C/man3/getline.3:25 build/C/man3/gets.3:26 build/C/man3/getw.3:24 build/C/man2/link.2:32 build/C/man2/llseek.2:27 build/C/man2/lseek.2:46 build/C/man3/lseek64.3:24 build/C/man2/open.2:53 build/C/man3/perror.3:31 build/C/man2/pipe.2:37 build/C/man3/popen.3:39 build/C/man3/printf.3:35 build/C/man3/puts.3:25 build/C/man2/read.2:36 build/C/man2/readlink.2:42 build/C/man2/readv.2:31 build/C/man3/remove.3:32 build/C/man2/rename.2:33 build/C/man2/rmdir.2:31 build/C/man3/scanf.3:51 build/C/man3/setbuf.3:47 build/C/man3/stdin.3:10 build/C/man3/stdio.3:38 build/C/man3/stdio_ext.3:24 build/C/man2/symlink.2:33 build/C/man7/symlink.7:36 build/C/man3/tempnam.3:24 build/C/man3/tmpfile.3:30 build/C/man3/tmpnam.3:26 build/C/man2/unlink.2:33 build/C/man3/unlocked_stdio.3:24 build/C/man3/wprintf.3:15 build/C/man2/write.2:40
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man3/asprintf.3:28
51 msgid "asprintf, vasprintf - print to allocated string"
52 msgstr ""
53
54 #. type: SH
55 #: build/C/man3/asprintf.3:28 build/C/man3/ctermid.3:27 build/C/man3/dprintf.3:28 build/C/man3/fclose.3:45 build/C/man3/fcloseall.3:27 build/C/man3/ferror.3:45 build/C/man3/fflush.3:46 build/C/man3/fgetwc.3:19 build/C/man3/flockfile.3:26 build/C/man3/fmemopen.3:9 build/C/man3/fmtmsg.3:12 build/C/man3/fopen.3:45 build/C/man3/fopencookie.3:27 build/C/man3/fpurge.3:26 build/C/man3/fputwc.3:17 build/C/man3/fread.3:46 build/C/man3/fseek.3:43 build/C/man3/fseeko.3:26 build/C/man3/getline.3:27 build/C/man3/gets.3:28 build/C/man3/getw.3:26 build/C/man2/link.2:34 build/C/man2/llseek.2:29 build/C/man2/lseek.2:48 build/C/man3/lseek64.3:26 build/C/man2/open.2:55 build/C/man3/perror.3:33 build/C/man2/pipe.2:39 build/C/man3/popen.3:41 build/C/man3/printf.3:38 build/C/man3/puts.3:27 build/C/man2/read.2:38 build/C/man2/readlink.2:44 build/C/man2/readv.2:33 build/C/man3/remove.3:34 build/C/man2/rename.2:35 build/C/man2/rmdir.2:33 build/C/man3/scanf.3:53 build/C/man3/setbuf.3:49 build/C/man3/stdin.3:12 build/C/man3/stdio.3:40 build/C/man3/stdio_ext.3:28 build/C/man2/symlink.2:35 build/C/man3/tempnam.3:26 build/C/man3/tmpfile.3:32 build/C/man3/tmpnam.3:28 build/C/man2/unlink.2:35 build/C/man3/unlocked_stdio.3:27 build/C/man3/wprintf.3:18 build/C/man2/write.2:42
56 #, no-wrap
57 msgid "SYNOPSIS"
58 msgstr ""
59
60 #. type: Plain text
61 #: build/C/man3/asprintf.3:30
62 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
63 msgstr ""
64
65 #. type: Plain text
66 #: build/C/man3/asprintf.3:32 build/C/man3/dprintf.3:30 build/C/man3/fclose.3:47 build/C/man3/ferror.3:47 build/C/man3/fflush.3:48 build/C/man3/fseek.3:45 build/C/man3/perror.3:35 build/C/man3/printf.3:40 build/C/man3/remove.3:36 build/C/man2/rename.2:37 build/C/man3/stdio.3:42 build/C/man3/stdio_ext.3:30
67 msgid "B<#include E<lt>stdio.hE<gt>>"
68 msgstr ""
69
70 #. type: Plain text
71 #: build/C/man3/asprintf.3:34
72 msgid "B<int asprintf(char **>I<strp>B<, const char *>I<fmt>B<, ...);>"
73 msgstr ""
74
75 #. type: Plain text
76 #: build/C/man3/asprintf.3:36
77 msgid ""
78 "B<int vasprintf(char **>I<strp>B<, const char *>I<fmt>B<, va_list "
79 ">I<ap>B<);>"
80 msgstr ""
81
82 #. type: SH
83 #: build/C/man3/asprintf.3:36 build/C/man3/ctermid.3:44 build/C/man3/dprintf.3:54 build/C/man3/fclose.3:49 build/C/man3/fcloseall.3:34 build/C/man3/ferror.3:63 build/C/man3/fflush.3:50 build/C/man3/fgetwc.3:28 build/C/man3/flockfile.3:49 build/C/man3/fmemopen.3:42 build/C/man3/fmtmsg.3:22 build/C/man3/fopen.3:63 build/C/man3/fopencookie.3:35 build/C/man3/fpurge.3:40 build/C/man3/fputwc.3:26 build/C/man3/fread.3:56 build/C/man3/fseek.3:55 build/C/man3/fseeko.3:35 build/C/man3/getline.3:56 build/C/man3/gets.3:44 build/C/man3/getw.3:57 build/C/man2/link.2:38 build/C/man2/llseek.2:38 build/C/man2/lseek.2:54 build/C/man3/lseek64.3:34 build/C/man2/open.2:66 build/C/man3/perror.3:54 build/C/man2/pipe.2:51 build/C/man3/popen.3:62 build/C/man3/printf.3:76 build/C/man3/puts.3:41 build/C/man2/read.2:44 build/C/man2/readlink.2:61 build/C/man2/readv.2:56 build/C/man3/remove.3:38 build/C/man2/rename.2:39 build/C/man2/rmdir.2:37 build/C/man3/scanf.3:85 build/C/man3/setbuf.3:71 build/C/man3/stdin.3:20 build/C/man3/stdio.3:48 build/C/man3/stdio_ext.3:52 build/C/man2/symlink.2:52 build/C/man3/tempnam.3:40 build/C/man3/tmpfile.3:38 build/C/man3/tmpnam.3:34 build/C/man2/unlink.2:39 build/C/man3/unlocked_stdio.3:104 build/C/man3/wprintf.3:58 build/C/man2/write.2:46
84 #, no-wrap
85 msgid "DESCRIPTION"
86 msgstr ""
87
88 #. type: Plain text
89 #: build/C/man3/asprintf.3:51
90 msgid ""
91 "The functions B<asprintf>()  and B<vasprintf>()  are analogs of "
92 "B<sprintf>(3)  and B<vsprintf>(3), except that they allocate a string large "
93 "enough to hold the output including the terminating null byte, and return a "
94 "pointer to it via the first argument.  This pointer should be passed to "
95 "B<free>(3)  to release the allocated storage when it is no longer needed."
96 msgstr ""
97
98 #. type: SH
99 #: build/C/man3/asprintf.3:51 build/C/man3/ctermid.3:57 build/C/man3/fclose.3:57 build/C/man3/fcloseall.3:49 build/C/man3/fflush.3:72 build/C/man3/fgetwc.3:53 build/C/man3/flockfile.3:112 build/C/man3/fmemopen.3:172 build/C/man3/fmtmsg.3:148 build/C/man3/fopen.3:189 build/C/man3/fopencookie.3:235 build/C/man3/fpurge.3:56 build/C/man3/fputwc.3:52 build/C/man3/fread.3:81 build/C/man3/fseek.3:117 build/C/man3/fseeko.3:63 build/C/man3/getline.3:108 build/C/man3/gets.3:109 build/C/man3/getw.3:71 build/C/man2/link.2:52 build/C/man2/llseek.2:57 build/C/man2/lseek.2:151 build/C/man2/open.2:464 build/C/man2/pipe.2:92 build/C/man3/popen.3:121 build/C/man3/puts.3:82 build/C/man2/read.2:63 build/C/man2/readlink.2:75 build/C/man2/readv.2:175 build/C/man3/remove.3:60 build/C/man2/rename.2:91 build/C/man2/rmdir.2:40 build/C/man3/scanf.3:528 build/C/man3/setbuf.3:150 build/C/man2/symlink.2:84 build/C/man3/tempnam.3:85 build/C/man3/tmpfile.3:45 build/C/man3/tmpnam.3:68 build/C/man2/unlink.2:55 build/C/man3/wprintf.3:185 build/C/man2/write.2:89
100 #, no-wrap
101 msgid "RETURN VALUE"
102 msgstr ""
103
104 #. type: Plain text
105 #: build/C/man3/asprintf.3:59
106 msgid ""
107 "When successful, these functions return the number of bytes printed, just "
108 "like B<sprintf>(3).  If memory allocation wasn't possible, or some other "
109 "error occurs, these functions will return -1, and the contents of I<strp> is "
110 "undefined."
111 msgstr ""
112
113 #. type: SH
114 #: build/C/man3/asprintf.3:59 build/C/man3/ctermid.3:59 build/C/man3/dprintf.3:68 build/C/man3/fclose.3:88 build/C/man3/fcloseall.3:54 build/C/man3/ferror.3:105 build/C/man3/fflush.3:91 build/C/man3/fgetwc.3:65 build/C/man3/flockfile.3:119 build/C/man3/fmemopen.3:191 build/C/man3/fmtmsg.3:221 build/C/man3/fopen.3:246 build/C/man3/fopencookie.3:242 build/C/man3/fpurge.3:68 build/C/man3/fputwc.3:63 build/C/man3/fread.3:101 build/C/man3/fseek.3:164 build/C/man3/fseeko.3:75 build/C/man3/getline.3:132 build/C/man3/gets.3:136 build/C/man3/getw.3:78 build/C/man2/link.2:128 build/C/man2/llseek.2:76 build/C/man2/lseek.2:189 build/C/man2/open.2:610 build/C/man3/perror.3:111 build/C/man2/pipe.2:118 build/C/man3/popen.3:167 build/C/man3/printf.3:807 build/C/man3/puts.3:101 build/C/man2/read.2:155 build/C/man2/readlink.2:123 build/C/man2/readv.2:212 build/C/man3/remove.3:70 build/C/man2/rename.2:229 build/C/man2/rmdir.2:127 build/C/man3/scanf.3:575 build/C/man3/setbuf.3:162 build/C/man3/stdin.3:109 build/C/man3/stdio.3:244 build/C/man2/symlink.2:144 build/C/man3/tempnam.3:94 build/C/man3/tmpfile.3:74 build/C/man3/tmpnam.3:75 build/C/man2/unlink.2:141 build/C/man3/unlocked_stdio.3:111 build/C/man3/wprintf.3:193 build/C/man2/write.2:179
115 #, no-wrap
116 msgid "CONFORMING TO"
117 msgstr ""
118
119 #. type: Plain text
120 #: build/C/man3/asprintf.3:65
121 msgid ""
122 "These functions are GNU extensions, not in C or POSIX.  They are also "
123 "available under *BSD.  The FreeBSD implementation sets I<strp> to NULL on "
124 "error."
125 msgstr ""
126
127 #. type: SH
128 #: build/C/man3/asprintf.3:65 build/C/man3/ctermid.3:69 build/C/man3/dprintf.3:94 build/C/man3/fclose.3:100 build/C/man3/fcloseall.3:56 build/C/man3/ferror.3:112 build/C/man3/fflush.3:106 build/C/man3/fgetwc.3:82 build/C/man3/flockfile.3:127 build/C/man3/fmemopen.3:273 build/C/man3/fmtmsg.3:293 build/C/man3/fopen.3:302 build/C/man3/fopencookie.3:434 build/C/man3/fpurge.3:78 build/C/man3/fputwc.3:80 build/C/man3/fread.3:103 build/C/man3/fseek.3:166 build/C/man3/fseeko.3:81 build/C/man3/getline.3:166 build/C/man3/gets.3:171 build/C/man3/getw.3:84 build/C/man2/link.2:177 build/C/man2/llseek.2:82 build/C/man2/lseek.2:234 build/C/man3/lseek64.3:157 build/C/man2/open.2:849 build/C/man3/perror.3:139 build/C/man2/pipe.2:190 build/C/man3/popen.3:196 build/C/man3/printf.3:1074 build/C/man3/puts.3:110 build/C/man2/read.2:178 build/C/man2/readlink.2:212 build/C/man2/readv.2:282 build/C/man3/remove.3:81 build/C/man2/rename.2:242 build/C/man2/rmdir.2:132 build/C/man3/scanf.3:717 build/C/man3/setbuf.3:198 build/C/man3/stdin.3:150 build/C/man3/stdio.3:248 build/C/man3/stdio_ext.3:130 build/C/man2/symlink.2:159 build/C/man7/symlink.7:470 build/C/man3/tempnam.3:164 build/C/man3/tmpfile.3:86 build/C/man3/tmpnam.3:151 build/C/man2/unlink.2:148 build/C/man3/unlocked_stdio.3:134 build/C/man3/wprintf.3:229 build/C/man2/write.2:205
129 #, no-wrap
130 msgid "SEE ALSO"
131 msgstr ""
132
133 #. type: Plain text
134 #: build/C/man3/asprintf.3:68
135 msgid "B<free>(3), B<malloc>(3), B<printf>(3)"
136 msgstr ""
137
138 #. type: TH
139 #: build/C/man3/ctermid.3:24
140 #, no-wrap
141 msgid "CTERMID"
142 msgstr ""
143
144 #. type: TH
145 #: build/C/man3/ctermid.3:24
146 #, no-wrap
147 msgid "2007-07-26"
148 msgstr ""
149
150 #. type: Plain text
151 #: build/C/man3/ctermid.3:27
152 msgid "ctermid - get controlling terminal name"
153 msgstr ""
154
155 #. type: Plain text
156 #: build/C/man3/ctermid.3:32 build/C/man3/fgetwc.3:22 build/C/man3/flockfile.3:29 build/C/man3/fmemopen.3:12 build/C/man3/fopen.3:48 build/C/man3/fputwc.3:20 build/C/man3/fread.3:49 build/C/man3/fseeko.3:29 build/C/man3/getline.3:30 build/C/man3/gets.3:31 build/C/man3/getw.3:29 build/C/man3/popen.3:44 build/C/man3/puts.3:30 build/C/man3/scanf.3:56 build/C/man3/setbuf.3:52 build/C/man3/stdin.3:15 build/C/man3/tempnam.3:29 build/C/man3/tmpfile.3:35 build/C/man3/tmpnam.3:31 build/C/man3/unlocked_stdio.3:30
157 #, no-wrap
158 msgid "B<#include E<lt>stdio.hE<gt>>\n"
159 msgstr ""
160
161 #. type: Plain text
162 #: build/C/man3/ctermid.3:34
163 #, no-wrap
164 msgid "B<char *ctermid(char *>I<s>B<);>\n"
165 msgstr ""
166
167 #. type: Plain text
168 #: build/C/man3/ctermid.3:39 build/C/man3/dprintf.3:38 build/C/man3/ferror.3:59 build/C/man3/flockfile.3:40 build/C/man3/fmemopen.3:25 build/C/man3/fopen.3:59 build/C/man3/getline.3:40 build/C/man3/getw.3:38 build/C/man3/perror.3:49 build/C/man3/popen.3:53 build/C/man3/printf.3:63 build/C/man2/readlink.2:52 build/C/man2/readv.2:51 build/C/man3/scanf.3:71 build/C/man3/setbuf.3:66 build/C/man2/symlink.2:43 build/C/man3/tempnam.3:36 build/C/man3/unlocked_stdio.3:66 build/C/man3/wprintf.3:37
169 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
170 msgstr ""
171
172 #.  From <unistd.h>: _XOPEN_SOURCE
173 #. type: Plain text
174 #: build/C/man3/ctermid.3:44
175 msgid "B<ctermid>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
176 msgstr ""
177
178 #. type: Plain text
179 #: build/C/man3/ctermid.3:57
180 msgid ""
181 "B<ctermid>()  returns a string which is the pathname for the current "
182 "controlling terminal for this process.  If I<s> is NULL, a static buffer is "
183 "used, otherwise I<s> points to a buffer used to hold the terminal pathname.  "
184 "The symbolic constant B<L_ctermid> is the maximum number of characters in "
185 "the returned pathname."
186 msgstr ""
187
188 #. type: Plain text
189 #: build/C/man3/ctermid.3:59
190 msgid "The pointer to the pathname."
191 msgstr ""
192
193 #. type: Plain text
194 #: build/C/man3/ctermid.3:61
195 msgid "Svr4, POSIX.1-2001."
196 msgstr ""
197
198 #. type: SH
199 #: build/C/man3/ctermid.3:61 build/C/man3/fmemopen.3:201 build/C/man3/gets.3:150 build/C/man3/getw.3:80 build/C/man2/link.2:171 build/C/man2/open.2:838 build/C/man3/popen.3:173 build/C/man3/printf.3:930 build/C/man3/puts.3:103 build/C/man2/readv.2:256 build/C/man3/remove.3:78 build/C/man2/rename.2:231 build/C/man2/rmdir.2:129 build/C/man3/scanf.3:682 build/C/man3/setbuf.3:168 build/C/man3/tempnam.3:154 build/C/man3/tmpnam.3:144 build/C/man2/unlink.2:145
200 #, no-wrap
201 msgid "BUGS"
202 msgstr ""
203
204 #. type: Plain text
205 #: build/C/man3/ctermid.3:65
206 msgid ""
207 "The path returned may not uniquely identify the controlling terminal; it "
208 "may, for example, be I</dev/tty>."
209 msgstr ""
210
211 #.  in glibc 2.3.x, x >= 4, the glibc headers threw an error
212 #.  if ctermid() was given an argument; fixed in 2.4.
213 #. type: Plain text
214 #: build/C/man3/ctermid.3:69
215 msgid "It is not assured that the program can open the terminal."
216 msgstr ""
217
218 #. type: Plain text
219 #: build/C/man3/ctermid.3:70
220 msgid "B<ttyname>(3)"
221 msgstr ""
222
223 #. type: TH
224 #: build/C/man3/dprintf.3:25
225 #, no-wrap
226 msgid "DPRINTF"
227 msgstr ""
228
229 #. type: TH
230 #: build/C/man3/dprintf.3:25 build/C/man3/fmemopen.3:6
231 #, no-wrap
232 msgid "2010-09-15"
233 msgstr ""
234
235 #. type: Plain text
236 #: build/C/man3/dprintf.3:28
237 msgid "dprintf, vdprintf - print to a file descriptor"
238 msgstr ""
239
240 #. type: Plain text
241 #: build/C/man3/dprintf.3:32
242 msgid "B<int dprintf(int >I<fd>B<, const char *>I<format>B<, ...);>"
243 msgstr ""
244
245 #. type: Plain text
246 #: build/C/man3/dprintf.3:34
247 msgid "B<int vdprintf(int >I<fd>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
248 msgstr ""
249
250 #. type: Plain text
251 #: build/C/man3/dprintf.3:42
252 msgid "B<dprintf>(), B<vdprintf>():"
253 msgstr ""
254
255 #. type: TP
256 #: build/C/man3/dprintf.3:45 build/C/man3/fmemopen.3:33 build/C/man3/getline.3:47
257 #, no-wrap
258 msgid "Since glibc 2.10:"
259 msgstr ""
260
261 #. type: Plain text
262 #: build/C/man3/dprintf.3:48 build/C/man3/fmemopen.3:36
263 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
264 msgstr ""
265
266 #. type: TP
267 #: build/C/man3/dprintf.3:48 build/C/man3/fmemopen.3:36 build/C/man3/getline.3:50
268 #, no-wrap
269 msgid "Before glibc 2.10:"
270 msgstr ""
271
272 #. type: Plain text
273 #: build/C/man3/dprintf.3:51 build/C/man3/fmemopen.3:39 build/C/man3/getline.3:53 build/C/man3/unlocked_stdio.3:102
274 msgid "_GNU_SOURCE"
275 msgstr ""
276
277 #. type: Plain text
278 #: build/C/man3/dprintf.3:68
279 msgid ""
280 "The functions B<dprintf>()  and B<vdprintf>()  (as found in the glibc2 "
281 "library) are exact analogs of B<fprintf>(3)  and B<vfprintf>(3), except that "
282 "they output to a file descriptor I<fd> instead of to a I<stdio> stream."
283 msgstr ""
284
285 #.  .SH NOTES
286 #.  These functions are GNU extensions, not in C or POSIX.
287 #.  Clearly, the names were badly chosen.
288 #.  Many systems (like MacOS) have incompatible functions called
289 #.  .BR dprintf (),
290 #.  usually some debugging version of
291 #.  .BR printf (3),
292 #.  perhaps with a prototype like
293 #
294 #.  .BI "void dprintf(int level, const char *" format ", ...);"
295 #
296 #.  where the first argument is a debugging level (and output is to
297 #.  .IR stderr ).
298 #.  Moreover,
299 #.  .BR dprintf ()
300 #.  (or
301 #.  .BR DPRINTF )
302 #.  is also a popular macro name for a debugging printf.
303 #.  So, probably, it is better to avoid this function in programs
304 #.  intended to be portable.
305 #
306 #.  A better name would have been
307 #.  .BR fdprintf ().
308 #. type: Plain text
309 #: build/C/man3/dprintf.3:94
310 msgid ""
311 "These functions are GNU extensions that are nowadays specified in "
312 "POSIX.1-2008."
313 msgstr ""
314
315 #. type: Plain text
316 #: build/C/man3/dprintf.3:95
317 msgid "B<printf>(3)"
318 msgstr ""
319
320 #. type: TH
321 #: build/C/man3/fclose.3:42
322 #, no-wrap
323 msgid "FCLOSE"
324 msgstr ""
325
326 #. type: TH
327 #: build/C/man3/fclose.3:42 build/C/man3/fopen.3:42 build/C/man2/read.2:35
328 #, no-wrap
329 msgid "2009-02-23"
330 msgstr ""
331
332 #. type: Plain text
333 #: build/C/man3/fclose.3:45
334 msgid "fclose - close a stream"
335 msgstr ""
336
337 #. type: Plain text
338 #: build/C/man3/fclose.3:49
339 msgid "B<int fclose(FILE *>I<fp>B<);>"
340 msgstr ""
341
342 #. type: Plain text
343 #: build/C/man3/fclose.3:57
344 msgid ""
345 "The B<fclose>()  function will flushes the stream pointed to by I<fp> "
346 "(writing any buffered output data using B<fflush>(3))  and closes the "
347 "underlying file descriptor."
348 msgstr ""
349
350 #. type: Plain text
351 #: build/C/man3/fclose.3:68
352 msgid ""
353 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
354 "I<errno> is set to indicate the error.  In either case any further access "
355 "(including another call to B<fclose>())  to the stream results in undefined "
356 "behavior."
357 msgstr ""
358
359 #. type: SH
360 #: build/C/man3/fclose.3:68 build/C/man3/ferror.3:95 build/C/man3/fflush.3:79 build/C/man3/fgetwc.3:59 build/C/man3/flockfile.3:117 build/C/man3/fopen.3:201 build/C/man3/fpurge.3:63 build/C/man3/fputwc.3:58 build/C/man3/fseek.3:132 build/C/man3/fseeko.3:72 build/C/man3/getline.3:120 build/C/man2/link.2:57 build/C/man2/llseek.2:64 build/C/man2/lseek.2:159 build/C/man2/open.2:472 build/C/man2/pipe.2:97 build/C/man3/popen.3:141 build/C/man2/read.2:77 build/C/man2/readlink.2:83 build/C/man2/readv.2:186 build/C/man3/remove.3:65 build/C/man2/rename.2:96 build/C/man2/rmdir.2:45 build/C/man3/scanf.3:545 build/C/man2/symlink.2:89 build/C/man3/tempnam.3:90 build/C/man3/tmpfile.3:52 build/C/man3/tmpnam.3:73 build/C/man2/unlink.2:60 build/C/man2/write.2:107
361 #, no-wrap
362 msgid "ERRORS"
363 msgstr ""
364
365 #. type: TP
366 #: build/C/man3/fclose.3:69 build/C/man3/fflush.3:80 build/C/man3/fpurge.3:64 build/C/man3/fseek.3:133 build/C/man2/llseek.2:65 build/C/man2/lseek.2:160 build/C/man2/read.2:96 build/C/man3/scanf.3:551 build/C/man2/write.2:126
367 #, no-wrap
368 msgid "B<EBADF>"
369 msgstr ""
370
371 #.   This error cannot occur unless you are mixing ANSI C stdio operations and
372 #.   low-level file operations on the same stream. If you do get this error,
373 #.   you must have closed the stream's low-level file descriptor using
374 #.   something like close(fileno(fp)).
375 #. type: Plain text
376 #: build/C/man3/fclose.3:78
377 msgid "The file descriptor underlying I<fp> is not valid."
378 msgstr ""
379
380 #. type: Plain text
381 #: build/C/man3/fclose.3:88
382 msgid ""
383 "The B<fclose>()  function may also fail and set I<errno> for any of the "
384 "errors specified for the routines B<close>(2), B<write>(2)  or B<fflush>(3)."
385 msgstr ""
386
387 #. type: Plain text
388 #: build/C/man3/fclose.3:90 build/C/man3/fseek.3:166 build/C/man3/puts.3:103
389 msgid "C89, C99."
390 msgstr ""
391
392 #. type: SH
393 #: build/C/man3/fclose.3:90 build/C/man3/fflush.3:97 build/C/man3/fgetwc.3:67 build/C/man3/fmemopen.3:195 build/C/man3/fmtmsg.3:236 build/C/man3/fopen.3:255 build/C/man3/fpurge.3:76 build/C/man3/fputwc.3:65 build/C/man3/fseeko.3:77 build/C/man2/link.2:133 build/C/man2/llseek.2:79 build/C/man2/lseek.2:199 build/C/man2/open.2:636 build/C/man3/perror.3:124 build/C/man3/printf.3:868 build/C/man2/read.2:157 build/C/man2/readlink.2:128 build/C/man2/readv.2:224 build/C/man3/remove.3:72 build/C/man3/scanf.3:606 build/C/man3/stdin.3:118 build/C/man2/symlink.2:150 build/C/man3/tempnam.3:99 build/C/man3/tmpfile.3:76 build/C/man3/tmpnam.3:80 build/C/man3/wprintf.3:195 build/C/man2/write.2:188
394 #, no-wrap
395 msgid "NOTES"
396 msgstr ""
397
398 #. type: Plain text
399 #: build/C/man3/fclose.3:100
400 msgid ""
401 "Note that B<fclose>()  only flushes the user space buffers provided by the C "
402 "library.  To ensure that the data is physically stored on disk the kernel "
403 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
404 msgstr ""
405
406 #. type: Plain text
407 #: build/C/man3/fclose.3:105
408 msgid "B<close>(2), B<fcloseall>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
409 msgstr ""
410
411 #. type: TH
412 #: build/C/man3/fcloseall.3:24
413 #, no-wrap
414 msgid "FCLOSEALL"
415 msgstr ""
416
417 #. type: TH
418 #: build/C/man3/fcloseall.3:24
419 #, no-wrap
420 msgid "2006-12-27"
421 msgstr ""
422
423 #. type: Plain text
424 #: build/C/man3/fcloseall.3:27
425 msgid "fcloseall - close all open streams"
426 msgstr ""
427
428 #. type: Plain text
429 #: build/C/man3/fcloseall.3:31 build/C/man3/fopencookie.3:31
430 #, no-wrap
431 msgid ""
432 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
433 "B<#include E<lt>stdio.hE<gt>>\n"
434 msgstr ""
435
436 #. type: Plain text
437 #: build/C/man3/fcloseall.3:33
438 #, no-wrap
439 msgid "B<int fcloseall(void);>\n"
440 msgstr ""
441
442 #. type: Plain text
443 #: build/C/man3/fcloseall.3:42
444 msgid ""
445 "The B<fcloseall>()  function closes all of the calling process's open "
446 "streams.  Buffered output for each stream is written before it is closed (as "
447 "for B<fflush>(3)); buffered input is discarded."
448 msgstr ""
449
450 #. type: Plain text
451 #: build/C/man3/fcloseall.3:49
452 msgid "The standard streams, I<stdin>, I<stdout>, and I<stderr> are also closed."
453 msgstr ""
454
455 #. type: Plain text
456 #: build/C/man3/fcloseall.3:54
457 msgid ""
458 "This function returns 0 if all files were successfully closed; on error, "
459 "B<EOF> is returned."
460 msgstr ""
461
462 #. type: Plain text
463 #: build/C/man3/fcloseall.3:56
464 msgid "This function is a GNU extension."
465 msgstr ""
466
467 #. type: Plain text
468 #: build/C/man3/fcloseall.3:61
469 msgid "B<close>(2), B<fclose>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
470 msgstr ""
471
472 #. type: TH
473 #: build/C/man3/ferror.3:42
474 #, no-wrap
475 msgid "FERROR"
476 msgstr ""
477
478 #. type: TH
479 #: build/C/man3/ferror.3:42 build/C/man3/flockfile.3:23 build/C/man3/unlocked_stdio.3:23
480 #, no-wrap
481 msgid "2008-08-29"
482 msgstr ""
483
484 #. type: Plain text
485 #: build/C/man3/ferror.3:45
486 msgid "clearerr, feof, ferror, fileno - check and reset stream status"
487 msgstr ""
488
489 #. type: Plain text
490 #: build/C/man3/ferror.3:49
491 msgid "B<void clearerr(FILE *>I<stream>B<);>"
492 msgstr ""
493
494 #. type: Plain text
495 #: build/C/man3/ferror.3:51
496 msgid "B<int feof(FILE *>I<stream>B<);>"
497 msgstr ""
498
499 #. type: Plain text
500 #: build/C/man3/ferror.3:53
501 msgid "B<int ferror(FILE *>I<stream>B<);>"
502 msgstr ""
503
504 #. type: Plain text
505 #: build/C/man3/ferror.3:55
506 msgid "B<int fileno(FILE *>I<stream>B<);>"
507 msgstr ""
508
509 #. type: Plain text
510 #: build/C/man3/ferror.3:63
511 msgid "B<fileno>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
512 msgstr ""
513
514 #. type: Plain text
515 #: build/C/man3/ferror.3:68
516 msgid ""
517 "The function B<clearerr>()  clears the end-of-file and error indicators for "
518 "the stream pointed to by I<stream>."
519 msgstr ""
520
521 #. type: Plain text
522 #: build/C/man3/ferror.3:77
523 msgid ""
524 "The function B<feof>()  tests the end-of-file indicator for the stream "
525 "pointed to by I<stream>, returning nonzero if it is set.  The end-of-file "
526 "indicator can only be cleared by the function B<clearerr>()."
527 msgstr ""
528
529 #. type: Plain text
530 #: build/C/man3/ferror.3:86
531 msgid ""
532 "The function B<ferror>()  tests the error indicator for the stream pointed "
533 "to by I<stream>, returning nonzero if it is set.  The error indicator can "
534 "only be reset by the B<clearerr>()  function."
535 msgstr ""
536
537 #. type: Plain text
538 #: build/C/man3/ferror.3:92
539 msgid ""
540 "The function B<fileno>()  examines the argument I<stream> and returns its "
541 "integer descriptor."
542 msgstr ""
543
544 #. type: Plain text
545 #: build/C/man3/ferror.3:95 build/C/man3/fgetwc.3:53 build/C/man3/fputwc.3:52 build/C/man3/fread.3:81 build/C/man3/gets.3:109 build/C/man3/puts.3:82
546 msgid "For nonlocking counterparts, see B<unlocked_stdio>(3)."
547 msgstr ""
548
549 #. type: Plain text
550 #: build/C/man3/ferror.3:105
551 msgid ""
552 "These functions should not fail and do not set the external variable "
553 "I<errno>.  (However, in case B<fileno>()  detects that its argument is not a "
554 "valid stream, it must return -1 and set I<errno> to B<EBADF>.)"
555 msgstr ""
556
557 #. type: Plain text
558 #: build/C/man3/ferror.3:112
559 msgid ""
560 "The functions B<clearerr>(), B<feof>(), and B<ferror>()  conform to C89 and "
561 "C99."
562 msgstr ""
563
564 #. type: Plain text
565 #: build/C/man3/ferror.3:116
566 msgid "B<open>(2), B<fdopen>(3), B<stdio>(3), B<unlocked_stdio>(3)"
567 msgstr ""
568
569 #. type: TH
570 #: build/C/man3/fflush.3:43
571 #, no-wrap
572 msgid "FFLUSH"
573 msgstr ""
574
575 #. type: TH
576 #: build/C/man3/fflush.3:43
577 #, no-wrap
578 msgid "2009-09-06"
579 msgstr ""
580
581 #. type: Plain text
582 #: build/C/man3/fflush.3:46
583 msgid "fflush - flush a stream"
584 msgstr ""
585
586 #. type: Plain text
587 #: build/C/man3/fflush.3:50
588 msgid "B<int fflush(FILE *>I<stream>B<);>"
589 msgstr ""
590
591 #. type: Plain text
592 #: build/C/man3/fflush.3:61
593 msgid ""
594 "For output streams, B<fflush>()  forces a write of all user-space buffered "
595 "data for the given output or update I<stream> via the stream's underlying "
596 "write function.  For input streams, B<fflush>()  discards any buffered data "
597 "that has been fetched from the underlying file, but has not been consumed by "
598 "the application.  The open status of the stream is unaffected."
599 msgstr ""
600
601 #. type: Plain text
602 #: build/C/man3/fflush.3:69
603 msgid ""
604 "If the I<stream> argument is NULL, B<fflush>()  flushes I<all> open output "
605 "streams."
606 msgstr ""
607
608 #. type: Plain text
609 #: build/C/man3/fflush.3:72
610 msgid "For a nonlocking counterpart, see B<unlocked_stdio>(3)."
611 msgstr ""
612
613 #. type: Plain text
614 #: build/C/man3/fflush.3:79
615 msgid ""
616 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
617 "I<errno> is set to indicate the error."
618 msgstr ""
619
620 #. type: Plain text
621 #: build/C/man3/fflush.3:84
622 msgid "I<Stream> is not an open stream, or is not open for writing."
623 msgstr ""
624
625 #. type: Plain text
626 #: build/C/man3/fflush.3:91
627 msgid ""
628 "The function B<fflush>()  may also fail and set I<errno> for any of the "
629 "errors specified for B<write>(2)."
630 msgstr ""
631
632 #. type: Plain text
633 #: build/C/man3/fflush.3:93
634 msgid "C89, C99, POSIX.1-2001, POSIX.1-2008."
635 msgstr ""
636
637 #.  Verified on: Solaris 8.
638 #. type: Plain text
639 #: build/C/man3/fflush.3:97
640 msgid ""
641 "The standards do not specify the behavior for input streams.  Most other "
642 "implementations behave the same as Linux."
643 msgstr ""
644
645 #. type: Plain text
646 #: build/C/man3/fflush.3:106
647 msgid ""
648 "Note that B<fflush>()  only flushes the user space buffers provided by the C "
649 "library.  To ensure that the data is physically stored on disk the kernel "
650 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
651 msgstr ""
652
653 #. type: Plain text
654 #: build/C/man3/fflush.3:113
655 msgid ""
656 "B<fsync>(2), B<sync>(2), B<write>(2), B<fclose>(3), B<fopen>(3), "
657 "B<setbuf>(3), B<unlocked_stdio>(3)"
658 msgstr ""
659
660 #. type: TH
661 #: build/C/man3/fgetwc.3:16
662 #, no-wrap
663 msgid "FGETWC"
664 msgstr ""
665
666 #. type: TH
667 #: build/C/man3/fgetwc.3:16 build/C/man3/fputwc.3:14
668 #, no-wrap
669 msgid "1999-07-25"
670 msgstr ""
671
672 #. type: Plain text
673 #: build/C/man3/fgetwc.3:19
674 msgid "fgetwc, getwc - read a wide character from a FILE stream"
675 msgstr ""
676
677 #. type: Plain text
678 #: build/C/man3/fgetwc.3:24 build/C/man3/fmemopen.3:18 build/C/man3/fputwc.3:22 build/C/man3/unlocked_stdio.3:52
679 #, no-wrap
680 msgid "B<#include E<lt>wchar.hE<gt>>\n"
681 msgstr ""
682
683 #. type: Plain text
684 #: build/C/man3/fgetwc.3:27
685 #, no-wrap
686 msgid ""
687 "B<wint_t fgetwc(FILE *>I<stream>B<);>\n"
688 "B<wint_t getwc(FILE *>I<stream>B<);>\n"
689 msgstr ""
690
691 #. type: Plain text
692 #: build/C/man3/fgetwc.3:42
693 msgid ""
694 "The B<fgetwc>()  function is the wide-character equivalent of the "
695 "B<fgetc>(3)  function.  It reads a wide character from I<stream> and returns "
696 "it.  If the end of stream is reached, or if I<ferror(stream)> becomes true, "
697 "it returns B<WEOF>.  If a wide-character conversion error occurs, it sets "
698 "I<errno> to B<EILSEQ> and returns B<WEOF>."
699 msgstr ""
700
701 #. type: Plain text
702 #: build/C/man3/fgetwc.3:50
703 msgid ""
704 "The B<getwc>()  function or macro functions identically to B<fgetwc>().  It "
705 "may be implemented as a macro, and may evaluate its argument more than "
706 "once.  There is no reason ever to use it."
707 msgstr ""
708
709 #. type: Plain text
710 #: build/C/man3/fgetwc.3:59
711 msgid ""
712 "The B<fgetwc>()  function returns the next wide-character from the stream, "
713 "or B<WEOF>."
714 msgstr ""
715
716 #. type: Plain text
717 #: build/C/man3/fgetwc.3:61 build/C/man3/fputwc.3:60
718 msgid "Apart from the usual ones, there is"
719 msgstr ""
720
721 #. type: TP
722 #: build/C/man3/fgetwc.3:61 build/C/man3/fputwc.3:60 build/C/man3/scanf.3:556
723 #, no-wrap
724 msgid "B<EILSEQ>"
725 msgstr ""
726
727 #. type: Plain text
728 #: build/C/man3/fgetwc.3:65
729 msgid "The data obtained from the input stream does not form a valid character."
730 msgstr ""
731
732 #. type: Plain text
733 #: build/C/man3/fgetwc.3:67 build/C/man3/fputwc.3:65
734 msgid "C99, POSIX.1-2001."
735 msgstr ""
736
737 #. type: Plain text
738 #: build/C/man3/fgetwc.3:74
739 msgid ""
740 "The behavior of B<fgetwc>()  depends on the B<LC_CTYPE> category of the "
741 "current locale."
742 msgstr ""
743
744 #. type: Plain text
745 #: build/C/man3/fgetwc.3:82
746 msgid ""
747 "In the absence of additional information passed to the B<fopen>(3)  call, it "
748 "is reasonable to expect that B<fgetwc>()  will actually read a multibyte "
749 "sequence from the stream and then convert it to a wide character."
750 msgstr ""
751
752 #. type: Plain text
753 #: build/C/man3/fgetwc.3:86
754 msgid "B<fgetws>(3), B<fputwc>(3), B<ungetwc>(3), B<unlocked_stdio>(3)"
755 msgstr ""
756
757 #. type: TH
758 #: build/C/man3/flockfile.3:23
759 #, no-wrap
760 msgid "FLOCKFILE"
761 msgstr ""
762
763 #. type: Plain text
764 #: build/C/man3/flockfile.3:26
765 msgid "flockfile, ftrylockfile, funlockfile - lock FILE for stdio"
766 msgstr ""
767
768 #. type: Plain text
769 #: build/C/man3/flockfile.3:31
770 #, no-wrap
771 msgid "B<void flockfile(FILE *>I<filehandle>B<);>\n"
772 msgstr ""
773
774 #. type: Plain text
775 #: build/C/man3/flockfile.3:33
776 #, no-wrap
777 msgid "B<int ftrylockfile(FILE *>I<filehandle>B<);>\n"
778 msgstr ""
779
780 #. type: Plain text
781 #: build/C/man3/flockfile.3:35
782 #, no-wrap
783 msgid "B<void funlockfile(FILE *>I<filehandle>B<);>\n"
784 msgstr ""
785
786 #. type: Plain text
787 #: build/C/man3/flockfile.3:44 build/C/man3/wprintf.3:41
788 msgid "All functions shown above:"
789 msgstr ""
790
791 #. type: Plain text
792 #: build/C/man3/flockfile.3:47
793 msgid ""
794 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
795 "|| _POSIX_SOURCE"
796 msgstr ""
797
798 #. type: Plain text
799 #: build/C/man3/flockfile.3:61
800 msgid ""
801 "The stdio functions are thread-safe.  This is achieved by assigning to each "
802 "I<FILE> object a lockcount and (if the lockcount is nonzero)  an owning "
803 "thread.  For each library call, these functions wait until the I<FILE> "
804 "object is no longer locked by a different thread, then lock it, do the "
805 "requested I/O, and unlock the object again."
806 msgstr ""
807
808 #. type: Plain text
809 #: build/C/man3/flockfile.3:67
810 msgid ""
811 "(Note: this locking has nothing to do with the file locking done by "
812 "functions like B<flock>(2)  and B<lockf>(3).)"
813 msgstr ""
814
815 #. type: Plain text
816 #: build/C/man3/flockfile.3:75
817 msgid ""
818 "All this is invisible to the C-programmer, but there may be two reasons to "
819 "wish for more detailed control.  On the one hand, maybe a series of I/O "
820 "actions by one thread belongs together, and should not be interrupted by the "
821 "I/O of some other thread.  On the other hand, maybe the locking overhead "
822 "should be avoided for greater efficiency."
823 msgstr ""
824
825 #. type: Plain text
826 #: build/C/man3/flockfile.3:92
827 msgid ""
828 "To this end, a thread can explicitly lock the I<FILE> object, then do its "
829 "series of I/O actions, then unlock.  This prevents other threads from coming "
830 "in between.  If the reason for doing this was to achieve greater efficiency, "
831 "one does the I/O with the nonlocking versions of the stdio functions: with "
832 "B<getc_unlocked>(3)  and B<putc_unlocked>(3)  instead of B<getc>(3)  and "
833 "B<putc>(3)."
834 msgstr ""
835
836 #. type: Plain text
837 #: build/C/man3/flockfile.3:99
838 msgid ""
839 "The B<flockfile>()  function waits for I<*filehandle> to be no longer locked "
840 "by a different thread, then makes the current thread owner of "
841 "I<*filehandle>, and increments the lockcount."
842 msgstr ""
843
844 #. type: Plain text
845 #: build/C/man3/flockfile.3:103
846 msgid "The B<funlockfile>()  function decrements the lock count."
847 msgstr ""
848
849 #. type: Plain text
850 #: build/C/man3/flockfile.3:112
851 msgid ""
852 "The B<ftrylockfile>()  function is a nonblocking version of B<flockfile>().  "
853 "It does nothing in case some other thread owns I<*filehandle>, and it "
854 "obtains ownership and increments the lockcount otherwise."
855 msgstr ""
856
857 #. type: Plain text
858 #: build/C/man3/flockfile.3:117
859 msgid ""
860 "The B<ftrylockfile>()  function returns zero for success (the lock was "
861 "obtained), and nonzero for failure."
862 msgstr ""
863
864 #. type: Plain text
865 #: build/C/man3/flockfile.3:119
866 msgid "None."
867 msgstr ""
868
869 #. type: Plain text
870 #: build/C/man3/flockfile.3:121 build/C/man3/popen.3:169
871 msgid "POSIX.1-2001."
872 msgstr ""
873
874 #. type: SH
875 #: build/C/man3/flockfile.3:121
876 #, no-wrap
877 msgid "AVAILABILITY"
878 msgstr ""
879
880 #. type: Plain text
881 #: build/C/man3/flockfile.3:127
882 msgid ""
883 "These functions are available when B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
884 "defined.  They are in libc since libc 5.1.1 and in glibc since glibc 2.0."
885 msgstr ""
886
887 #. type: Plain text
888 #: build/C/man3/flockfile.3:128
889 msgid "B<unlocked_stdio>(3)"
890 msgstr ""
891
892 #. type: TH
893 #: build/C/man3/fmemopen.3:6
894 #, no-wrap
895 msgid "FMEMOPEN"
896 msgstr ""
897
898 #. type: Plain text
899 #: build/C/man3/fmemopen.3:9
900 msgid "fmemopen, open_memstream, open_wmemstream - open memory as stream"
901 msgstr ""
902
903 #. type: Plain text
904 #: build/C/man3/fmemopen.3:14
905 #, no-wrap
906 msgid ""
907 "B<FILE *fmemopen(void *>I<buf>B<, size_t >I<size>B<, const char "
908 "*>I<mode>B<);>\n"
909 msgstr ""
910
911 #. type: Plain text
912 #: build/C/man3/fmemopen.3:16
913 #, no-wrap
914 msgid "B<FILE *open_memstream(char **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
915 msgstr ""
916
917 #. type: Plain text
918 #: build/C/man3/fmemopen.3:20
919 #, no-wrap
920 msgid "B<FILE *open_wmemstream(wchar_t **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
921 msgstr ""
922
923 #. type: Plain text
924 #: build/C/man3/fmemopen.3:30
925 msgid "B<fmemopen>(), B<open_memstream>(), B<open_wmemstream>():"
926 msgstr ""
927
928 #. type: Plain text
929 #: build/C/man3/fmemopen.3:53
930 msgid ""
931 "The B<fmemopen>()  function opens a stream that permits the access specified "
932 "by I<mode>.  The stream allows I/O to be performed on the string or memory "
933 "buffer pointed to by I<buf>.  This buffer must be at least I<size> bytes "
934 "long."
935 msgstr ""
936
937 #. type: Plain text
938 #: build/C/man3/fmemopen.3:73
939 msgid ""
940 "The argument I<mode> is the same as for B<fopen>(3).  If I<mode> specifies "
941 "an append mode, then the initial file position is set to the location of the "
942 "first null byte (\\(aq\\e0\\(aq) in the buffer; otherwise the initial file "
943 "position is set to the start of the buffer.  Since glibc 2.9, the letter 'b' "
944 "may be specified as the second character in I<mode>.  This provides "
945 "\"binary\" mode: writes don't implicitly add a terminating null byte, and "
946 "B<fseek>(3)  B<SEEK_END> is relative to the end of the buffer (i.e., the "
947 "value specified by the I<size> argument), rather than the current string "
948 "length."
949 msgstr ""
950
951 #. type: Plain text
952 #: build/C/man3/fmemopen.3:85
953 msgid ""
954 "When a stream that has been opened for writing is flushed (B<fflush>(3))  or "
955 "closed (B<fclose>(3)), a null byte is written at the end of the buffer if "
956 "there is space.  The caller should ensure that an extra byte is available in "
957 "the buffer (and that I<size> counts that byte)  to allow for this."
958 msgstr ""
959
960 #.  See http://sourceware.org/bugzilla/show_bug.cgi?id=1995
961 #.  and
962 #.  http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html
963 #. type: Plain text
964 #: build/C/man3/fmemopen.3:103
965 msgid ""
966 "Attempts to write more than I<size> bytes to the buffer result in an error.  "
967 "(By default, such errors will only be visible when the I<stdio> buffer is "
968 "flushed.  Disabling buffering with I<setbuf(fp,\\ NULL)> may be useful to "
969 "detect errors at the time of an output operation.  Alternatively, the caller "
970 "can explicitly set I<buf> as the stdio stream buffer, at the same time "
971 "informing stdio of the buffer's size, using I<setbuffer(fp, buf, size)>.)"
972 msgstr ""
973
974 #. type: Plain text
975 #: build/C/man3/fmemopen.3:111
976 msgid ""
977 "In a stream opened for reading, null bytes (\\(aq\\e0\\(aq) in the buffer do "
978 "not cause read operations to return an end-of-file indication.  A read from "
979 "the buffer will only indicate end-of-file when the file pointer advances "
980 "I<size> bytes past the start of the buffer."
981 msgstr ""
982
983 #. type: Plain text
984 #: build/C/man3/fmemopen.3:126
985 msgid ""
986 "If I<buf> is specified as NULL, then B<fmemopen>()  dynamically allocates a "
987 "buffer I<size> bytes long.  This is useful for an application that wants to "
988 "write data to a temporary buffer and then read it back again.  The buffer is "
989 "automatically freed when the stream is closed.  Note that the caller has no "
990 "way to obtain a pointer to the temporary buffer allocated by this call (but "
991 "see B<open_memstream>()  below)."
992 msgstr ""
993
994 #. type: Plain text
995 #: build/C/man3/fmemopen.3:137
996 msgid ""
997 "The B<open_memstream>()  function opens a stream for writing to a buffer.  "
998 "The buffer is dynamically allocated (as with B<malloc>(3)), and "
999 "automatically grows as required.  After closing the stream, the caller "
1000 "should B<free>(3)  this buffer."
1001 msgstr ""
1002
1003 #. type: Plain text
1004 #: build/C/man3/fmemopen.3:152
1005 msgid ""
1006 "When the stream is closed (B<fclose>(3))  or flushed (B<fflush>(3)), the "
1007 "locations pointed to by I<ptr> and I<sizeloc> are updated to contain, "
1008 "respectively, a pointer to the buffer and the current size of the buffer.  "
1009 "These values remain valid only as long as the caller performs no further "
1010 "output on the stream.  If further output is performed, then the stream must "
1011 "again be flushed before trying to access these variables."
1012 msgstr ""
1013
1014 #. type: Plain text
1015 #: build/C/man3/fmemopen.3:158
1016 msgid ""
1017 "A null byte is maintained at the end of the buffer.  This byte is I<not> "
1018 "included in the size value stored at I<sizeloc>."
1019 msgstr ""
1020
1021 #. type: Plain text
1022 #: build/C/man3/fmemopen.3:166
1023 msgid ""
1024 "The stream's file position can be changed with B<fseek>(3)  or "
1025 "B<fseeko>(3).  Moving the file position past the end of the data already "
1026 "written fills the intervening space with zeros."
1027 msgstr ""
1028
1029 #. type: Plain text
1030 #: build/C/man3/fmemopen.3:172
1031 msgid ""
1032 "The B<open_wmemstream>()  is similar to B<open_memstream>(), but operates on "
1033 "wide characters instead of bytes."
1034 msgstr ""
1035
1036 #. type: Plain text
1037 #: build/C/man3/fmemopen.3:184
1038 msgid ""
1039 "Upon successful completion B<fmemopen>(), B<open_memstream>()  and "
1040 "B<open_wmemstream>()  return a I<FILE> pointer.  Otherwise, NULL is returned "
1041 "and I<errno> is set to indicate the error."
1042 msgstr ""
1043
1044 #. type: SH
1045 #: build/C/man3/fmemopen.3:184 build/C/man3/fmtmsg.3:218 build/C/man3/getline.3:130 build/C/man2/pipe.2:113 build/C/man2/readv.2:207
1046 #, no-wrap
1047 msgid "VERSIONS"
1048 msgstr ""
1049
1050 #. type: Plain text
1051 #: build/C/man3/fmemopen.3:191
1052 msgid ""
1053 "B<fmemopen>()  and B<open_memstream>()  were already available in glibc "
1054 "1.0.x.  B<open_wmemstream>()  is available since glibc 2.4."
1055 msgstr ""
1056
1057 #. type: Plain text
1058 #: build/C/man3/fmemopen.3:195
1059 msgid ""
1060 "POSIX.1-2008.  These functions are not specified in POSIX.1-2001, and are "
1061 "not widely available on other systems."
1062 msgstr ""
1063
1064 #. type: Plain text
1065 #: build/C/man3/fmemopen.3:201
1066 msgid ""
1067 "There is no file descriptor associated with the file stream returned by "
1068 "these functions (i.e., B<fileno>(3)  will return an error if called on the "
1069 "returned stream)."
1070 msgstr ""
1071
1072 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=1996
1073 #. type: Plain text
1074 #: build/C/man3/fmemopen.3:208
1075 msgid ""
1076 "In glibc before version 2.7, seeking past the end of a stream created by "
1077 "B<open_memstream>()  does not enlarge the buffer; instead the B<fseek>(3)  "
1078 "call fails, returning -1."
1079 msgstr ""
1080
1081 #. type: SH
1082 #: build/C/man3/fmemopen.3:208 build/C/man3/fmtmsg.3:240 build/C/man3/fopencookie.3:244 build/C/man3/getline.3:139 build/C/man2/pipe.2:124 build/C/man3/printf.3:974 build/C/man2/readlink.2:155 build/C/man2/readv.2:263
1083 #, no-wrap
1084 msgid "EXAMPLE"
1085 msgstr ""
1086
1087 #. type: Plain text
1088 #: build/C/man3/fmemopen.3:218
1089 msgid ""
1090 "The program below uses B<fmemopen>()  to open an input buffer, and "
1091 "B<open_memstream>()  to open a dynamically sized output buffer.  The program "
1092 "scans its input string (taken from the program's first command-line "
1093 "argument) reading integers, and writes the squares of these integers to the "
1094 "output buffer.  An example of the output produced by this program is the "
1095 "following:"
1096 msgstr ""
1097
1098 #. type: Plain text
1099 #: build/C/man3/fmemopen.3:223
1100 #, no-wrap
1101 msgid ""
1102 "$B< ./a.out \\(aq1 23 43\\(aq>\n"
1103 "size=11; ptr=1 529 1849\n"
1104 msgstr ""
1105
1106 #. type: SS
1107 #: build/C/man3/fmemopen.3:225 build/C/man3/fopencookie.3:268
1108 #, no-wrap
1109 msgid "Program source"
1110 msgstr ""
1111
1112 #. type: Plain text
1113 #: build/C/man3/fmemopen.3:232
1114 #, no-wrap
1115 msgid ""
1116 "#define _GNU_SOURCE\n"
1117 "#include E<lt>string.hE<gt>\n"
1118 "#include E<lt>stdio.hE<gt>\n"
1119 "#include E<lt>stdlib.hE<gt>\n"
1120 msgstr ""
1121
1122 #. type: Plain text
1123 #: build/C/man3/fmemopen.3:235
1124 #, no-wrap
1125 msgid ""
1126 "#define handle_error(msg) \\e\n"
1127 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1128 msgstr ""
1129
1130 #. type: Plain text
1131 #: build/C/man3/fmemopen.3:243
1132 #, no-wrap
1133 msgid ""
1134 "int\n"
1135 "main(int argc, char *argv[])\n"
1136 "{\n"
1137 "    FILE *out, *in;\n"
1138 "    int v, s;\n"
1139 "    size_t size;\n"
1140 "    char *ptr;\n"
1141 msgstr ""
1142
1143 #. type: Plain text
1144 #: build/C/man3/fmemopen.3:248
1145 #, no-wrap
1146 msgid ""
1147 "    if (argc != 2) {\n"
1148 "\tfprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
1149 "\texit(EXIT_FAILURE);\n"
1150 "    }\n"
1151 msgstr ""
1152
1153 #. type: Plain text
1154 #: build/C/man3/fmemopen.3:252
1155 #, no-wrap
1156 msgid ""
1157 "    in = fmemopen(argv[1], strlen(argv[1]), \"r\");\n"
1158 "    if (in == NULL)\n"
1159 "        handle_error(\"fmemopen\");\n"
1160 msgstr ""
1161
1162 #. type: Plain text
1163 #: build/C/man3/fmemopen.3:256
1164 #, no-wrap
1165 msgid ""
1166 "    out = open_memstream(&ptr, &size);\n"
1167 "    if (out == NULL)\n"
1168 "        handle_error(\"open_memstream\");\n"
1169 msgstr ""
1170
1171 #. type: Plain text
1172 #: build/C/man3/fmemopen.3:261
1173 #, no-wrap
1174 msgid ""
1175 "    for (;;) {\n"
1176 "        s = fscanf(in, \"%d\", &v);\n"
1177 "        if (s E<lt>= 0)\n"
1178 "            break;\n"
1179 msgstr ""
1180
1181 #. type: Plain text
1182 #: build/C/man3/fmemopen.3:272
1183 #, no-wrap
1184 msgid ""
1185 "        s = fprintf(out, \"%d \", v * v);\n"
1186 "        if (s == -1)\n"
1187 "            handle_error(\"fprintf\");\n"
1188 "    }\n"
1189 "    fclose(in);\n"
1190 "    fclose(out);\n"
1191 "    printf(\"size=%ld; ptr=%s\\en\", (long) size, ptr);\n"
1192 "    free(ptr);\n"
1193 "    exit(EXIT_SUCCESS);\n"
1194 "}\n"
1195 msgstr ""
1196
1197 #. type: Plain text
1198 #: build/C/man3/fmemopen.3:275
1199 msgid "B<fopen>(3), B<fopencookie>(3)"
1200 msgstr ""
1201
1202 #. type: TH
1203 #: build/C/man3/fmtmsg.3:9
1204 #, no-wrap
1205 msgid "FMTMSG"
1206 msgstr ""
1207
1208 #. type: TH
1209 #: build/C/man3/fmtmsg.3:9
1210 #, no-wrap
1211 msgid "2008-06-14"
1212 msgstr ""
1213
1214 #. type: Plain text
1215 #: build/C/man3/fmtmsg.3:12
1216 msgid "fmtmsg - print formatted error messages"
1217 msgstr ""
1218
1219 #. type: Plain text
1220 #: build/C/man3/fmtmsg.3:15
1221 #, no-wrap
1222 msgid "B<#include E<lt>fmtmsg.hE<gt>>\n"
1223 msgstr ""
1224
1225 #. type: Plain text
1226 #: build/C/man3/fmtmsg.3:17
1227 #, no-wrap
1228 msgid "B<int fmtmsg(long >I<classification>B<, const char *>I<label>B<,>\n"
1229 msgstr ""
1230
1231 #. type: Plain text
1232 #: build/C/man3/fmtmsg.3:19
1233 #, no-wrap
1234 msgid "B<           int >I<severity>B<, const char *>I<text>B<,>\n"
1235 msgstr ""
1236
1237 #. type: Plain text
1238 #: build/C/man3/fmtmsg.3:21
1239 #, no-wrap
1240 msgid "B<           const char *>I<action>B<, const char *>I<tag>B<);>\n"
1241 msgstr ""
1242
1243 #. type: Plain text
1244 #: build/C/man3/fmtmsg.3:32
1245 msgid ""
1246 "This function displays a message described by its arguments on the device(s)  "
1247 "specified in the I<classification> argument.  For messages written to "
1248 "I<stderr>, the format depends on the B<MSGVERB> environment variable."
1249 msgstr ""
1250
1251 #. type: Plain text
1252 #: build/C/man3/fmtmsg.3:39
1253 msgid ""
1254 "The I<label> argument identifies the source of the message.  The string must "
1255 "consist of two colon separated parts where the first part has not more than "
1256 "10 and the second part not more than 14 characters."
1257 msgstr ""
1258
1259 #. type: Plain text
1260 #: build/C/man3/fmtmsg.3:43
1261 msgid "The I<text> argument describes the condition of the error."
1262 msgstr ""
1263
1264 #. type: Plain text
1265 #: build/C/man3/fmtmsg.3:48
1266 msgid ""
1267 "The I<action> argument describes possible steps to recover from the error.  "
1268 "If it is printed, it is prefixed by \"TO FIX: \"."
1269 msgstr ""
1270
1271 #. type: Plain text
1272 #: build/C/man3/fmtmsg.3:56
1273 msgid ""
1274 "The I<tag> argument is a reference to the online documentation where more "
1275 "information can be found.  It should contain the I<label> value and a unique "
1276 "identification number."
1277 msgstr ""
1278
1279 #. type: SS
1280 #: build/C/man3/fmtmsg.3:56
1281 #, no-wrap
1282 msgid "Dummy arguments"
1283 msgstr ""
1284
1285 #. type: Plain text
1286 #: build/C/man3/fmtmsg.3:75
1287 msgid ""
1288 "Each of the arguments can have a dummy value.  The dummy classification "
1289 "value B<MM_NULLMC> (0L) does not specify any output, so nothing is printed.  "
1290 "The dummy severity value B<NO_SEV> (0) says that no severity is supplied.  "
1291 "The values B<MM_NULLLBL>, B<MM_NULLTXT>, B<MM_NULLACT>, B<MM_NULLTAG> are "
1292 "synonyms for I<((char *) 0)>, the empty string, and B<MM_NULLSEV> is a "
1293 "synonym for B<NO_SEV>."
1294 msgstr ""
1295
1296 #. type: SS
1297 #: build/C/man3/fmtmsg.3:75
1298 #, no-wrap
1299 msgid "The classification argument"
1300 msgstr ""
1301
1302 #. type: Plain text
1303 #: build/C/man3/fmtmsg.3:79
1304 msgid ""
1305 "The I<classification> argument is the sum of values describing 4 types of "
1306 "information."
1307 msgstr ""
1308
1309 #. type: Plain text
1310 #: build/C/man3/fmtmsg.3:82
1311 msgid "The first value defines the output channel."
1312 msgstr ""
1313
1314 #. type: TP
1315 #: build/C/man3/fmtmsg.3:82
1316 #, no-wrap
1317 msgid "B<MM_PRINT>"
1318 msgstr ""
1319
1320 #. type: Plain text
1321 #: build/C/man3/fmtmsg.3:86
1322 msgid "Output to I<stderr>."
1323 msgstr ""
1324
1325 #. type: TP
1326 #: build/C/man3/fmtmsg.3:86
1327 #, no-wrap
1328 msgid "B<MM_CONSOLE>"
1329 msgstr ""
1330
1331 #. type: Plain text
1332 #: build/C/man3/fmtmsg.3:89
1333 msgid "Output to the system console."
1334 msgstr ""
1335
1336 #. type: TP
1337 #: build/C/man3/fmtmsg.3:89
1338 #, no-wrap
1339 msgid "B<MM_PRINT | MM_CONSOLE>"
1340 msgstr ""
1341
1342 #. type: Plain text
1343 #: build/C/man3/fmtmsg.3:92
1344 msgid "Output to both."
1345 msgstr ""
1346
1347 #. type: Plain text
1348 #: build/C/man3/fmtmsg.3:94
1349 msgid "The second value is the source of the error:"
1350 msgstr ""
1351
1352 #. type: TP
1353 #: build/C/man3/fmtmsg.3:94
1354 #, no-wrap
1355 msgid "B<MM_HARD>"
1356 msgstr ""
1357
1358 #. type: Plain text
1359 #: build/C/man3/fmtmsg.3:97
1360 msgid "A hardware error occurred."
1361 msgstr ""
1362
1363 #. type: TP
1364 #: build/C/man3/fmtmsg.3:97
1365 #, no-wrap
1366 msgid "B<MM_FIRM>"
1367 msgstr ""
1368
1369 #. type: Plain text
1370 #: build/C/man3/fmtmsg.3:100
1371 msgid "A firmware error occurred."
1372 msgstr ""
1373
1374 #. type: TP
1375 #: build/C/man3/fmtmsg.3:100
1376 #, no-wrap
1377 msgid "B<MM_SOFT>"
1378 msgstr ""
1379
1380 #. type: Plain text
1381 #: build/C/man3/fmtmsg.3:103
1382 msgid "A software error occurred."
1383 msgstr ""
1384
1385 #. type: Plain text
1386 #: build/C/man3/fmtmsg.3:105
1387 msgid "The third value encodes the detector of the problem:"
1388 msgstr ""
1389
1390 #. type: TP
1391 #: build/C/man3/fmtmsg.3:105
1392 #, no-wrap
1393 msgid "B<MM_APPL>"
1394 msgstr ""
1395
1396 #. type: Plain text
1397 #: build/C/man3/fmtmsg.3:108
1398 msgid "It is detected by an application."
1399 msgstr ""
1400
1401 #. type: TP
1402 #: build/C/man3/fmtmsg.3:108
1403 #, no-wrap
1404 msgid "B<MM_UTIL>"
1405 msgstr ""
1406
1407 #. type: Plain text
1408 #: build/C/man3/fmtmsg.3:111
1409 msgid "It is detected by a utility."
1410 msgstr ""
1411
1412 #. type: TP
1413 #: build/C/man3/fmtmsg.3:111
1414 #, no-wrap
1415 msgid "B<MM_OPSYS>"
1416 msgstr ""
1417
1418 #. type: Plain text
1419 #: build/C/man3/fmtmsg.3:114
1420 msgid "It is detected by the operating system."
1421 msgstr ""
1422
1423 #. type: Plain text
1424 #: build/C/man3/fmtmsg.3:116
1425 msgid "The fourth value shows the severity of the incident:"
1426 msgstr ""
1427
1428 #. type: TP
1429 #: build/C/man3/fmtmsg.3:116
1430 #, no-wrap
1431 msgid "B<MM_RECOVER>"
1432 msgstr ""
1433
1434 #. type: Plain text
1435 #: build/C/man3/fmtmsg.3:119
1436 msgid "It is a recoverable error."
1437 msgstr ""
1438
1439 #. type: TP
1440 #: build/C/man3/fmtmsg.3:119
1441 #, no-wrap
1442 msgid "B<MM_NRECOV>"
1443 msgstr ""
1444
1445 #. type: Plain text
1446 #: build/C/man3/fmtmsg.3:122
1447 msgid "It is a nonrecoverable error."
1448 msgstr ""
1449
1450 #. type: SS
1451 #: build/C/man3/fmtmsg.3:122
1452 #, no-wrap
1453 msgid "The severity argument"
1454 msgstr ""
1455
1456 #. type: Plain text
1457 #: build/C/man3/fmtmsg.3:126
1458 msgid "The I<severity> argument can take one of the following values:"
1459 msgstr ""
1460
1461 #. type: TP
1462 #: build/C/man3/fmtmsg.3:126
1463 #, no-wrap
1464 msgid "B<MM_NOSEV>"
1465 msgstr ""
1466
1467 #. type: Plain text
1468 #: build/C/man3/fmtmsg.3:129
1469 msgid "No severity is printed."
1470 msgstr ""
1471
1472 #. type: TP
1473 #: build/C/man3/fmtmsg.3:129
1474 #, no-wrap
1475 msgid "B<MM_HALT>"
1476 msgstr ""
1477
1478 #. type: Plain text
1479 #: build/C/man3/fmtmsg.3:132
1480 msgid "This value is printed as HALT."
1481 msgstr ""
1482
1483 #. type: TP
1484 #: build/C/man3/fmtmsg.3:132
1485 #, no-wrap
1486 msgid "B<MM_ERROR>"
1487 msgstr ""
1488
1489 #. type: Plain text
1490 #: build/C/man3/fmtmsg.3:135
1491 msgid "This value is printed as ERROR."
1492 msgstr ""
1493
1494 #. type: TP
1495 #: build/C/man3/fmtmsg.3:135
1496 #, no-wrap
1497 msgid "B<MM_WARNING>"
1498 msgstr ""
1499
1500 #. type: Plain text
1501 #: build/C/man3/fmtmsg.3:138
1502 msgid "This value is printed as WARNING."
1503 msgstr ""
1504
1505 #. type: TP
1506 #: build/C/man3/fmtmsg.3:138
1507 #, no-wrap
1508 msgid "B<MM_INFO>"
1509 msgstr ""
1510
1511 #. type: Plain text
1512 #: build/C/man3/fmtmsg.3:141
1513 msgid "This value is printed as INFO."
1514 msgstr ""
1515
1516 #. type: Plain text
1517 #: build/C/man3/fmtmsg.3:148
1518 msgid ""
1519 "The numeric values are between 0 and 4.  Using B<addseverity>(3)  or the "
1520 "environment variable B<SEV_LEVEL> you can add more levels and strings to "
1521 "print."
1522 msgstr ""
1523
1524 #. type: Plain text
1525 #: build/C/man3/fmtmsg.3:150
1526 msgid "The function can return 4 values:"
1527 msgstr ""
1528
1529 #. type: TP
1530 #: build/C/man3/fmtmsg.3:150
1531 #, no-wrap
1532 msgid "B<MM_OK>"
1533 msgstr ""
1534
1535 #. type: Plain text
1536 #: build/C/man3/fmtmsg.3:153
1537 msgid "Everything went smooth."
1538 msgstr ""
1539
1540 #. type: TP
1541 #: build/C/man3/fmtmsg.3:153
1542 #, no-wrap
1543 msgid "B<MM_NOTOK>"
1544 msgstr ""
1545
1546 #. type: Plain text
1547 #: build/C/man3/fmtmsg.3:156
1548 msgid "Complete failure."
1549 msgstr ""
1550
1551 #. type: TP
1552 #: build/C/man3/fmtmsg.3:156
1553 #, no-wrap
1554 msgid "B<MM_NOMSG>"
1555 msgstr ""
1556
1557 #. type: Plain text
1558 #: build/C/man3/fmtmsg.3:160
1559 msgid "Error writing to I<stderr>."
1560 msgstr ""
1561
1562 #. type: TP
1563 #: build/C/man3/fmtmsg.3:160
1564 #, no-wrap
1565 msgid "B<MM_NOCON>"
1566 msgstr ""
1567
1568 #. type: Plain text
1569 #: build/C/man3/fmtmsg.3:163
1570 msgid "Error writing to the console."
1571 msgstr ""
1572
1573 #. type: SH
1574 #: build/C/man3/fmtmsg.3:163
1575 #, no-wrap
1576 msgid "ENVIRONMENT"
1577 msgstr ""
1578
1579 #. type: Plain text
1580 #: build/C/man3/fmtmsg.3:174
1581 msgid ""
1582 "The environment variable B<MSGVERB> (\"message verbosity\") can be used to "
1583 "suppress parts of the output to I<stderr>.  (It does not influence output to "
1584 "the console.)  When this variable is defined, is non-NULL, and is a "
1585 "colon-separated list of valid keywords, then only the parts of the message "
1586 "corresponding to these keywords is printed.  Valid keywords are \"label\", "
1587 "\"severity\", \"text\", \"action\" and \"tag\"."
1588 msgstr ""
1589
1590 #. type: Plain text
1591 #: build/C/man3/fmtmsg.3:186
1592 msgid ""
1593 "The environment variable B<SEV_LEVEL> can be used to introduce new severity "
1594 "levels.  By default, only the five severity levels described above are "
1595 "available.  Any other numeric value would make B<fmtmsg>()  print nothing.  "
1596 "If the user puts B<SEV_LEVEL> with a format like"
1597 msgstr ""
1598
1599 #. type: Plain text
1600 #: build/C/man3/fmtmsg.3:189
1601 msgid "SEV_LEVEL=[description[:description[:...]]]"
1602 msgstr ""
1603
1604 #. type: Plain text
1605 #: build/C/man3/fmtmsg.3:194
1606 msgid ""
1607 "in the environment of the process before the first call to B<fmtmsg>(), "
1608 "where each description is of the form"
1609 msgstr ""
1610
1611 #. type: Plain text
1612 #: build/C/man3/fmtmsg.3:197
1613 msgid "severity-keyword,level,printstring"
1614 msgstr ""
1615
1616 #. type: Plain text
1617 #: build/C/man3/fmtmsg.3:204
1618 msgid ""
1619 "then B<fmtmsg>()  will also accept the indicated values for the level (in "
1620 "addition to the standard levels 0-4), and use the indicated printstring when "
1621 "such a level occurs."
1622 msgstr ""
1623
1624 #. type: Plain text
1625 #: build/C/man3/fmtmsg.3:218
1626 msgid ""
1627 "The severity-keyword part is not used by B<fmtmsg>()  but it has to be "
1628 "present.  The level part is a string representation of a number.  The "
1629 "numeric value must be a number greater than 4.  This value must be used in "
1630 "the severity argument of B<fmtmsg>()  to select this class.  It is not "
1631 "possible to overwrite any of the predefined classes.  The printstring is the "
1632 "string printed when a message of this class is processed by B<fmtmsg>()."
1633 msgstr ""
1634
1635 #. type: Plain text
1636 #: build/C/man3/fmtmsg.3:221
1637 msgid "B<fmtmsg>()  is provided in glibc since version 2.1."
1638 msgstr ""
1639
1640 #. type: Plain text
1641 #: build/C/man3/fmtmsg.3:236
1642 msgid ""
1643 "The functions B<fmtmsg>()  and B<addseverity>(3), and environment variables "
1644 "B<MSGVERB> and B<SEV_LEVEL> come from System V.  The function B<fmtmsg>()  "
1645 "and the environment variable B<MSGVERB> are described in POSIX.1-2001."
1646 msgstr ""
1647
1648 #. type: Plain text
1649 #: build/C/man3/fmtmsg.3:240
1650 msgid ""
1651 "System V and UnixWare man pages tell us that these functions have been "
1652 "replaced by \"pfmt() and addsev()\" or by \"pfmt(), vpfmt(), lfmt(), and "
1653 "vlfmt()\", and will be removed later."
1654 msgstr ""
1655
1656 #. type: Plain text
1657 #: build/C/man3/fmtmsg.3:245
1658 #, no-wrap
1659 msgid ""
1660 "#include E<lt>stdio.hE<gt>\n"
1661 "#include E<lt>stdlib.hE<gt>\n"
1662 "#include E<lt>fmtmsg.hE<gt>\n"
1663 msgstr ""
1664
1665 #. type: Plain text
1666 #: build/C/man3/fmtmsg.3:251
1667 #, no-wrap
1668 msgid ""
1669 "int\n"
1670 "main(void)\n"
1671 "{\n"
1672 "    long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER;\n"
1673 "    int err;\n"
1674 msgstr ""
1675
1676 #. type: Plain text
1677 #: build/C/man3/fmtmsg.3:272
1678 #, no-wrap
1679 msgid ""
1680 "    err = fmtmsg(class, \"util-linux:mount\", MM_ERROR,\n"
1681 "                \"unknown mount option\", \"See mount(8).\",\n"
1682 "                \"util-linux:mount:017\");\n"
1683 "    switch (err) {\n"
1684 "    case MM_OK:\n"
1685 "        break;\n"
1686 "    case MM_NOTOK:\n"
1687 "        printf(\"Nothing printed\\en\");\n"
1688 "        break;\n"
1689 "    case MM_NOMSG:\n"
1690 "        printf(\"Nothing printed to stderr\\en\");\n"
1691 "        break;\n"
1692 "    case MM_NOCON:\n"
1693 "        printf(\"No console output\\en\");\n"
1694 "        break;\n"
1695 "    default:\n"
1696 "        printf(\"Unknown error from fmtmsg()\\en\");\n"
1697 "    }\n"
1698 "    exit(EXIT_SUCCESS);\n"
1699 "}\n"
1700 msgstr ""
1701
1702 #. type: Plain text
1703 #: build/C/man3/fmtmsg.3:275
1704 msgid "The output should be:"
1705 msgstr ""
1706
1707 #. type: Plain text
1708 #: build/C/man3/fmtmsg.3:279
1709 #, no-wrap
1710 msgid ""
1711 "    util-linux:mount: ERROR: unknown mount option\n"
1712 "    TO FIX: See mount(8).  util-linux:mount:017\n"
1713 msgstr ""
1714
1715 #. type: Plain text
1716 #: build/C/man3/fmtmsg.3:282
1717 msgid "and after"
1718 msgstr ""
1719
1720 #. type: Plain text
1721 #: build/C/man3/fmtmsg.3:285
1722 #, no-wrap
1723 msgid "    MSGVERB=text:action; export MSGVERB\n"
1724 msgstr ""
1725
1726 #. type: Plain text
1727 #: build/C/man3/fmtmsg.3:288
1728 msgid "the output becomes:"
1729 msgstr ""
1730
1731 #. type: Plain text
1732 #: build/C/man3/fmtmsg.3:292
1733 #, no-wrap
1734 msgid ""
1735 "    unknown mount option\n"
1736 "    TO FIX: See mount(8).\n"
1737 msgstr ""
1738
1739 #. type: Plain text
1740 #: build/C/man3/fmtmsg.3:295
1741 msgid "B<addseverity>(3), B<perror>(3)"
1742 msgstr ""
1743
1744 #. type: TH
1745 #: build/C/man3/fopen.3:42
1746 #, no-wrap
1747 msgid "FOPEN"
1748 msgstr ""
1749
1750 #. type: Plain text
1751 #: build/C/man3/fopen.3:45
1752 msgid "fopen, fdopen, freopen - stream open functions"
1753 msgstr ""
1754
1755 #. type: Plain text
1756 #: build/C/man3/fopen.3:50
1757 #, no-wrap
1758 msgid "B<FILE *fopen(const char *>I<path>B<, const char *>I<mode>B<);>\n"
1759 msgstr ""
1760
1761 #. type: Plain text
1762 #: build/C/man3/fopen.3:52
1763 #, no-wrap
1764 msgid "B<FILE *fdopen(int >I<fd>B<, const char *>I<mode>B<);>\n"
1765 msgstr ""
1766
1767 #. type: Plain text
1768 #: build/C/man3/fopen.3:54
1769 #, no-wrap
1770 msgid ""
1771 "B<FILE *freopen(const char *>I<path>B<, const char *>I<mode>B<, FILE "
1772 "*>I<stream>B<);>\n"
1773 msgstr ""
1774
1775 #. type: Plain text
1776 #: build/C/man3/fopen.3:63
1777 msgid "B<fdopen>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
1778 msgstr ""
1779
1780 #. type: Plain text
1781 #: build/C/man3/fopen.3:69
1782 msgid ""
1783 "The B<fopen>()  function opens the file whose name is the string pointed to "
1784 "by I<path> and associates a stream with it."
1785 msgstr ""
1786
1787 #. type: Plain text
1788 #: build/C/man3/fopen.3:74
1789 msgid ""
1790 "The argument I<mode> points to a string beginning with one of the following "
1791 "sequences (Additional characters may follow these sequences.):"
1792 msgstr ""
1793
1794 #. type: TP
1795 #: build/C/man3/fopen.3:74
1796 #, no-wrap
1797 msgid "B<r>"
1798 msgstr ""
1799
1800 #. type: Plain text
1801 #: build/C/man3/fopen.3:78
1802 msgid ""
1803 "Open text file for reading.  The stream is positioned at the beginning of "
1804 "the file."
1805 msgstr ""
1806
1807 #. type: TP
1808 #: build/C/man3/fopen.3:78
1809 #, no-wrap
1810 msgid "B<r+>"
1811 msgstr ""
1812
1813 #. type: Plain text
1814 #: build/C/man3/fopen.3:82
1815 msgid ""
1816 "Open for reading and writing.  The stream is positioned at the beginning of "
1817 "the file."
1818 msgstr ""
1819
1820 #. type: TP
1821 #: build/C/man3/fopen.3:82
1822 #, no-wrap
1823 msgid "B<w>"
1824 msgstr ""
1825
1826 #. type: Plain text
1827 #: build/C/man3/fopen.3:86
1828 msgid ""
1829 "Truncate file to zero length or create text file for writing.  The stream is "
1830 "positioned at the beginning of the file."
1831 msgstr ""
1832
1833 #. type: TP
1834 #: build/C/man3/fopen.3:86
1835 #, no-wrap
1836 msgid "B<w+>"
1837 msgstr ""
1838
1839 #. type: Plain text
1840 #: build/C/man3/fopen.3:92
1841 msgid ""
1842 "Open for reading and writing.  The file is created if it does not exist, "
1843 "otherwise it is truncated.  The stream is positioned at the beginning of the "
1844 "file."
1845 msgstr ""
1846
1847 #. type: TP
1848 #: build/C/man3/fopen.3:92 build/C/man3/scanf.3:444
1849 #, no-wrap
1850 msgid "B<a>"
1851 msgstr ""
1852
1853 #. type: Plain text
1854 #: build/C/man3/fopen.3:97
1855 msgid ""
1856 "Open for appending (writing at end of file).  The file is created if it does "
1857 "not exist.  The stream is positioned at the end of the file."
1858 msgstr ""
1859
1860 #. type: TP
1861 #: build/C/man3/fopen.3:97
1862 #, no-wrap
1863 msgid "B<a+>"
1864 msgstr ""
1865
1866 #. type: Plain text
1867 #: build/C/man3/fopen.3:103
1868 msgid ""
1869 "Open for reading and appending (writing at end of file).  The file is "
1870 "created if it does not exist.  The initial file position for reading is at "
1871 "the beginning of the file, but output is always appended to the end of the "
1872 "file."
1873 msgstr ""
1874
1875 #. type: Plain text
1876 #: build/C/man3/fopen.3:116
1877 msgid ""
1878 "The I<mode> string can also include the letter \\(aqb\\(aq either as a last "
1879 "character or as a character between the characters in any of the "
1880 "two-character strings described above.  This is strictly for compatibility "
1881 "with C89 and has no effect; the \\(aqb\\(aq is ignored on all POSIX "
1882 "conforming systems, including Linux.  (Other systems may treat text files "
1883 "and binary files differently, and adding the \\(aqb\\(aq may be a good idea "
1884 "if you do I/O to a binary file and expect that your program may be ported to "
1885 "non-UNIX environments.)"
1886 msgstr ""
1887
1888 #. type: Plain text
1889 #: build/C/man3/fopen.3:119
1890 msgid "See NOTES below for details of glibc extensions for I<mode>."
1891 msgstr ""
1892
1893 #. type: Plain text
1894 #: build/C/man3/fopen.3:124
1895 msgid ""
1896 "Any created files will have mode B<S_IRUSR> | B<S_IWUSR> | B<S_IRGRP> | "
1897 "B<S_IWGRP> | B<S_IROTH> | B<S_IWOTH> (0666), as modified by the process's "
1898 "umask value (see B<umask>(2))."
1899 msgstr ""
1900
1901 #. type: Plain text
1902 #: build/C/man3/fopen.3:139
1903 msgid ""
1904 "Reads and writes may be intermixed on read/write streams in any order.  Note "
1905 "that ANSI C requires that a file positioning function intervene between "
1906 "output and input, unless an input operation encounters end-of-file.  (If "
1907 "this condition is not met, then a read is allowed to return the result of "
1908 "writes other than the most recent.)  Therefore it is good practice (and "
1909 "indeed sometimes necessary under Linux) to put an B<fseek>(3)  or "
1910 "B<fgetpos>(3)  operation between write and read operations on such a "
1911 "stream.  This operation may be an apparent no-op (as in I<fseek(..., 0L, "
1912 "SEEK_CUR)> called for its synchronizing side effect."
1913 msgstr ""
1914
1915 #. type: Plain text
1916 #: build/C/man3/fopen.3:144
1917 msgid ""
1918 "Opening a file in append mode (B<a> as the first character of I<mode>)  "
1919 "causes all subsequent write operations to this stream to occur at "
1920 "end-of-file, as if preceded by an"
1921 msgstr ""
1922
1923 #. type: Plain text
1924 #: build/C/man3/fopen.3:147
1925 #, no-wrap
1926 msgid "    fseek(stream,0,SEEK_END);\n"
1927 msgstr ""
1928
1929 #. type: Plain text
1930 #: build/C/man3/fopen.3:150
1931 msgid "call."
1932 msgstr ""
1933
1934 #. type: Plain text
1935 #: build/C/man3/fopen.3:171
1936 msgid ""
1937 "The B<fdopen>()  function associates a stream with the existing file "
1938 "descriptor, I<fd>.  The I<mode> of the stream (one of the values \"r\", "
1939 "\"r+\", \"w\", \"w+\", \"a\", \"a+\")  must be compatible with the mode of "
1940 "the file descriptor.  The file position indicator of the new stream is set "
1941 "to that belonging to I<fd>, and the error and end-of-file indicators are "
1942 "cleared.  Modes \"w\" or \"w+\" do not cause truncation of the file.  The "
1943 "file descriptor is not dup'ed, and will be closed when the stream created by "
1944 "B<fdopen>()  is closed.  The result of applying B<fdopen>()  to a shared "
1945 "memory object is undefined."
1946 msgstr ""
1947
1948 #. type: Plain text
1949 #: build/C/man3/fopen.3:189
1950 msgid ""
1951 "The B<freopen>()  function opens the file whose name is the string pointed "
1952 "to by I<path> and associates the stream pointed to by I<stream> with it.  "
1953 "The original stream (if it exists) is closed.  The I<mode> argument is used "
1954 "just as in the B<fopen>()  function.  The primary use of the B<freopen>()  "
1955 "function is to change the file associated with a standard text stream "
1956 "(I<stderr>, I<stdin>, or I<stdout>)."
1957 msgstr ""
1958
1959 #. type: Plain text
1960 #: build/C/man3/fopen.3:201
1961 msgid ""
1962 "Upon successful completion B<fopen>(), B<fdopen>()  and B<freopen>()  return "
1963 "a I<FILE> pointer.  Otherwise, NULL is returned and I<errno> is set to "
1964 "indicate the error."
1965 msgstr ""
1966
1967 #. type: TP
1968 #: build/C/man3/fopen.3:202 build/C/man3/fseek.3:138 build/C/man3/getline.3:121 build/C/man2/llseek.2:72 build/C/man2/lseek.2:164 build/C/man2/pipe.2:102 build/C/man2/read.2:108 build/C/man2/read.2:119 build/C/man2/readlink.2:93 build/C/man2/readlink.2:102 build/C/man2/readv.2:198 build/C/man2/rename.2:136 build/C/man2/rmdir.2:67 build/C/man3/scanf.3:563 build/C/man2/write.2:148
1969 #, no-wrap
1970 msgid "B<EINVAL>"
1971 msgstr ""
1972
1973 #. type: Plain text
1974 #: build/C/man3/fopen.3:212
1975 msgid ""
1976 "The I<mode> provided to B<fopen>(), B<fdopen>(), or B<freopen>()  was "
1977 "invalid."
1978 msgstr ""
1979
1980 #. type: Plain text
1981 #: build/C/man3/fopen.3:222
1982 msgid ""
1983 "The B<fopen>(), B<fdopen>()  and B<freopen>()  functions may also fail and "
1984 "set I<errno> for any of the errors specified for the routine B<malloc>(3)."
1985 msgstr ""
1986
1987 #. type: Plain text
1988 #: build/C/man3/fopen.3:229
1989 msgid ""
1990 "The B<fopen>()  function may also fail and set I<errno> for any of the "
1991 "errors specified for the routine B<open>(2)."
1992 msgstr ""
1993
1994 #. type: Plain text
1995 #: build/C/man3/fopen.3:236
1996 msgid ""
1997 "The B<fdopen>()  function may also fail and set I<errno> for any of the "
1998 "errors specified for the routine B<fcntl>(2)."
1999 msgstr ""
2000
2001 #. type: Plain text
2002 #: build/C/man3/fopen.3:246
2003 msgid ""
2004 "The B<freopen>()  function may also fail and set I<errno> for any of the "
2005 "errors specified for the routines B<open>(2), B<fclose>(3)  and "
2006 "B<fflush>(3)."
2007 msgstr ""
2008
2009 #. type: Plain text
2010 #: build/C/man3/fopen.3:255
2011 msgid ""
2012 "The B<fopen>()  and B<freopen>()  functions conform to C89.  The B<fdopen>()  "
2013 "function conforms to POSIX.1-1990."
2014 msgstr ""
2015
2016 #. type: SS
2017 #: build/C/man3/fopen.3:256
2018 #, no-wrap
2019 msgid "Glibc Notes"
2020 msgstr ""
2021
2022 #. type: Plain text
2023 #: build/C/man3/fopen.3:259
2024 msgid ""
2025 "The GNU C library allows the following extensions for the string specified "
2026 "in I<mode>:"
2027 msgstr ""
2028
2029 #. type: TP
2030 #: build/C/man3/fopen.3:259
2031 #, no-wrap
2032 msgid "B<c> (since glibc 2.3.3)"
2033 msgstr ""
2034
2035 #. type: Plain text
2036 #: build/C/man3/fopen.3:264
2037 msgid ""
2038 "Do not make the open operation, or subsequent read and write operations, "
2039 "thread cancellation points."
2040 msgstr ""
2041
2042 #. type: TP
2043 #: build/C/man3/fopen.3:264
2044 #, no-wrap
2045 msgid "B<e> (since glibc 2.7)"
2046 msgstr ""
2047
2048 #. type: Plain text
2049 #: build/C/man3/fopen.3:272
2050 msgid ""
2051 "Open the file with the B<O_CLOEXEC> flag.  See B<open>(2)  for more "
2052 "information."
2053 msgstr ""
2054
2055 #. type: TP
2056 #: build/C/man3/fopen.3:272
2057 #, no-wrap
2058 msgid "B<m> (since glibc 2.3)"
2059 msgstr ""
2060
2061 #.  As at glibc 2.4:
2062 #. type: Plain text
2063 #: build/C/man3/fopen.3:284
2064 msgid ""
2065 "Attempt to access the file using B<mmap>(2), rather than I/O system calls "
2066 "(B<read>(2), B<write>(2)).  Currently, use of B<mmap>(2)  is only attempted "
2067 "for a file opened for reading."
2068 msgstr ""
2069
2070 #. type: TP
2071 #: build/C/man3/fopen.3:284 build/C/man3/scanf.3:418
2072 #, no-wrap
2073 msgid "B<x>"
2074 msgstr ""
2075
2076 #.  Since glibc 2.0?
2077 #.  FIXME C11 specifies this flag
2078 #.  FIXME document /,ccs= charset/
2079 #. type: Plain text
2080 #: build/C/man3/fopen.3:302
2081 msgid ""
2082 "Open the file exclusively (like the B<O_EXCL> flag of B<open>(2)).  If the "
2083 "file already exists, B<fopen>()  fails, and sets I<errno> to B<EEXIST>.  "
2084 "This flag is ignored for B<fdopen>()."
2085 msgstr ""
2086
2087 #. type: Plain text
2088 #: build/C/man3/fopen.3:307
2089 msgid "B<open>(2), B<fclose>(3), B<fileno>(3), B<fmemopen>(3), B<fopencookie>(3)"
2090 msgstr ""
2091
2092 #. type: TH
2093 #: build/C/man3/fopencookie.3:24
2094 #, no-wrap
2095 msgid "FOPENCOOKIE"
2096 msgstr ""
2097
2098 #. type: TH
2099 #: build/C/man3/fopencookie.3:24
2100 #, no-wrap
2101 msgid "2008-12-05"
2102 msgstr ""
2103
2104 #. type: TH
2105 #: build/C/man3/fopencookie.3:24 build/C/man2/link.2:31 build/C/man2/llseek.2:26 build/C/man2/lseek.2:45 build/C/man3/lseek64.3:23 build/C/man2/open.2:52 build/C/man2/pipe.2:36 build/C/man2/read.2:35 build/C/man2/readlink.2:41 build/C/man2/readv.2:30 build/C/man2/rename.2:32 build/C/man2/rmdir.2:30 build/C/man3/setbuf.3:46 build/C/man3/stdin.3:9 build/C/man2/symlink.2:32 build/C/man7/symlink.7:35 build/C/man2/unlink.2:32 build/C/man2/write.2:39
2106 #, no-wrap
2107 msgid "Linux"
2108 msgstr ""
2109
2110 #. type: Plain text
2111 #: build/C/man3/fopencookie.3:27
2112 msgid "fopencookie - opening a custom stream"
2113 msgstr ""
2114
2115 #. type: Plain text
2116 #: build/C/man3/fopencookie.3:34
2117 #, no-wrap
2118 msgid ""
2119 "B<FILE *fopencookie(void *>I<cookie>B<, const char *>I<mode>B<,>\n"
2120 "B<                  cookie_io_functions_t >I<io_funcs>B<);>\n"
2121 msgstr ""
2122
2123 #. type: Plain text
2124 #: build/C/man3/fopencookie.3:47
2125 msgid ""
2126 "The B<fopencookie>()  function allows the programmer to create a custom "
2127 "implementation for a standard I/O stream.  This implementation can store the "
2128 "stream's data at a location of its own choosing; for example, "
2129 "B<fopencookie>()  is used to implement B<fmemopen>(3), which provides a "
2130 "stream interface to data that is stored in a buffer in memory."
2131 msgstr ""
2132
2133 #. type: Plain text
2134 #: build/C/man3/fopencookie.3:49
2135 msgid "In order to create a custom stream the programmer must:"
2136 msgstr ""
2137
2138 #. type: IP
2139 #: build/C/man3/fopencookie.3:49 build/C/man3/fopencookie.3:52 build/C/man3/fopencookie.3:63 build/C/man3/scanf.3:669 build/C/man3/scanf.3:674 build/C/man3/scanf.3:680 build/C/man7/symlink.7:248 build/C/man7/symlink.7:258 build/C/man7/symlink.7:288 build/C/man7/symlink.7:348 build/C/man7/symlink.7:377 build/C/man7/symlink.7:406 build/C/man7/symlink.7:437 build/C/man7/symlink.7:450
2140 #, no-wrap
2141 msgid "*"
2142 msgstr ""
2143
2144 #. type: Plain text
2145 #: build/C/man3/fopencookie.3:52
2146 msgid ""
2147 "Implement four \"hook\" functions that are used internally by the standard "
2148 "I/O library when performing I/O on the stream."
2149 msgstr ""
2150
2151 #. type: Plain text
2152 #: build/C/man3/fopencookie.3:63
2153 msgid ""
2154 "Define a \"cookie\" data type, a structure that provides bookkeeping "
2155 "information (e.g., where to store data) used by the aforementioned hook "
2156 "functions.  The standard I/O package knows nothing about the contents of "
2157 "this cookie (thus it is typed as I<void\\ *> when passed to "
2158 "B<fopencookie>()), but automatically supplies the cookie as the first "
2159 "argument when calling the hook functions."
2160 msgstr ""
2161
2162 #. type: Plain text
2163 #: build/C/man3/fopencookie.3:68
2164 msgid ""
2165 "Call B<fopencookie>()  to open a new stream and associate the cookie and "
2166 "hook functions with that stream."
2167 msgstr ""
2168
2169 #. type: Plain text
2170 #: build/C/man3/fopencookie.3:76
2171 msgid ""
2172 "The B<fopencookie>()  function serves a purpose similar to B<fopen>(3): it "
2173 "opens a new stream and returns a pointer to a I<FILE> object that is used to "
2174 "operate on that stream."
2175 msgstr ""
2176
2177 #. type: Plain text
2178 #: build/C/man3/fopencookie.3:83
2179 msgid ""
2180 "The I<cookie> argument is a pointer to the caller's cookie structure that is "
2181 "to be associated with the new stream.  This pointer is supplied as the first "
2182 "argument when the standard I/O library invokes any of the hook functions "
2183 "described below."
2184 msgstr ""
2185
2186 #. type: Plain text
2187 #: build/C/man3/fopencookie.3:99
2188 msgid ""
2189 "The I<mode> argument serves the same purpose as for B<fopen>(3).  The "
2190 "following modes are supported: I<r>, I<w>, I<a>, I<r+>, I<w+>, and I<a+>.  "
2191 "See B<fopen>(3)  for details."
2192 msgstr ""
2193
2194 #. type: Plain text
2195 #: build/C/man3/fopencookie.3:105
2196 msgid ""
2197 "The I<io_funcs> argument is a structure that contains four fields pointing "
2198 "to the programmer-defined hook functions that are used to implement this "
2199 "stream.  The structure is defined as follows"
2200 msgstr ""
2201
2202 #. type: Plain text
2203 #: build/C/man3/fopencookie.3:114
2204 #, no-wrap
2205 msgid ""
2206 "struct cookie_io_functions_t {\n"
2207 "    cookie_read_function_t  *read;\n"
2208 "    cookie_write_function_t *write;\n"
2209 "    cookie_seek_function_t  *seek;\n"
2210 "    cookie_close_function_t *close;\n"
2211 "};\n"
2212 msgstr ""
2213
2214 #. type: Plain text
2215 #: build/C/man3/fopencookie.3:118
2216 msgid "The four fields are as follows:"
2217 msgstr ""
2218
2219 #. type: TP
2220 #: build/C/man3/fopencookie.3:118
2221 #, no-wrap
2222 msgid "I<cookie_read_function_t *read>"
2223 msgstr ""
2224
2225 #. type: Plain text
2226 #: build/C/man3/fopencookie.3:122
2227 msgid ""
2228 "This function implements read operations for the stream.  When called, it "
2229 "receives three arguments:"
2230 msgstr ""
2231
2232 #. type: Plain text
2233 #: build/C/man3/fopencookie.3:124
2234 #, no-wrap
2235 msgid "    ssize_t read(void *cookie, char *buf, size_t size);\n"
2236 msgstr ""
2237
2238 #. type: Plain text
2239 #: build/C/man3/fopencookie.3:139
2240 msgid ""
2241 "The I<buf> and I<size> arguments are, respectively, a buffer into which "
2242 "input data can be placed and the size of that buffer.  As its function "
2243 "result, the I<read> function should return the number of bytes copied into "
2244 "I<buf>, 0 on end of file, or -1 on error.  The I<read> function should "
2245 "update the stream offset appropriately."
2246 msgstr ""
2247
2248 #. type: Plain text
2249 #: build/C/man3/fopencookie.3:144
2250 msgid ""
2251 "If I<*read> is a NULL pointer, then reads from the custom stream always "
2252 "return end of file."
2253 msgstr ""
2254
2255 #. type: TP
2256 #: build/C/man3/fopencookie.3:144
2257 #, no-wrap
2258 msgid "I<cookie_write_function_t *write>"
2259 msgstr ""
2260
2261 #. type: Plain text
2262 #: build/C/man3/fopencookie.3:148
2263 msgid ""
2264 "This function implements write operations for the stream.  When called, it "
2265 "receives three arguments:"
2266 msgstr ""
2267
2268 #. type: Plain text
2269 #: build/C/man3/fopencookie.3:150
2270 #, no-wrap
2271 msgid "    ssize_t write(void *cookie, const char *buf, size_t size);\n"
2272 msgstr ""
2273
2274 #. type: Plain text
2275 #: build/C/man3/fopencookie.3:165
2276 msgid ""
2277 "The I<buf> and I<size> arguments are, respectively, a buffer of data to be "
2278 "output to the stream and the size of that buffer.  As its function result, "
2279 "the I<write> function should return the number of bytes copied from I<buf>, "
2280 "or -1 on error.  The I<write> function should update the stream offset "
2281 "appropriately."
2282 msgstr ""
2283
2284 #. type: Plain text
2285 #: build/C/man3/fopencookie.3:170
2286 msgid "If I<*write> is a NULL pointer, then output to the stream is discarded."
2287 msgstr ""
2288
2289 #. type: TP
2290 #: build/C/man3/fopencookie.3:170
2291 #, no-wrap
2292 msgid "I<cookie_seek_function_t *seek>"
2293 msgstr ""
2294
2295 #. type: Plain text
2296 #: build/C/man3/fopencookie.3:174
2297 msgid ""
2298 "This function implements seek operations on the stream.  When called, it "
2299 "receives three arguments:"
2300 msgstr ""
2301
2302 #. type: Plain text
2303 #: build/C/man3/fopencookie.3:176
2304 #, no-wrap
2305 msgid "    int seek(void *cookie, off64_t *offset, int whence);\n"
2306 msgstr ""
2307
2308 #. type: Plain text
2309 #: build/C/man3/fopencookie.3:182
2310 msgid ""
2311 "The I<*offset> argument specifies the new file offset depending on which of "
2312 "the following three values is supplied in I<whence>:"
2313 msgstr ""
2314
2315 #. type: TP
2316 #: build/C/man3/fopencookie.3:183 build/C/man2/lseek.2:65
2317 #, no-wrap
2318 msgid "B<SEEK_SET>"
2319 msgstr ""
2320
2321 #. type: Plain text
2322 #: build/C/man3/fopencookie.3:188
2323 msgid ""
2324 "The stream offset should be set I<*offset> bytes from the start of the "
2325 "stream."
2326 msgstr ""
2327
2328 #. type: TP
2329 #: build/C/man3/fopencookie.3:188 build/C/man2/lseek.2:70
2330 #, no-wrap
2331 msgid "B<SEEK_CUR>"
2332 msgstr ""
2333
2334 #. type: Plain text
2335 #: build/C/man3/fopencookie.3:192
2336 msgid "I<*offset> should be added to the current stream offset."
2337 msgstr ""
2338
2339 #. type: TP
2340 #: build/C/man3/fopencookie.3:192 build/C/man2/lseek.2:75
2341 #, no-wrap
2342 msgid "B<SEEK_END>"
2343 msgstr ""
2344
2345 #. type: Plain text
2346 #: build/C/man3/fopencookie.3:196
2347 msgid "The stream offset should be set to the size of the stream plus I<*offset>."
2348 msgstr ""
2349
2350 #. type: Plain text
2351 #: build/C/man3/fopencookie.3:203
2352 msgid ""
2353 "Before returning, the I<seek> function should update I<*offset> to indicate "
2354 "the new stream offset."
2355 msgstr ""
2356
2357 #. type: Plain text
2358 #: build/C/man3/fopencookie.3:207
2359 msgid ""
2360 "As its function result, the I<seek> function should return 0 on success, and "
2361 "-1 on error."
2362 msgstr ""
2363
2364 #. type: Plain text
2365 #: build/C/man3/fopencookie.3:212
2366 msgid ""
2367 "If I<*seek> is a NULL pointer, then it is not possible to perform seek "
2368 "operations on the stream."
2369 msgstr ""
2370
2371 #. type: TP
2372 #: build/C/man3/fopencookie.3:212
2373 #, no-wrap
2374 msgid "I<cookie_close_function_t *close>"
2375 msgstr ""
2376
2377 #. type: Plain text
2378 #: build/C/man3/fopencookie.3:218
2379 msgid ""
2380 "This function closes the stream.  The hook function can do things such as "
2381 "freeing buffers allocated for the stream.  When called, it receives one "
2382 "argument:"
2383 msgstr ""
2384
2385 #. type: Plain text
2386 #: build/C/man3/fopencookie.3:220
2387 #, no-wrap
2388 msgid "    int close(void *cookie);\n"
2389 msgstr ""
2390
2391 #. type: Plain text
2392 #: build/C/man3/fopencookie.3:225
2393 msgid ""
2394 "The I<cookie> argument is the cookie that the programmer supplied when "
2395 "calling B<fopencookie>()."
2396 msgstr ""
2397
2398 #. type: Plain text
2399 #: build/C/man3/fopencookie.3:231
2400 msgid ""
2401 "As its function result, the I<close> function should return 0 on success, "
2402 "and B<EOF> on error."
2403 msgstr ""
2404
2405 #. type: Plain text
2406 #: build/C/man3/fopencookie.3:235
2407 msgid ""
2408 "If I<*close> is NULL, then no special action is performed when the stream is "
2409 "closed."
2410 msgstr ""
2411
2412 #.  .SH ERRORS
2413 #.  It's not clear if errno ever gets set...
2414 #. type: Plain text
2415 #: build/C/man3/fopencookie.3:242
2416 msgid ""
2417 "On success B<fopencookie>()  returns a pointer to the new stream.  On error, "
2418 "NULL is returned."
2419 msgstr ""
2420
2421 #. type: Plain text
2422 #: build/C/man3/fopencookie.3:244
2423 msgid "This function is a nonstandard GNU extension."
2424 msgstr ""
2425
2426 #. type: Plain text
2427 #: build/C/man3/fopencookie.3:253
2428 msgid ""
2429 "The program below implements a custom stream whose functionality is similar "
2430 "(but not identical) to that available via B<fmemopen>(3).  It implements a "
2431 "stream whose data is stored in a memory buffer.  The program writes its "
2432 "command-line arguments to the stream, and then seeks through the stream "
2433 "reading two out of every five characters and writing them to standard "
2434 "output.  The following shell session demonstrates the use of the program:"
2435 msgstr ""
2436
2437 #. type: Plain text
2438 #: build/C/man3/fopencookie.3:261
2439 #, no-wrap
2440 msgid ""
2441 "$B< ./a.out \\(aqhello world\\(aq>\n"
2442 "/he/\n"
2443 "/ w/\n"
2444 "/d/\n"
2445 "Reached end of file\n"
2446 msgstr ""
2447
2448 #. type: Plain text
2449 #: build/C/man3/fopencookie.3:268
2450 msgid ""
2451 "Note that a more general version of the program below could be improved to "
2452 "more robustly handle various error situations (e.g., opening a stream with a "
2453 "cookie that already has an open stream; closing a stream that has already "
2454 "been closed)."
2455 msgstr ""
2456
2457 #. type: Plain text
2458 #: build/C/man3/fopencookie.3:277
2459 #, no-wrap
2460 msgid ""
2461 "#define _GNU_SOURCE\n"
2462 "#include E<lt>sys/types.hE<gt>\n"
2463 "#include E<lt>stdio.hE<gt>\n"
2464 "#include E<lt>stdlib.hE<gt>\n"
2465 "#include E<lt>unistd.hE<gt>\n"
2466 "#include E<lt>string.hE<gt>\n"
2467 msgstr ""
2468
2469 #. type: Plain text
2470 #: build/C/man3/fopencookie.3:279
2471 #, no-wrap
2472 msgid "#define INIT_BUF_SIZE 4\n"
2473 msgstr ""
2474
2475 #. type: Plain text
2476 #: build/C/man3/fopencookie.3:286
2477 #, no-wrap
2478 msgid ""
2479 "struct memfile_cookie {\n"
2480 "    char   *buf;        /* Dynamically sized buffer for data */\n"
2481 "    size_t  allocated;  /* Size of buf */\n"
2482 "    size_t  endpos;     /* Number of characters in buf */\n"
2483 "    off_t   offset;     /* Current file offset in buf */\n"
2484 "};\n"
2485 msgstr ""
2486
2487 #. type: Plain text
2488 #: build/C/man3/fopencookie.3:292
2489 #, no-wrap
2490 msgid ""
2491 "ssize_t\n"
2492 "memfile_write(void *c, const char *buf, size_t size)\n"
2493 "{\n"
2494 "    char *new_buff;\n"
2495 "    struct memfile_cookie *cookie = c;\n"
2496 msgstr ""
2497
2498 #. type: Plain text
2499 #: build/C/man3/fopencookie.3:294
2500 #, no-wrap
2501 msgid "    /* Buffer too small? Keep doubling size until big enough */\n"
2502 msgstr ""
2503
2504 #. type: Plain text
2505 #: build/C/man3/fopencookie.3:304
2506 #, no-wrap
2507 msgid ""
2508 "    while (size + cookie-E<gt>offset E<gt> cookie-E<gt>allocated) {\n"
2509 "        new_buff = realloc(cookie-E<gt>buf, cookie-E<gt>allocated * 2);\n"
2510 "        if (new_buff == NULL) {\n"
2511 "            return -1;\n"
2512 "        } else {\n"
2513 "            cookie-E<gt>allocated *= 2;\n"
2514 "            cookie-E<gt>buf = new_buff;\n"
2515 "        }\n"
2516 "    }\n"
2517 msgstr ""
2518
2519 #. type: Plain text
2520 #: build/C/man3/fopencookie.3:306
2521 #, no-wrap
2522 msgid "    memcpy(cookie-E<gt>buf + cookie-E<gt>offset, buf, size);\n"
2523 msgstr ""
2524
2525 #. type: Plain text
2526 #: build/C/man3/fopencookie.3:310
2527 #, no-wrap
2528 msgid ""
2529 "    cookie-E<gt>offset += size;\n"
2530 "    if (cookie-E<gt>offset E<gt> cookie-E<gt>endpos)\n"
2531 "        cookie-E<gt>endpos = cookie-E<gt>offset;\n"
2532 msgstr ""
2533
2534 #. type: Plain text
2535 #: build/C/man3/fopencookie.3:313
2536 #, no-wrap
2537 msgid ""
2538 "    return size;\n"
2539 "}\n"
2540 msgstr ""
2541
2542 #. type: Plain text
2543 #: build/C/man3/fopencookie.3:319
2544 #, no-wrap
2545 msgid ""
2546 "ssize_t\n"
2547 "memfile_read(void *c, char *buf, size_t size)\n"
2548 "{\n"
2549 "    ssize_t xbytes;\n"
2550 "    struct memfile_cookie *cookie = c;\n"
2551 msgstr ""
2552
2553 #. type: Plain text
2554 #: build/C/man3/fopencookie.3:321
2555 #, no-wrap
2556 msgid "    /* Fetch minimum of bytes requested and bytes available */\n"
2557 msgstr ""
2558
2559 #. type: Plain text
2560 #: build/C/man3/fopencookie.3:327
2561 #, no-wrap
2562 msgid ""
2563 "    xbytes = size;\n"
2564 "    if (cookie-E<gt>offset + size E<gt> cookie-E<gt>endpos)\n"
2565 "        xbytes = cookie-E<gt>endpos - cookie-E<gt>offset;\n"
2566 "    if (xbytes E<lt> 0)     /* offset may be past endpos */\n"
2567 "       xbytes = 0;\n"
2568 msgstr ""
2569
2570 #. type: Plain text
2571 #: build/C/man3/fopencookie.3:329
2572 #, no-wrap
2573 msgid "    memcpy(buf, cookie-E<gt>buf + cookie-E<gt>offset, xbytes);\n"
2574 msgstr ""
2575
2576 #. type: Plain text
2577 #: build/C/man3/fopencookie.3:333
2578 #, no-wrap
2579 msgid ""
2580 "    cookie-E<gt>offset += xbytes;\n"
2581 "    return xbytes;\n"
2582 "}\n"
2583 msgstr ""
2584
2585 #. type: Plain text
2586 #: build/C/man3/fopencookie.3:339
2587 #, no-wrap
2588 msgid ""
2589 "int\n"
2590 "memfile_seek(void *c, off64_t *offset, int whence)\n"
2591 "{\n"
2592 "    off64_t new_offset;\n"
2593 "    struct memfile_cookie *cookie = c;\n"
2594 msgstr ""
2595
2596 #. type: Plain text
2597 #: build/C/man3/fopencookie.3:348
2598 #, no-wrap
2599 msgid ""
2600 "    if (whence == SEEK_SET)\n"
2601 "        new_offset = *offset;\n"
2602 "    else if (whence == SEEK_END)\n"
2603 "        new_offset = cookie-E<gt>endpos + *offset;\n"
2604 "    else if (whence == SEEK_CUR)\n"
2605 "        new_offset = cookie-E<gt>offset + *offset;\n"
2606 "    else\n"
2607 "        return -1;\n"
2608 msgstr ""
2609
2610 #. type: Plain text
2611 #: build/C/man3/fopencookie.3:351
2612 #, no-wrap
2613 msgid ""
2614 "    if (new_offset E<lt> 0)\n"
2615 "        return -1;\n"
2616 msgstr ""
2617
2618 #. type: Plain text
2619 #: build/C/man3/fopencookie.3:356
2620 #, no-wrap
2621 msgid ""
2622 "    cookie-E<gt>offset = new_offset;\n"
2623 "    *offset = new_offset;\n"
2624 "    return 0;\n"
2625 "}\n"
2626 msgstr ""
2627
2628 #. type: Plain text
2629 #: build/C/man3/fopencookie.3:361
2630 #, no-wrap
2631 msgid ""
2632 "int\n"
2633 "memfile_close(void *c)\n"
2634 "{\n"
2635 "    struct memfile_cookie *cookie = c;\n"
2636 msgstr ""
2637
2638 #. type: Plain text
2639 #: build/C/man3/fopencookie.3:365
2640 #, no-wrap
2641 msgid ""
2642 "    free(cookie-E<gt>buf);\n"
2643 "    cookie-E<gt>allocated = 0;\n"
2644 "    cookie-E<gt>buf = NULL;\n"
2645 msgstr ""
2646
2647 #. type: Plain text
2648 #: build/C/man3/fopencookie.3:368
2649 #, no-wrap
2650 msgid ""
2651 "    return 0;\n"
2652 "}\n"
2653 msgstr ""
2654
2655 #. type: Plain text
2656 #: build/C/man3/fopencookie.3:384
2657 #, no-wrap
2658 msgid ""
2659 "int\n"
2660 "main(int argc, char *argv[])\n"
2661 "{\n"
2662 "    cookie_io_functions_t  memfile_func = {\n"
2663 "        .read  = memfile_read,\n"
2664 "        .write = memfile_write,\n"
2665 "        .seek  = memfile_seek,\n"
2666 "        .close = memfile_close\n"
2667 "    };\n"
2668 "    FILE *fp;\n"
2669 "    struct memfile_cookie mycookie;\n"
2670 "    ssize_t nread;\n"
2671 "    long p;\n"
2672 "    int j;\n"
2673 "    char buf[1000];\n"
2674 msgstr ""
2675
2676 #. type: Plain text
2677 #: build/C/man3/fopencookie.3:386
2678 #, no-wrap
2679 msgid "    /* Set up the cookie before calling fopencookie() */\n"
2680 msgstr ""
2681
2682 #. type: Plain text
2683 #: build/C/man3/fopencookie.3:392
2684 #, no-wrap
2685 msgid ""
2686 "    mycookie.buf = malloc(INIT_BUF_SIZE);\n"
2687 "    if (mycookie.buf == NULL) {\n"
2688 "        perror(\"malloc\");\n"
2689 "        exit(EXIT_FAILURE);\n"
2690 "    }\n"
2691 msgstr ""
2692
2693 #. type: Plain text
2694 #: build/C/man3/fopencookie.3:396
2695 #, no-wrap
2696 msgid ""
2697 "    mycookie.allocated = INIT_BUF_SIZE;\n"
2698 "    mycookie.offset = 0;\n"
2699 "    mycookie.endpos = 0;\n"
2700 msgstr ""
2701
2702 #. type: Plain text
2703 #: build/C/man3/fopencookie.3:402
2704 #, no-wrap
2705 msgid ""
2706 "    fp = fopencookie(&mycookie,\"w+\", memfile_func);\n"
2707 "    if (fp == NULL) {\n"
2708 "        perror(\"fopencookie\");\n"
2709 "        exit(EXIT_FAILURE);\n"
2710 "    }\n"
2711 msgstr ""
2712
2713 #. type: Plain text
2714 #: build/C/man3/fopencookie.3:404
2715 #, no-wrap
2716 msgid "    /* Write command-line arguments to our file */\n"
2717 msgstr ""
2718
2719 #. type: Plain text
2720 #: build/C/man3/fopencookie.3:410
2721 #, no-wrap
2722 msgid ""
2723 "    for (j = 1; j E<lt> argc; j++)\n"
2724 "        if (fputs(argv[j], fp) == EOF) {\n"
2725 "            perror(\"fputs\");\n"
2726 "            exit(EXIT_FAILURE);\n"
2727 "        }\n"
2728 msgstr ""
2729
2730 #. type: Plain text
2731 #: build/C/man3/fopencookie.3:412
2732 #, no-wrap
2733 msgid "    /* Read two bytes out of every five, until EOF */\n"
2734 msgstr ""
2735
2736 #. type: Plain text
2737 #: build/C/man3/fopencookie.3:427
2738 #, no-wrap
2739 msgid ""
2740 "    for (p = 0; ; p += 5) {\n"
2741 "        if (fseek(fp, p, SEEK_SET) == -1) {\n"
2742 "            perror(\"fseek\");\n"
2743 "            exit(EXIT_FAILURE);\n"
2744 "        }\n"
2745 "        nread = fread(buf, 1, 2, fp);\n"
2746 "        if (nread == -1) {\n"
2747 "            perror(\"fread\");\n"
2748 "            exit(EXIT_FAILURE);\n"
2749 "        }\n"
2750 "        if (nread == 0) {\n"
2751 "            printf(\"Reached end of file\\en\");\n"
2752 "            break;\n"
2753 "        }\n"
2754 msgstr ""
2755
2756 #. type: Plain text
2757 #: build/C/man3/fopencookie.3:430
2758 #, no-wrap
2759 msgid ""
2760 "        printf(\"/%.*s/\\en\", nread, buf);\n"
2761 "    }\n"
2762 msgstr ""
2763
2764 #. type: Plain text
2765 #: build/C/man3/fopencookie.3:433 build/C/man2/readlink.2:211
2766 #, no-wrap
2767 msgid ""
2768 "    exit(EXIT_SUCCESS);\n"
2769 "}\n"
2770 msgstr ""
2771
2772 #. type: Plain text
2773 #: build/C/man3/fopencookie.3:438
2774 msgid "B<fclose>(3), B<fmemopen>(3), B<fopen>(3), B<fseek>(3)"
2775 msgstr ""
2776
2777 #. type: TH
2778 #: build/C/man3/fpurge.3:23
2779 #, no-wrap
2780 msgid "FPURGE"
2781 msgstr ""
2782
2783 #. type: TH
2784 #: build/C/man3/fpurge.3:23
2785 #, no-wrap
2786 msgid "2001-12-15"
2787 msgstr ""
2788
2789 #. type: Plain text
2790 #: build/C/man3/fpurge.3:26
2791 msgid "fpurge, __fpurge - purge a stream"
2792 msgstr ""
2793
2794 #. type: Plain text
2795 #: build/C/man3/fpurge.3:30
2796 #, no-wrap
2797 msgid ""
2798 "/* unsupported */\n"
2799 "B<#include E<lt>stdio.hE<gt>>\n"
2800 msgstr ""
2801
2802 #. type: Plain text
2803 #: build/C/man3/fpurge.3:32
2804 #, no-wrap
2805 msgid "B<int fpurge(FILE *>I<stream>B<);>\n"
2806 msgstr ""
2807
2808 #. type: Plain text
2809 #: build/C/man3/fpurge.3:35
2810 #, no-wrap
2811 msgid ""
2812 "/* supported */\n"
2813 "B<#include E<lt>stdio.hE<gt>>\n"
2814 msgstr ""
2815
2816 #. type: Plain text
2817 #: build/C/man3/fpurge.3:37
2818 #, no-wrap
2819 msgid "B<#include E<lt>stdio_ext.hE<gt>>\n"
2820 msgstr ""
2821
2822 #. type: Plain text
2823 #: build/C/man3/fpurge.3:39
2824 #, no-wrap
2825 msgid "B<void  __fpurge(FILE *>I<stream>B<);>\n"
2826 msgstr ""
2827
2828 #. type: Plain text
2829 #: build/C/man3/fpurge.3:52
2830 msgid ""
2831 "The function B<fpurge>()  clears the buffers of the given stream.  For "
2832 "output streams this discards any unwritten output.  For input streams this "
2833 "discards any input read from the underlying object but not yet obtained via "
2834 "B<getc>(3); this includes any text pushed back via B<ungetc>(3).  See also "
2835 "B<fflush>(3)."
2836 msgstr ""
2837
2838 #. type: Plain text
2839 #: build/C/man3/fpurge.3:56
2840 msgid ""
2841 "The function B<__fpurge>()  does precisely the same, but without returning a "
2842 "value."
2843 msgstr ""
2844
2845 #. type: Plain text
2846 #: build/C/man3/fpurge.3:63
2847 msgid ""
2848 "Upon successful completion B<fpurge>()  returns 0.  On error, it returns -1 "
2849 "and sets I<errno> appropriately."
2850 msgstr ""
2851
2852 #. type: Plain text
2853 #: build/C/man3/fpurge.3:68
2854 msgid "I<stream> is not an open stream."
2855 msgstr ""
2856
2857 #. type: Plain text
2858 #: build/C/man3/fpurge.3:76
2859 msgid ""
2860 "These functions are nonstandard and not portable.  The function B<fpurge>()  "
2861 "was introduced in 4.4BSD and is not available under Linux.  The function "
2862 "B<__fpurge>()  was introduced in Solaris, and is present in glibc 2.1.95 and "
2863 "later."
2864 msgstr ""
2865
2866 #. type: Plain text
2867 #: build/C/man3/fpurge.3:78
2868 msgid "Usually it is a mistake to want to discard input buffers."
2869 msgstr ""
2870
2871 #.  .BR fclean (3),
2872 #. type: Plain text
2873 #: build/C/man3/fpurge.3:82
2874 msgid "B<fflush>(3), B<setbuf>(3), B<stdio_ext>(3)"
2875 msgstr ""
2876
2877 #. type: TH
2878 #: build/C/man3/fputwc.3:14
2879 #, no-wrap
2880 msgid "FPUTWC"
2881 msgstr ""
2882
2883 #. type: Plain text
2884 #: build/C/man3/fputwc.3:17
2885 msgid "fputwc, putwc - write a wide character to a FILE stream"
2886 msgstr ""
2887
2888 #. type: Plain text
2889 #: build/C/man3/fputwc.3:25
2890 #, no-wrap
2891 msgid ""
2892 "B<wint_t fputwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
2893 "B<wint_t putwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
2894 msgstr ""
2895
2896 #. type: Plain text
2897 #: build/C/man3/fputwc.3:41
2898 msgid ""
2899 "The B<fputwc>()  function is the wide-character equivalent of the "
2900 "B<fputc>(3)  function.  It writes the wide character I<wc> to I<stream>.  If "
2901 "I<ferror(stream)> becomes true, it returns B<WEOF>.  If a wide-character "
2902 "conversion error occurs, it sets I<errno> to B<EILSEQ> and returns B<WEOF>.  "
2903 "Otherwise it returns I<wc>."
2904 msgstr ""
2905
2906 #. type: Plain text
2907 #: build/C/man3/fputwc.3:49
2908 msgid ""
2909 "The B<putwc>()  function or macro functions identically to B<fputwc>().  It "
2910 "may be implemented as a macro, and may evaluate its argument more than "
2911 "once.  There is no reason ever to use it."
2912 msgstr ""
2913
2914 #. type: Plain text
2915 #: build/C/man3/fputwc.3:58
2916 msgid ""
2917 "The B<fputwc>()  function returns I<wc> if no error occurred, or B<WEOF> to "
2918 "indicate an error."
2919 msgstr ""
2920
2921 #. type: Plain text
2922 #: build/C/man3/fputwc.3:63
2923 msgid "Conversion of I<wc> to the stream's encoding fails."
2924 msgstr ""
2925
2926 #. type: Plain text
2927 #: build/C/man3/fputwc.3:72
2928 msgid ""
2929 "The behavior of B<fputwc>()  depends on the B<LC_CTYPE> category of the "
2930 "current locale."
2931 msgstr ""
2932
2933 #. type: Plain text
2934 #: build/C/man3/fputwc.3:80
2935 msgid ""
2936 "In the absence of additional information passed to the B<fopen>(3)  call, it "
2937 "is reasonable to expect that B<fputwc>()  will actually write the multibyte "
2938 "sequence corresponding to the wide character I<wc>."
2939 msgstr ""
2940
2941 #. type: Plain text
2942 #: build/C/man3/fputwc.3:83
2943 msgid "B<fgetwc>(3), B<fputws>(3), B<unlocked_stdio>(3)"
2944 msgstr ""
2945
2946 #. type: TH
2947 #: build/C/man3/fread.3:43
2948 #, no-wrap
2949 msgid "FREAD"
2950 msgstr ""
2951
2952 #. type: TH
2953 #: build/C/man3/fread.3:43
2954 #, no-wrap
2955 msgid "2012-03-30"
2956 msgstr ""
2957
2958 #. type: Plain text
2959 #: build/C/man3/fread.3:46
2960 msgid "fread, fwrite - binary stream input/output"
2961 msgstr ""
2962
2963 #. type: Plain text
2964 #: build/C/man3/fread.3:52
2965 #, no-wrap
2966 msgid ""
2967 "B<size_t fread(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<, FILE "
2968 "*>I<stream>B<);>\n"
2969 msgstr ""
2970
2971 #. type: Plain text
2972 #: build/C/man3/fread.3:55
2973 #, no-wrap
2974 msgid ""
2975 "B<size_t fwrite(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
2976 ">I<nmemb>B<,>\n"
2977 "B<              FILE *>I<stream>B<);>\n"
2978 msgstr ""
2979
2980 #. type: Plain text
2981 #: build/C/man3/fread.3:67
2982 msgid ""
2983 "The function B<fread>()  reads I<nmemb> elements of data, each I<size> bytes "
2984 "long, from the stream pointed to by I<stream>, storing them at the location "
2985 "given by I<ptr>."
2986 msgstr ""
2987
2988 #. type: Plain text
2989 #: build/C/man3/fread.3:78
2990 msgid ""
2991 "The function B<fwrite>()  writes I<nmemb> elements of data, each I<size> "
2992 "bytes long, to the stream pointed to by I<stream>, obtaining them from the "
2993 "location given by I<ptr>."
2994 msgstr ""
2995
2996 #. type: Plain text
2997 #: build/C/man3/fread.3:94
2998 msgid ""
2999 "On success, B<fread>()  and B<fwrite>()  return the number of I<items> read "
3000 "or written.  This number equals the number of bytes transferred only when "
3001 "I<size> is 1.  If an error occurs, or the end of the file is reached, the "
3002 "return value is a short item count (or zero)."
3003 msgstr ""
3004
3005 #. type: Plain text
3006 #: build/C/man3/fread.3:101
3007 msgid ""
3008 "B<fread>()  does not distinguish between end-of-file and error, and callers "
3009 "must use B<feof>(3)  and B<ferror>(3)  to determine which occurred."
3010 msgstr ""
3011
3012 #. type: Plain text
3013 #: build/C/man3/fread.3:103
3014 msgid "C89, POSIX.1-2001."
3015 msgstr ""
3016
3017 #. type: Plain text
3018 #: build/C/man3/fread.3:108
3019 msgid "B<read>(2), B<write>(2), B<feof>(3), B<ferror>(3), B<unlocked_stdio>(3)"
3020 msgstr ""
3021
3022 #. type: TH
3023 #: build/C/man3/fseek.3:40
3024 #, no-wrap
3025 msgid "FSEEK"
3026 msgstr ""
3027
3028 #. type: TH
3029 #: build/C/man3/fseek.3:40
3030 #, no-wrap
3031 msgid "1993-11-29"
3032 msgstr ""
3033
3034 #. type: Plain text
3035 #: build/C/man3/fseek.3:43
3036 msgid "fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream"
3037 msgstr ""
3038
3039 #. type: Plain text
3040 #: build/C/man3/fseek.3:47
3041 msgid "B<int fseek(FILE *>I<stream>B<, long >I<offset>B<, int >I<whence>B<);>"
3042 msgstr ""
3043
3044 #. type: Plain text
3045 #: build/C/man3/fseek.3:49
3046 msgid "B<long ftell(FILE *>I<stream>B<);>"
3047 msgstr ""
3048
3049 #. type: Plain text
3050 #: build/C/man3/fseek.3:51
3051 msgid "B<void rewind(FILE *>I<stream>B<);>"
3052 msgstr ""
3053
3054 #. type: Plain text
3055 #: build/C/man3/fseek.3:53
3056 msgid "B<int fgetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3057 msgstr ""
3058
3059 #. type: Plain text
3060 #: build/C/man3/fseek.3:55
3061 msgid "B<int fsetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3062 msgstr ""
3063
3064 #. type: Plain text
3065 #: build/C/man3/fseek.3:79
3066 msgid ""
3067 "The B<fseek>()  function sets the file position indicator for the stream "
3068 "pointed to by I<stream>.  The new position, measured in bytes, is obtained "
3069 "by adding I<offset> bytes to the position specified by I<whence>.  If "
3070 "I<whence> is set to B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, the offset is "
3071 "relative to the start of the file, the current position indicator, or "
3072 "end-of-file, respectively.  A successful call to the B<fseek>()  function "
3073 "clears the end-of-file indicator for the stream and undoes any effects of "
3074 "the B<ungetc>(3)  function on the same stream."
3075 msgstr ""
3076
3077 #. type: Plain text
3078 #: build/C/man3/fseek.3:85
3079 msgid ""
3080 "The B<ftell>()  function obtains the current value of the file position "
3081 "indicator for the stream pointed to by I<stream>."
3082 msgstr ""
3083
3084 #. type: Plain text
3085 #: build/C/man3/fseek.3:92
3086 msgid ""
3087 "The B<rewind>()  function sets the file position indicator for the stream "
3088 "pointed to by I<stream> to the beginning of the file.  It is equivalent to:"
3089 msgstr ""
3090
3091 #. type: Plain text
3092 #: build/C/man3/fseek.3:95
3093 msgid "(void) fseek(stream, 0L, SEEK_SET)"
3094 msgstr ""
3095
3096 #. type: Plain text
3097 #: build/C/man3/fseek.3:99
3098 msgid ""
3099 "except that the error indicator for the stream is also cleared (see "
3100 "B<clearerr>(3))."
3101 msgstr ""
3102
3103 #. type: Plain text
3104 #: build/C/man3/fseek.3:117
3105 msgid ""
3106 "The B<fgetpos>()  and B<fsetpos>()  functions are alternate interfaces "
3107 "equivalent to B<ftell>()  and B<fseek>()  (with whence set to B<SEEK_SET>), "
3108 "setting and storing the current value of the file offset into or from the "
3109 "object referenced by I<pos>.  On some non-UNIX systems an I<fpos_t> object "
3110 "may be a complex object and these routines may be the only way to portably "
3111 "reposition a text stream."
3112 msgstr ""
3113
3114 #. type: Plain text
3115 #: build/C/man3/fseek.3:132
3116 msgid ""
3117 "The B<rewind>()  function returns no value.  Upon successful completion, "
3118 "B<fgetpos>(), B<fseek>(), B<fsetpos>()  return 0, and B<ftell>()  returns "
3119 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3120 "indicate the error."
3121 msgstr ""
3122
3123 #. type: Plain text
3124 #: build/C/man3/fseek.3:138
3125 msgid "The I<stream> specified is not a seekable stream."
3126 msgstr ""
3127
3128 #. type: Plain text
3129 #: build/C/man3/fseek.3:149
3130 msgid ""
3131 "The I<whence> argument to B<fseek>()  was not B<SEEK_SET>, B<SEEK_END>, or "
3132 "B<SEEK_CUR>."
3133 msgstr ""
3134
3135 #. type: Plain text
3136 #: build/C/man3/fseek.3:164
3137 msgid ""
3138 "The functions B<fgetpos>(), B<fseek>(), B<fsetpos>(), and B<ftell>()  may "
3139 "also fail and set I<errno> for any of the errors specified for the routines "
3140 "B<fflush>(3), B<fstat>(2), B<lseek>(2), and B<malloc>(3)."
3141 msgstr ""
3142
3143 #. type: Plain text
3144 #: build/C/man3/fseek.3:168
3145 msgid "B<lseek>(2), B<fseeko>(3)"
3146 msgstr ""
3147
3148 #. type: TH
3149 #: build/C/man3/fseeko.3:23
3150 #, no-wrap
3151 msgid "FSEEKO"
3152 msgstr ""
3153
3154 #. type: TH
3155 #: build/C/man3/fseeko.3:23
3156 #, no-wrap
3157 msgid "2001-11-05"
3158 msgstr ""
3159
3160 #. type: Plain text
3161 #: build/C/man3/fseeko.3:26
3162 msgid "fseeko, ftello - seek to or report file position"
3163 msgstr ""
3164
3165 #. type: Plain text
3166 #: build/C/man3/fseeko.3:31
3167 #, no-wrap
3168 msgid "B<int fseeko(FILE *>I<stream>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
3169 msgstr ""
3170
3171 #. type: Plain text
3172 #: build/C/man3/fseeko.3:34
3173 #, no-wrap
3174 msgid ""
3175 "B<off_t ftello(FILE *>I<stream>B<);>\n"
3176 "\n"
3177 msgstr ""
3178
3179 #. type: Plain text
3180 #: build/C/man3/fseeko.3:52
3181 msgid ""
3182 "The B<fseeko>()  and B<ftello>()  functions are identical to B<fseek>(3)  "
3183 "and B<ftell>(3)  (see B<fseek>(3)), respectively, except that the I<offset> "
3184 "argument of B<fseeko>()  and the return value of B<ftello>()  is of type "
3185 "I<off_t> instead of I<long>."
3186 msgstr ""
3187
3188 #. type: Plain text
3189 #: build/C/man3/fseeko.3:55
3190 msgid ""
3191 "On many architectures both I<off_t> and I<long> are 32-bit types, but "
3192 "compilation with"
3193 msgstr ""
3194
3195 #. type: Plain text
3196 #: build/C/man3/fseeko.3:59 build/C/man3/lseek64.3:79
3197 #, no-wrap
3198 msgid "#define _FILE_OFFSET_BITS 64\n"
3199 msgstr ""
3200
3201 #. type: Plain text
3202 #: build/C/man3/fseeko.3:63
3203 msgid "will turn I<off_t> into a 64-bit type."
3204 msgstr ""
3205
3206 #. type: Plain text
3207 #: build/C/man3/fseeko.3:72
3208 msgid ""
3209 "On successful completion, B<fseeko>()  returns 0, while B<ftello>()  returns "
3210 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3211 "indicate the error."
3212 msgstr ""
3213
3214 #. type: Plain text
3215 #: build/C/man3/fseeko.3:75
3216 msgid "See the ERRORS in B<fseek>(3)."
3217 msgstr ""
3218
3219 #. type: Plain text
3220 #: build/C/man3/fseeko.3:77
3221 msgid "SUSv2, POSIX.1-2001."
3222 msgstr ""
3223
3224 #. type: Plain text
3225 #: build/C/man3/fseeko.3:81
3226 msgid ""
3227 "These functions are found on System V-like systems.  They are not present in "
3228 "libc4, libc5, glibc 2.0 but are available since glibc 2.1."
3229 msgstr ""
3230
3231 #. type: Plain text
3232 #: build/C/man3/fseeko.3:82
3233 msgid "B<fseek>(3)"
3234 msgstr ""
3235
3236 #. type: TH
3237 #: build/C/man3/getline.3:24
3238 #, no-wrap
3239 msgid "GETLINE"
3240 msgstr ""
3241
3242 #. type: TH
3243 #: build/C/man3/getline.3:24
3244 #, no-wrap
3245 msgid "2010-06-12"
3246 msgstr ""
3247
3248 #. type: Plain text
3249 #: build/C/man3/getline.3:27
3250 msgid "getline, getdelim - delimited string input"
3251 msgstr ""
3252
3253 #. type: Plain text
3254 #: build/C/man3/getline.3:32
3255 #, no-wrap
3256 msgid ""
3257 "B<ssize_t getline(char **>I<lineptr>B<, size_t *>I<n>B<, FILE "
3258 "*>I<stream>B<);>\n"
3259 msgstr ""
3260
3261 #. type: Plain text
3262 #: build/C/man3/getline.3:35
3263 #, no-wrap
3264 msgid ""
3265 "B<ssize_t getdelim(char **>I<lineptr>B<, size_t *>I<n>B<, int >I<delim>B<, "
3266 "FILE *>I<stream>B<);>\n"
3267 msgstr ""
3268
3269 #. type: Plain text
3270 #: build/C/man3/getline.3:45
3271 msgid "B<getline>(), B<getdelim>():"
3272 msgstr ""
3273
3274 #. type: Plain text
3275 #: build/C/man3/getline.3:50
3276 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700"
3277 msgstr ""
3278
3279 #. type: Plain text
3280 #: build/C/man3/getline.3:63
3281 msgid ""
3282 "B<getline>()  reads an entire line from I<stream>, storing the address of "
3283 "the buffer containing the text into I<*lineptr>.  The buffer is "
3284 "null-terminated and includes the newline character, if one was found."
3285 msgstr ""
3286
3287 #. type: Plain text
3288 #: build/C/man3/getline.3:73
3289 msgid ""
3290 "If I<*lineptr> is NULL, then B<getline>()  will allocate a buffer for "
3291 "storing the line, which should be freed by the user program.  (In this case, "
3292 "the value in I<*n> is ignored.)"
3293 msgstr ""
3294
3295 #. type: Plain text
3296 #: build/C/man3/getline.3:91
3297 msgid ""
3298 "Alternatively, before calling B<getline>(), I<*lineptr> can contain a "
3299 "pointer to a B<malloc>(3)-allocated buffer I<*n> bytes in size.  If the "
3300 "buffer is not large enough to hold the line, B<getline>()  resizes it with "
3301 "B<realloc>(3), updating I<*lineptr> and I<*n> as necessary."
3302 msgstr ""
3303
3304 #. type: Plain text
3305 #: build/C/man3/getline.3:97
3306 msgid ""
3307 "In either case, on a successful call, I<*lineptr> and I<*n> will be updated "
3308 "to reflect the buffer address and allocated size respectively."
3309 msgstr ""
3310
3311 #. type: Plain text
3312 #: build/C/man3/getline.3:108
3313 msgid ""
3314 "B<getdelim>()  works like B<getline>(), except that a line delimiter other "
3315 "than newline can be specified as the I<delimiter> argument.  As with "
3316 "B<getline>(), a delimiter character is not added if one was not present in "
3317 "the input before end of file was reached."
3318 msgstr ""
3319
3320 #. type: Plain text
3321 #: build/C/man3/getline.3:117
3322 msgid ""
3323 "On success, B<getline>()  and B<getdelim>()  return the number of characters "
3324 "read, including the delimiter character, but not including the terminating "
3325 "null byte.  This value can be used to handle embedded null bytes in the line "
3326 "read."
3327 msgstr ""
3328
3329 #. type: Plain text
3330 #: build/C/man3/getline.3:120
3331 msgid ""
3332 "Both functions return -1 on failure to read a line (including end-of-file "
3333 "condition)."
3334 msgstr ""
3335
3336 #. type: Plain text
3337 #: build/C/man3/getline.3:130
3338 msgid "Bad arguments (I<n> or I<lineptr> is NULL, or I<stream> is not valid)."
3339 msgstr ""
3340
3341 #. type: Plain text
3342 #: build/C/man3/getline.3:132
3343 msgid "These functions are available since libc 4.6.27."
3344 msgstr ""
3345
3346 #. type: Plain text
3347 #: build/C/man3/getline.3:139
3348 msgid ""
3349 "Both B<getline>()  and B<getdelim>()  were originally GNU extensions.  They "
3350 "were standardized in POSIX.1-2008."
3351 msgstr ""
3352
3353 #. type: Plain text
3354 #: build/C/man3/getline.3:144
3355 #, no-wrap
3356 msgid ""
3357 "#define _GNU_SOURCE\n"
3358 "#include E<lt>stdio.hE<gt>\n"
3359 "#include E<lt>stdlib.hE<gt>\n"
3360 msgstr ""
3361
3362 #. type: Plain text
3363 #: build/C/man3/getline.3:152
3364 #, no-wrap
3365 msgid ""
3366 "int\n"
3367 "main(void)\n"
3368 "{\n"
3369 "    FILE *fp;\n"
3370 "    char *line = NULL;\n"
3371 "    size_t len = 0;\n"
3372 "    ssize_t read;\n"
3373 msgstr ""
3374
3375 #. type: Plain text
3376 #: build/C/man3/getline.3:156
3377 #, no-wrap
3378 msgid ""
3379 "    fp = fopen(\"/etc/motd\", \"r\");\n"
3380 "    if (fp == NULL)\n"
3381 "        exit(EXIT_FAILURE);\n"
3382 msgstr ""
3383
3384 #. type: Plain text
3385 #: build/C/man3/getline.3:161
3386 #, no-wrap
3387 msgid ""
3388 "    while ((read = getline(&line, &len, fp)) != -1) {\n"
3389 "        printf(\"Retrieved line of length %zu :\\en\", read);\n"
3390 "        printf(\"%s\", line);\n"
3391 "    }\n"
3392 msgstr ""
3393
3394 #. type: Plain text
3395 #: build/C/man3/getline.3:165
3396 #, no-wrap
3397 msgid ""
3398 "    free(line);\n"
3399 "    exit(EXIT_SUCCESS);\n"
3400 "}\n"
3401 msgstr ""
3402
3403 #. type: Plain text
3404 #: build/C/man3/getline.3:172
3405 msgid "B<read>(2), B<fgets>(3), B<fopen>(3), B<fread>(3), B<gets>(3), B<scanf>(3)"
3406 msgstr ""
3407
3408 #. type: TH
3409 #: build/C/man3/gets.3:25
3410 #, no-wrap
3411 msgid "GETS"
3412 msgstr ""
3413
3414 #. type: TH
3415 #: build/C/man3/gets.3:25
3416 #, no-wrap
3417 msgid "2012-01-18"
3418 msgstr ""
3419
3420 #. type: Plain text
3421 #: build/C/man3/gets.3:28
3422 msgid "fgetc, fgets, getc, getchar, gets, ungetc - input of characters and strings"
3423 msgstr ""
3424
3425 #. type: Plain text
3426 #: build/C/man3/gets.3:33
3427 #, no-wrap
3428 msgid "B<int fgetc(FILE *>I<stream>B<);>\n"
3429 msgstr ""
3430
3431 #. type: Plain text
3432 #: build/C/man3/gets.3:35
3433 #, no-wrap
3434 msgid "B<char *fgets(char *>I<s>B<, int >I<size>B<, FILE *>I<stream>B<);>\n"
3435 msgstr ""
3436
3437 #. type: Plain text
3438 #: build/C/man3/gets.3:37
3439 #, no-wrap
3440 msgid "B<int getc(FILE *>I<stream>B<);>\n"
3441 msgstr ""
3442
3443 #. type: Plain text
3444 #: build/C/man3/gets.3:39
3445 #, no-wrap
3446 msgid "B<int getchar(void);>\n"
3447 msgstr ""
3448
3449 #. type: Plain text
3450 #: build/C/man3/gets.3:41
3451 #, no-wrap
3452 msgid "B<char *gets(char *>I<s>B<);>\n"
3453 msgstr ""
3454
3455 #. type: Plain text
3456 #: build/C/man3/gets.3:43
3457 #, no-wrap
3458 msgid "B<int ungetc(int >I<c>B<, FILE *>I<stream>B<);>\n"
3459 msgstr ""
3460
3461 #. type: Plain text
3462 #: build/C/man3/gets.3:55
3463 msgid ""
3464 "B<fgetc>()  reads the next character from I<stream> and returns it as an "
3465 "I<unsigned char> cast to an I<int>, or B<EOF> on end of file or error."
3466 msgstr ""
3467
3468 #. type: Plain text
3469 #: build/C/man3/gets.3:62
3470 msgid ""
3471 "B<getc>()  is equivalent to B<fgetc>()  except that it may be implemented as "
3472 "a macro which evaluates I<stream> more than once."
3473 msgstr ""
3474
3475 #. type: Plain text
3476 #: build/C/man3/gets.3:66
3477 msgid "B<getchar>()  is equivalent to B<getc(>I<stdin>B<)>."
3478 msgstr ""
3479
3480 #. type: Plain text
3481 #: build/C/man3/gets.3:76
3482 msgid ""
3483 "B<gets>()  reads a line from I<stdin> into the buffer pointed to by I<s> "
3484 "until either a terminating newline or B<EOF>, which it replaces with a null "
3485 "byte (\\(aq\\e0\\(aq).  No check for buffer overrun is performed (see BUGS "
3486 "below)."
3487 msgstr ""
3488
3489 #. type: Plain text
3490 #: build/C/man3/gets.3:90
3491 msgid ""
3492 "B<fgets>()  reads in at most one less than I<size> characters from I<stream> "
3493 "and stores them into the buffer pointed to by I<s>.  Reading stops after an "
3494 "B<EOF> or a newline.  If a newline is read, it is stored into the buffer.  A "
3495 "terminating null byte (\\(aq\\e0\\(aq)  is stored after the last character "
3496 "in the buffer."
3497 msgstr ""
3498
3499 #. type: Plain text
3500 #: build/C/man3/gets.3:101
3501 msgid ""
3502 "B<ungetc>()  pushes I<c> back to I<stream>, cast to I<unsigned char>, where "
3503 "it is available for subsequent read operations.  Pushed-back characters will "
3504 "be returned in reverse order; only one pushback is guaranteed."
3505 msgstr ""
3506
3507 #. type: Plain text
3508 #: build/C/man3/gets.3:106
3509 msgid ""
3510 "Calls to the functions described here can be mixed with each other and with "
3511 "calls to other input functions from the I<stdio> library for the same input "
3512 "stream."
3513 msgstr ""
3514
3515 #. type: Plain text
3516 #: build/C/man3/gets.3:121
3517 msgid ""
3518 "B<fgetc>(), B<getc>()  and B<getchar>()  return the character read as an "
3519 "I<unsigned char> cast to an I<int> or B<EOF> on end of file or error."
3520 msgstr ""
3521
3522 #. type: Plain text
3523 #: build/C/man3/gets.3:129
3524 msgid ""
3525 "B<gets>()  and B<fgets>()  return I<s> on success, and NULL on error or when "
3526 "end of file occurs while no characters have been read."
3527 msgstr ""
3528
3529 #. type: Plain text
3530 #: build/C/man3/gets.3:136
3531 msgid "B<ungetc>()  returns I<c> on success, or B<EOF> on error."
3532 msgstr ""
3533
3534 #. type: Plain text
3535 #: build/C/man3/gets.3:138
3536 msgid "C89, C99, POSIX.1-2001."
3537 msgstr ""
3538
3539 #. type: Plain text
3540 #: build/C/man3/gets.3:150
3541 msgid ""
3542 "LSB deprecates B<gets>().  POSIX.1-2008 marks B<gets>()  obsolescent.  ISO "
3543 "C11 removes the specification of B<gets>()  from the C language, and since "
3544 "version 2.16, glibc header files don't expose the function declaration if "
3545 "the B<_ISOC11_SOURCE> feature test macro is defined."
3546 msgstr ""
3547
3548 #. type: Plain text
3549 #: build/C/man3/gets.3:164
3550 msgid ""
3551 "Never use B<gets>().  Because it is impossible to tell without knowing the "
3552 "data in advance how many characters B<gets>()  will read, and because "
3553 "B<gets>()  will continue to store characters past the end of the buffer, it "
3554 "is extremely dangerous to use.  It has been used to break computer "
3555 "security.  Use B<fgets>()  instead."
3556 msgstr ""
3557
3558 #. type: Plain text
3559 #: build/C/man3/gets.3:171
3560 msgid ""
3561 "It is not advisable to mix calls to input functions from the I<stdio> "
3562 "library with low-level calls to B<read>(2)  for the file descriptor "
3563 "associated with the input stream; the results will be undefined and very "
3564 "probably not what you want."
3565 msgstr ""
3566
3567 #. type: Plain text
3568 #: build/C/man3/gets.3:186
3569 msgid ""
3570 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetwc>(3), B<fgetws>(3), "
3571 "B<fopen>(3), B<fread>(3), B<fseek>(3), B<getline>(3), B<getwchar>(3), "
3572 "B<puts>(3), B<scanf>(3), B<ungetwc>(3), B<unlocked_stdio>(3), "
3573 "B<feature_test_macros>(7)"
3574 msgstr ""
3575
3576 #. type: TH
3577 #: build/C/man3/getw.3:23
3578 #, no-wrap
3579 msgid "GETW"
3580 msgstr ""
3581
3582 #. type: TH
3583 #: build/C/man3/getw.3:23
3584 #, no-wrap
3585 msgid "2010-09-26"
3586 msgstr ""
3587
3588 #. type: Plain text
3589 #: build/C/man3/getw.3:26
3590 msgid "getw, putw - input and output of words (ints)"
3591 msgstr ""
3592
3593 #. type: Plain text
3594 #: build/C/man3/getw.3:31
3595 #, no-wrap
3596 msgid "B<int getw(FILE *>I<stream>B<);>\n"
3597 msgstr ""
3598
3599 #. type: Plain text
3600 #: build/C/man3/getw.3:33
3601 #, no-wrap
3602 msgid "B<int putw(int >I<w>B<, FILE *>I<stream>B<);>\n"
3603 msgstr ""
3604
3605 #. type: Plain text
3606 #: build/C/man3/getw.3:42
3607 msgid "B<getw>(), B<putw>():"
3608 msgstr ""
3609
3610 #. type: TP
3611 #: build/C/man3/getw.3:45
3612 #, no-wrap
3613 msgid "Since glibc 2.3.3:"
3614 msgstr ""
3615
3616 #. type: Plain text
3617 #: build/C/man3/getw.3:48
3618 msgid "_SVID_SOURCE || _BSD_SOURCE ||"
3619 msgstr ""
3620
3621 #. type: Plain text
3622 #: build/C/man3/getw.3:51
3623 #, no-wrap
3624 msgid ""
3625 "(_XOPEN_SOURCE &&\n"
3626 "    !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600))\n"
3627 msgstr ""
3628
3629 #. type: TP
3630 #: build/C/man3/getw.3:51
3631 #, no-wrap
3632 msgid "Before glibc 2.3.3:"
3633 msgstr ""
3634
3635 #. type: Plain text
3636 #: build/C/man3/getw.3:54
3637 msgid "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE"
3638 msgstr ""
3639
3640 #. type: Plain text
3641 #: build/C/man3/getw.3:64
3642 msgid ""
3643 "B<getw>()  reads a word (that is, an I<int>) from I<stream>.  It's provided "
3644 "for compatibility with SVr4.  We recommend you use B<fread>(3)  instead."
3645 msgstr ""
3646
3647 #. type: Plain text
3648 #: build/C/man3/getw.3:71
3649 msgid ""
3650 "B<putw>()  writes the word I<w> (that is, an I<int>) to I<stream>.  It is "
3651 "provided for compatibility with SVr4, but we recommend you use B<fwrite>(3)  "
3652 "instead."
3653 msgstr ""
3654
3655 #. type: Plain text
3656 #: build/C/man3/getw.3:78
3657 msgid ""
3658 "Normally, B<getw>()  returns the word read, and B<putw>()  returns 0.  On "
3659 "error, they return B<EOF>."
3660 msgstr ""
3661
3662 #. type: Plain text
3663 #: build/C/man3/getw.3:80
3664 msgid "SVr4, SUSv2.  Not present in POSIX.1-2001."
3665 msgstr ""
3666
3667 #. type: Plain text
3668 #: build/C/man3/getw.3:84
3669 msgid ""
3670 "The value returned on error is also a legitimate data value.  B<ferror>(3)  "
3671 "can be used to distinguish between the two cases."
3672 msgstr ""
3673
3674 #. type: Plain text
3675 #: build/C/man3/getw.3:89
3676 msgid "B<ferror>(3), B<fread>(3), B<fwrite>(3), B<getc>(3), B<putc>(3)"
3677 msgstr ""
3678
3679 #. type: TH
3680 #: build/C/man2/link.2:31
3681 #, no-wrap
3682 msgid "LINK"
3683 msgstr ""
3684
3685 #. type: TH
3686 #: build/C/man2/link.2:31
3687 #, no-wrap
3688 msgid "2008-08-21"
3689 msgstr ""
3690
3691 #. type: Plain text
3692 #: build/C/man2/link.2:34
3693 msgid "link - make a new name for a file"
3694 msgstr ""
3695
3696 #. type: Plain text
3697 #: build/C/man2/link.2:36 build/C/man2/lseek.2:52 build/C/man3/lseek64.3:32 build/C/man2/readlink.2:46 build/C/man2/rmdir.2:35 build/C/man2/symlink.2:37 build/C/man2/unlink.2:37 build/C/man2/write.2:44
3698 msgid "B<#include E<lt>unistd.hE<gt>>"
3699 msgstr ""
3700
3701 #. type: Plain text
3702 #: build/C/man2/link.2:38
3703 msgid "B<int link(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
3704 msgstr ""
3705
3706 #. type: Plain text
3707 #: build/C/man2/link.2:41
3708 msgid ""
3709 "B<link>()  creates a new link (also known as a hard link) to an existing "
3710 "file."
3711 msgstr ""
3712
3713 #. type: Plain text
3714 #: build/C/man2/link.2:47 build/C/man2/symlink.2:84
3715 msgid "If I<newpath> exists it will I<not> be overwritten."
3716 msgstr ""
3717
3718 #. type: Plain text
3719 #: build/C/man2/link.2:52
3720 msgid ""
3721 "This new name may be used exactly as the old one for any operation; both "
3722 "names refer to the same file (and so have the same permissions and "
3723 "ownership) and it is impossible to tell which name was the \"original\"."
3724 msgstr ""
3725
3726 #. type: Plain text
3727 #: build/C/man2/link.2:57 build/C/man2/pipe.2:97 build/C/man3/remove.3:65 build/C/man2/rename.2:96 build/C/man2/rmdir.2:45 build/C/man2/symlink.2:89 build/C/man2/unlink.2:60
3728 msgid ""
3729 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
3730 "appropriately."
3731 msgstr ""
3732
3733 #. type: TP
3734 #: build/C/man2/link.2:58 build/C/man2/open.2:473 build/C/man2/readlink.2:84 build/C/man2/rename.2:97 build/C/man2/rmdir.2:46 build/C/man2/symlink.2:90 build/C/man3/tmpfile.3:53 build/C/man2/unlink.2:61
3735 #, no-wrap
3736 msgid "B<EACCES>"
3737 msgstr ""
3738
3739 #. type: Plain text
3740 #: build/C/man2/link.2:69
3741 msgid ""
3742 "Write access to the directory containing I<newpath> is denied, or search "
3743 "permission is denied for one of the directories in the path prefix of "
3744 "I<oldpath> or I<newpath>.  (See also B<path_resolution>(7).)"
3745 msgstr ""
3746
3747 #. type: TP
3748 #: build/C/man2/link.2:69 build/C/man2/open.2:482 build/C/man2/symlink.2:99 build/C/man3/tmpfile.3:56
3749 #, no-wrap
3750 msgid "B<EEXIST>"
3751 msgstr ""
3752
3753 #. type: Plain text
3754 #: build/C/man2/link.2:73 build/C/man2/symlink.2:103
3755 msgid "I<newpath> already exists."
3756 msgstr ""
3757
3758 #. type: TP
3759 #: build/C/man2/link.2:73 build/C/man2/llseek.2:69 build/C/man2/open.2:488 build/C/man2/pipe.2:98 build/C/man2/read.2:100 build/C/man2/readlink.2:89 build/C/man2/rename.2:133 build/C/man2/rmdir.2:64 build/C/man2/symlink.2:103 build/C/man2/unlink.2:80 build/C/man2/write.2:135
3760 #, no-wrap
3761 msgid "B<EFAULT>"
3762 msgstr ""
3763
3764 #. type: Plain text
3765 #: build/C/man2/link.2:76 build/C/man2/rename.2:136 build/C/man2/symlink.2:106
3766 msgid "I<oldpath> or I<newpath> points outside your accessible address space."
3767 msgstr ""
3768
3769 #. type: TP
3770 #: build/C/man2/link.2:76 build/C/man2/read.2:129 build/C/man2/readlink.2:105 build/C/man2/symlink.2:106 build/C/man2/unlink.2:84 build/C/man2/write.2:159
3771 #, no-wrap
3772 msgid "B<EIO>"
3773 msgstr ""
3774
3775 #. type: Plain text
3776 #: build/C/man2/link.2:79 build/C/man2/symlink.2:109 build/C/man2/unlink.2:87
3777 msgid "An I/O error occurred."
3778 msgstr ""
3779
3780 #. type: TP
3781 #: build/C/man2/link.2:79 build/C/man2/open.2:512 build/C/man2/readlink.2:108 build/C/man2/rename.2:146 build/C/man2/rmdir.2:73 build/C/man2/symlink.2:109 build/C/man2/unlink.2:92
3782 #, no-wrap
3783 msgid "B<ELOOP>"
3784 msgstr ""
3785
3786 #. type: Plain text
3787 #: build/C/man2/link.2:83 build/C/man2/rename.2:150
3788 msgid ""
3789 "Too many symbolic links were encountered in resolving I<oldpath> or "
3790 "I<newpath>."
3791 msgstr ""
3792
3793 #. type: TP
3794 #: build/C/man2/link.2:83 build/C/man2/rename.2:150
3795 #, no-wrap
3796 msgid "B<EMLINK>"
3797 msgstr ""
3798
3799 #. type: Plain text
3800 #: build/C/man2/link.2:88
3801 msgid ""
3802 "The file referred to by I<oldpath> already has the maximum number of links "
3803 "to it."
3804 msgstr ""
3805
3806 #. type: TP
3807 #: build/C/man2/link.2:88 build/C/man2/open.2:522 build/C/man2/readlink.2:111 build/C/man2/rename.2:157 build/C/man2/rmdir.2:77 build/C/man2/symlink.2:113 build/C/man2/unlink.2:96
3808 #, no-wrap
3809 msgid "B<ENAMETOOLONG>"
3810 msgstr ""
3811
3812 #. type: Plain text
3813 #: build/C/man2/link.2:91 build/C/man2/rename.2:160 build/C/man2/symlink.2:116
3814 msgid "I<oldpath> or I<newpath> was too long."
3815 msgstr ""
3816
3817 #. type: TP
3818 #: build/C/man2/link.2:91 build/C/man2/open.2:536 build/C/man2/readlink.2:114 build/C/man2/rename.2:160 build/C/man2/rmdir.2:80 build/C/man2/symlink.2:116 build/C/man2/unlink.2:99
3819 #, no-wrap
3820 msgid "B<ENOENT>"
3821 msgstr ""
3822
3823 #. type: Plain text
3824 #: build/C/man2/link.2:96
3825 msgid ""
3826 "A directory component in I<oldpath> or I<newpath> does not exist or is a "
3827 "dangling symbolic link."
3828 msgstr ""
3829
3830 #. type: TP
3831 #: build/C/man2/link.2:96 build/C/man2/open.2:543 build/C/man2/readlink.2:117 build/C/man2/rename.2:173 build/C/man2/rmdir.2:85 build/C/man3/scanf.3:568 build/C/man2/symlink.2:123 build/C/man3/tempnam.3:91 build/C/man2/unlink.2:106
3832 #, no-wrap
3833 msgid "B<ENOMEM>"
3834 msgstr ""
3835
3836 #. type: Plain text
3837 #: build/C/man2/link.2:99 build/C/man2/open.2:546 build/C/man2/readlink.2:120 build/C/man2/rename.2:176 build/C/man2/rmdir.2:88 build/C/man2/symlink.2:126 build/C/man2/unlink.2:109
3838 msgid "Insufficient kernel memory was available."
3839 msgstr ""
3840
3841 #. type: TP
3842 #: build/C/man2/link.2:99 build/C/man2/open.2:546 build/C/man2/rename.2:176 build/C/man2/symlink.2:126 build/C/man3/tmpfile.3:68 build/C/man2/write.2:162
3843 #, no-wrap
3844 msgid "B<ENOSPC>"
3845 msgstr ""
3846
3847 #. type: Plain text
3848 #: build/C/man2/link.2:103 build/C/man2/rename.2:180 build/C/man2/symlink.2:130
3849 msgid "The device containing the file has no room for the new directory entry."
3850 msgstr ""
3851
3852 #. type: TP
3853 #: build/C/man2/link.2:103 build/C/man2/open.2:552 build/C/man2/readlink.2:120 build/C/man2/rename.2:180 build/C/man2/rmdir.2:88 build/C/man2/symlink.2:130 build/C/man2/unlink.2:109
3854 #, no-wrap
3855 msgid "B<ENOTDIR>"
3856 msgstr ""
3857
3858 #. type: Plain text
3859 #: build/C/man2/link.2:108
3860 msgid ""
3861 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
3862 "a directory."
3863 msgstr ""
3864
3865 #. type: TP
3866 #: build/C/man2/link.2:108 build/C/man2/link.2:112 build/C/man2/open.2:585 build/C/man2/rmdir.2:107 build/C/man2/rmdir.2:118 build/C/man2/symlink.2:135 build/C/man2/unlink.2:114
3867 #, no-wrap
3868 msgid "B<EPERM>"
3869 msgstr ""
3870
3871 #. type: Plain text
3872 #: build/C/man2/link.2:112
3873 msgid "I<oldpath> is a directory."
3874 msgstr ""
3875
3876 #. type: Plain text
3877 #: build/C/man2/link.2:117
3878 msgid ""
3879 "The file system containing I<oldpath> and I<newpath> does not support the "
3880 "creation of hard links."
3881 msgstr ""
3882
3883 #. type: TP
3884 #: build/C/man2/link.2:117 build/C/man2/open.2:593 build/C/man2/rename.2:218 build/C/man2/rmdir.2:123 build/C/man2/symlink.2:140 build/C/man3/tmpfile.3:71 build/C/man2/unlink.2:137
3885 #, no-wrap
3886 msgid "B<EROFS>"
3887 msgstr ""
3888
3889 #. type: Plain text
3890 #: build/C/man2/link.2:120 build/C/man2/rename.2:221
3891 msgid "The file is on a read-only file system."
3892 msgstr ""
3893
3894 #. type: TP
3895 #: build/C/man2/link.2:120 build/C/man2/rename.2:221
3896 #, no-wrap
3897 msgid "B<EXDEV>"
3898 msgstr ""
3899
3900 #. type: Plain text
3901 #: build/C/man2/link.2:128
3902 msgid ""
3903 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
3904 "permits a file system to be mounted at multiple points, but B<link>()  does "
3905 "not work across different mount points, even if the same file system is "
3906 "mounted on both.)"
3907 msgstr ""
3908
3909 #.  SVr4 documents additional ENOLINK and
3910 #.  EMULTIHOP error conditions; POSIX.1 does not document ELOOP.
3911 #.  X/OPEN does not document EFAULT, ENOMEM or EIO.
3912 #. type: Plain text
3913 #: build/C/man2/link.2:133
3914 msgid "SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES)."
3915 msgstr ""
3916
3917 #. type: Plain text
3918 #: build/C/man2/link.2:140
3919 msgid ""
3920 "Hard links, as created by B<link>(), cannot span file systems.  Use "
3921 "B<symlink>(2)  if this is required."
3922 msgstr ""
3923
3924 #.  more precisely: since kernel 1.3.56
3925 #.  For example, the default Solaris compilation environment
3926 #.  behaves like Linux, and contributors to a March 2005
3927 #.  thread in the Austin mailing list reported that some
3928 #.  other (System V) implementations did/do the same -- MTK, Apr 05
3929 #. type: Plain text
3930 #: build/C/man2/link.2:171
3931 msgid ""
3932 "POSIX.1-2001 says that B<link>()  should dereference I<oldpath> if it is a "
3933 "symbolic link.  However, since kernel 2.0, Linux does not do so: if "
3934 "I<oldpath> is a symbolic link, then I<newpath> is created as a (hard) link "
3935 "to the same symbolic link file (i.e., I<newpath> becomes a symbolic link to "
3936 "the same file that I<oldpath> refers to).  Some other implementations behave "
3937 "in the same manner as Linux.  POSIX.1-2008 changes the specification of "
3938 "B<link>(), making it implementation-dependent whether or not I<oldpath> is "
3939 "dereferenced if it is a symbolic link.  For precise control over the "
3940 "treatment of symbolic links when creating a link, see B<linkat>(2)."
3941 msgstr ""
3942
3943 #. type: Plain text
3944 #: build/C/man2/link.2:177
3945 msgid ""
3946 "On NFS file systems, the return code may be wrong in case the NFS server "
3947 "performs the link creation and dies before it can say so.  Use B<stat>(2)  "
3948 "to find out if the link got created."
3949 msgstr ""
3950
3951 #. type: Plain text
3952 #: build/C/man2/link.2:186
3953 msgid ""
3954 "B<ln>(1), B<linkat>(2), B<open>(2), B<rename>(2), B<stat>(2), B<symlink>(2), "
3955 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
3956 msgstr ""
3957
3958 #. type: TH
3959 #: build/C/man2/llseek.2:26
3960 #, no-wrap
3961 msgid "LLSEEK"
3962 msgstr ""
3963
3964 #. type: TH
3965 #: build/C/man2/llseek.2:26
3966 #, no-wrap
3967 msgid "2007-06-01"
3968 msgstr ""
3969
3970 #. type: Plain text
3971 #: build/C/man2/llseek.2:29
3972 msgid "_llseek - reposition read/write file offset"
3973 msgstr ""
3974
3975 #. type: Plain text
3976 #: build/C/man2/llseek.2:33
3977 #, no-wrap
3978 msgid ""
3979 "B<#include E<lt>sys/types.hE<gt>>\n"
3980 "B<#include E<lt>unistd.hE<gt>>\n"
3981 msgstr ""
3982
3983 #. type: Plain text
3984 #: build/C/man2/llseek.2:37
3985 #, no-wrap
3986 msgid ""
3987 "B<int _llseek(unsigned int >I<fd>B<, unsigned long >I<offset_high>B<,>\n"
3988 "B<            unsigned long >I<offset_low>B<, loff_t *>I<result>B<,>\n"
3989 "B<            unsigned int >I<whence>B<);>\n"
3990 msgstr ""
3991
3992 #. type: Plain text
3993 #: build/C/man2/llseek.2:57
3994 msgid ""
3995 "The B<_llseek>()  function repositions the offset of the open file "
3996 "associated with the file descriptor I<fd> to I<(offset_highE<lt>E<lt>32) | "
3997 "offset_low> bytes relative to the beginning of the file, the current "
3998 "position in the file, or the end of the file, depending on whether I<whence> "
3999 "is B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively.  It returns the "
4000 "resulting file position in the argument I<result>."
4001 msgstr ""
4002
4003 #. type: Plain text
4004 #: build/C/man2/llseek.2:64
4005 msgid ""
4006 "Upon successful completion, B<_llseek>()  returns 0.  Otherwise, a value of "
4007 "-1 is returned and I<errno> is set to indicate the error."
4008 msgstr ""
4009
4010 #. type: Plain text
4011 #: build/C/man2/llseek.2:69 build/C/man2/lseek.2:164
4012 msgid "I<fd> is not an open file descriptor."
4013 msgstr ""
4014
4015 #. type: Plain text
4016 #: build/C/man2/llseek.2:72
4017 msgid "Problem with copying results to user space."
4018 msgstr ""
4019
4020 #. type: Plain text
4021 #: build/C/man2/llseek.2:76
4022 msgid "I<whence> is invalid."
4023 msgstr ""
4024
4025 #. type: Plain text
4026 #: build/C/man2/llseek.2:79
4027 msgid ""
4028 "This function is Linux-specific, and should not be used in programs intended "
4029 "to be portable."
4030 msgstr ""
4031
4032 #. type: Plain text
4033 #: build/C/man2/llseek.2:82
4034 msgid ""
4035 "Glibc does not provide a wrapper for this system call; call it using "
4036 "B<syscall>(2)."
4037 msgstr ""
4038
4039 #. type: Plain text
4040 #: build/C/man2/llseek.2:84
4041 msgid "B<lseek>(2), B<lseek64>(3)"
4042 msgstr ""
4043
4044 #. type: TH
4045 #: build/C/man2/lseek.2:45
4046 #, no-wrap
4047 msgid "LSEEK"
4048 msgstr ""
4049
4050 #. type: TH
4051 #: build/C/man2/lseek.2:45
4052 #, no-wrap
4053 msgid "2011-09-25"
4054 msgstr ""
4055
4056 #. type: Plain text
4057 #: build/C/man2/lseek.2:48
4058 msgid "lseek - reposition read/write file offset"
4059 msgstr ""
4060
4061 #. type: Plain text
4062 #: build/C/man2/lseek.2:50 build/C/man3/lseek64.3:30
4063 msgid "B<#include E<lt>sys/types.hE<gt>>"
4064 msgstr ""
4065
4066 #. type: Plain text
4067 #: build/C/man2/lseek.2:54
4068 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>"
4069 msgstr ""
4070
4071 #. type: Plain text
4072 #: build/C/man2/lseek.2:65
4073 msgid ""
4074 "The B<lseek>()  function repositions the offset of the open file associated "
4075 "with the file descriptor I<fd> to the argument I<offset> according to the "
4076 "directive I<whence> as follows:"
4077 msgstr ""
4078
4079 #. type: Plain text
4080 #: build/C/man2/lseek.2:70
4081 msgid "The offset is set to I<offset> bytes."
4082 msgstr ""
4083
4084 #. type: Plain text
4085 #: build/C/man2/lseek.2:75
4086 msgid "The offset is set to its current location plus I<offset> bytes."
4087 msgstr ""
4088
4089 #. type: Plain text
4090 #: build/C/man2/lseek.2:80
4091 msgid "The offset is set to the size of the file plus I<offset> bytes."
4092 msgstr ""
4093
4094 #. type: Plain text
4095 #: build/C/man2/lseek.2:88
4096 msgid ""
4097 "The B<lseek>()  function allows the file offset to be set beyond the end of "
4098 "the file (but this does not change the size of the file).  If data is later "
4099 "written at this point, subsequent reads of the data in the gap (a \"hole\") "
4100 "return null bytes (\\(aq\\e0\\(aq) until data is actually written into the "
4101 "gap."
4102 msgstr ""
4103
4104 #. type: SS
4105 #: build/C/man2/lseek.2:88
4106 #, no-wrap
4107 msgid "Seeking file data and holes"
4108 msgstr ""
4109
4110 #. type: Plain text
4111 #: build/C/man2/lseek.2:91
4112 msgid ""
4113 "Since version 3.1, Linux supports the following additional values for "
4114 "I<whence>:"
4115 msgstr ""
4116
4117 #. type: TP
4118 #: build/C/man2/lseek.2:91
4119 #, no-wrap
4120 msgid "B<SEEK_DATA>"
4121 msgstr ""
4122
4123 #. type: Plain text
4124 #: build/C/man2/lseek.2:102
4125 msgid ""
4126 "Adjust the file offset to the next location in the file greater than or "
4127 "equal to I<offset> containing data.  If I<offset> points to data, then the "
4128 "file offset is set to I<offset>."
4129 msgstr ""
4130
4131 #. type: TP
4132 #: build/C/man2/lseek.2:102
4133 #, no-wrap
4134 msgid "B<SEEK_HOLE>"
4135 msgstr ""
4136
4137 #. type: Plain text
4138 #: build/C/man2/lseek.2:116
4139 msgid ""
4140 "Adjust the file offset to the next hole in the file greater than or equal to "
4141 "I<offset>.  If I<offset> points into the middle of a hole, then the file "
4142 "offset is set to I<offset>.  If there is no hole past I<offset>, then the "
4143 "file offset is adjusted to the end of the file (i.e., there is an implicit "
4144 "hole at the end of any file)."
4145 msgstr ""
4146
4147 #. type: Plain text
4148 #: build/C/man2/lseek.2:122
4149 msgid ""
4150 "In both of the above cases, B<lseek>()  fails if I<offset> points past the "
4151 "end of the file."
4152 msgstr ""
4153
4154 #. type: Plain text
4155 #: build/C/man2/lseek.2:128
4156 msgid ""
4157 "These operations allow applications to map holes in a sparsely allocated "
4158 "file.  This can be useful for applications such as file backup tools, which "
4159 "can save space when creating backups and preserve holes, if they have a "
4160 "mechanism for discovering holes."
4161 msgstr ""
4162
4163 #.  https://lkml.org/lkml/2011/4/22/79
4164 #.  http://lwn.net/Articles/440255/
4165 #.  http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
4166 #. type: Plain text
4167 #: build/C/man2/lseek.2:151
4168 msgid ""
4169 "For the purposes of these operations, a hole is a sequence of zeros that "
4170 "(normally) has not been allocated in the underlying file storage.  However, "
4171 "a file system is not obliged to report holes, so these operations are not a "
4172 "guaranteed mechanism for mapping the storage space actually allocated to a "
4173 "file.  (Furthermore, a sequence of zeros that actually has been written to "
4174 "the underlying storage may not be reported as a hole.)  In the simplest "
4175 "implementation, a file system can support the operations by making "
4176 "B<SEEK_HOLE> always return the offset of the end of the file, and making "
4177 "B<SEEK_DATA> always return I<offset> (i.e., even if the location referred to "
4178 "by I<offset> is a hole, it can be considered to consist of data that is a "
4179 "sequence of zeros)."
4180 msgstr ""
4181
4182 #. type: Plain text
4183 #: build/C/man2/lseek.2:159
4184 msgid ""
4185 "Upon successful completion, B<lseek>()  returns the resulting offset "
4186 "location as measured in bytes from the beginning of the file.  On error, the "
4187 "value I<(off_t)\\ -1> is returned and I<errno> is set to indicate the error."
4188 msgstr ""
4189
4190 #.  Some systems may allow negative offsets for character devices
4191 #.  and/or for remote file systems.
4192 #. type: Plain text
4193 #: build/C/man2/lseek.2:172
4194 msgid ""
4195 "I<whence> is not valid.  Or: the resulting file offset would be negative, or "
4196 "beyond the end of a seekable device."
4197 msgstr ""
4198
4199 #. type: TP
4200 #: build/C/man2/lseek.2:172 build/C/man2/open.2:565
4201 #, no-wrap
4202 msgid "B<EOVERFLOW>"
4203 msgstr ""
4204
4205 #.  HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
4206 #. type: Plain text
4207 #: build/C/man2/lseek.2:177
4208 msgid "The resulting file offset cannot be represented in an I<off_t>."
4209 msgstr ""
4210
4211 #. type: TP
4212 #: build/C/man2/lseek.2:177
4213 #, no-wrap
4214 msgid "B<ESPIPE>"
4215 msgstr ""
4216
4217 #. type: Plain text
4218 #: build/C/man2/lseek.2:181
4219 msgid "I<fd> is associated with a pipe, socket, or FIFO."
4220 msgstr ""
4221
4222 #. type: TP
4223 #: build/C/man2/lseek.2:181 build/C/man2/open.2:559
4224 #, no-wrap
4225 msgid "B<ENXIO>"
4226 msgstr ""
4227
4228 #. type: Plain text
4229 #: build/C/man2/lseek.2:189
4230 msgid ""
4231 "I<whence> is B<SEEK_DATA> or B<SEEK_HOLE>, and the current file offset is "
4232 "beyond the end of the file."
4233 msgstr ""
4234
4235 #.  SVr4 documents additional error
4236 #.  conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE.
4237 #. type: Plain text
4238 #: build/C/man2/lseek.2:191 build/C/man2/read.2:157 build/C/man2/rmdir.2:129 build/C/man2/symlink.2:150 build/C/man2/unlink.2:145 build/C/man2/write.2:183
4239 msgid "SVr4, 4.3BSD, POSIX.1-2001."
4240 msgstr ""
4241
4242 #.  FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
4243 #. type: Plain text
4244 #: build/C/man2/lseek.2:199
4245 msgid ""
4246 "B<SEEK_DATA> and B<SEEK_HOLE> are nonstandard extensions also present in "
4247 "Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the "
4248 "next POSIX revision (Issue 8)."
4249 msgstr ""
4250
4251 #. type: Plain text
4252 #: build/C/man2/lseek.2:203
4253 msgid ""
4254 "Some devices are incapable of seeking and POSIX does not specify which "
4255 "devices must support B<lseek>()."
4256 msgstr ""
4257
4258 #.  Other systems return the number of written characters,
4259 #.  using SEEK_SET to set the counter. (Of written characters.)
4260 #. type: Plain text
4261 #: build/C/man2/lseek.2:210
4262 msgid "On Linux, using B<lseek>()  on a tty device returns B<ESPIPE>."
4263 msgstr ""
4264
4265 #. type: Plain text
4266 #: build/C/man2/lseek.2:213
4267 msgid ""
4268 "When converting old code, substitute values for I<whence> with the following "
4269 "macros:"
4270 msgstr ""
4271
4272 #. type: tbl table
4273 #: build/C/man2/lseek.2:216
4274 #, no-wrap
4275 msgid "old\tnew\n"
4276 msgstr ""
4277
4278 #. type: tbl table
4279 #: build/C/man2/lseek.2:217
4280 #, no-wrap
4281 msgid "0\tSEEK_SET\n"
4282 msgstr ""
4283
4284 #. type: tbl table
4285 #: build/C/man2/lseek.2:218
4286 #, no-wrap
4287 msgid "1\tSEEK_CUR\n"
4288 msgstr ""
4289
4290 #. type: tbl table
4291 #: build/C/man2/lseek.2:219
4292 #, no-wrap
4293 msgid "2\tSEEK_END\n"
4294 msgstr ""
4295
4296 #. type: tbl table
4297 #: build/C/man2/lseek.2:220
4298 #, no-wrap
4299 msgid "L_SET\tSEEK_SET\n"
4300 msgstr ""
4301
4302 #. type: tbl table
4303 #: build/C/man2/lseek.2:221
4304 #, no-wrap
4305 msgid "L_INCR\tSEEK_CUR\n"
4306 msgstr ""
4307
4308 #. type: tbl table
4309 #: build/C/man2/lseek.2:222
4310 #, no-wrap
4311 msgid "L_XTND\tSEEK_END\n"
4312 msgstr ""
4313
4314 #. type: Plain text
4315 #: build/C/man2/lseek.2:234
4316 msgid ""
4317 "Note that file descriptors created by B<dup>(2)  or B<fork>(2)  share the "
4318 "current file position pointer, so seeking on such files may be subject to "
4319 "race conditions."
4320 msgstr ""
4321
4322 #. type: Plain text
4323 #: build/C/man2/lseek.2:240
4324 msgid ""
4325 "B<dup>(2), B<fork>(2), B<open>(2), B<fseek>(3), B<lseek64>(3), "
4326 "B<posix_fallocate>(3)"
4327 msgstr ""
4328
4329 #. type: TH
4330 #: build/C/man3/lseek64.3:23
4331 #, no-wrap
4332 msgid "LSEEK64"
4333 msgstr ""
4334
4335 #. type: TH
4336 #: build/C/man3/lseek64.3:23
4337 #, no-wrap
4338 msgid "2004-12-11"
4339 msgstr ""
4340
4341 #. type: Plain text
4342 #: build/C/man3/lseek64.3:26
4343 msgid "lseek64 - reposition 64-bit read/write file offset"
4344 msgstr ""
4345
4346 #. type: Plain text
4347 #: build/C/man3/lseek64.3:28
4348 msgid "B<#define _LARGEFILE64_SOURCE> /* See feature_test_macros(7) */"
4349 msgstr ""
4350
4351 #. type: Plain text
4352 #: build/C/man3/lseek64.3:34
4353 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>"
4354 msgstr ""
4355
4356 #. type: Plain text
4357 #: build/C/man3/lseek64.3:51
4358 msgid ""
4359 "The B<lseek>(2)  family of functions reposition the offset of the open file "
4360 "associated with the file descriptor I<fd> to I<offset> bytes relative to the "
4361 "start, current position, or end of the file, when I<whence> has the value "
4362 "B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively."
4363 msgstr ""
4364
4365 #. type: Plain text
4366 #: build/C/man3/lseek64.3:54
4367 msgid "For more details, return value, and errors, see B<lseek>(2)."
4368 msgstr ""
4369
4370 #. type: Plain text
4371 #: build/C/man3/lseek64.3:61
4372 msgid ""
4373 "Four interfaces are available: B<lseek>(2), B<lseek64>(), B<llseek>(2), and "
4374 "the raw system call B<_llseek>(2)."
4375 msgstr ""
4376
4377 #. type: SS
4378 #: build/C/man3/lseek64.3:61
4379 #, no-wrap
4380 msgid "lseek"
4381 msgstr ""
4382
4383 #. type: Plain text
4384 #: build/C/man3/lseek64.3:63 build/C/man3/lseek64.3:85 build/C/man3/lseek64.3:114
4385 msgid "Prototype:"
4386 msgstr ""
4387
4388 #. type: Plain text
4389 #: build/C/man3/lseek64.3:67
4390 #, no-wrap
4391 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
4392 msgstr ""
4393
4394 #. type: Plain text
4395 #: build/C/man3/lseek64.3:75
4396 msgid ""
4397 "B<lseek>(2)  uses the type I<off_t>.  This is a 32-bit signed type on 32-bit "
4398 "architectures, unless one compiles with"
4399 msgstr ""
4400
4401 #. type: Plain text
4402 #: build/C/man3/lseek64.3:83
4403 msgid "in which case it is a 64-bit signed type."
4404 msgstr ""
4405
4406 #. type: SS
4407 #: build/C/man3/lseek64.3:83
4408 #, no-wrap
4409 msgid "lseek64"
4410 msgstr ""
4411
4412 #. type: Plain text
4413 #: build/C/man3/lseek64.3:89
4414 #, no-wrap
4415 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>\n"
4416 msgstr ""
4417
4418 #. type: Plain text
4419 #: build/C/man3/lseek64.3:100
4420 msgid ""
4421 "The library routine B<lseek64>()  uses a 64-bit type even when I<off_t> is a "
4422 "32-bit type.  Its prototype (and the type I<off64_t>)  is available only "
4423 "when one compiles with"
4424 msgstr ""
4425
4426 #. type: Plain text
4427 #: build/C/man3/lseek64.3:104
4428 #, no-wrap
4429 msgid "#define _LARGEFILE64_SOURCE\n"
4430 msgstr ""
4431
4432 #.  in glibc 2.0.94, not in 2.0.6
4433 #. type: Plain text
4434 #: build/C/man3/lseek64.3:112
4435 msgid ""
4436 "The function B<lseek64>()  is available since glibc 2.1, and is defined to "
4437 "be an alias for B<llseek>()."
4438 msgstr ""
4439
4440 #. type: SS
4441 #: build/C/man3/lseek64.3:112
4442 #, no-wrap
4443 msgid "llseek"
4444 msgstr ""
4445
4446 #. type: Plain text
4447 #: build/C/man3/lseek64.3:118
4448 #, no-wrap
4449 msgid "B<loff_t llseek(int >I<fd>B<, loff_t >I<offset>B<, int >I<whence>B<);>\n"
4450 msgstr ""
4451
4452 #.  in libc 5.0.9, not in 4.7.6
4453 #. type: Plain text
4454 #: build/C/man3/lseek64.3:137
4455 msgid ""
4456 "The type I<loff_t> is a 64-bit signed type.  The library routine B<llseek>()  "
4457 "is available in libc5 and glibc and works without special defines.  Its "
4458 "prototype was given in I<E<lt>unistd.hE<gt>> with libc5, but glibc does not "
4459 "provide a prototype.  This is bad, since a prototype is needed.  Users "
4460 "should add the above prototype, or something equivalent, to their own "
4461 "source.  When users complained about data loss caused by a miscompilation of "
4462 "B<e2fsck>(8), glibc 2.1.3 added the link-time warning"
4463 msgstr ""
4464
4465 #. type: Plain text
4466 #: build/C/man3/lseek64.3:140
4467 msgid "the \\`llseek\\' function may be dangerous; use \\`lseek64\\' instead."
4468 msgstr ""
4469
4470 #. type: Plain text
4471 #: build/C/man3/lseek64.3:144
4472 msgid "This makes this function unusable if one desires a warning-free compilation."
4473 msgstr ""
4474
4475 #. type: SS
4476 #: build/C/man3/lseek64.3:144
4477 #, no-wrap
4478 msgid "_llseek"
4479 msgstr ""
4480
4481 #. type: Plain text
4482 #: build/C/man3/lseek64.3:147
4483 msgid ""
4484 "All the above functions are implemented in terms of this system call.  The "
4485 "prototype is:"
4486 msgstr ""
4487
4488 #. type: Plain text
4489 #: build/C/man3/lseek64.3:152
4490 #, no-wrap
4491 msgid ""
4492 "B<int _llseek(int >I<fd>B<, off_t >I<offset_hi>B<, off_t >I<offset_lo>B<,>\n"
4493 "B<            loff_t *>I<result>B<, int >I<whence>B<);>\n"
4494 msgstr ""
4495
4496 #. type: Plain text
4497 #: build/C/man3/lseek64.3:157
4498 msgid "For more details, see B<llseek>(2)."
4499 msgstr ""
4500
4501 #. type: Plain text
4502 #: build/C/man3/lseek64.3:159
4503 msgid "B<llseek>(2), B<lseek>(2)"
4504 msgstr ""
4505
4506 #. type: TH
4507 #: build/C/man2/open.2:52
4508 #, no-wrap
4509 msgid "OPEN"
4510 msgstr ""
4511
4512 #. type: TH
4513 #: build/C/man2/open.2:52
4514 #, no-wrap
4515 msgid "2012-02-27"
4516 msgstr ""
4517
4518 #. type: Plain text
4519 #: build/C/man2/open.2:55
4520 msgid "open, creat - open and possibly create a file or device"
4521 msgstr ""
4522
4523 #. type: Plain text
4524 #: build/C/man2/open.2:60
4525 #, no-wrap
4526 msgid ""
4527 "B<#include E<lt>sys/types.hE<gt>>\n"
4528 "B<#include E<lt>sys/stat.hE<gt>>\n"
4529 "B<#include E<lt>fcntl.hE<gt>>\n"
4530 msgstr ""
4531
4532 #. type: Plain text
4533 #: build/C/man2/open.2:63
4534 #, no-wrap
4535 msgid ""
4536 "B<int open(const char *>I<pathname>B<, int >I<flags>B<);>\n"
4537 "B<int open(const char *>I<pathname>B<, int >I<flags>B<, mode_t "
4538 ">I<mode>B<);>\n"
4539 msgstr ""
4540
4541 #. type: Plain text
4542 #: build/C/man2/open.2:65
4543 #, no-wrap
4544 msgid "B<int creat(const char *>I<pathname>B<, mode_t >I<mode>B<);>\n"
4545 msgstr ""
4546
4547 #. type: Plain text
4548 #: build/C/man2/open.2:76
4549 msgid ""
4550 "Given a I<pathname> for a file, B<open>()  returns a file descriptor, a "
4551 "small, nonnegative integer for use in subsequent system calls (B<read>(2), "
4552 "B<write>(2), B<lseek>(2), B<fcntl>(2), etc.).  The file descriptor returned "
4553 "by a successful call will be the lowest-numbered file descriptor not "
4554 "currently open for the process."
4555 msgstr ""
4556
4557 #. type: Plain text
4558 #: build/C/man2/open.2:88
4559 msgid ""
4560 "By default, the new file descriptor is set to remain open across an "
4561 "B<execve>(2)  (i.e., the B<FD_CLOEXEC> file descriptor flag described in "
4562 "B<fcntl>(2)  is initially disabled; the B<O_CLOEXEC> flag, described below, "
4563 "can be used to change this default).  The file offset is set to the "
4564 "beginning of the file (see B<lseek>(2))."
4565 msgstr ""
4566
4567 #. type: Plain text
4568 #: build/C/man2/open.2:107
4569 msgid ""
4570 "A call to B<open>()  creates a new I<open file description>, an entry in the "
4571 "system-wide table of open files.  This entry records the file offset and the "
4572 "file status flags (modifiable via the B<fcntl>(2)  B<F_SETFL> operation).  A "
4573 "file descriptor is a reference to one of these entries; this reference is "
4574 "unaffected if I<pathname> is subsequently removed or modified to refer to a "
4575 "different file.  The new open file description is initially not shared with "
4576 "any other process, but sharing may arise via B<fork>(2)."
4577 msgstr ""
4578
4579 #. type: Plain text
4580 #: build/C/man2/open.2:115
4581 msgid ""
4582 "The argument I<flags> must include one of the following I<access modes>: "
4583 "B<O_RDONLY>, B<O_WRONLY>, or B<O_RDWR>.  These request opening the file "
4584 "read-only, write-only, or read/write, respectively."
4585 msgstr ""
4586
4587 #.  FIXME . Actually is it true that the "file status flags" are all of the
4588 #.  remaining flags listed below?  SUSv4 divides the flags into:
4589 #.  * Access mode
4590 #.  * File creation
4591 #.  * File status
4592 #.  * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW)
4593 #.  though it's not clear what the difference between "other" and
4594 #.  "File creation" flags is.  (I've raised an Aardvark to see if this
4595 #.  can be clarified in SUSv4; 10 Oct 2008.)
4596 #. type: Plain text
4597 #: build/C/man2/open.2:142
4598 msgid ""
4599 "In addition, zero or more file creation flags and file status flags can be "
4600 "bitwise-I<or>'d in I<flags>.  The I<file creation flags> are B<O_CREAT>, "
4601 "B<O_EXCL>, B<O_NOCTTY>, and B<O_TRUNC>.  The I<file status flags> are all of "
4602 "the remaining flags listed below.  The distinction between these two groups "
4603 "of flags is that the file status flags can be retrieved and (in some cases)  "
4604 "modified using B<fcntl>(2).  The full list of file creation flags and file "
4605 "status flags is as follows:"
4606 msgstr ""
4607
4608 #. type: TP
4609 #: build/C/man2/open.2:142
4610 #, no-wrap
4611 msgid "B<O_APPEND>"
4612 msgstr ""
4613
4614 #.  For more background, see
4615 #.  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946
4616 #.  http://nfs.sourceforge.net/
4617 #. type: Plain text
4618 #: build/C/man2/open.2:159
4619 msgid ""
4620 "The file is opened in append mode.  Before each B<write>(2), the file offset "
4621 "is positioned at the end of the file, as if with B<lseek>(2).  B<O_APPEND> "
4622 "may lead to corrupted files on NFS file systems if more than one process "
4623 "appends data to a file at once.  This is because NFS does not support "
4624 "appending to a file, so the client kernel has to simulate it, which can't be "
4625 "done without a race condition."
4626 msgstr ""
4627
4628 #. type: TP
4629 #: build/C/man2/open.2:159
4630 #, no-wrap
4631 msgid "B<O_ASYNC>"
4632 msgstr ""
4633
4634 #. type: Plain text
4635 #: build/C/man2/open.2:172
4636 msgid ""
4637 "Enable signal-driven I/O: generate a signal (B<SIGIO> by default, but this "
4638 "can be changed via B<fcntl>(2))  when input or output becomes possible on "
4639 "this file descriptor.  This feature is only available for terminals, "
4640 "pseudoterminals, sockets, and (since Linux 2.6) pipes and FIFOs.  See "
4641 "B<fcntl>(2)  for further details."
4642 msgstr ""
4643
4644 #. type: TP
4645 #: build/C/man2/open.2:172
4646 #, no-wrap
4647 msgid "B<O_CLOEXEC> (Since Linux 2.6.23)"
4648 msgstr ""
4649
4650 #.  This flag fixes only one form of the race condition;
4651 #.  The race can also occur with, for example, descriptors
4652 #.  returned by accept(), pipe(), etc.
4653 #. type: Plain text
4654 #: build/C/man2/open.2:197
4655 msgid ""
4656 "Enable the close-on-exec flag for the new file descriptor.  Specifying this "
4657 "flag permits a program to avoid additional B<fcntl>(2)  B<F_SETFD> "
4658 "operations to set the B<FD_CLOEXEC> flag.  Additionally, use of this flag is "
4659 "essential in some multithreaded programs since using a separate B<fcntl>(2)  "
4660 "B<F_SETFD> operation to set the B<FD_CLOEXEC> flag does not suffice to avoid "
4661 "race conditions where one thread opens a file descriptor at the same time as "
4662 "another thread does a B<fork>(2)  plus B<execve>(2)."
4663 msgstr ""
4664
4665 #. type: TP
4666 #: build/C/man2/open.2:197
4667 #, no-wrap
4668 msgid "B<O_CREAT>"
4669 msgstr ""
4670
4671 #.  As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
4672 #.  XFS (since 2.6.14).
4673 #. type: Plain text
4674 #: build/C/man2/open.2:213
4675 msgid ""
4676 "If the file does not exist it will be created.  The owner (user ID) of the "
4677 "file is set to the effective user ID of the process.  The group ownership "
4678 "(group ID) is set either to the effective group ID of the process or to the "
4679 "group ID of the parent directory (depending on file system type and mount "
4680 "options, and the mode of the parent directory, see the mount options "
4681 "I<bsdgroups> and I<sysvgroups> described in B<mount>(8))."
4682 msgstr ""
4683
4684 #. type: Plain text
4685 #: build/C/man2/open.2:236
4686 msgid ""
4687 "I<mode> specifies the permissions to use in case a new file is created.  "
4688 "This argument must be supplied when B<O_CREAT> is specified in I<flags>; if "
4689 "B<O_CREAT> is not specified, then I<mode> is ignored.  The effective "
4690 "permissions are modified by the process's I<umask> in the usual way: The "
4691 "permissions of the created file are I<(mode\\ &\\ ~umask)>.  Note that this "
4692 "mode only applies to future accesses of the newly created file; the "
4693 "B<open>()  call that creates a read-only file may well return a read/write "
4694 "file descriptor."
4695 msgstr ""
4696
4697 #. type: Plain text
4698 #: build/C/man2/open.2:239
4699 msgid "The following symbolic constants are provided for I<mode>:"
4700 msgstr ""
4701
4702 #. type: TP
4703 #: build/C/man2/open.2:239
4704 #, no-wrap
4705 msgid "B<S_IRWXU>"
4706 msgstr ""
4707
4708 #. type: Plain text
4709 #: build/C/man2/open.2:242
4710 msgid "00700 user (file owner) has read, write and execute permission"
4711 msgstr ""
4712
4713 #. type: TP
4714 #: build/C/man2/open.2:242
4715 #, no-wrap
4716 msgid "B<S_IRUSR>"
4717 msgstr ""
4718
4719 #. type: Plain text
4720 #: build/C/man2/open.2:245
4721 msgid "00400 user has read permission"
4722 msgstr ""
4723
4724 #. type: TP
4725 #: build/C/man2/open.2:245
4726 #, no-wrap
4727 msgid "B<S_IWUSR>"
4728 msgstr ""
4729
4730 #. type: Plain text
4731 #: build/C/man2/open.2:248
4732 msgid "00200 user has write permission"
4733 msgstr ""
4734
4735 #. type: TP
4736 #: build/C/man2/open.2:248
4737 #, no-wrap
4738 msgid "B<S_IXUSR>"
4739 msgstr ""
4740
4741 #. type: Plain text
4742 #: build/C/man2/open.2:251
4743 msgid "00100 user has execute permission"
4744 msgstr ""
4745
4746 #. type: TP
4747 #: build/C/man2/open.2:251
4748 #, no-wrap
4749 msgid "B<S_IRWXG>"
4750 msgstr ""
4751
4752 #. type: Plain text
4753 #: build/C/man2/open.2:254
4754 msgid "00070 group has read, write and execute permission"
4755 msgstr ""
4756
4757 #. type: TP
4758 #: build/C/man2/open.2:254
4759 #, no-wrap
4760 msgid "B<S_IRGRP>"
4761 msgstr ""
4762
4763 #. type: Plain text
4764 #: build/C/man2/open.2:257
4765 msgid "00040 group has read permission"
4766 msgstr ""
4767
4768 #. type: TP
4769 #: build/C/man2/open.2:257
4770 #, no-wrap
4771 msgid "B<S_IWGRP>"
4772 msgstr ""
4773
4774 #. type: Plain text
4775 #: build/C/man2/open.2:260
4776 msgid "00020 group has write permission"
4777 msgstr ""
4778
4779 #. type: TP
4780 #: build/C/man2/open.2:260
4781 #, no-wrap
4782 msgid "B<S_IXGRP>"
4783 msgstr ""
4784
4785 #. type: Plain text
4786 #: build/C/man2/open.2:263
4787 msgid "00010 group has execute permission"
4788 msgstr ""
4789
4790 #. type: TP
4791 #: build/C/man2/open.2:263
4792 #, no-wrap
4793 msgid "B<S_IRWXO>"
4794 msgstr ""
4795
4796 #. type: Plain text
4797 #: build/C/man2/open.2:266
4798 msgid "00007 others have read, write and execute permission"
4799 msgstr ""
4800
4801 #. type: TP
4802 #: build/C/man2/open.2:266
4803 #, no-wrap
4804 msgid "B<S_IROTH>"
4805 msgstr ""
4806
4807 #. type: Plain text
4808 #: build/C/man2/open.2:269
4809 msgid "00004 others have read permission"
4810 msgstr ""
4811
4812 #. type: TP
4813 #: build/C/man2/open.2:269
4814 #, no-wrap
4815 msgid "B<S_IWOTH>"
4816 msgstr ""
4817
4818 #. type: Plain text
4819 #: build/C/man2/open.2:272
4820 msgid "00002 others have write permission"
4821 msgstr ""
4822
4823 #. type: TP
4824 #: build/C/man2/open.2:272
4825 #, no-wrap
4826 msgid "B<S_IXOTH>"
4827 msgstr ""
4828
4829 #. type: Plain text
4830 #: build/C/man2/open.2:275
4831 msgid "00001 others have execute permission"
4832 msgstr ""
4833
4834 #. type: TP
4835 #: build/C/man2/open.2:276
4836 #, no-wrap
4837 msgid "B<O_DIRECT> (Since Linux 2.4.10)"
4838 msgstr ""
4839
4840 #. type: Plain text
4841 #: build/C/man2/open.2:293
4842 msgid ""
4843 "Try to minimize cache effects of the I/O to and from this file.  In general "
4844 "this will degrade performance, but it is useful in special situations, such "
4845 "as when applications do their own caching.  File I/O is done directly "
4846 "to/from user space buffers.  The B<O_DIRECT> flag on its own makes an effort "
4847 "to transfer data synchronously, but does not give the guarantees of the "
4848 "B<O_SYNC> flag that data and necessary metadata are transferred.  To "
4849 "guarantee synchronous I/O, B<O_SYNC> must be used in addition to "
4850 "B<O_DIRECT>.  See NOTES below for further discussion."
4851 msgstr ""
4852
4853 #. type: Plain text
4854 #: build/C/man2/open.2:297
4855 msgid ""
4856 "A semantically similar (but deprecated) interface for block devices is "
4857 "described in B<raw>(8)."
4858 msgstr ""
4859
4860 #. type: TP
4861 #: build/C/man2/open.2:297
4862 #, no-wrap
4863 msgid "B<O_DIRECTORY>"
4864 msgstr ""
4865
4866 #.  But see the following and its replies:
4867 #.  http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2
4868 #.  [PATCH] open: O_DIRECTORY and O_CREAT together should fail
4869 #.  O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored.
4870 #. type: Plain text
4871 #: build/C/man2/open.2:311
4872 msgid ""
4873 "If I<pathname> is not a directory, cause the open to fail.  This flag is "
4874 "Linux-specific, and was added in kernel version 2.1.126, to avoid "
4875 "denial-of-service problems if B<opendir>(3)  is called on a FIFO or tape "
4876 "device, but should not be used outside of the implementation of "
4877 "B<opendir>(3)."
4878 msgstr ""
4879
4880 #. type: TP
4881 #: build/C/man2/open.2:311
4882 #, no-wrap
4883 msgid "B<O_EXCL>"
4884 msgstr ""
4885
4886 #. type: Plain text
4887 #: build/C/man2/open.2:321
4888 msgid ""
4889 "Ensure that this call creates the file: if this flag is specified in "
4890 "conjunction with B<O_CREAT>, and I<pathname> already exists, then B<open>()  "
4891 "will fail."
4892 msgstr ""
4893
4894 #.  POSIX.1-2001 explicitly requires this behavior.
4895 #. type: Plain text
4896 #: build/C/man2/open.2:329
4897 msgid ""
4898 "When these two flags are specified, symbolic links are not followed: if "
4899 "I<pathname> is a symbolic link, then B<open>()  fails regardless of where "
4900 "the symbolic link points to."
4901 msgstr ""
4902
4903 #. type: Plain text
4904 #: build/C/man2/open.2:345
4905 msgid ""
4906 "In general, the behavior of B<O_EXCL> is undefined if it is used without "
4907 "B<O_CREAT>.  There is one exception: on Linux 2.6 and later, B<O_EXCL> can "
4908 "be used without B<O_CREAT> if I<pathname> refers to a block device.  If the "
4909 "block device is in use by the system (e.g., mounted), B<open>()  fails with "
4910 "the error B<EBUSY>."
4911 msgstr ""
4912
4913 #. type: Plain text
4914 #: build/C/man2/open.2:367
4915 msgid ""
4916 "On NFS, B<O_EXCL> is only supported when using NFSv3 or later on kernel 2.6 "
4917 "or later.  In NFS environments where B<O_EXCL> support is not provided, "
4918 "programs that rely on it for performing locking tasks will contain a race "
4919 "condition.  Portable programs that want to perform atomic file locking using "
4920 "a lockfile, and need to avoid reliance on NFS support for B<O_EXCL>, can "
4921 "create a unique file on the same file system (e.g., incorporating hostname "
4922 "and PID), and use B<link>(2)  to make a link to the lockfile.  If B<link>(2)  "
4923 "returns 0, the lock is successful.  Otherwise, use B<stat>(2)  on the unique "
4924 "file to check if its link count has increased to 2, in which case the lock "
4925 "is also successful."
4926 msgstr ""
4927
4928 #. type: TP
4929 #: build/C/man2/open.2:367
4930 #, no-wrap
4931 msgid "B<O_LARGEFILE>"
4932 msgstr ""
4933
4934 #. type: Plain text
4935 #: build/C/man2/open.2:389
4936 msgid ""
4937 "(LFS)  Allow files whose sizes cannot be represented in an I<off_t> (but can "
4938 "be represented in an I<off64_t>)  to be opened.  The B<_LARGEFILE64_SOURCE> "
4939 "macro must be defined (before including I<any> header files)  in order to "
4940 "obtain this definition.  Setting the B<_FILE_OFFSET_BITS> feature test macro "
4941 "to 64 (rather than using B<O_LARGEFILE>)  is the preferred method of "
4942 "accessing large files on 32-bit systems (see B<feature_test_macros>(7))."
4943 msgstr ""
4944
4945 #. type: TP
4946 #: build/C/man2/open.2:389
4947 #, no-wrap
4948 msgid "B<O_NOATIME> (Since Linux 2.6.8)"
4949 msgstr ""
4950
4951 #.  The O_NOATIME flag also affects the treatment of st_atime
4952 #.  by mmap() and readdir(2), MTK, Dec 04.
4953 #. type: Plain text
4954 #: build/C/man2/open.2:400
4955 msgid ""
4956 "Do not update the file last access time (st_atime in the inode)  when the "
4957 "file is B<read>(2).  This flag is intended for use by indexing or backup "
4958 "programs, where its use can significantly reduce the amount of disk "
4959 "activity.  This flag may not be effective on all file systems.  One example "
4960 "is NFS, where the server maintains the access time."
4961 msgstr ""
4962
4963 #. type: TP
4964 #: build/C/man2/open.2:400
4965 #, no-wrap
4966 msgid "B<O_NOCTTY>"
4967 msgstr ""
4968
4969 #. type: Plain text
4970 #: build/C/man2/open.2:408
4971 msgid ""
4972 "If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(em it will "
4973 "not become the process's controlling terminal even if the process does not "
4974 "have one."
4975 msgstr ""
4976
4977 #. type: TP
4978 #: build/C/man2/open.2:408
4979 #, no-wrap
4980 msgid "B<O_NOFOLLOW>"
4981 msgstr ""
4982
4983 #.  The headers from glibc 2.0.100 and later include a
4984 #.  definition of this flag; \fIkernels before 2.1.126 will ignore it if
4985 #.  used\fP.
4986 #. type: Plain text
4987 #: build/C/man2/open.2:417
4988 msgid ""
4989 "If I<pathname> is a symbolic link, then the open fails.  This is a FreeBSD "
4990 "extension, which was added to Linux in version 2.1.126.  Symbolic links in "
4991 "earlier components of the pathname will still be followed."
4992 msgstr ""
4993
4994 #. type: TP
4995 #: build/C/man2/open.2:417
4996 #, no-wrap
4997 msgid "B<O_NONBLOCK> or B<O_NDELAY>"
4998 msgstr ""
4999
5000 #. type: Plain text
5001 #: build/C/man2/open.2:430
5002 msgid ""
5003 "When possible, the file is opened in nonblocking mode.  Neither the "
5004 "B<open>()  nor any subsequent operations on the file descriptor which is "
5005 "returned will cause the calling process to wait.  For the handling of FIFOs "
5006 "(named pipes), see also B<fifo>(7).  For a discussion of the effect of "
5007 "B<O_NONBLOCK> in conjunction with mandatory file locks and with file leases, "
5008 "see B<fcntl>(2)."
5009 msgstr ""
5010
5011 #. type: TP
5012 #: build/C/man2/open.2:430
5013 #, no-wrap
5014 msgid "B<O_SYNC>"
5015 msgstr ""
5016
5017 #. type: Plain text
5018 #: build/C/man2/open.2:438
5019 msgid ""
5020 "The file is opened for synchronous I/O.  Any B<write>(2)s on the resulting "
5021 "file descriptor will block the calling process until the data has been "
5022 "physically written to the underlying hardware.  I<But see NOTES below>."
5023 msgstr ""
5024
5025 #. type: TP
5026 #: build/C/man2/open.2:438
5027 #, no-wrap
5028 msgid "B<O_TRUNC>"
5029 msgstr ""
5030
5031 #. type: Plain text
5032 #: build/C/man2/open.2:452
5033 msgid ""
5034 "If the file already exists and is a regular file and the open mode allows "
5035 "writing (i.e., is B<O_RDWR> or B<O_WRONLY>)  it will be truncated to length "
5036 "0.  If the file is a FIFO or terminal device file, the B<O_TRUNC> flag is "
5037 "ignored.  Otherwise the effect of B<O_TRUNC> is unspecified."
5038 msgstr ""
5039
5040 #. type: Plain text
5041 #: build/C/man2/open.2:456
5042 msgid ""
5043 "Some of these optional flags can be altered using B<fcntl>(2)  after the "
5044 "file has been opened."
5045 msgstr ""
5046
5047 #. type: Plain text
5048 #: build/C/man2/open.2:464
5049 msgid ""
5050 "B<creat>()  is equivalent to B<open>()  with I<flags> equal to "
5051 "B<O_CREAT|O_WRONLY|O_TRUNC>."
5052 msgstr ""
5053
5054 #. type: Plain text
5055 #: build/C/man2/open.2:472
5056 msgid ""
5057 "B<open>()  and B<creat>()  return the new file descriptor, or -1 if an error "
5058 "occurred (in which case, I<errno> is set appropriately)."
5059 msgstr ""
5060
5061 #. type: Plain text
5062 #: build/C/man2/open.2:482
5063 msgid ""
5064 "The requested access to the file is not allowed, or search permission is "
5065 "denied for one of the directories in the path prefix of I<pathname>, or the "
5066 "file did not exist yet and write access to the parent directory is not "
5067 "allowed.  (See also B<path_resolution>(7).)"
5068 msgstr ""
5069
5070 #. type: Plain text
5071 #: build/C/man2/open.2:488
5072 msgid "I<pathname> already exists and B<O_CREAT> and B<O_EXCL> were used."
5073 msgstr ""
5074
5075 #. type: Plain text
5076 #: build/C/man2/open.2:492 build/C/man2/rmdir.2:67 build/C/man2/unlink.2:84
5077 msgid "I<pathname> points outside your accessible address space."
5078 msgstr ""
5079
5080 #. type: TP
5081 #: build/C/man2/open.2:492 build/C/man2/write.2:139
5082 #, no-wrap
5083 msgid "B<EFBIG>"
5084 msgstr ""
5085
5086 #. type: Plain text
5087 #: build/C/man2/open.2:496
5088 msgid "See B<EOVERFLOW>."
5089 msgstr ""
5090
5091 #. type: TP
5092 #: build/C/man2/open.2:496 build/C/man2/read.2:104 build/C/man3/scanf.3:559 build/C/man3/tmpfile.3:59 build/C/man2/write.2:144
5093 #, no-wrap
5094 msgid "B<EINTR>"
5095 msgstr ""
5096
5097 #. type: Plain text
5098 #: build/C/man2/open.2:503
5099 msgid ""
5100 "While blocked waiting to complete an open of a slow device (e.g., a FIFO; "
5101 "see B<fifo>(7)), the call was interrupted by a signal handler; see "
5102 "B<signal>(7)."
5103 msgstr ""
5104
5105 #. type: TP
5106 #: build/C/man2/open.2:503 build/C/man2/read.2:140 build/C/man2/rename.2:140 build/C/man2/unlink.2:87
5107 #, no-wrap
5108 msgid "B<EISDIR>"
5109 msgstr ""
5110
5111 #. type: Plain text
5112 #: build/C/man2/open.2:512
5113 msgid ""
5114 "I<pathname> refers to a directory and the access requested involved writing "
5115 "(that is, B<O_WRONLY> or B<O_RDWR> is set)."
5116 msgstr ""
5117
5118 #. type: Plain text
5119 #: build/C/man2/open.2:519
5120 msgid ""
5121 "Too many symbolic links were encountered in resolving I<pathname>, or "
5122 "B<O_NOFOLLOW> was specified but I<pathname> was a symbolic link."
5123 msgstr ""
5124
5125 #. type: TP
5126 #: build/C/man2/open.2:519 build/C/man2/pipe.2:107 build/C/man3/tmpfile.3:62
5127 #, no-wrap
5128 msgid "B<EMFILE>"
5129 msgstr ""
5130
5131 #. type: Plain text
5132 #: build/C/man2/open.2:522
5133 msgid "The process already has the maximum number of files open."
5134 msgstr ""
5135
5136 #. type: Plain text
5137 #: build/C/man2/open.2:526 build/C/man2/rmdir.2:80 build/C/man2/unlink.2:99
5138 msgid "I<pathname> was too long."
5139 msgstr ""
5140
5141 #. type: TP
5142 #: build/C/man2/open.2:526 build/C/man2/pipe.2:110 build/C/man3/tmpfile.3:65
5143 #, no-wrap
5144 msgid "B<ENFILE>"
5145 msgstr ""
5146
5147 #. type: Plain text
5148 #: build/C/man2/open.2:529 build/C/man2/pipe.2:113
5149 msgid "The system limit on the total number of open files has been reached."
5150 msgstr ""
5151
5152 #. type: TP
5153 #: build/C/man2/open.2:529
5154 #, no-wrap
5155 msgid "B<ENODEV>"
5156 msgstr ""
5157
5158 #. type: Plain text
5159 #: build/C/man2/open.2:536
5160 msgid ""
5161 "I<pathname> refers to a device special file and no corresponding device "
5162 "exists.  (This is a Linux kernel bug; in this situation B<ENXIO> must be "
5163 "returned.)"
5164 msgstr ""
5165
5166 #. type: Plain text
5167 #: build/C/man2/open.2:543
5168 msgid ""
5169 "B<O_CREAT> is not set and the named file does not exist.  Or, a directory "
5170 "component in I<pathname> does not exist or is a dangling symbolic link."
5171 msgstr ""
5172
5173 #. type: Plain text
5174 #: build/C/man2/open.2:552
5175 msgid ""
5176 "I<pathname> was to be created but the device containing I<pathname> has no "
5177 "room for the new file."
5178 msgstr ""
5179
5180 #. type: Plain text
5181 #: build/C/man2/open.2:559
5182 msgid ""
5183 "A component used as a directory in I<pathname> is not, in fact, a directory, "
5184 "or B<O_DIRECTORY> was specified and I<pathname> was not a directory."
5185 msgstr ""
5186
5187 #. type: Plain text
5188 #: build/C/man2/open.2:565
5189 msgid ""
5190 "B<O_NONBLOCK> | B<O_WRONLY> is set, the named file is a FIFO and no process "
5191 "has the file open for reading.  Or, the file is a device special file and no "
5192 "corresponding device exists."
5193 msgstr ""
5194
5195 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=7253
5196 #.  "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW"
5197 #.  Reported 2006-10-03
5198 #. type: Plain text
5199 #: build/C/man2/open.2:585
5200 msgid ""
5201 "I<pathname> refers to a regular file that is too large to be opened.  The "
5202 "usual scenario here is that an application compiled on a 32-bit platform "
5203 "without I<-D_FILE_OFFSET_BITS=64> tried to open a file whose size exceeds "
5204 "I<(2E<lt>E<lt>31)-1> bits; see also B<O_LARGEFILE> above.  This is the error "
5205 "specified by POSIX.1-2001; in kernels before 2.6.24, Linux gave the error "
5206 "B<EFBIG> for this case."
5207 msgstr ""
5208
5209 #.  Strictly speaking, it's the file system UID... (MTK)
5210 #. type: Plain text
5211 #: build/C/man2/open.2:593
5212 msgid ""
5213 "The B<O_NOATIME> flag was specified, but the effective user ID of the caller "
5214 "did not match the owner of the file and the caller was not privileged "
5215 "(B<CAP_FOWNER>)."
5216 msgstr ""
5217
5218 #. type: Plain text
5219 #: build/C/man2/open.2:598
5220 msgid ""
5221 "I<pathname> refers to a file on a read-only file system and write access was "
5222 "requested."
5223 msgstr ""
5224
5225 #. type: TP
5226 #: build/C/man2/open.2:598
5227 #, no-wrap
5228 msgid "B<ETXTBSY>"
5229 msgstr ""
5230
5231 #. type: Plain text
5232 #: build/C/man2/open.2:603
5233 msgid ""
5234 "I<pathname> refers to an executable image which is currently being executed "
5235 "and write access was requested."
5236 msgstr ""
5237
5238 #. type: TP
5239 #: build/C/man2/open.2:603
5240 #, no-wrap
5241 msgid "B<EWOULDBLOCK>"
5242 msgstr ""
5243
5244 #. type: Plain text
5245 #: build/C/man2/open.2:610
5246 msgid ""
5247 "The B<O_NONBLOCK> flag was specified, and an incompatible lease was held on "
5248 "the file (see B<fcntl>(2))."
5249 msgstr ""
5250
5251 #. type: Plain text
5252 #: build/C/man2/open.2:623
5253 msgid ""
5254 "SVr4, 4.3BSD, POSIX.1-2001.  The B<O_DIRECTORY>, B<O_NOATIME>, and "
5255 "B<O_NOFOLLOW> flags are Linux-specific, and one may need to define "
5256 "B<_GNU_SOURCE> (before including I<any> header files)  to obtain their "
5257 "definitions."
5258 msgstr ""
5259
5260 #. type: Plain text
5261 #: build/C/man2/open.2:628
5262 msgid ""
5263 "The B<O_CLOEXEC> flag is not specified in POSIX.1-2001, but is specified in "
5264 "POSIX.1-2008."
5265 msgstr ""
5266
5267 #. type: Plain text
5268 #: build/C/man2/open.2:636
5269 msgid ""
5270 "B<O_DIRECT> is not specified in POSIX; one has to define B<_GNU_SOURCE> "
5271 "(before including I<any> header files)  to get its definition."
5272 msgstr ""
5273
5274 #. type: Plain text
5275 #: build/C/man2/open.2:644
5276 msgid ""
5277 "Under Linux, the B<O_NONBLOCK> flag indicates that one wants to open but "
5278 "does not necessarily have the intention to read or write.  This is typically "
5279 "used to open devices in order to get a file descriptor for use with "
5280 "B<ioctl>(2)."
5281 msgstr ""
5282
5283 #.  See for example util-linux's disk-utils/setfdprm.c
5284 #.  For some background on access mode 3, see
5285 #.  http://thread.gmane.org/gmane.linux.kernel/653123
5286 #.  "[RFC] correct flags to f_mode conversion in __dentry_open"
5287 #.  LKML, 12 Mar 2008
5288 #. type: Plain text
5289 #: build/C/man2/open.2:673
5290 msgid ""
5291 "Unlike the other values that can be specified in I<flags>, the I<access "
5292 "mode> values B<O_RDONLY>, B<O_WRONLY>, and B<O_RDWR>, do not specify "
5293 "individual bits.  Rather, they define the low order two bits of I<flags>, "
5294 "and are defined respectively as 0, 1, and 2.  In other words, the "
5295 "combination B<O_RDONLY | O_WRONLY> is a logical error, and certainly does "
5296 "not have the same meaning as B<O_RDWR>.  Linux reserves the special, "
5297 "nonstandard access mode 3 (binary 11) in I<flags> to mean: check for read "
5298 "and write permission on the file and return a descriptor that can't be used "
5299 "for reading or writing.  This nonstandard access mode is used by some Linux "
5300 "drivers to return a descriptor that is only to be used for device-specific "
5301 "B<ioctl>(2)  operations."
5302 msgstr ""
5303
5304 #.  Linux 2.0, 2.5: truncate
5305 #.  Solaris 5.7, 5.8: truncate
5306 #.  Irix 6.5: truncate
5307 #.  Tru64 5.1B: truncate
5308 #.  HP-UX 11.22: truncate
5309 #.  FreeBSD 4.7: truncate
5310 #. type: Plain text
5311 #: build/C/man2/open.2:684
5312 msgid ""
5313 "The (undefined) effect of B<O_RDONLY | O_TRUNC> varies among "
5314 "implementations.  On many systems the file is actually truncated."
5315 msgstr ""
5316
5317 #. type: Plain text
5318 #: build/C/man2/open.2:688
5319 msgid ""
5320 "There are many infelicities in the protocol underlying NFS, affecting "
5321 "amongst others B<O_SYNC> and B<O_NDELAY>."
5322 msgstr ""
5323
5324 #. type: Plain text
5325 #: build/C/man2/open.2:710
5326 msgid ""
5327 "POSIX provides for three different variants of synchronized I/O, "
5328 "corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>.  Currently "
5329 "(2.6.31), Linux only implements B<O_SYNC>, but glibc maps B<O_DSYNC> and "
5330 "B<O_RSYNC> to the same numerical value as B<O_SYNC>.  Most Linux file "
5331 "systems don't actually implement the POSIX B<O_SYNC> semantics, which "
5332 "require all metadata updates of a write to be on disk on returning to "
5333 "userspace, but only the B<O_DSYNC> semantics, which require only actual file "
5334 "data and metadata necessary to retrieve it to be on disk by the time the "
5335 "system call returns."
5336 msgstr ""
5337
5338 #. type: Plain text
5339 #: build/C/man2/open.2:718
5340 msgid ""
5341 "Note that B<open>()  can open device special files, but B<creat>()  cannot "
5342 "create them; use B<mknod>(2)  instead."
5343 msgstr ""
5344
5345 #. type: Plain text
5346 #: build/C/man2/open.2:731
5347 msgid ""
5348 "On NFS file systems with UID mapping enabled, B<open>()  may return a file "
5349 "descriptor but, for example, B<read>(2)  requests are denied with "
5350 "B<EACCES>.  This is because the client performs B<open>()  by checking the "
5351 "permissions, but UID mapping is performed by the server upon read and write "
5352 "requests."
5353 msgstr ""
5354
5355 #. type: Plain text
5356 #: build/C/man2/open.2:750
5357 msgid ""
5358 "If the file is newly created, its I<st_atime>, I<st_ctime>, I<st_mtime> "
5359 "fields (respectively, time of last access, time of last status change, and "
5360 "time of last modification; see B<stat>(2))  are set to the current time, and "
5361 "so are the I<st_ctime> and I<st_mtime> fields of the parent directory.  "
5362 "Otherwise, if the file is modified because of the B<O_TRUNC> flag, its "
5363 "st_ctime and st_mtime fields are set to the current time."
5364 msgstr ""
5365
5366 #. type: SS
5367 #: build/C/man2/open.2:750
5368 #, no-wrap
5369 msgid "O_DIRECT"
5370 msgstr ""
5371
5372 #. type: Plain text
5373 #: build/C/man2/open.2:767
5374 msgid ""
5375 "The B<O_DIRECT> flag may impose alignment restrictions on the length and "
5376 "address of userspace buffers and the file offset of I/Os.  In Linux "
5377 "alignment restrictions vary by file system and kernel version and might be "
5378 "absent entirely.  However there is currently no file system-independent "
5379 "interface for an application to discover these restrictions for a given file "
5380 "or file system.  Some file systems provide their own interfaces for doing "
5381 "so, for example the B<XFS_IOC_DIOINFO> operation in B<xfsctl>(3)."
5382 msgstr ""
5383
5384 #. type: Plain text
5385 #: build/C/man2/open.2:773
5386 msgid ""
5387 "Under Linux 2.4, transfer sizes, and the alignment of the user buffer and "
5388 "the file offset must all be multiples of the logical block size of the file "
5389 "system.  Under Linux 2.6, alignment to 512-byte boundaries suffices."
5390 msgstr ""
5391
5392 #. type: Plain text
5393 #: build/C/man2/open.2:783
5394 msgid ""
5395 "The B<O_DIRECT> flag was introduced in SGI IRIX, where it has alignment "
5396 "restrictions similar to those of Linux 2.4.  IRIX has also a B<fcntl>(2)  "
5397 "call to query appropriate alignments, and sizes.  FreeBSD 4.x introduced a "
5398 "flag of the same name, but without alignment restrictions."
5399 msgstr ""
5400
5401 #. type: Plain text
5402 #: build/C/man2/open.2:792
5403 msgid ""
5404 "B<O_DIRECT> support was added under Linux in kernel version 2.4.10.  Older "
5405 "Linux kernels simply ignore this flag.  Some file systems may not implement "
5406 "the flag and B<open>()  will fail with B<EINVAL> if it is used."
5407 msgstr ""
5408
5409 #. type: Plain text
5410 #: build/C/man2/open.2:803
5411 msgid ""
5412 "Applications should avoid mixing B<O_DIRECT> and normal I/O to the same "
5413 "file, and especially to overlapping byte regions in the same file.  Even "
5414 "when the file system correctly handles the coherency issues in this "
5415 "situation, overall I/O throughput is likely to be slower than using either "
5416 "mode alone.  Likewise, applications should avoid mixing B<mmap>(2)  of files "
5417 "with direct I/O to the same files."
5418 msgstr ""
5419
5420 #. type: Plain text
5421 #: build/C/man2/open.2:825
5422 msgid ""
5423 "The behaviour of B<O_DIRECT> with NFS will differ from local file systems.  "
5424 "Older kernels, or kernels configured in certain ways, may not support this "
5425 "combination.  The NFS protocol does not support passing the flag to the "
5426 "server, so B<O_DIRECT> I/O will only bypass the page cache on the client; "
5427 "the server may still cache the I/O.  The client asks the server to make the "
5428 "I/O synchronous to preserve the synchronous semantics of B<O_DIRECT>.  Some "
5429 "servers will perform poorly under these circumstances, especially if the I/O "
5430 "size is small.  Some servers may also be configured to lie to clients about "
5431 "the I/O having reached stable storage; this will avoid the performance "
5432 "penalty at some risk to data integrity in the event of server power "
5433 "failure.  The Linux NFS client places no alignment restrictions on "
5434 "B<O_DIRECT> I/O."
5435 msgstr ""
5436
5437 #. type: Plain text
5438 #: build/C/man2/open.2:832
5439 msgid ""
5440 "In summary, B<O_DIRECT> is a potentially powerful tool that should be used "
5441 "with caution.  It is recommended that applications treat use of B<O_DIRECT> "
5442 "as a performance option which is disabled by default."
5443 msgstr ""
5444
5445 #. type: Plain text
5446 #: build/C/man2/open.2:837
5447 msgid ""
5448 "\"The thing that has always disturbed me about O_DIRECT is that the whole "
5449 "interface is just stupid, and was probably designed by a deranged monkey on "
5450 "some serious mind-controlling substances.\"\\(emLinus"
5451 msgstr ""
5452
5453 #.  FIXME . Check bugzilla report on open(O_ASYNC)
5454 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=5993
5455 #. type: Plain text
5456 #: build/C/man2/open.2:849
5457 msgid ""
5458 "Currently, it is not possible to enable signal-driven I/O by specifying "
5459 "B<O_ASYNC> when calling B<open>(); use B<fcntl>(2)  to enable this flag."
5460 msgstr ""
5461
5462 #. type: Plain text
5463 #: build/C/man2/open.2:870
5464 msgid ""
5465 "B<chmod>(2), B<chown>(2), B<close>(2), B<dup>(2), B<fcntl>(2), B<link>(2), "
5466 "B<lseek>(2), B<mknod>(2), B<mmap>(2), B<mount>(2), B<openat>(2), B<read>(2), "
5467 "B<socket>(2), B<stat>(2), B<umask>(2), B<unlink>(2), B<write>(2), "
5468 "B<fopen>(3), B<fifo>(7), B<path_resolution>(7), B<symlink>(7)"
5469 msgstr ""
5470
5471 #. type: TH
5472 #: build/C/man3/perror.3:30
5473 #, no-wrap
5474 msgid "PERROR"
5475 msgstr ""
5476
5477 #. type: TH
5478 #: build/C/man3/perror.3:30
5479 #, no-wrap
5480 msgid "2012-04-17"
5481 msgstr ""
5482
5483 #. type: Plain text
5484 #: build/C/man3/perror.3:33
5485 msgid "perror - print a system error message"
5486 msgstr ""
5487
5488 #. type: Plain text
5489 #: build/C/man3/perror.3:37
5490 msgid "B<void perror(const char *>I<s>B<);>"
5491 msgstr ""
5492
5493 #. type: Plain text
5494 #: build/C/man3/perror.3:39
5495 msgid "B<#include E<lt>errno.hE<gt>>"
5496 msgstr ""
5497
5498 #. type: Plain text
5499 #: build/C/man3/perror.3:41
5500 msgid "B<const char *>I<sys_errlist>B<[];>"
5501 msgstr ""
5502
5503 #. type: Plain text
5504 #: build/C/man3/perror.3:43
5505 msgid "B<int >I<sys_nerr>B<;>"
5506 msgstr ""
5507
5508 #. type: Plain text
5509 #: build/C/man3/perror.3:45
5510 msgid "B<int >I<errno>B<;>"
5511 msgstr ""
5512
5513 #. type: Plain text
5514 #: build/C/man3/perror.3:54
5515 msgid "I<sys_errlist>, I<sys_nerr>: _BSD_SOURCE"
5516 msgstr ""
5517
5518 #. type: Plain text
5519 #: build/C/man3/perror.3:67
5520 msgid ""
5521 "The routine B<perror>()  produces a message on the standard error output, "
5522 "describing the last error encountered during a call to a system or library "
5523 "function.  First (if I<s> is not NULL and I<*s> is not a null byte "
5524 "(\\(aq\\e0\\(aq)) the argument string I<s> is printed, followed by a colon "
5525 "and a blank.  Then the message and a new-line."
5526 msgstr ""
5527
5528 #. type: Plain text
5529 #: build/C/man3/perror.3:75
5530 msgid ""
5531 "To be of most use, the argument string should include the name of the "
5532 "function that incurred the error.  The error number is taken from the "
5533 "external variable I<errno>, which is set when errors occur but not cleared "
5534 "when successful calls are made."
5535 msgstr ""
5536
5537 #. type: Plain text
5538 #: build/C/man3/perror.3:89
5539 msgid ""
5540 "The global error list I<sys_errlist>[] indexed by I<errno> can be used to "
5541 "obtain the error message without the newline.  The largest message number "
5542 "provided in the table is I<sys_nerr>-1.  Be careful when directly accessing "
5543 "this list because new error values may not have been added to "
5544 "I<sys_errlist>[].  The use of I<sys_errlist>[] is nowadays deprecated."
5545 msgstr ""
5546
5547 #. type: Plain text
5548 #: build/C/man3/perror.3:111
5549 msgid ""
5550 "When a system call fails, it usually returns -1 and sets the variable "
5551 "I<errno> to a value describing what went wrong.  (These values can be found "
5552 "in I<E<lt>errno.hE<gt>>.)  Many library functions do likewise.  The function "
5553 "B<perror>()  serves to translate this error code into human-readable form.  "
5554 "Note that I<errno> is undefined after a successful library call: this call "
5555 "may well change this variable, even though it succeeds, for example because "
5556 "it internally used some other library function that failed.  Thus, if a "
5557 "failing call is not immediately followed by a call to B<perror>(), the value "
5558 "of I<errno> should be saved."
5559 msgstr ""
5560
5561 #. type: Plain text
5562 #: build/C/man3/perror.3:124
5563 msgid ""
5564 "The function B<perror>()  and the external I<errno> (see B<errno>(3))  "
5565 "conform to C89, C99, 4.3BSD, POSIX.1-2001.  The externals I<sys_nerr> and "
5566 "I<sys_errlist> conform to BSD."
5567 msgstr ""
5568
5569 #.  and only when _BSD_SOURCE is defined.
5570 #.  When
5571 #.  .B _GNU_SOURCE
5572 #.  is defined, the symbols
5573 #.  .I _sys_nerr
5574 #.  and
5575 #.  .I _sys_errlist
5576 #.  are provided.
5577 #. type: Plain text
5578 #: build/C/man3/perror.3:139
5579 msgid ""
5580 "The externals I<sys_nerr> and I<sys_errlist> are defined by glibc, but in "
5581 "I<E<lt>stdio.hE<gt>>."
5582 msgstr ""
5583
5584 #. type: Plain text
5585 #: build/C/man3/perror.3:143
5586 msgid "B<err>(3), B<errno>(3), B<error>(3), B<strerror>(3)"
5587 msgstr ""
5588
5589 #. type: TH
5590 #: build/C/man2/pipe.2:36
5591 #, no-wrap
5592 msgid "PIPE"
5593 msgstr ""
5594
5595 #. type: TH
5596 #: build/C/man2/pipe.2:36
5597 #, no-wrap
5598 msgid "2012-02-14"
5599 msgstr ""
5600
5601 #. type: Plain text
5602 #: build/C/man2/pipe.2:39
5603 msgid "pipe, pipe2 - create pipe"
5604 msgstr ""
5605
5606 #. type: Plain text
5607 #: build/C/man2/pipe.2:42 build/C/man2/read.2:41
5608 #, no-wrap
5609 msgid "B<#include E<lt>unistd.hE<gt>>\n"
5610 msgstr ""
5611
5612 #. type: Plain text
5613 #: build/C/man2/pipe.2:44
5614 #, no-wrap
5615 msgid "B<int pipe(int >I<pipefd>B<[2]);>\n"
5616 msgstr ""
5617
5618 #. type: Plain text
5619 #: build/C/man2/pipe.2:48
5620 #, no-wrap
5621 msgid ""
5622 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
5623 "B<#include E<lt>fcntl.hE<gt>>              /* Obtain O_* constant "
5624 "definitions */\n"
5625 "B<#include E<lt>unistd.hE<gt>>\n"
5626 msgstr ""
5627
5628 #. type: Plain text
5629 #: build/C/man2/pipe.2:50
5630 #, no-wrap
5631 msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
5632 msgstr ""
5633
5634 #. type: Plain text
5635 #: build/C/man2/pipe.2:66
5636 msgid ""
5637 "B<pipe>()  creates a pipe, a unidirectional data channel that can be used "
5638 "for interprocess communication.  The array I<pipefd> is used to return two "
5639 "file descriptors referring to the ends of the pipe.  I<pipefd[0]> refers to "
5640 "the read end of the pipe.  I<pipefd[1]> refers to the write end of the "
5641 "pipe.  Data written to the write end of the pipe is buffered by the kernel "
5642 "until it is read from the read end of the pipe.  For further details, see "
5643 "B<pipe>(7)."
5644 msgstr ""
5645
5646 #. type: Plain text
5647 #: build/C/man2/pipe.2:76
5648 msgid ""
5649 "If I<flags> is 0, then B<pipe2>()  is the same as B<pipe>().  The following "
5650 "values can be bitwise ORed in I<flags> to obtain different behavior:"
5651 msgstr ""
5652
5653 #. type: TP
5654 #: build/C/man2/pipe.2:76
5655 #, no-wrap
5656 msgid "B<O_NONBLOCK>"
5657 msgstr ""
5658
5659 #. type: Plain text
5660 #: build/C/man2/pipe.2:84
5661 msgid ""
5662 "Set the B<O_NONBLOCK> file status flag on the two new open file "
5663 "descriptions.  Using this flag saves extra calls to B<fcntl>(2)  to achieve "
5664 "the same result."
5665 msgstr ""
5666
5667 #. type: TP
5668 #: build/C/man2/pipe.2:84
5669 #, no-wrap
5670 msgid "B<O_CLOEXEC>"
5671 msgstr ""
5672
5673 #. type: Plain text
5674 #: build/C/man2/pipe.2:92
5675 msgid ""
5676 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the two new file "
5677 "descriptors.  See the description of the same flag in B<open>(2)  for "
5678 "reasons why this may be useful."
5679 msgstr ""
5680
5681 #. type: Plain text
5682 #: build/C/man2/pipe.2:102
5683 msgid "I<pipefd> is not valid."
5684 msgstr ""
5685
5686 #. type: Plain text
5687 #: build/C/man2/pipe.2:107
5688 msgid "(B<pipe2>())  Invalid value in I<flags>."
5689 msgstr ""
5690
5691 #. type: Plain text
5692 #: build/C/man2/pipe.2:110
5693 msgid "Too many file descriptors are in use by the process."
5694 msgstr ""
5695
5696 #. type: Plain text
5697 #: build/C/man2/pipe.2:118
5698 msgid ""
5699 "B<pipe2>()  was added to Linux in version 2.6.27; glibc support is available "
5700 "starting with version 2.9."
5701 msgstr ""
5702
5703 #. type: Plain text
5704 #: build/C/man2/pipe.2:121
5705 msgid "B<pipe>(): POSIX.1-2001."
5706 msgstr ""
5707
5708 #. type: Plain text
5709 #: build/C/man2/pipe.2:124
5710 msgid "B<pipe2>()  is Linux-specific."
5711 msgstr ""
5712
5713 #.  fork.2 refers to this example program.
5714 #. type: Plain text
5715 #: build/C/man2/pipe.2:140
5716 msgid ""
5717 "The following program creates a pipe, and then B<fork>(2)s to create a child "
5718 "process; the child inherits a duplicate set of file descriptors that refer "
5719 "to the same pipe.  After the B<fork>(2), each process closes the descriptors "
5720 "that it doesn't need for the pipe (see B<pipe>(7)).  The parent then writes "
5721 "the string contained in the program's command-line argument to the pipe, and "
5722 "the child reads this string a byte at a time from the pipe and echoes it on "
5723 "standard output."
5724 msgstr ""
5725
5726 #. type: Plain text
5727 #: build/C/man2/pipe.2:147
5728 #, no-wrap
5729 msgid ""
5730 "#include E<lt>sys/wait.hE<gt>\n"
5731 "#include E<lt>stdio.hE<gt>\n"
5732 "#include E<lt>stdlib.hE<gt>\n"
5733 "#include E<lt>unistd.hE<gt>\n"
5734 "#include E<lt>string.hE<gt>\n"
5735 msgstr ""
5736
5737 #. type: Plain text
5738 #: build/C/man2/pipe.2:154
5739 #, no-wrap
5740 msgid ""
5741 "int\n"
5742 "main(int argc, char *argv[])\n"
5743 "{\n"
5744 "    int pipefd[2];\n"
5745 "    pid_t cpid;\n"
5746 "    char buf;\n"
5747 msgstr ""
5748
5749 #. type: Plain text
5750 #: build/C/man2/pipe.2:159
5751 #, no-wrap
5752 msgid ""
5753 "    if (argc != 2) {\n"
5754 "\tfprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\en\", argv[0]);\n"
5755 "\texit(EXIT_FAILURE);\n"
5756 "    }\n"
5757 msgstr ""
5758
5759 #. type: Plain text
5760 #: build/C/man2/pipe.2:164
5761 #, no-wrap
5762 msgid ""
5763 "    if (pipe(pipefd) == -1) {\n"
5764 "        perror(\"pipe\");\n"
5765 "        exit(EXIT_FAILURE);\n"
5766 "    }\n"
5767 msgstr ""
5768
5769 #. type: Plain text
5770 #: build/C/man2/pipe.2:170
5771 #, no-wrap
5772 msgid ""
5773 "    cpid = fork();\n"
5774 "    if (cpid == -1) {\n"
5775 "        perror(\"fork\");\n"
5776 "        exit(EXIT_FAILURE);\n"
5777 "    }\n"
5778 msgstr ""
5779
5780 #. type: Plain text
5781 #: build/C/man2/pipe.2:173
5782 #, no-wrap
5783 msgid ""
5784 "    if (cpid == 0) {    /* Child reads from pipe */\n"
5785 "        close(pipefd[1]);          /* Close unused write end */\n"
5786 msgstr ""
5787
5788 #. type: Plain text
5789 #: build/C/man2/pipe.2:176
5790 #, no-wrap
5791 msgid ""
5792 "        while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
5793 "            write(STDOUT_FILENO, &buf, 1);\n"
5794 msgstr ""
5795
5796 #. type: Plain text
5797 #: build/C/man2/pipe.2:180
5798 #, no-wrap
5799 msgid ""
5800 "        write(STDOUT_FILENO, \"\\en\", 1);\n"
5801 "        close(pipefd[0]);\n"
5802 "        _exit(EXIT_SUCCESS);\n"
5803 msgstr ""
5804
5805 #. type: Plain text
5806 #: build/C/man2/pipe.2:189
5807 #, no-wrap
5808 msgid ""
5809 "    } else {            /* Parent writes argv[1] to pipe */\n"
5810 "        close(pipefd[0]);          /* Close unused read end */\n"
5811 "        write(pipefd[1], argv[1], strlen(argv[1]));\n"
5812 "        close(pipefd[1]);          /* Reader will see EOF */\n"
5813 "        wait(NULL);                /* Wait for child */\n"
5814 "        exit(EXIT_SUCCESS);\n"
5815 "    }\n"
5816 "}\n"
5817 msgstr ""
5818
5819 #. type: Plain text
5820 #: build/C/man2/pipe.2:196
5821 msgid ""
5822 "B<fork>(2), B<read>(2), B<socketpair>(2), B<write>(2), B<popen>(3), "
5823 "B<pipe>(7)"
5824 msgstr ""
5825
5826 #. type: TH
5827 #: build/C/man3/popen.3:38
5828 #, no-wrap
5829 msgid "POPEN"
5830 msgstr ""
5831
5832 #. type: TH
5833 #: build/C/man3/popen.3:38
5834 #, no-wrap
5835 msgid "2010-02-03"
5836 msgstr ""
5837
5838 #. type: Plain text
5839 #: build/C/man3/popen.3:41
5840 msgid "popen, pclose - pipe stream to or from a process"
5841 msgstr ""
5842
5843 #. type: Plain text
5844 #: build/C/man3/popen.3:46
5845 #, no-wrap
5846 msgid "B<FILE *popen(const char *>I<command>B<, const char *>I<type>B<);>\n"
5847 msgstr ""
5848
5849 #. type: Plain text
5850 #: build/C/man3/popen.3:48
5851 #, no-wrap
5852 msgid "B<int pclose(FILE *>I<stream>B<);>\n"
5853 msgstr ""
5854
5855 #. type: Plain text
5856 #: build/C/man3/popen.3:58
5857 msgid "B<popen>(), B<pclose>():"
5858 msgstr ""
5859
5860 #. type: Plain text
5861 #: build/C/man3/popen.3:60
5862 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE"
5863 msgstr ""
5864
5865 #. type: Plain text
5866 #: build/C/man3/popen.3:71
5867 msgid ""
5868 "The B<popen>()  function opens a process by creating a pipe, forking, and "
5869 "invoking the shell.  Since a pipe is by definition unidirectional, the "
5870 "I<type> argument may specify only reading or writing, not both; the "
5871 "resulting stream is correspondingly read-only or write-only."
5872 msgstr ""
5873
5874 #. type: Plain text
5875 #: build/C/man3/popen.3:95
5876 msgid ""
5877 "The I<command> argument is a pointer to a null-terminated string containing "
5878 "a shell command line.  This command is passed to I</bin/sh> using the B<-c> "
5879 "flag; interpretation, if any, is performed by the shell.  The I<type> "
5880 "argument is a pointer to a null-terminated string which must contain either "
5881 "the letter \\(aqr\\(aq for reading or the letter \\(aqw\\(aq for writing.  "
5882 "Since glibc 2.9, this argument can additionally include the letter "
5883 "\\(aqe\\(aq, which causes the close-on-exec flag (B<FD_CLOEXEC>)  to be set "
5884 "on the underlying file descriptor; see the description of the B<O_CLOEXEC> "
5885 "flag in B<open>(2)  for reasons why this may be useful."
5886 msgstr ""
5887
5888 #. type: Plain text
5889 #: build/C/man3/popen.3:111
5890 msgid ""
5891 "The return value from B<popen>()  is a normal standard I/O stream in all "
5892 "respects save that it must be closed with B<pclose>()  rather than "
5893 "B<fclose>(3).  Writing to such a stream writes to the standard input of the "
5894 "command; the command's standard output is the same as that of the process "
5895 "that called B<popen>(), unless this is altered by the command itself.  "
5896 "Conversely, reading from a \"popened\" stream reads the command's standard "
5897 "output, and the command's standard input is the same as that of the process "
5898 "that called B<popen>()."
5899 msgstr ""
5900
5901 #. type: Plain text
5902 #: build/C/man3/popen.3:115
5903 msgid "Note that output B<popen>()  streams are fully buffered by default."
5904 msgstr ""
5905
5906 #. type: Plain text
5907 #: build/C/man3/popen.3:121
5908 msgid ""
5909 "The B<pclose>()  function waits for the associated process to terminate and "
5910 "returns the exit status of the command as returned by B<wait4>(2)."
5911 msgstr ""
5912
5913 #. type: Plain text
5914 #: build/C/man3/popen.3:129
5915 msgid ""
5916 "The B<popen>()  function returns NULL if the B<fork>(2)  or B<pipe>(2)  "
5917 "calls fail, or if it cannot allocate memory."
5918 msgstr ""
5919
5920 #.  These conditions actually give undefined results, so I commented
5921 #.  them out.
5922 #.  .I stream
5923 #.  is not associated with a "popen()ed" command, if
5924 #. .I stream
5925 #.  already "pclose()d", or if
5926 #. type: Plain text
5927 #: build/C/man3/popen.3:141
5928 msgid ""
5929 "The B<pclose>()  function returns -1 if B<wait4>(2)  returns an error, or "
5930 "some other error is detected."
5931 msgstr ""
5932
5933 #. type: Plain text
5934 #: build/C/man3/popen.3:160
5935 msgid ""
5936 "The B<popen>()  function does not set I<errno> if memory allocation fails.  "
5937 "If the underlying B<fork>(2)  or B<pipe>(2)  fails, I<errno> is set "
5938 "appropriately.  If the I<type> argument is invalid, and this condition is "
5939 "detected, I<errno> is set to B<EINVAL>."
5940 msgstr ""
5941
5942 #. type: Plain text
5943 #: build/C/man3/popen.3:167
5944 msgid ""
5945 "If B<pclose>()  cannot obtain the child status, I<errno> is set to "
5946 "B<ECHILD>."
5947 msgstr ""
5948
5949 #. type: Plain text
5950 #: build/C/man3/popen.3:173
5951 msgid "The \\(aqe\\(aq value for I<type> is a Linux extension."
5952 msgstr ""
5953
5954 #. type: Plain text
5955 #: build/C/man3/popen.3:186
5956 msgid ""
5957 "Since the standard input of a command opened for reading shares its seek "
5958 "offset with the process that called B<popen>(), if the original process has "
5959 "done a buffered read, the command's input position may not be as expected.  "
5960 "Similarly, the output from a command opened for writing may become "
5961 "intermingled with that of the original process.  The latter can be avoided "
5962 "by calling B<fflush>(3)  before B<popen>()."
5963 msgstr ""
5964
5965 #.  .SH HISTORY
5966 #.  A
5967 #.  .BR popen ()
5968 #.  and a
5969 #.  .BR pclose ()
5970 #.  function appeared in Version 7 AT&T UNIX.
5971 #. type: Plain text
5972 #: build/C/man3/popen.3:196
5973 msgid ""
5974 "Failure to execute the shell is indistinguishable from the shell's failure "
5975 "to execute command, or an immediate exit of the command.  The only hint is "
5976 "an exit status of 127."
5977 msgstr ""
5978
5979 #. type: Plain text
5980 #: build/C/man3/popen.3:205
5981 msgid ""
5982 "B<sh>(1), B<fork>(2), B<pipe>(2), B<wait4>(2), B<fclose>(3), B<fflush>(3), "
5983 "B<fopen>(3), B<stdio>(3), B<system>(3)"
5984 msgstr ""
5985
5986 #. type: TH
5987 #: build/C/man3/printf.3:34
5988 #, no-wrap
5989 msgid "PRINTF"
5990 msgstr ""
5991
5992 #. type: TH
5993 #: build/C/man3/printf.3:34 build/C/man3/puts.3:24 build/C/man3/scanf.3:50
5994 #, no-wrap
5995 msgid "2011-09-28"
5996 msgstr ""
5997
5998 #. type: Plain text
5999 #: build/C/man3/printf.3:38
6000 msgid ""
6001 "printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - "
6002 "formatted output conversion"
6003 msgstr ""
6004
6005 #. type: Plain text
6006 #: build/C/man3/printf.3:42
6007 msgid "B<int printf(const char *>I<format>B<, ...);>"
6008 msgstr ""
6009
6010 #. type: Plain text
6011 #: build/C/man3/printf.3:44
6012 msgid "B<int fprintf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>"
6013 msgstr ""
6014
6015 #. type: Plain text
6016 #: build/C/man3/printf.3:46
6017 msgid "B<int sprintf(char *>I<str>B<, const char *>I<format>B<, ...);>"
6018 msgstr ""
6019
6020 #. type: Plain text
6021 #: build/C/man3/printf.3:48
6022 msgid ""
6023 "B<int snprintf(char *>I<str>B<, size_t >I<size>B<, const char *>I<format>B<, "
6024 "...);>"
6025 msgstr ""
6026
6027 #. type: Plain text
6028 #: build/C/man3/printf.3:50
6029 msgid "B<#include E<lt>stdarg.hE<gt>>"
6030 msgstr ""
6031
6032 #. type: Plain text
6033 #: build/C/man3/printf.3:52
6034 msgid "B<int vprintf(const char *>I<format>B<, va_list >I<ap>B<);>"
6035 msgstr ""
6036
6037 #. type: Plain text
6038 #: build/C/man3/printf.3:54
6039 msgid ""
6040 "B<int vfprintf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
6041 ">I<ap>B<);>"
6042 msgstr ""
6043
6044 #. type: Plain text
6045 #: build/C/man3/printf.3:56
6046 msgid ""
6047 "B<int vsprintf(char *>I<str>B<, const char *>I<format>B<, va_list "
6048 ">I<ap>B<);>"
6049 msgstr ""
6050
6051 #. type: Plain text
6052 #: build/C/man3/printf.3:59
6053 msgid ""
6054 "B<int vsnprintf(char *>I<str>B<, size_t >I<size>B<, const char "
6055 "*>I<format>B<, va_list >I<ap>B<);>"
6056 msgstr ""
6057
6058 #. type: Plain text
6059 #: build/C/man3/printf.3:68
6060 msgid "B<snprintf>(), B<vsnprintf>():"
6061 msgstr ""
6062
6063 #. type: Plain text
6064 #: build/C/man3/printf.3:71
6065 msgid ""
6066 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE || "
6067 "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
6068 msgstr ""
6069
6070 #. type: Plain text
6071 #: build/C/man3/printf.3:74 build/C/man3/scanf.3:83
6072 msgid "or I<cc -std=c99>"
6073 msgstr ""
6074
6075 #. type: Plain text
6076 #: build/C/man3/printf.3:101
6077 msgid ""
6078 "The functions in the B<printf>()  family produce output according to a "
6079 "I<format> as described below.  The functions B<printf>()  and B<vprintf>()  "
6080 "write output to I<stdout>, the standard output stream; B<fprintf>()  and "
6081 "B<vfprintf>()  write output to the given output I<stream>; B<sprintf>(), "
6082 "B<snprintf>(), B<vsprintf>()  and B<vsnprintf>()  write to the character "
6083 "string I<str>."
6084 msgstr ""
6085
6086 #. type: Plain text
6087 #: build/C/man3/printf.3:110
6088 msgid ""
6089 "The functions B<snprintf>()  and B<vsnprintf>()  write at most I<size> bytes "
6090 "(including the terminating null byte (\\(aq\\e0\\(aq)) to I<str>."
6091 msgstr ""
6092
6093 #. type: Plain text
6094 #: build/C/man3/printf.3:134
6095 msgid ""
6096 "The functions B<vprintf>(), B<vfprintf>(), B<vsprintf>(), B<vsnprintf>()  "
6097 "are equivalent to the functions B<printf>(), B<fprintf>(), B<sprintf>(), "
6098 "B<snprintf>(), respectively, except that they are called with a I<va_list> "
6099 "instead of a variable number of arguments.  These functions do not call the "
6100 "I<va_end> macro.  Because they invoke the I<va_arg> macro, the value of "
6101 "I<ap> is undefined after the call.  See B<stdarg>(3)."
6102 msgstr ""
6103
6104 #. type: Plain text
6105 #: build/C/man3/printf.3:141
6106 msgid ""
6107 "These eight functions write the output under the control of a I<format> "
6108 "string that specifies how subsequent arguments (or arguments accessed via "
6109 "the variable-length argument facilities of B<stdarg>(3))  are converted for "
6110 "output."
6111 msgstr ""
6112
6113 #. type: Plain text
6114 #: build/C/man3/printf.3:152
6115 msgid ""
6116 "C99 and POSIX.1-2001 specify that the results are undefined if a call to "
6117 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), or B<vsnprintf>()  would cause "
6118 "copying to take place between objects that overlap (e.g., if the target "
6119 "string array and one of the supplied input arguments refer to the same "
6120 "buffer).  See NOTES."
6121 msgstr ""
6122
6123 #. type: SS
6124 #: build/C/man3/printf.3:152
6125 #, no-wrap
6126 msgid "Return value"
6127 msgstr ""
6128
6129 #. type: Plain text
6130 #: build/C/man3/printf.3:155
6131 msgid ""
6132 "Upon successful return, these functions return the number of characters "
6133 "printed (excluding the null byte used to end output to strings)."
6134 msgstr ""
6135
6136 #. type: Plain text
6137 #: build/C/man3/printf.3:171
6138 msgid ""
6139 "The functions B<snprintf>()  and B<vsnprintf>()  do not write more than "
6140 "I<size> bytes (including the terminating null byte (\\(aq\\e0\\(aq)).  If "
6141 "the output was truncated due to this limit then the return value is the "
6142 "number of characters (excluding the terminating null byte)  which would have "
6143 "been written to the final string if enough space had been available.  Thus, "
6144 "a return value of I<size> or more means that the output was truncated.  (See "
6145 "also below under NOTES.)"
6146 msgstr ""
6147
6148 #. type: Plain text
6149 #: build/C/man3/printf.3:173
6150 msgid "If an output error is encountered, a negative value is returned."
6151 msgstr ""
6152
6153 #. type: SS
6154 #: build/C/man3/printf.3:173
6155 #, no-wrap
6156 msgid "Format of the format string"
6157 msgstr ""
6158
6159 #. type: Plain text
6160 #: build/C/man3/printf.3:195
6161 msgid ""
6162 "The format string is a character string, beginning and ending in its initial "
6163 "shift state, if any.  The format string is composed of zero or more "
6164 "directives: ordinary characters (not B<%>), which are copied unchanged to "
6165 "the output stream; and conversion specifications, each of which results in "
6166 "fetching zero or more subsequent arguments.  Each conversion specification "
6167 "is introduced by the character B<%>, and ends with a I<conversion "
6168 "specifier>.  In between there may be (in this order) zero or more I<flags>, "
6169 "an optional minimum I<field width>, an optional I<precision> and an optional "
6170 "I<length modifier>."
6171 msgstr ""
6172
6173 #. type: Plain text
6174 #: build/C/man3/printf.3:208
6175 msgid ""
6176 "The arguments must correspond properly (after type promotion) with the "
6177 "conversion specifier.  By default, the arguments are used in the order "
6178 "given, where each \\(aq*\\(aq and each conversion specifier asks for the "
6179 "next argument (and it is an error if insufficiently many arguments are "
6180 "given).  One can also specify explicitly which argument is taken, at each "
6181 "place where an argument is required, by writing \"%m$\" instead of "
6182 "\\(aq%\\(aq and \"*m$\" instead of \\(aq*\\(aq, where the decimal integer m "
6183 "denotes the position in the argument list of the desired argument, indexed "
6184 "starting from 1.  Thus,"
6185 msgstr ""
6186
6187 #. type: Plain text
6188 #: build/C/man3/printf.3:212
6189 #, no-wrap
6190 msgid "printf(\"%*d\", width, num);\n"
6191 msgstr ""
6192
6193 #. type: Plain text
6194 #: build/C/man3/printf.3:216
6195 msgid "and"
6196 msgstr ""
6197
6198 #. type: Plain text
6199 #: build/C/man3/printf.3:220
6200 #, no-wrap
6201 msgid "printf(\"%2$*1$d\", width, num);\n"
6202 msgstr ""
6203
6204 #. type: Plain text
6205 #: build/C/man3/printf.3:236
6206 msgid ""
6207 "are equivalent.  The second style allows repeated references to the same "
6208 "argument.  The C99 standard does not include the style using \\(aq$\\(aq, "
6209 "which comes from the Single UNIX Specification.  If the style using "
6210 "\\(aq$\\(aq is used, it must be used throughout for all conversions taking "
6211 "an argument and all width and precision arguments, but it may be mixed with "
6212 "\"%%\" formats which do not consume an argument.  There may be no gaps in "
6213 "the numbers of arguments specified using \\(aq$\\(aq; for example, if "
6214 "arguments 1 and 3 are specified, argument 2 must also be specified somewhere "
6215 "in the format string."
6216 msgstr ""
6217
6218 #. type: Plain text
6219 #: build/C/man3/printf.3:246
6220 msgid ""
6221 "For some numeric conversions a radix character (\"decimal point\") or "
6222 "thousands' grouping character is used.  The actual character used depends on "
6223 "the B<LC_NUMERIC> part of the locale.  The POSIX locale uses \\(aq.\\(aq as "
6224 "radix character, and does not have a grouping character.  Thus,"
6225 msgstr ""
6226
6227 #. type: Plain text
6228 #: build/C/man3/printf.3:250
6229 #, no-wrap
6230 msgid "    printf(\"%\\(aq.2f\", 1234567.89);\n"
6231 msgstr ""
6232
6233 #. type: Plain text
6234 #: build/C/man3/printf.3:255
6235 msgid ""
6236 "results in \"1234567.89\" in the POSIX locale, in \"1234567,89\" in the "
6237 "nl_NL locale, and in \"1.234.567,89\" in the da_DK locale."
6238 msgstr ""
6239
6240 #. type: SS
6241 #: build/C/man3/printf.3:255
6242 #, no-wrap
6243 msgid "The flag characters"
6244 msgstr ""
6245
6246 #. type: Plain text
6247 #: build/C/man3/printf.3:257
6248 msgid "The character % is followed by zero or more of the following flags:"
6249 msgstr ""
6250
6251 #. type: TP
6252 #: build/C/man3/printf.3:257
6253 #, no-wrap
6254 msgid "B<#>"
6255 msgstr ""
6256
6257 #. type: Plain text
6258 #: build/C/man3/printf.3:291
6259 msgid ""
6260 "The value should be converted to an \"alternate form\".  For B<o> "
6261 "conversions, the first character of the output string is made zero (by "
6262 "prefixing a 0 if it was not zero already).  For B<x> and B<X> conversions, a "
6263 "nonzero result has the string \"0x\" (or \"0X\" for B<X> conversions) "
6264 "prepended to it.  For B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> "
6265 "conversions, the result will always contain a decimal point, even if no "
6266 "digits follow it (normally, a decimal point appears in the results of those "
6267 "conversions only if a digit follows).  For B<g> and B<G> conversions, "
6268 "trailing zeros are not removed from the result as they would otherwise be.  "
6269 "For other conversions, the result is undefined."
6270 msgstr ""
6271
6272 #. type: TP
6273 #: build/C/man3/printf.3:291
6274 #, no-wrap
6275 msgid "B<\\&0>"
6276 msgstr ""
6277
6278 #. type: Plain text
6279 #: build/C/man3/printf.3:331
6280 msgid ""
6281 "The value should be zero padded.  For B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, "
6282 "B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> conversions, the "
6283 "converted value is padded on the left with zeros rather than blanks.  If the "
6284 "B<\\&0> and B<-> flags both appear, the B<\\&0> flag is ignored.  If a "
6285 "precision is given with a numeric conversion (B<d>, B<i>, B<o>, B<u>, B<x>, "
6286 "and B<X>), the B<\\&0> flag is ignored.  For other conversions, the behavior "
6287 "is undefined."
6288 msgstr ""
6289
6290 #. type: TP
6291 #: build/C/man3/printf.3:331
6292 #, no-wrap
6293 msgid "B<->"
6294 msgstr ""
6295
6296 #. type: Plain text
6297 #: build/C/man3/printf.3:344
6298 msgid ""
6299 "The converted value is to be left adjusted on the field boundary.  (The "
6300 "default is right justification.)  Except for B<n> conversions, the converted "
6301 "value is padded on the right with blanks, rather than on the left with "
6302 "blanks or zeros.  A B<-> overrides a B<\\&0> if both are given."
6303 msgstr ""
6304
6305 #. type: TP
6306 #: build/C/man3/printf.3:344
6307 #, no-wrap
6308 msgid "B<\\(aq \\(aq>"
6309 msgstr ""
6310
6311 #. type: Plain text
6312 #: build/C/man3/printf.3:348
6313 msgid ""
6314 "(a space) A blank should be left before a positive number (or empty string) "
6315 "produced by a signed conversion."
6316 msgstr ""
6317
6318 #. type: TP
6319 #: build/C/man3/printf.3:348
6320 #, no-wrap
6321 msgid "B<+>"
6322 msgstr ""
6323
6324 #. type: Plain text
6325 #: build/C/man3/printf.3:356
6326 msgid ""
6327 "A sign (+ or -) should always be placed before a number produced by a signed "
6328 "conversion.  By default a sign is used only for negative numbers.  A B<+> "
6329 "overrides a space if both are used."
6330 msgstr ""
6331
6332 #. type: Plain text
6333 #: build/C/man3/printf.3:359
6334 msgid ""
6335 "The five flag characters above are defined in the C standard.  The SUSv2 "
6336 "specifies one further flag character."
6337 msgstr ""
6338
6339 #. type: TP
6340 #: build/C/man3/printf.3:359
6341 #, no-wrap
6342 msgid "B<\\(aq>"
6343 msgstr ""
6344
6345 #. type: Plain text
6346 #: build/C/man3/printf.3:376
6347 msgid ""
6348 "For decimal conversion (B<i>, B<d>, B<u>, B<f>, B<F>, B<g>, B<G>)  the "
6349 "output is to be grouped with thousands' grouping characters if the locale "
6350 "information indicates any.  Note that many versions of B<gcc>(1)  cannot "
6351 "parse this option and will issue a warning.  SUSv2 does not include "
6352 "I<%\\(aqF>."
6353 msgstr ""
6354
6355 #. type: Plain text
6356 #: build/C/man3/printf.3:378
6357 msgid "glibc 2.2 adds one further flag character."
6358 msgstr ""
6359
6360 #. type: TP
6361 #: build/C/man3/printf.3:378
6362 #, no-wrap
6363 msgid "B<I>"
6364 msgstr ""
6365
6366 #.  outdigits keyword in locale file
6367 #. type: Plain text
6368 #: build/C/man3/printf.3:388
6369 msgid ""
6370 "For decimal integer conversion (B<i>, B<d>, B<u>)  the output uses the "
6371 "locale's alternative output digits, if any.  For example, since glibc 2.2.3 "
6372 "this will give Arabic-Indic digits in the Persian (\"fa_IR\") locale."
6373 msgstr ""
6374
6375 #. type: SS
6376 #: build/C/man3/printf.3:388
6377 #, no-wrap
6378 msgid "The field width"
6379 msgstr ""
6380
6381 #. type: Plain text
6382 #: build/C/man3/printf.3:404
6383 msgid ""
6384 "An optional decimal digit string (with nonzero first digit) specifying a "
6385 "minimum field width.  If the converted value has fewer characters than the "
6386 "field width, it will be padded with spaces on the left (or right, if the "
6387 "left-adjustment flag has been given).  Instead of a decimal digit string one "
6388 "may write \"*\" or \"*m$\" (for some decimal integer I<m>) to specify that "
6389 "the field width is given in the next argument, or in the I<m>-th argument, "
6390 "respectively, which must be of type I<int>.  A negative field width is taken "
6391 "as a \\(aq-\\(aq flag followed by a positive field width.  In no case does a "
6392 "nonexistent or small field width cause truncation of a field; if the result "
6393 "of a conversion is wider than the field width, the field is expanded to "
6394 "contain the conversion result."
6395 msgstr ""
6396
6397 #. type: SS
6398 #: build/C/man3/printf.3:404
6399 #, no-wrap
6400 msgid "The precision"
6401 msgstr ""
6402
6403 #. type: Plain text
6404 #: build/C/man3/printf.3:440
6405 msgid ""
6406 "An optional precision, in the form of a period (\\(aq.\\(aq)  followed by an "
6407 "optional decimal digit string.  Instead of a decimal digit string one may "
6408 "write \"*\" or \"*m$\" (for some decimal integer m) to specify that the "
6409 "precision is given in the next argument, or in the m-th argument, "
6410 "respectively, which must be of type I<int>.  If the precision is given as "
6411 "just \\(aq.\\(aq, or the precision is negative, the precision is taken to be "
6412 "zero.  This gives the minimum number of digits to appear for B<d>, B<i>, "
6413 "B<o>, B<u>, B<x>, and B<X> conversions, the number of digits to appear after "
6414 "the radix character for B<a>, B<A>, B<e>, B<E>, B<f>, and B<F> conversions, "
6415 "the maximum number of significant digits for B<g> and B<G> conversions, or "
6416 "the maximum number of characters to be printed from a string for B<s> and "
6417 "B<S> conversions."
6418 msgstr ""
6419
6420 #. type: SS
6421 #: build/C/man3/printf.3:440
6422 #, no-wrap
6423 msgid "The length modifier"
6424 msgstr ""
6425
6426 #. type: Plain text
6427 #: build/C/man3/printf.3:450
6428 msgid ""
6429 "Here, \"integer conversion\" stands for B<d>, B<i>, B<o>, B<u>, B<x>, or "
6430 "B<X> conversion."
6431 msgstr ""
6432
6433 #. type: TP
6434 #: build/C/man3/printf.3:450 build/C/man3/scanf.3:291
6435 #, no-wrap
6436 msgid "B<hh>"
6437 msgstr ""
6438
6439 #. type: Plain text
6440 #: build/C/man3/printf.3:461
6441 msgid ""
6442 "A following integer conversion corresponds to a I<signed char> or I<unsigned "
6443 "char> argument, or a following B<n> conversion corresponds to a pointer to a "
6444 "I<signed char> argument."
6445 msgstr ""
6446
6447 #. type: TP
6448 #: build/C/man3/printf.3:461 build/C/man3/scanf.3:281
6449 #, no-wrap
6450 msgid "B<h>"
6451 msgstr ""
6452
6453 #. type: Plain text
6454 #: build/C/man3/printf.3:472
6455 msgid ""
6456 "A following integer conversion corresponds to a I<short int> or I<unsigned "
6457 "short int> argument, or a following B<n> conversion corresponds to a pointer "
6458 "to a I<short int> argument."
6459 msgstr ""
6460
6461 #. type: TP
6462 #: build/C/man3/printf.3:472 build/C/man3/scanf.3:308
6463 #, no-wrap
6464 msgid "B<l>"
6465 msgstr ""
6466
6467 #. type: Plain text
6468 #: build/C/man3/printf.3:491
6469 msgid ""
6470 "(ell) A following integer conversion corresponds to a I<long int> or "
6471 "I<unsigned long int> argument, or a following B<n> conversion corresponds to "
6472 "a pointer to a I<long int> argument, or a following B<c> conversion "
6473 "corresponds to a I<wint_t> argument, or a following B<s> conversion "
6474 "corresponds to a pointer to I<wchar_t> argument."
6475 msgstr ""
6476
6477 #. type: TP
6478 #: build/C/man3/printf.3:491
6479 #, no-wrap
6480 msgid "B<ll>"
6481 msgstr ""
6482
6483 #. type: Plain text
6484 #: build/C/man3/printf.3:503
6485 msgid ""
6486 "(ell-ell).  A following integer conversion corresponds to a I<long long int> "
6487 "or I<unsigned long long int> argument, or a following B<n> conversion "
6488 "corresponds to a pointer to a I<long long int> argument."
6489 msgstr ""
6490
6491 #. type: TP
6492 #: build/C/man3/printf.3:503 build/C/man3/scanf.3:335
6493 #, no-wrap
6494 msgid "B<L>"
6495 msgstr ""
6496
6497 #. type: Plain text
6498 #: build/C/man3/printf.3:519
6499 msgid ""
6500 "A following B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, or B<G> conversion "
6501 "corresponds to a I<long double> argument.  (C99 allows %LF, but SUSv2 does "
6502 "not.)"
6503 msgstr ""
6504
6505 #. type: TP
6506 #: build/C/man3/printf.3:519 build/C/man3/scanf.3:351
6507 #, no-wrap
6508 msgid "B<q>"
6509 msgstr ""
6510
6511 #. type: Plain text
6512 #: build/C/man3/printf.3:525
6513 msgid ""
6514 "(\"quad\". 4.4BSD and Linux libc5 only.  Don't use.)  This is a synonym for "
6515 "B<ll>."
6516 msgstr ""
6517
6518 #. type: TP
6519 #: build/C/man3/printf.3:525 build/C/man3/scanf.3:299
6520 #, no-wrap
6521 msgid "B<j>"
6522 msgstr ""
6523
6524 #. type: Plain text
6525 #: build/C/man3/printf.3:532
6526 msgid ""
6527 "A following integer conversion corresponds to an I<intmax_t> or I<uintmax_t> "
6528 "argument."
6529 msgstr ""
6530
6531 #. type: TP
6532 #: build/C/man3/printf.3:532 build/C/man3/scanf.3:363
6533 #, no-wrap
6534 msgid "B<z>"
6535 msgstr ""
6536
6537 #. type: Plain text
6538 #: build/C/man3/printf.3:543
6539 msgid ""
6540 "A following integer conversion corresponds to a I<size_t> or I<ssize_t> "
6541 "argument.  (Linux libc5 has B<Z> with this meaning.  Don't use it.)"
6542 msgstr ""
6543
6544 #. type: TP
6545 #: build/C/man3/printf.3:543 build/C/man3/scanf.3:356
6546 #, no-wrap
6547 msgid "B<t>"
6548 msgstr ""
6549
6550 #. type: Plain text
6551 #: build/C/man3/printf.3:548
6552 msgid "A following integer conversion corresponds to a I<ptrdiff_t> argument."
6553 msgstr ""
6554
6555 #. type: Plain text
6556 #: build/C/man3/printf.3:577
6557 msgid ""
6558 "The SUSv2 only knows about the length modifiers B<h> (in B<hd>, B<hi>, "
6559 "B<ho>, B<hx>, B<hX>, B<hn>)  and B<l> (in B<ld>, B<li>, B<lo>, B<lx>, B<lX>, "
6560 "B<ln>, B<lc>, B<ls>)  and B<L> (in B<Le>, B<LE>, B<Lf>, B<Lg>, B<LG>)."
6561 msgstr ""
6562
6563 #. type: SS
6564 #: build/C/man3/printf.3:577
6565 #, no-wrap
6566 msgid "The conversion specifier"
6567 msgstr ""
6568
6569 #. type: Plain text
6570 #: build/C/man3/printf.3:580
6571 msgid ""
6572 "A character that specifies the type of conversion to be applied.  The "
6573 "conversion specifiers and their meanings are:"
6574 msgstr ""
6575
6576 #. type: TP
6577 #: build/C/man3/printf.3:580
6578 #, no-wrap
6579 msgid "B<d>, B<i>"
6580 msgstr ""
6581
6582 #. type: Plain text
6583 #: build/C/man3/printf.3:590
6584 msgid ""
6585 "The I<int> argument is converted to signed decimal notation.  The precision, "
6586 "if any, gives the minimum number of digits that must appear; if the "
6587 "converted value requires fewer digits, it is padded on the left with zeros.  "
6588 "The default precision is 1.  When 0 is printed with an explicit precision 0, "
6589 "the output is empty."
6590 msgstr ""
6591
6592 #. type: TP
6593 #: build/C/man3/printf.3:590
6594 #, no-wrap
6595 msgid "B<o>, B<u>, B<x>, B<X>"
6596 msgstr ""
6597
6598 #. type: Plain text
6599 #: build/C/man3/printf.3:617
6600 msgid ""
6601 "The I<unsigned int> argument is converted to unsigned octal (B<o>), unsigned "
6602 "decimal (B<u>), or unsigned hexadecimal (B<x> and B<X>)  notation.  The "
6603 "letters B<abcdef> are used for B<x> conversions; the letters B<ABCDEF> are "
6604 "used for B<X> conversions.  The precision, if any, gives the minimum number "
6605 "of digits that must appear; if the converted value requires fewer digits, it "
6606 "is padded on the left with zeros.  The default precision is 1.  When 0 is "
6607 "printed with an explicit precision 0, the output is empty."
6608 msgstr ""
6609
6610 #. type: TP
6611 #: build/C/man3/printf.3:617
6612 #, no-wrap
6613 msgid "B<e>, B<E>"
6614 msgstr ""
6615
6616 #. type: Plain text
6617 #: build/C/man3/printf.3:622
6618 msgid "The I<double> argument is rounded and converted in the style"
6619 msgstr ""
6620
6621 #. type: Plain text
6622 #: build/C/man3/printf.3:637
6623 msgid ""
6624 "[-]dB<\\&.>dddB<e>\\*(Pmdd where there is one digit before the decimal-point "
6625 "character and the number of digits after it is equal to the precision; if "
6626 "the precision is missing, it is taken as 6; if the precision is zero, no "
6627 "decimal-point character appears.  An B<E> conversion uses the letter B<E> "
6628 "(rather than B<e>)  to introduce the exponent.  The exponent always contains "
6629 "at least two digits; if the value is zero, the exponent is 00."
6630 msgstr ""
6631
6632 #. type: TP
6633 #: build/C/man3/printf.3:637
6634 #, no-wrap
6635 msgid "B<f>, B<F>"
6636 msgstr ""
6637
6638 #. type: Plain text
6639 #: build/C/man3/printf.3:648
6640 msgid ""
6641 "The I<double> argument is rounded and converted to decimal notation in the "
6642 "style [-]dddB<\\&.>ddd, where the number of digits after the decimal-point "
6643 "character is equal to the precision specification.  If the precision is "
6644 "missing, it is taken as 6; if the precision is explicitly zero, no "
6645 "decimal-point character appears.  If a decimal point appears, at least one "
6646 "digit appears before it."
6647 msgstr ""
6648
6649 #. type: Plain text
6650 #: build/C/man3/printf.3:659
6651 msgid ""
6652 "(The SUSv2 does not know about B<F> and says that character string "
6653 "representations for infinity and NaN may be made available.  The C99 "
6654 "standard specifies \"[-]inf\" or \"[-]infinity\" for infinity, and a string "
6655 "starting with \"nan\" for NaN, in the case of B<f> conversion, and "
6656 "\"[-]INF\" or \"[-]INFINITY\" or \"NAN*\" in the case of B<F> conversion.)"
6657 msgstr ""
6658
6659 #. type: TP
6660 #: build/C/man3/printf.3:659
6661 #, no-wrap
6662 msgid "B<g>, B<G>"
6663 msgstr ""
6664
6665 #. type: Plain text
6666 #: build/C/man3/printf.3:684
6667 msgid ""
6668 "The I<double> argument is converted in style B<f> or B<e> (or B<F> or B<E> "
6669 "for B<G> conversions).  The precision specifies the number of significant "
6670 "digits.  If the precision is missing, 6 digits are given; if the precision "
6671 "is zero, it is treated as 1.  Style B<e> is used if the exponent from its "
6672 "conversion is less than -4 or greater than or equal to the precision.  "
6673 "Trailing zeros are removed from the fractional part of the result; a decimal "
6674 "point appears only if it is followed by at least one digit."
6675 msgstr ""
6676
6677 #. type: TP
6678 #: build/C/man3/printf.3:684
6679 #, no-wrap
6680 msgid "B<a>, B<A>"
6681 msgstr ""
6682
6683 #. type: Plain text
6684 #: build/C/man3/printf.3:708
6685 msgid ""
6686 "(C99; not in SUSv2) For B<a> conversion, the I<double> argument is converted "
6687 "to hexadecimal notation (using the letters abcdef)  in the style "
6688 "[-]B<0x>hB<\\&.>hhhhB<p>\\*(Pmd; for B<A> conversion the prefix B<0X>, the "
6689 "letters ABCDEF, and the exponent separator B<P> is used.  There is one "
6690 "hexadecimal digit before the decimal point, and the number of digits after "
6691 "it is equal to the precision.  The default precision suffices for an exact "
6692 "representation of the value if an exact representation in base 2 exists and "
6693 "otherwise is sufficiently large to distinguish values of type I<double>.  "
6694 "The digit before the decimal point is unspecified for nonnormalized numbers, "
6695 "and nonzero but otherwise unspecified for normalized numbers."
6696 msgstr ""
6697
6698 #. type: TP
6699 #: build/C/man3/printf.3:708 build/C/man3/scanf.3:456 build/C/man3/wprintf.3:132
6700 #, no-wrap
6701 msgid "B<c>"
6702 msgstr ""
6703
6704 #. type: Plain text
6705 #: build/C/man3/printf.3:726
6706 msgid ""
6707 "If no B<l> modifier is present, the I<int> argument is converted to an "
6708 "I<unsigned char>, and the resulting character is written.  If an B<l> "
6709 "modifier is present, the I<wint_t> (wide character) argument is converted to "
6710 "a multibyte sequence by a call to the B<wcrtomb>(3)  function, with a "
6711 "conversion state starting in the initial state, and the resulting multibyte "
6712 "string is written."
6713 msgstr ""
6714
6715 #. type: TP
6716 #: build/C/man3/printf.3:726 build/C/man3/scanf.3:448 build/C/man3/wprintf.3:146
6717 #, no-wrap
6718 msgid "B<s>"
6719 msgstr ""
6720
6721 #. type: Plain text
6722 #: build/C/man3/printf.3:741
6723 msgid ""
6724 "If no B<l> modifier is present: The I<const char *> argument is expected to "
6725 "be a pointer to an array of character type (pointer to a string).  "
6726 "Characters from the array are written up to (but not including) a "
6727 "terminating null byte (\\(aq\\e0\\(aq); if a precision is specified, no more "
6728 "than the number specified are written.  If a precision is given, no null "
6729 "byte need be present; if the precision is not specified, or is greater than "
6730 "the size of the array, the array must contain a terminating null byte."
6731 msgstr ""
6732
6733 #. type: Plain text
6734 #: build/C/man3/printf.3:768
6735 msgid ""
6736 "If an B<l> modifier is present: The I<const wchar_t *> argument is expected "
6737 "to be a pointer to an array of wide characters.  Wide characters from the "
6738 "array are converted to multibyte characters (each by a call to the "
6739 "B<wcrtomb>(3)  function, with a conversion state starting in the initial "
6740 "state before the first wide character), up to and including a terminating "
6741 "null wide character.  The resulting multibyte characters are written up to "
6742 "(but not including) the terminating null byte.  If a precision is specified, "
6743 "no more bytes than the number specified are written, but no partial "
6744 "multibyte characters are written.  Note that the precision determines the "
6745 "number of I<bytes> written, not the number of I<wide characters> or I<screen "
6746 "positions>.  The array must contain a terminating null wide character, "
6747 "unless a precision is given and it is so small that the number of bytes "
6748 "written exceeds it before the end of the array is reached."
6749 msgstr ""
6750
6751 #. type: TP
6752 #: build/C/man3/printf.3:768
6753 #, no-wrap
6754 msgid "B<C>"
6755 msgstr ""
6756
6757 #. type: Plain text
6758 #: build/C/man3/printf.3:774
6759 msgid "(Not in C99, but in SUSv2.)  Synonym for B<lc>.  Don't use."
6760 msgstr ""
6761
6762 #. type: TP
6763 #: build/C/man3/printf.3:774
6764 #, no-wrap
6765 msgid "B<S>"
6766 msgstr ""
6767
6768 #. type: Plain text
6769 #: build/C/man3/printf.3:780
6770 msgid "(Not in C99, but in SUSv2.)  Synonym for B<ls>.  Don't use."
6771 msgstr ""
6772
6773 #. type: TP
6774 #: build/C/man3/printf.3:780 build/C/man3/scanf.3:500
6775 #, no-wrap
6776 msgid "B<p>"
6777 msgstr ""
6778
6779 #. type: Plain text
6780 #: build/C/man3/printf.3:788
6781 msgid ""
6782 "The I<void *> pointer argument is printed in hexadecimal (as if by B<%#x> or "
6783 "B<%#lx>)."
6784 msgstr ""
6785
6786 #. type: TP
6787 #: build/C/man3/printf.3:788 build/C/man3/scanf.3:508
6788 #, no-wrap
6789 msgid "B<n>"
6790 msgstr ""
6791
6792 #. type: Plain text
6793 #: build/C/man3/printf.3:795
6794 msgid ""
6795 "The number of characters written so far is stored into the integer indicated "
6796 "by the I<int *> (or variant) pointer argument.  No argument is converted."
6797 msgstr ""
6798
6799 #. type: TP
6800 #: build/C/man3/printf.3:795
6801 #, no-wrap
6802 msgid "B<m>"
6803 msgstr ""
6804
6805 #. type: Plain text
6806 #: build/C/man3/printf.3:801
6807 msgid ""
6808 "(Glibc extension.)  Print output of I<strerror(errno)>.  No argument is "
6809 "required."
6810 msgstr ""
6811
6812 #. type: TP
6813 #: build/C/man3/printf.3:801 build/C/man3/scanf.3:374
6814 #, no-wrap
6815 msgid "B<%>"
6816 msgstr ""
6817
6818 #. type: Plain text
6819 #: build/C/man3/printf.3:807
6820 msgid ""
6821 "A \\(aq%\\(aq is written.  No argument is converted.  The complete "
6822 "conversion specification is \\(aq%%\\(aq."
6823 msgstr ""
6824
6825 #. type: Plain text
6826 #: build/C/man3/printf.3:822
6827 msgid ""
6828 "The B<fprintf>(), B<printf>(), B<sprintf>(), B<vprintf>(), B<vfprintf>(), "
6829 "and B<vsprintf>()  functions conform to C89 and C99.  The B<snprintf>()  and "
6830 "B<vsnprintf>()  functions conform to C99."
6831 msgstr ""
6832
6833 #. type: Plain text
6834 #: build/C/man3/printf.3:835
6835 msgid ""
6836 "Concerning the return value of B<snprintf>(), SUSv2 and C99 contradict each "
6837 "other: when B<snprintf>()  is called with I<size>=0 then SUSv2 stipulates an "
6838 "unspecified return value less than 1, while C99 allows I<str> to be NULL in "
6839 "this case, and gives the return value (as always)  as the number of "
6840 "characters that would have been written in case the output string has been "
6841 "large enough."
6842 msgstr ""
6843
6844 #. type: Plain text
6845 #: build/C/man3/printf.3:849
6846 msgid ""
6847 "Linux libc4 knows about the five C standard flags.  It knows about the "
6848 "length modifiers B<h>, B<l>, B<L>, and the conversions B<c>, B<d>, B<e>, "
6849 "B<E>, B<f>, B<F>, B<g>, B<G>, B<i>, B<n>, B<o>, B<p>, B<s>, B<u>, B<x>, and "
6850 "B<X>, where B<F> is a synonym for B<f>.  Additionally, it accepts B<D>, "
6851 "B<O>, and B<U> as synonyms for B<ld>, B<lo>, and B<lu>.  (This is bad, and "
6852 "caused serious bugs later, when support for B<%D> disappeared.)  No "
6853 "locale-dependent radix character, no thousands' separator, no NaN or "
6854 "infinity, no \"%m$\" and \"*m$\"."
6855 msgstr ""
6856
6857 #. type: Plain text
6858 #: build/C/man3/printf.3:860
6859 msgid ""
6860 "Linux libc5 knows about the five C standard flags and the \\(aq flag, "
6861 "locale, \"%m$\" and \"*m$\".  It knows about the length modifiers B<h>, "
6862 "B<l>, B<L>, B<Z>, and B<q>, but accepts B<L> and B<q> both for I<long "
6863 "double> and for I<long long int> (this is a bug).  It no longer recognizes "
6864 "B<F>, B<D>, B<O>, and B<U>, but adds the conversion character B<m>, which "
6865 "outputs I<strerror(errno)>."
6866 msgstr ""
6867
6868 #. type: Plain text
6869 #: build/C/man3/printf.3:862
6870 msgid "glibc 2.0 adds conversion characters B<C> and B<S>."
6871 msgstr ""
6872
6873 #. type: Plain text
6874 #: build/C/man3/printf.3:865
6875 msgid ""
6876 "glibc 2.1 adds length modifiers B<hh>, B<j>, B<t>, and B<z> and conversion "
6877 "characters B<a> and B<A>."
6878 msgstr ""
6879
6880 #. type: Plain text
6881 #: build/C/man3/printf.3:868
6882 msgid ""
6883 "glibc 2.2 adds the conversion character B<F> with C99 semantics, and the "
6884 "flag character B<I>."
6885 msgstr ""
6886
6887 #. type: Plain text
6888 #: build/C/man3/printf.3:870
6889 msgid "Some programs imprudently rely on code such as the following"
6890 msgstr ""
6891
6892 #. type: Plain text
6893 #: build/C/man3/printf.3:872
6894 #, no-wrap
6895 msgid "    sprintf(buf, \"%s some further text\", buf);\n"
6896 msgstr ""
6897
6898 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7075
6899 #. type: Plain text
6900 #: build/C/man3/printf.3:888
6901 msgid ""
6902 "to append text to I<buf>.  However, the standards explicitly note that the "
6903 "results are undefined if source and destination buffers overlap when calling "
6904 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), and B<vsnprintf>().  Depending "
6905 "on the version of B<gcc>(1)  used, and the compiler options employed, calls "
6906 "such as the above will B<not> produce the expected results."
6907 msgstr ""
6908
6909 #.  .SH HISTORY
6910 #.  UNIX V7 defines the three routines
6911 #.  .BR printf (),
6912 #.  .BR fprintf (),
6913 #.  .BR sprintf (),
6914 #.  and has the flag \-, the width or precision *, the length modifier l,
6915 #.  and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx.
6916 #.  This is still true for 2.9.1BSD, but 2.10BSD has the flags
6917 #.  #, + and <space> and no longer mentions D,O,U,X.
6918 #.  2.11BSD has
6919 #.  .BR vprintf (),
6920 #.  .BR vfprintf (),
6921 #.  .BR vsprintf (),
6922 #.  and warns not to use D,O,U,X.
6923 #.  4.3BSD Reno has the flag 0, the length modifiers h and L,
6924 #.  and the conversions n, p, E, G, X (with current meaning)
6925 #.  and deprecates D,O,U.
6926 #.  4.4BSD introduces the functions
6927 #.  .BR snprintf ()
6928 #.  and
6929 #.  .BR vsnprintf (),
6930 #.  and the length modifier q.
6931 #.  FreeBSD also has functions
6932 #.  .BR asprintf ()
6933 #.  and
6934 #.  .BR vasprintf (),
6935 #.  that allocate a buffer large enough for
6936 #.  .BR sprintf ().
6937 #.  In glibc there are functions
6938 #.  .BR dprintf ()
6939 #.  and
6940 #.  .BR vdprintf ()
6941 #.  that print to a file descriptor instead of a stream.
6942 #. type: Plain text
6943 #: build/C/man3/printf.3:930
6944 msgid ""
6945 "The glibc implementation of the functions B<snprintf>()  and B<vsnprintf>()  "
6946 "conforms to the C99 standard, that is, behaves as described above, since "
6947 "glibc version 2.1.  Until glibc 2.0.6 they would return -1 when the output "
6948 "was truncated."
6949 msgstr ""
6950
6951 #. type: Plain text
6952 #: build/C/man3/printf.3:947
6953 msgid ""
6954 "Because B<sprintf>()  and B<vsprintf>()  assume an arbitrarily long string, "
6955 "callers must be careful not to overflow the actual space; this is often "
6956 "impossible to assure.  Note that the length of the strings produced is "
6957 "locale-dependent and difficult to predict.  Use B<snprintf>()  and "
6958 "B<vsnprintf>()  instead (or B<asprintf>(3)  and B<vasprintf>(3))."
6959 msgstr ""
6960
6961 #. type: Plain text
6962 #: build/C/man3/printf.3:960
6963 msgid ""
6964 "Linux libc4.[45] does not have a B<snprintf>(), but provides a libbsd that "
6965 "contains an B<snprintf>()  equivalent to B<sprintf>(), that is, one that "
6966 "ignores the I<size> argument.  Thus, the use of B<snprintf>()  with early "
6967 "libc4 leads to serious security problems."
6968 msgstr ""
6969
6970 #.  .PP
6971 #.  Some floating-point conversions under early libc4
6972 #.  caused memory leaks.
6973 #. type: Plain text
6974 #: build/C/man3/printf.3:974
6975 msgid ""
6976 "Code such as B<printf(>I<foo>B<);> often indicates a bug, since I<foo> may "
6977 "contain a % character.  If I<foo> comes from untrusted user input, it may "
6978 "contain B<%n>, causing the B<printf>()  call to write to memory and creating "
6979 "a security hole."
6980 msgstr ""
6981
6982 #. type: Plain text
6983 #: build/C/man3/printf.3:977
6984 msgid "To print \\*(Pi to five decimal places:"
6985 msgstr ""
6986
6987 #. type: Plain text
6988 #: build/C/man3/printf.3:983
6989 #, no-wrap
6990 msgid ""
6991 "#include E<lt>math.hE<gt>\n"
6992 "#include E<lt>stdio.hE<gt>\n"
6993 "fprintf(stdout, \"pi = %.5f\\en\", 4 * atan(1.0));\n"
6994 msgstr ""
6995
6996 #. type: Plain text
6997 #: build/C/man3/printf.3:992
6998 msgid ""
6999 "To print a date and time in the form \"Sunday, July 3, 10:02\", where "
7000 "I<weekday> and I<month> are pointers to strings:"
7001 msgstr ""
7002
7003 #. type: Plain text
7004 #: build/C/man3/printf.3:998
7005 #, no-wrap
7006 msgid ""
7007 "#include E<lt>stdio.hE<gt>\n"
7008 "fprintf(stdout, \"%s, %s %d, %.2d:%.2d\\en\",\n"
7009 "        weekday, month, day, hour, min);\n"
7010 msgstr ""
7011
7012 #. type: Plain text
7013 #: build/C/man3/printf.3:1004
7014 msgid ""
7015 "Many countries use the day-month-year order.  Hence, an internationalized "
7016 "version must be able to print the arguments in an order specified by the "
7017 "format:"
7018 msgstr ""
7019
7020 #. type: Plain text
7021 #: build/C/man3/printf.3:1010
7022 #, no-wrap
7023 msgid ""
7024 "#include E<lt>stdio.hE<gt>\n"
7025 "fprintf(stdout, format,\n"
7026 "        weekday, month, day, hour, min);\n"
7027 msgstr ""
7028
7029 #. type: Plain text
7030 #: build/C/man3/printf.3:1017
7031 msgid ""
7032 "where I<format> depends on locale, and may permute the arguments.  With the "
7033 "value:"
7034 msgstr ""
7035
7036 #. type: Plain text
7037 #: build/C/man3/printf.3:1021
7038 #, no-wrap
7039 msgid "\"%1$s, %3$d. %2$s, %4$d:%5$.2d\\en\"\n"
7040 msgstr ""
7041
7042 #. type: Plain text
7043 #: build/C/man3/printf.3:1025
7044 msgid "one might obtain \"Sonntag, 3. Juli, 10:02\"."
7045 msgstr ""
7046
7047 #. type: Plain text
7048 #: build/C/man3/printf.3:1028
7049 msgid ""
7050 "To allocate a sufficiently large string and print into it (code correct for "
7051 "both glibc 2.0 and glibc 2.1):"
7052 msgstr ""
7053
7054 #. type: Plain text
7055 #: build/C/man3/printf.3:1033
7056 #, no-wrap
7057 msgid ""
7058 "#include E<lt>stdio.hE<gt>\n"
7059 "#include E<lt>stdlib.hE<gt>\n"
7060 "#include E<lt>stdarg.hE<gt>\n"
7061 msgstr ""
7062
7063 #. type: Plain text
7064 #: build/C/man3/printf.3:1041
7065 #, no-wrap
7066 msgid ""
7067 "char *\n"
7068 "make_message(const char *fmt, ...)\n"
7069 "{\n"
7070 "    int n;\n"
7071 "    int size = 100;     /* Guess we need no more than 100 bytes. */\n"
7072 "    char *p, *np;\n"
7073 "    va_list ap;\n"
7074 msgstr ""
7075
7076 #. type: Plain text
7077 #: build/C/man3/printf.3:1044
7078 #, no-wrap
7079 msgid ""
7080 "    if ((p = malloc(size)) == NULL)\n"
7081 "        return NULL;\n"
7082 msgstr ""
7083
7084 #. type: Plain text
7085 #: build/C/man3/printf.3:1046
7086 #, no-wrap
7087 msgid "    while (1) {\n"
7088 msgstr ""
7089
7090 #. type: Plain text
7091 #: build/C/man3/printf.3:1048
7092 #, no-wrap
7093 msgid "        /* Try to print in the allocated space. */\n"
7094 msgstr ""
7095
7096 #. type: Plain text
7097 #: build/C/man3/printf.3:1052
7098 #, no-wrap
7099 msgid ""
7100 "        va_start(ap, fmt);\n"
7101 "        n = vsnprintf(p, size, fmt, ap);\n"
7102 "        va_end(ap);\n"
7103 msgstr ""
7104
7105 #. type: Plain text
7106 #: build/C/man3/printf.3:1054
7107 #, no-wrap
7108 msgid "        /* If that worked, return the string. */\n"
7109 msgstr ""
7110
7111 #. type: Plain text
7112 #: build/C/man3/printf.3:1057
7113 #, no-wrap
7114 msgid ""
7115 "        if (n E<gt> -1 && n E<lt> size)\n"
7116 "            return p;\n"
7117 msgstr ""
7118
7119 #. type: Plain text
7120 #: build/C/man3/printf.3:1059
7121 #, no-wrap
7122 msgid "        /* Else try again with more space. */\n"
7123 msgstr ""
7124
7125 #. type: Plain text
7126 #: build/C/man3/printf.3:1064
7127 #, no-wrap
7128 msgid ""
7129 "        if (n E<gt> -1)    /* glibc 2.1 */\n"
7130 "            size = n+1; /* precisely what is needed */\n"
7131 "        else           /* glibc 2.0 */\n"
7132 "            size *= 2;  /* twice the old size */\n"
7133 msgstr ""
7134
7135 #. type: Plain text
7136 #: build/C/man3/printf.3:1073
7137 #, no-wrap
7138 msgid ""
7139 "        if ((np = realloc (p, size)) == NULL) {\n"
7140 "            free(p);\n"
7141 "            return NULL;\n"
7142 "        } else {\n"
7143 "            p = np;\n"
7144 "        }\n"
7145 "    }\n"
7146 "}\n"
7147 msgstr ""
7148
7149 #. type: Plain text
7150 #: build/C/man3/printf.3:1082
7151 msgid ""
7152 "B<printf>(1), B<asprintf>(3), B<dprintf>(3), B<scanf>(3), B<setlocale>(3), "
7153 "B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)"
7154 msgstr ""
7155
7156 #. type: TH
7157 #: build/C/man3/puts.3:24
7158 #, no-wrap
7159 msgid "PUTS"
7160 msgstr ""
7161
7162 #. type: Plain text
7163 #: build/C/man3/puts.3:27
7164 msgid "fputc, fputs, putc, putchar, puts - output of characters and strings"
7165 msgstr ""
7166
7167 #. type: Plain text
7168 #: build/C/man3/puts.3:32
7169 #, no-wrap
7170 msgid "B<int fputc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7171 msgstr ""
7172
7173 #. type: Plain text
7174 #: build/C/man3/puts.3:34
7175 #, no-wrap
7176 msgid "B<int fputs(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
7177 msgstr ""
7178
7179 #. type: Plain text
7180 #: build/C/man3/puts.3:36
7181 #, no-wrap
7182 msgid "B<int putc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7183 msgstr ""
7184
7185 #. type: Plain text
7186 #: build/C/man3/puts.3:38
7187 #, no-wrap
7188 msgid "B<int putchar(int >I<c>B<);>\n"
7189 msgstr ""
7190
7191 #. type: Plain text
7192 #: build/C/man3/puts.3:40
7193 #, no-wrap
7194 msgid "B<int puts(const char *>I<s>B<);>\n"
7195 msgstr ""
7196
7197 #. type: Plain text
7198 #: build/C/man3/puts.3:49
7199 msgid ""
7200 "B<fputc>()  writes the character I<c>, cast to an I<unsigned char>, to "
7201 "I<stream>."
7202 msgstr ""
7203
7204 #. type: Plain text
7205 #: build/C/man3/puts.3:56
7206 msgid ""
7207 "B<fputs>()  writes the string I<s> to I<stream>, without its terminating "
7208 "null byte (\\(aq\\e0\\(aq)."
7209 msgstr ""
7210
7211 #. type: Plain text
7212 #: build/C/man3/puts.3:63
7213 msgid ""
7214 "B<putc>()  is equivalent to B<fputc>()  except that it may be implemented as "
7215 "a macro which evaluates I<stream> more than once."
7216 msgstr ""
7217
7218 #. type: Plain text
7219 #: build/C/man3/puts.3:67
7220 msgid "B<putchar(>I<c>B<);> is equivalent to B<putc(>I<c>B<,>I<stdout>B<).>"
7221 msgstr ""
7222
7223 #. type: Plain text
7224 #: build/C/man3/puts.3:74
7225 msgid "B<puts>()  writes the string I<s> and a trailing newline to I<stdout>."
7226 msgstr ""
7227
7228 #. type: Plain text
7229 #: build/C/man3/puts.3:79
7230 msgid ""
7231 "Calls to the functions described here can be mixed with each other and with "
7232 "calls to other output functions from the I<stdio> library for the same "
7233 "output stream."
7234 msgstr ""
7235
7236 #. type: Plain text
7237 #: build/C/man3/puts.3:94
7238 msgid ""
7239 "B<fputc>(), B<putc>()  and B<putchar>()  return the character written as an "
7240 "I<unsigned char> cast to an I<int> or B<EOF> on error."
7241 msgstr ""
7242
7243 #. type: Plain text
7244 #: build/C/man3/puts.3:101
7245 msgid ""
7246 "B<puts>()  and B<fputs>()  return a nonnegative number on success, or B<EOF> "
7247 "on error."
7248 msgstr ""
7249
7250 #. type: Plain text
7251 #: build/C/man3/puts.3:110
7252 msgid ""
7253 "It is not advisable to mix calls to output functions from the I<stdio> "
7254 "library with low-level calls to B<write>(2)  for the file descriptor "
7255 "associated with the same output stream; the results will be undefined and "
7256 "very probably not what you want."
7257 msgstr ""
7258
7259 #. type: Plain text
7260 #: build/C/man3/puts.3:121
7261 msgid ""
7262 "B<write>(2), B<ferror>(3), B<fopen>(3), B<fputwc>(3), B<fputws>(3), "
7263 "B<fseek>(3), B<fwrite>(3), B<gets>(3), B<putwchar>(3), B<scanf>(3), "
7264 "B<unlocked_stdio>(3)"
7265 msgstr ""
7266
7267 #. type: TH
7268 #: build/C/man2/read.2:35
7269 #, no-wrap
7270 msgid "READ"
7271 msgstr ""
7272
7273 #. type: Plain text
7274 #: build/C/man2/read.2:38
7275 msgid "read - read from a file descriptor"
7276 msgstr ""
7277
7278 #. type: Plain text
7279 #: build/C/man2/read.2:43
7280 #, no-wrap
7281 msgid "B<ssize_t read(int >I<fd>B<, void *>I<buf>B<, size_t >I<count>B<);>\n"
7282 msgstr ""
7283
7284 #. type: Plain text
7285 #: build/C/man2/read.2:52
7286 msgid ""
7287 "B<read>()  attempts to read up to I<count> bytes from file descriptor I<fd> "
7288 "into the buffer starting at I<buf>."
7289 msgstr ""
7290
7291 #. type: Plain text
7292 #: build/C/man2/read.2:63
7293 msgid ""
7294 "If I<count> is zero, B<read>()  returns zero and has no other results.  If "
7295 "I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
7296 msgstr ""
7297
7298 #. type: Plain text
7299 #: build/C/man2/read.2:77
7300 msgid ""
7301 "On success, the number of bytes read is returned (zero indicates end of "
7302 "file), and the file position is advanced by this number.  It is not an error "
7303 "if this number is smaller than the number of bytes requested; this may "
7304 "happen for example because fewer bytes are actually available right now "
7305 "(maybe because we were close to end-of-file, or because we are reading from "
7306 "a pipe, or from a terminal), or because B<read>()  was interrupted by a "
7307 "signal.  On error, -1 is returned, and I<errno> is set appropriately.  In "
7308 "this case it is left unspecified whether the file position (if any) changes."
7309 msgstr ""
7310
7311 #. type: TP
7312 #: build/C/man2/read.2:78 build/C/man3/scanf.3:546 build/C/man2/write.2:108
7313 #, no-wrap
7314 msgid "B<EAGAIN>"
7315 msgstr ""
7316
7317 #. type: Plain text
7318 #: build/C/man2/read.2:85
7319 msgid ""
7320 "The file descriptor I<fd> refers to a file other than a socket and has been "
7321 "marked nonblocking (B<O_NONBLOCK>), and the read would block."
7322 msgstr ""
7323
7324 #. type: TP
7325 #: build/C/man2/read.2:85 build/C/man2/write.2:115
7326 #, no-wrap
7327 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
7328 msgstr ""
7329
7330 #.  Actually EAGAIN on Linux
7331 #. type: Plain text
7332 #: build/C/man2/read.2:96
7333 msgid ""
7334 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
7335 "(B<O_NONBLOCK>), and the read would block.  POSIX.1-2001 allows either error "
7336 "to be returned for this case, and does not require these constants to have "
7337 "the same value, so a portable application should check for both "
7338 "possibilities."
7339 msgstr ""
7340
7341 #. type: Plain text
7342 #: build/C/man2/read.2:100
7343 msgid "I<fd> is not a valid file descriptor or is not open for reading."
7344 msgstr ""
7345
7346 #. type: Plain text
7347 #: build/C/man2/read.2:104 build/C/man2/write.2:139
7348 msgid "I<buf> is outside your accessible address space."
7349 msgstr ""
7350
7351 #. type: Plain text
7352 #: build/C/man2/read.2:108
7353 msgid ""
7354 "The call was interrupted by a signal before any data was read; see "
7355 "B<signal>(7)."
7356 msgstr ""
7357
7358 #. type: Plain text
7359 #: build/C/man2/read.2:119
7360 msgid ""
7361 "I<fd> is attached to an object which is unsuitable for reading; or the file "
7362 "was opened with the B<O_DIRECT> flag, and either the address specified in "
7363 "I<buf>, the value specified in I<count>, or the current file offset is not "
7364 "suitably aligned."
7365 msgstr ""
7366
7367 #. type: Plain text
7368 #: build/C/man2/read.2:129
7369 msgid ""
7370 "I<fd> was created via a call to B<timerfd_create>(2)  and the wrong size "
7371 "buffer was given to B<read>(); see B<timerfd_create>(2)  for further "
7372 "information."
7373 msgstr ""
7374
7375 #. type: Plain text
7376 #: build/C/man2/read.2:140
7377 msgid ""
7378 "I/O error.  This will happen for example when the process is in a background "
7379 "process group, tries to read from its controlling tty, and either it is "
7380 "ignoring or blocking B<SIGTTIN> or its process group is orphaned.  It may "
7381 "also occur when there is a low-level I/O error while reading from a disk or "
7382 "tape."
7383 msgstr ""
7384
7385 #. type: Plain text
7386 #: build/C/man2/read.2:144
7387 msgid "I<fd> refers to a directory."
7388 msgstr ""
7389
7390 #. type: Plain text
7391 #: build/C/man2/read.2:155
7392 msgid ""
7393 "Other errors may occur, depending on the object connected to I<fd>.  POSIX "
7394 "allows a B<read>()  that is interrupted after reading some data to return -1 "
7395 "(with I<errno> set to B<EINTR>)  or to return the number of bytes already "
7396 "read."
7397 msgstr ""
7398
7399 #. type: Plain text
7400 #: build/C/man2/read.2:169
7401 msgid ""
7402 "On NFS file systems, reading small amounts of data will only update the "
7403 "timestamp the first time, subsequent calls may not do so.  This is caused by "
7404 "client side attribute caching, because most if not all NFS clients leave "
7405 "st_atime (last file access time)  updates to the server and client side "
7406 "reads satisfied from the client's cache will not cause st_atime updates on "
7407 "the server as there are no server side reads.  UNIX semantics can be "
7408 "obtained by disabling client side attribute caching, but in most situations "
7409 "this will substantially increase server load and decrease performance."
7410 msgstr ""
7411
7412 #. type: Plain text
7413 #: build/C/man2/read.2:178
7414 msgid ""
7415 "Many file systems and disks were considered to be fast enough that the "
7416 "implementation of B<O_NONBLOCK> was deemed unnecessary.  So, B<O_NONBLOCK> "
7417 "may not be available on files and/or disks."
7418 msgstr ""
7419
7420 #. type: Plain text
7421 #: build/C/man2/read.2:190
7422 msgid ""
7423 "B<close>(2), B<fcntl>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), B<pread>(2), "
7424 "B<readdir>(2), B<readlink>(2), B<readv>(2), B<select>(2), B<write>(2), "
7425 "B<fread>(3)"
7426 msgstr ""
7427
7428 #. type: TH
7429 #: build/C/man2/readlink.2:41
7430 #, no-wrap
7431 msgid "READLINK"
7432 msgstr ""
7433
7434 #. type: TH
7435 #: build/C/man2/readlink.2:41
7436 #, no-wrap
7437 msgid "2011-09-20"
7438 msgstr ""
7439
7440 #. type: Plain text
7441 #: build/C/man2/readlink.2:44
7442 msgid "readlink - read value of a symbolic link"
7443 msgstr ""
7444
7445 #. type: Plain text
7446 #: build/C/man2/readlink.2:48
7447 msgid ""
7448 "B<ssize_t readlink(const char *>I<path>B<, char *>I<buf>B<, size_t "
7449 ">I<bufsiz>B<);>"
7450 msgstr ""
7451
7452 #. type: Plain text
7453 #: build/C/man2/readlink.2:56
7454 msgid "B<readlink>():"
7455 msgstr ""
7456
7457 #. type: Plain text
7458 #: build/C/man2/readlink.2:59 build/C/man2/symlink.2:50
7459 msgid ""
7460 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
7461 "_XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
7462 msgstr ""
7463
7464 #. type: Plain text
7465 #: build/C/man2/readlink.2:75
7466 msgid ""
7467 "B<readlink>()  places the contents of the symbolic link I<path> in the "
7468 "buffer I<buf>, which has size I<bufsiz>.  B<readlink>()  does not append a "
7469 "null byte to I<buf>.  It will truncate the contents (to a length of "
7470 "I<bufsiz> characters), in case the buffer is too small to hold all of the "
7471 "contents."
7472 msgstr ""
7473
7474 #. type: Plain text
7475 #: build/C/man2/readlink.2:83
7476 msgid ""
7477 "On success, B<readlink>()  returns the number of bytes placed in I<buf>.  On "
7478 "error, -1 is returned and I<errno> is set to indicate the error."
7479 msgstr ""
7480
7481 #. type: Plain text
7482 #: build/C/man2/readlink.2:89
7483 msgid ""
7484 "Search permission is denied for a component of the path prefix.  (See also "
7485 "B<path_resolution>(7).)"
7486 msgstr ""
7487
7488 #. type: Plain text
7489 #: build/C/man2/readlink.2:93
7490 msgid "I<buf> extends outside the process's allocated address space."
7491 msgstr ""
7492
7493 #.  At the glibc level, bufsiz is unsigned, so this error can only occur
7494 #.  if bufsiz==0.  However, the in the kernel syscall, bufsiz is signed,
7495 #.  and this error can also occur if bufsiz < 0.
7496 #.  See: http://thread.gmane.org/gmane.linux.man/380
7497 #.  Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
7498 #. type: Plain text
7499 #: build/C/man2/readlink.2:102
7500 msgid "I<bufsiz> is not positive."
7501 msgstr ""
7502
7503 #. type: Plain text
7504 #: build/C/man2/readlink.2:105
7505 msgid "The named file is not a symbolic link."
7506 msgstr ""
7507
7508 #. type: Plain text
7509 #: build/C/man2/readlink.2:108
7510 msgid "An I/O error occurred while reading from the file system."
7511 msgstr ""
7512
7513 #. type: Plain text
7514 #: build/C/man2/readlink.2:111
7515 msgid "Too many symbolic links were encountered in translating the pathname."
7516 msgstr ""
7517
7518 #. type: Plain text
7519 #: build/C/man2/readlink.2:114
7520 msgid "A pathname, or a component of a pathname, was too long."
7521 msgstr ""
7522
7523 #. type: Plain text
7524 #: build/C/man2/readlink.2:117
7525 msgid "The named file does not exist."
7526 msgstr ""
7527
7528 #. type: Plain text
7529 #: build/C/man2/readlink.2:123
7530 msgid "A component of the path prefix is not a directory."
7531 msgstr ""
7532
7533 #. type: Plain text
7534 #: build/C/man2/readlink.2:128
7535 msgid "4.4BSD (B<readlink>()  first appeared in 4.2BSD), POSIX.1-2001."
7536 msgstr ""
7537
7538 #. type: Plain text
7539 #: build/C/man2/readlink.2:136
7540 msgid ""
7541 "In versions of glibc up to and including glibc 2.4, the return type of "
7542 "B<readlink>()  was declared as I<int>.  Nowadays, the return type is "
7543 "declared as I<ssize_t>, as (newly) required in POSIX.1-2001."
7544 msgstr ""
7545
7546 #. type: Plain text
7547 #: build/C/man2/readlink.2:155
7548 msgid ""
7549 "Using a statically sized buffer might not provide enough room for the "
7550 "symbolic link contents.  The required size for the buffer can be obtained "
7551 "from the I<stat.st_size> value returned by a call to B<lstat>(2)  on the "
7552 "link.  However, the number of bytes written by B<readlink>()  should be "
7553 "checked to make sure that the size of the symbolic link did not increase "
7554 "between the calls.  Dynamically allocating the buffer for B<readlink>()  "
7555 "also addresses a common portability problem when using I<PATH_MAX> for the "
7556 "buffer size, as this constant is not guaranteed to be defined per POSIX if "
7557 "the system does not have such limit."
7558 msgstr ""
7559
7560 #. type: Plain text
7561 #: build/C/man2/readlink.2:161
7562 msgid ""
7563 "The following program allocates the buffer needed by B<readlink>()  "
7564 "dynamically from the information provided by B<lstat>(), making sure there's "
7565 "no race condition between the calls."
7566 msgstr ""
7567
7568 #. type: Plain text
7569 #: build/C/man2/readlink.2:168
7570 #, no-wrap
7571 msgid ""
7572 "#include E<lt>sys/types.hE<gt>\n"
7573 "#include E<lt>sys/stat.hE<gt>\n"
7574 "#include E<lt>stdio.hE<gt>\n"
7575 "#include E<lt>stdlib.hE<gt>\n"
7576 "#include E<lt>unistd.hE<gt>\n"
7577 msgstr ""
7578
7579 #. type: Plain text
7580 #: build/C/man2/readlink.2:175
7581 #, no-wrap
7582 msgid ""
7583 "int\n"
7584 "main(int argc, char *argv[])\n"
7585 "{\n"
7586 "    struct stat sb;\n"
7587 "    char *linkname;\n"
7588 "    ssize_t r;\n"
7589 msgstr ""
7590
7591 #. type: Plain text
7592 #: build/C/man2/readlink.2:180
7593 #, no-wrap
7594 msgid ""
7595 "    if (argc != 2) {\n"
7596 "        fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt>\\en\", argv[0]);\n"
7597 "        exit(EXIT_FAILURE);\n"
7598 "    }\n"
7599 msgstr ""
7600
7601 #. type: Plain text
7602 #: build/C/man2/readlink.2:185
7603 #, no-wrap
7604 msgid ""
7605 "    if (lstat(argv[1], &sb) == -1) {\n"
7606 "        perror(\"lstat\");\n"
7607 "        exit(EXIT_FAILURE);\n"
7608 "    }\n"
7609 msgstr ""
7610
7611 #. type: Plain text
7612 #: build/C/man2/readlink.2:191
7613 #, no-wrap
7614 msgid ""
7615 "    linkname = malloc(sb.st_size + 1);\n"
7616 "    if (linkname == NULL) {\n"
7617 "        fprintf(stderr, \"insufficient memory\\en\");\n"
7618 "        exit(EXIT_FAILURE);\n"
7619 "    }\n"
7620 msgstr ""
7621
7622 #. type: Plain text
7623 #: build/C/man2/readlink.2:193
7624 #, no-wrap
7625 msgid "    r = readlink(argv[1], linkname, sb.st_size + 1);\n"
7626 msgstr ""
7627
7628 #. type: Plain text
7629 #: build/C/man2/readlink.2:198
7630 #, no-wrap
7631 msgid ""
7632 "    if (r E<lt> 0) {\n"
7633 "        perror(\"lstat\");\n"
7634 "        exit(EXIT_FAILURE);\n"
7635 "    }\n"
7636 msgstr ""
7637
7638 #. type: Plain text
7639 #: build/C/man2/readlink.2:204
7640 #, no-wrap
7641 msgid ""
7642 "    if (r E<gt> sb.st_size) {\n"
7643 "        fprintf(stderr, \"symlink increased in size \"\n"
7644 "                        \"between lstat() and readlink()\\en\");\n"
7645 "        exit(EXIT_FAILURE);\n"
7646 "    }\n"
7647 msgstr ""
7648
7649 #. type: Plain text
7650 #: build/C/man2/readlink.2:206
7651 #, no-wrap
7652 msgid "    linkname[sb.st_size] = \\(aq\\e0\\(aq;\n"
7653 msgstr ""
7654
7655 #. type: Plain text
7656 #: build/C/man2/readlink.2:208
7657 #, no-wrap
7658 msgid ""
7659 "    printf(\"\\(aq%s\\(aq points to \\(aq%s\\(aq\\en\", argv[1], "
7660 "linkname);\n"
7661 msgstr ""
7662
7663 #. type: Plain text
7664 #: build/C/man2/readlink.2:219
7665 msgid ""
7666 "B<readlink>(1), B<lstat>(2), B<readlinkat>(2), B<stat>(2), B<symlink>(2), "
7667 "B<path_resolution>(7), B<symlink>(7)"
7668 msgstr ""
7669
7670 #. type: TH
7671 #: build/C/man2/readv.2:30
7672 #, no-wrap
7673 msgid "READV"
7674 msgstr ""
7675
7676 #. type: TH
7677 #: build/C/man2/readv.2:30
7678 #, no-wrap
7679 msgid "2010-11-17"
7680 msgstr ""
7681
7682 #. type: Plain text
7683 #: build/C/man2/readv.2:33
7684 msgid "readv, writev, preadv, pwritev - read or write data into multiple buffers"
7685 msgstr ""
7686
7687 #. type: Plain text
7688 #: build/C/man2/readv.2:36
7689 #, no-wrap
7690 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
7691 msgstr ""
7692
7693 #. type: Plain text
7694 #: build/C/man2/readv.2:38
7695 #, no-wrap
7696 msgid ""
7697 "B<ssize_t readv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7698 ">I<iovcnt>B<);>\n"
7699 msgstr ""
7700
7701 #. type: Plain text
7702 #: build/C/man2/readv.2:40
7703 #, no-wrap
7704 msgid ""
7705 "B<ssize_t writev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7706 ">I<iovcnt>B<);>\n"
7707 msgstr ""
7708
7709 #. type: Plain text
7710 #: build/C/man2/readv.2:43
7711 #, no-wrap
7712 msgid ""
7713 "B<ssize_t preadv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7714 ">I<iovcnt>B<,>\n"
7715 "B<               off_t >I<offset>B<);>\n"
7716 msgstr ""
7717
7718 #. type: Plain text
7719 #: build/C/man2/readv.2:46
7720 #, no-wrap
7721 msgid ""
7722 "B<ssize_t pwritev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7723 ">I<iovcnt>B<,>\n"
7724 "B<                off_t >I<offset>B<);>\n"
7725 msgstr ""
7726
7727 #. type: Plain text
7728 #: build/C/man2/readv.2:56
7729 msgid "B<preadv>(), B<pwritev>(): _BSD_SOURCE"
7730 msgstr ""
7731
7732 #. type: Plain text
7733 #: build/C/man2/readv.2:66
7734 msgid ""
7735 "The B<readv>()  system call reads I<iovcnt> buffers from the file associated "
7736 "with the file descriptor I<fd> into the buffers described by I<iov> "
7737 "(\"scatter input\")."
7738 msgstr ""
7739
7740 #. type: Plain text
7741 #: build/C/man2/readv.2:76
7742 msgid ""
7743 "The B<writev>()  system call writes I<iovcnt> buffers of data described by "
7744 "I<iov> to the file associated with the file descriptor I<fd> (\"gather "
7745 "output\")."
7746 msgstr ""
7747
7748 #. type: Plain text
7749 #: build/C/man2/readv.2:85
7750 msgid ""
7751 "The pointer I<iov> points to an array of I<iovec> structures, defined in "
7752 "I<E<lt>sys/uio.hE<gt>> as:"
7753 msgstr ""
7754
7755 #. type: Plain text
7756 #: build/C/man2/readv.2:93
7757 #, no-wrap
7758 msgid ""
7759 "struct iovec {\n"
7760 "    void  *iov_base;    /* Starting address */\n"
7761 "    size_t iov_len;     /* Number of bytes to transfer */\n"
7762 "};\n"
7763 msgstr ""
7764
7765 #. type: Plain text
7766 #: build/C/man2/readv.2:101
7767 msgid ""
7768 "The B<readv>()  system call works just like B<read>(2)  except that multiple "
7769 "buffers are filled."
7770 msgstr ""
7771
7772 #. type: Plain text
7773 #: build/C/man2/readv.2:107
7774 msgid ""
7775 "The B<writev>()  system call works just like B<write>(2)  except that "
7776 "multiple buffers are written out."
7777 msgstr ""
7778
7779 #. type: Plain text
7780 #: build/C/man2/readv.2:126
7781 msgid ""
7782 "Buffers are processed in array order.  This means that B<readv>()  "
7783 "completely fills I<iov>[0] before proceeding to I<iov>[1], and so on.  (If "
7784 "there is insufficient data, then not all buffers pointed to by I<iov> may be "
7785 "filled.)  Similarly, B<writev>()  writes out the entire contents of "
7786 "I<iov>[0] before proceeding to I<iov>[1], and so on."
7787 msgstr ""
7788
7789 #. type: Plain text
7790 #: build/C/man2/readv.2:144
7791 msgid ""
7792 "The data transfers performed by B<readv>()  and B<writev>()  are atomic: the "
7793 "data written by B<writev>()  is written as a single block that is not "
7794 "intermingled with output from writes in other processes (but see B<pipe>(7)  "
7795 "for an exception); analogously, B<readv>()  is guaranteed to read a "
7796 "contiguous block of data from the file, regardless of read operations "
7797 "performed in other threads or processes that have file descriptors referring "
7798 "to the same open file description (see B<open>(2))."
7799 msgstr ""
7800
7801 #. type: SS
7802 #: build/C/man2/readv.2:144
7803 #, no-wrap
7804 msgid "preadv() and pwritev()"
7805 msgstr ""
7806
7807 #. type: Plain text
7808 #: build/C/man2/readv.2:157
7809 msgid ""
7810 "The B<preadv>()  system call combines the functionality of B<readv>()  and "
7811 "B<pread>(2).  It performs the same task as B<readv>(), but adds a fourth "
7812 "argument, I<offset>, which specifies the file offset at which the input "
7813 "operation is to be performed."
7814 msgstr ""
7815
7816 #. type: Plain text
7817 #: build/C/man2/readv.2:170
7818 msgid ""
7819 "The B<pwritev>()  system call combines the functionality of B<writev>()  and "
7820 "B<pwrite>(2).  It performs the same task as B<writev>(), but adds a fourth "
7821 "argument, I<offset>, which specifies the file offset at which the output "
7822 "operation is to be performed."
7823 msgstr ""
7824
7825 #. type: Plain text
7826 #: build/C/man2/readv.2:175
7827 msgid ""
7828 "The file offset is not changed by these system calls.  The file referred to "
7829 "by I<fd> must be capable of seeking."
7830 msgstr ""
7831
7832 #. type: Plain text
7833 #: build/C/man2/readv.2:186
7834 msgid ""
7835 "On success, B<readv>()  and B<preadv>()  return the number of bytes read; "
7836 "B<writev>()  and B<pwritev>()  return the number of bytes written.  On "
7837 "error, -1 is returned, and I<errno> is set appropriately."
7838 msgstr ""
7839
7840 #. type: Plain text
7841 #: build/C/man2/readv.2:198
7842 msgid ""
7843 "The errors are as given for B<read>(2)  and B<write>(2).  Furthermore, "
7844 "B<preadv>()  and B<pwritev>()  can also fail for the same reasons as "
7845 "B<lseek>(2).  Additionally, the following error is defined:"
7846 msgstr ""
7847
7848 #. type: Plain text
7849 #: build/C/man2/readv.2:207
7850 msgid ""
7851 "The sum of the I<iov_len> values overflows an I<ssize_t> value.  Or, the "
7852 "vector count I<iovcnt> is less than zero or greater than the permitted "
7853 "maximum."
7854 msgstr ""
7855
7856 #. type: Plain text
7857 #: build/C/man2/readv.2:212
7858 msgid ""
7859 "B<preadv>()  and B<pwritev>()  first appeared in Linux 2.6.30; library "
7860 "support was added in glibc 2.10."
7861 msgstr ""
7862
7863 #.  The readv/writev system calls were buggy before Linux 1.3.40.
7864 #.  (Says release.libc.)
7865 #. type: Plain text
7866 #: build/C/man2/readv.2:220
7867 msgid ""
7868 "B<readv>(), B<writev>(): 4.4BSD (these system calls first appeared in "
7869 "4.2BSD), POSIX.1-2001.  Linux libc5 used I<size_t> as the type of the "
7870 "I<iovcnt> argument, and I<int> as the return type."
7871 msgstr ""
7872
7873 #. type: Plain text
7874 #: build/C/man2/readv.2:224
7875 msgid "B<preadv>(), B<pwritev>(): nonstandard, but present also on the modern BSDs."
7876 msgstr ""
7877
7878 #. type: SS
7879 #: build/C/man2/readv.2:225
7880 #, no-wrap
7881 msgid "Linux Notes"
7882 msgstr ""
7883
7884 #. type: Plain text
7885 #: build/C/man2/readv.2:256
7886 msgid ""
7887 "POSIX.1-2001 allows an implementation to place a limit on the number of "
7888 "items that can be passed in I<iov>.  An implementation can advertise its "
7889 "limit by defining B<IOV_MAX> in I<E<lt>limits.hE<gt>> or at run time via the "
7890 "return value from I<sysconf(_SC_IOV_MAX)>.  On Linux, the limit advertised "
7891 "by these mechanisms is 1024, which is the true kernel limit.  However, the "
7892 "glibc wrapper functions do some extra work if they detect that the "
7893 "underlying kernel system call failed because this limit was exceeded.  In "
7894 "the case of B<readv>()  the wrapper function allocates a temporary buffer "
7895 "large enough for all of the items specified by I<iov>, passes that buffer in "
7896 "a call to B<read>(2), copies data from the buffer to the locations specified "
7897 "by the I<iov_base> fields of the elements of I<iov>, and then frees the "
7898 "buffer.  The wrapper function for B<writev>()  performs the analogous task "
7899 "using a temporary buffer and a call to B<write>(2)."
7900 msgstr ""
7901
7902 #. type: Plain text
7903 #: build/C/man2/readv.2:263
7904 msgid ""
7905 "It is not advisable to mix calls to B<readv>()  or B<writev>(), which "
7906 "operate on file descriptors, with the functions from the stdio library; the "
7907 "results will be undefined and probably not what you want."
7908 msgstr ""
7909
7910 #. type: Plain text
7911 #: build/C/man2/readv.2:266
7912 msgid "The following code sample demonstrates the use of B<writev>():"
7913 msgstr ""
7914
7915 #. type: Plain text
7916 #: build/C/man2/readv.2:273
7917 #, no-wrap
7918 msgid ""
7919 "char *str0 = \"hello \";\n"
7920 "char *str1 = \"world\\en\";\n"
7921 "struct iovec iov[2];\n"
7922 "ssize_t nwritten;\n"
7923 msgstr ""
7924
7925 #. type: Plain text
7926 #: build/C/man2/readv.2:278
7927 #, no-wrap
7928 msgid ""
7929 "iov[0].iov_base = str0;\n"
7930 "iov[0].iov_len = strlen(str0);\n"
7931 "iov[1].iov_base = str1;\n"
7932 "iov[1].iov_len = strlen(str1);\n"
7933 msgstr ""
7934
7935 #. type: Plain text
7936 #: build/C/man2/readv.2:280
7937 #, no-wrap
7938 msgid "nwritten = writev(STDOUT_FILENO, iov, 2);\n"
7939 msgstr ""
7940
7941 #. type: Plain text
7942 #: build/C/man2/readv.2:285
7943 msgid "B<pread>(2), B<read>(2), B<write>(2)"
7944 msgstr ""
7945
7946 #. type: TH
7947 #: build/C/man3/remove.3:31
7948 #, no-wrap
7949 msgid "REMOVE"
7950 msgstr ""
7951
7952 #. type: TH
7953 #: build/C/man3/remove.3:31
7954 #, no-wrap
7955 msgid "2008-12-03"
7956 msgstr ""
7957
7958 #. type: Plain text
7959 #: build/C/man3/remove.3:34
7960 msgid "remove - remove a file or directory"
7961 msgstr ""
7962
7963 #. type: Plain text
7964 #: build/C/man3/remove.3:38
7965 msgid "B<int remove(const char *>I<pathname>B<);>"
7966 msgstr ""
7967
7968 #. type: Plain text
7969 #: build/C/man3/remove.3:46
7970 msgid ""
7971 "B<remove>()  deletes a name from the file system.  It calls B<unlink>(2)  "
7972 "for files, and B<rmdir>(2)  for directories."
7973 msgstr ""
7974
7975 #. type: Plain text
7976 #: build/C/man3/remove.3:50
7977 msgid ""
7978 "If the removed name was the last link to a file and no processes have the "
7979 "file open, the file is deleted and the space it was using is made available "
7980 "for reuse."
7981 msgstr ""
7982
7983 #. type: Plain text
7984 #: build/C/man3/remove.3:55
7985 msgid ""
7986 "If the name was the last link to a file, but any processes still have the "
7987 "file open, the file will remain in existence until the last file descriptor "
7988 "referring to it is closed."
7989 msgstr ""
7990
7991 #. type: Plain text
7992 #: build/C/man3/remove.3:57
7993 msgid "If the name referred to a symbolic link, the link is removed."
7994 msgstr ""
7995
7996 #. type: Plain text
7997 #: build/C/man3/remove.3:60
7998 msgid ""
7999 "If the name referred to a socket, FIFO, or device, the name is removed, but "
8000 "processes which have the object open may continue to use it."
8001 msgstr ""
8002
8003 #. type: Plain text
8004 #: build/C/man3/remove.3:70
8005 msgid "The errors that occur are those for B<unlink>(2)  and B<rmdir>(2)."
8006 msgstr ""
8007
8008 #. type: Plain text
8009 #: build/C/man3/remove.3:72
8010 msgid "C89, C99, 4.3BSD, POSIX.1-2001."
8011 msgstr ""
8012
8013 #. type: Plain text
8014 #: build/C/man3/remove.3:78
8015 msgid ""
8016 "Under libc4 and libc5, B<remove>()  was an alias for B<unlink>(2)  (and "
8017 "hence would not remove directories)."
8018 msgstr ""
8019
8020 #. type: Plain text
8021 #: build/C/man3/remove.3:81 build/C/man2/unlink.2:148
8022 msgid ""
8023 "Infelicities in the protocol underlying NFS can cause the unexpected "
8024 "disappearance of files which are still being used."
8025 msgstr ""
8026
8027 #. type: Plain text
8028 #: build/C/man3/remove.3:91
8029 msgid ""
8030 "B<rm>(1), B<unlink>(1), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
8031 "B<rmdir>(2), B<unlink>(2), B<mkfifo>(3), B<symlink>(7)"
8032 msgstr ""
8033
8034 #. type: TH
8035 #: build/C/man2/rename.2:32
8036 #, no-wrap
8037 msgid "RENAME"
8038 msgstr ""
8039
8040 #. type: TH
8041 #: build/C/man2/rename.2:32
8042 #, no-wrap
8043 msgid "2009-03-30"
8044 msgstr ""
8045
8046 #. type: Plain text
8047 #: build/C/man2/rename.2:35
8048 msgid "rename - change the name or location of a file"
8049 msgstr ""
8050
8051 #. type: Plain text
8052 #: build/C/man2/rename.2:39
8053 msgid "B<int rename(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
8054 msgstr ""
8055
8056 #. type: Plain text
8057 #: build/C/man2/rename.2:48
8058 msgid ""
8059 "B<rename>()  renames a file, moving it between directories if required.  Any "
8060 "other hard links to the file (as created using B<link>(2))  are unaffected.  "
8061 "Open file descriptors for I<oldpath> are also unaffected."
8062 msgstr ""
8063
8064 #. type: Plain text
8065 #: build/C/man2/rename.2:56
8066 msgid ""
8067 "If I<newpath> already exists it will be atomically replaced (subject to a "
8068 "few conditions; see ERRORS below), so that there is no point at which "
8069 "another process attempting to access I<newpath> will find it missing."
8070 msgstr ""
8071
8072 #. type: Plain text
8073 #: build/C/man2/rename.2:64
8074 msgid ""
8075 "If I<oldpath> and I<newpath> are existing hard links referring to the same "
8076 "file, then B<rename>()  does nothing, and returns a success status."
8077 msgstr ""
8078
8079 #. type: Plain text
8080 #: build/C/man2/rename.2:72
8081 msgid ""
8082 "If I<newpath> exists but the operation fails for some reason B<rename>()  "
8083 "guarantees to leave an instance of I<newpath> in place."
8084 msgstr ""
8085
8086 #. type: Plain text
8087 #: build/C/man2/rename.2:78
8088 msgid ""
8089 "I<oldpath> can specify a directory.  In this case, I<newpath> must either "
8090 "not exist, or it must specify an empty directory."
8091 msgstr ""
8092
8093 #. type: Plain text
8094 #: build/C/man2/rename.2:85
8095 msgid ""
8096 "However, when overwriting there will probably be a window in which both "
8097 "I<oldpath> and I<newpath> refer to the file being renamed."
8098 msgstr ""
8099
8100 #. type: Plain text
8101 #: build/C/man2/rename.2:91
8102 msgid ""
8103 "If I<oldpath> refers to a symbolic link the link is renamed; if I<newpath> "
8104 "refers to a symbolic link the link will be overwritten."
8105 msgstr ""
8106
8107 #. type: Plain text
8108 #: build/C/man2/rename.2:116
8109 msgid ""
8110 "Write permission is denied for the directory containing I<oldpath> or "
8111 "I<newpath>, or, search permission is denied for one of the directories in "
8112 "the path prefix of I<oldpath> or I<newpath>, or I<oldpath> is a directory "
8113 "and does not allow write permission (needed to update the I<..> entry).  "
8114 "(See also B<path_resolution>(7).)"
8115 msgstr ""
8116
8117 #. type: TP
8118 #: build/C/man2/rename.2:116 build/C/man2/rmdir.2:55 build/C/man2/unlink.2:71
8119 #, no-wrap
8120 msgid "B<EBUSY>"
8121 msgstr ""
8122
8123 #. type: Plain text
8124 #: build/C/man2/rename.2:133
8125 msgid ""
8126 "The rename fails because I<oldpath> or I<newpath> is a directory that is in "
8127 "use by some process (perhaps as current working directory, or as root "
8128 "directory, or because it was open for reading) or is in use by the system "
8129 "(for example as mount point), while the system considers this an error.  "
8130 "(Note that there is no requirement to return B<EBUSY> in such "
8131 "cases\\(emthere is nothing wrong with doing the rename anyway\\(embut it is "
8132 "allowed to return B<EBUSY> if the system cannot otherwise handle such "
8133 "situations.)"
8134 msgstr ""
8135
8136 #. type: Plain text
8137 #: build/C/man2/rename.2:140
8138 msgid ""
8139 "The new pathname contained a path prefix of the old, or, more generally, an "
8140 "attempt was made to make a directory a subdirectory of itself."
8141 msgstr ""
8142
8143 #. type: Plain text
8144 #: build/C/man2/rename.2:146
8145 msgid "I<newpath> is an existing directory, but I<oldpath> is not a directory."
8146 msgstr ""
8147
8148 #. type: Plain text
8149 #: build/C/man2/rename.2:157
8150 msgid ""
8151 "I<oldpath> already has the maximum number of links to it, or it was a "
8152 "directory and the directory containing I<newpath> has the maximum number of "
8153 "links."
8154 msgstr ""
8155
8156 #. type: Plain text
8157 #: build/C/man2/rename.2:173
8158 msgid ""
8159 "The link named by I<oldpath> does not exist; or, a directory component in "
8160 "I<newpath> does not exist; or, I<oldpath> or I<newpath> is an empty string."
8161 msgstr ""
8162
8163 #. type: Plain text
8164 #: build/C/man2/rename.2:190
8165 msgid ""
8166 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
8167 "a directory.  Or, I<oldpath> is a directory, and I<newpath> exists but is "
8168 "not a directory."
8169 msgstr ""
8170
8171 #. type: TP
8172 #: build/C/man2/rename.2:190
8173 #, no-wrap
8174 msgid "B<ENOTEMPTY> or B<EEXIST>"
8175 msgstr ""
8176
8177 #. type: Plain text
8178 #: build/C/man2/rename.2:194
8179 msgid ""
8180 "I<newpath> is a nonempty directory, that is, contains entries other than "
8181 "\".\" and \"..\"."
8182 msgstr ""
8183
8184 #. type: TP
8185 #: build/C/man2/rename.2:194 build/C/man2/unlink.2:126
8186 #, no-wrap
8187 msgid "B<EPERM> or B<EACCES>"
8188 msgstr ""
8189
8190 #. type: Plain text
8191 #: build/C/man2/rename.2:218
8192 msgid ""
8193 "The directory containing I<oldpath> has the sticky bit (B<S_ISVTX>)  set and "
8194 "the process's effective user ID is neither the user ID of the file to be "
8195 "deleted nor that of the directory containing it, and the process is not "
8196 "privileged (Linux: does not have the B<CAP_FOWNER> capability); or "
8197 "I<newpath> is an existing file and the directory containing it has the "
8198 "sticky bit set and the process's effective user ID is neither the user ID of "
8199 "the file to be replaced nor that of the directory containing it, and the "
8200 "process is not privileged (Linux: does not have the B<CAP_FOWNER> "
8201 "capability); or the file system containing I<pathname> does not support "
8202 "renaming of the type requested."
8203 msgstr ""
8204
8205 #. type: Plain text
8206 #: build/C/man2/rename.2:229
8207 msgid ""
8208 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
8209 "permits a file system to be mounted at multiple points, but B<rename>()  "
8210 "does not work across different mount points, even if the same file system is "
8211 "mounted on both.)"
8212 msgstr ""
8213
8214 #. type: Plain text
8215 #: build/C/man2/rename.2:231
8216 msgid "4.3BSD, C89, C99, POSIX.1-2001."
8217 msgstr ""
8218
8219 #. type: Plain text
8220 #: build/C/man2/rename.2:242
8221 msgid ""
8222 "On NFS file systems, you can not assume that if the operation failed the "
8223 "file was not renamed.  If the server does the rename operation and then "
8224 "crashes, the retransmitted RPC which will be processed when the server is up "
8225 "again causes a failure.  The application is expected to deal with this.  See "
8226 "B<link>(2)  for a similar problem."
8227 msgstr ""
8228
8229 #. type: Plain text
8230 #: build/C/man2/rename.2:250
8231 msgid ""
8232 "B<mv>(1), B<chmod>(2), B<link>(2), B<renameat>(2), B<symlink>(2), "
8233 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
8234 msgstr ""
8235
8236 #. type: TH
8237 #: build/C/man2/rmdir.2:30
8238 #, no-wrap
8239 msgid "RMDIR"
8240 msgstr ""
8241
8242 #. type: TH
8243 #: build/C/man2/rmdir.2:30
8244 #, no-wrap
8245 msgid "2008-05-08"
8246 msgstr ""
8247
8248 #. type: Plain text
8249 #: build/C/man2/rmdir.2:33
8250 msgid "rmdir - delete a directory"
8251 msgstr ""
8252
8253 #. type: Plain text
8254 #: build/C/man2/rmdir.2:37
8255 msgid "B<int rmdir(const char *>I<pathname>B<);>"
8256 msgstr ""
8257
8258 #. type: Plain text
8259 #: build/C/man2/rmdir.2:40
8260 msgid "B<rmdir>()  deletes a directory, which must be empty."
8261 msgstr ""
8262
8263 #. type: Plain text
8264 #: build/C/man2/rmdir.2:55
8265 msgid ""
8266 "Write access to the directory containing I<pathname> was not allowed, or one "
8267 "of the directories in the path prefix of I<pathname> did not allow search "
8268 "permission.  (See also B<path_resolution>(7)."
8269 msgstr ""
8270
8271 #. type: Plain text
8272 #: build/C/man2/rmdir.2:64
8273 msgid ""
8274 "I<pathname> is currently in use by the system or some process that prevents "
8275 "its removal.  On Linux this means I<pathname> is currently used as a mount "
8276 "point or is the root directory of the calling process."
8277 msgstr ""
8278
8279 #. type: Plain text
8280 #: build/C/man2/rmdir.2:73
8281 msgid "I<pathname> has I<.> as last component."
8282 msgstr ""
8283
8284 #. type: Plain text
8285 #: build/C/man2/rmdir.2:77
8286 msgid "Too many symbolic links were encountered in resolving I<pathname>."
8287 msgstr ""
8288
8289 #. type: Plain text
8290 #: build/C/man2/rmdir.2:85
8291 msgid ""
8292 "A directory component in I<pathname> does not exist or is a dangling "
8293 "symbolic link."
8294 msgstr ""
8295
8296 #. type: Plain text
8297 #: build/C/man2/rmdir.2:94
8298 msgid ""
8299 "I<pathname>, or a component used as a directory in I<pathname>, is not, in "
8300 "fact, a directory."
8301 msgstr ""
8302
8303 #. type: TP
8304 #: build/C/man2/rmdir.2:94
8305 #, no-wrap
8306 msgid "B<ENOTEMPTY>"
8307 msgstr ""
8308
8309 #. type: Plain text
8310 #: build/C/man2/rmdir.2:107
8311 msgid ""
8312 "I<pathname> contains entries other than I<.> and I<..> ; or, I<pathname> has "
8313 "I<..> as its final component.  POSIX.1-2001 also allows B<EEXIST> for this "
8314 "condition."
8315 msgstr ""
8316
8317 #. type: Plain text
8318 #: build/C/man2/rmdir.2:118
8319 msgid ""
8320 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
8321 "and the process's effective user ID is neither the user ID of the file to be "
8322 "deleted nor that of the directory containing it, and the process is not "
8323 "privileged (Linux: does not have the B<CAP_FOWNER> capability)."
8324 msgstr ""
8325
8326 #. type: Plain text
8327 #: build/C/man2/rmdir.2:123
8328 msgid ""
8329 "The file system containing I<pathname> does not support the removal of "
8330 "directories."
8331 msgstr ""
8332
8333 #. type: Plain text
8334 #: build/C/man2/rmdir.2:127
8335 msgid "I<pathname> refers to a directory on a read-only file system."
8336 msgstr ""
8337
8338 #. type: Plain text
8339 #: build/C/man2/rmdir.2:132
8340 msgid ""
8341 "Infelicities in the protocol underlying NFS can cause the unexpected "
8342 "disappearance of directories which are still being used."
8343 msgstr ""
8344
8345 #. type: Plain text
8346 #: build/C/man2/rmdir.2:140
8347 msgid ""
8348 "B<rm>(1), B<rmdir>(1), B<chdir>(2), B<chmod>(2), B<mkdir>(2), B<rename>(2), "
8349 "B<unlink>(2), B<unlinkat>(2)"
8350 msgstr ""
8351
8352 #. type: TH
8353 #: build/C/man3/scanf.3:50
8354 #, no-wrap
8355 msgid "SCANF"
8356 msgstr ""
8357
8358 #. type: Plain text
8359 #: build/C/man3/scanf.3:53
8360 msgid "scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion"
8361 msgstr ""
8362
8363 #. type: Plain text
8364 #: build/C/man3/scanf.3:60
8365 #, no-wrap
8366 msgid ""
8367 "B<int scanf(const char *>I<format>B<, ...);>\n"
8368 "B<int fscanf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>\n"
8369 "B<int sscanf(const char *>I<str>B<, const char *>I<format>B<, ...);>\n"
8370 msgstr ""
8371
8372 #. type: Plain text
8373 #: build/C/man3/scanf.3:62
8374 #, no-wrap
8375 msgid "B<#include E<lt>stdarg.hE<gt>>\n"
8376 msgstr ""
8377
8378 #. type: Plain text
8379 #: build/C/man3/scanf.3:66
8380 #, no-wrap
8381 msgid ""
8382 "B<int vscanf(const char *>I<format>B<, va_list >I<ap>B<);>\n"
8383 "B<int vsscanf(const char *>I<str>B<, const char *>I<format>B<, va_list "
8384 ">I<ap>B<);>\n"
8385 "B<int vfscanf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
8386 ">I<ap>B<);>\n"
8387 msgstr ""
8388
8389 #. type: Plain text
8390 #: build/C/man3/scanf.3:77
8391 msgid "B<vscanf>(), B<vsscanf>(), B<vfscanf>():"
8392 msgstr ""
8393
8394 #. type: Plain text
8395 #: build/C/man3/scanf.3:80
8396 msgid ""
8397 "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ "
8398 "200112L;"
8399 msgstr ""
8400
8401 #. type: Plain text
8402 #: build/C/man3/scanf.3:102
8403 msgid ""
8404 "The B<scanf>()  family of functions scans input according to I<format> as "
8405 "described below.  This format may contain I<conversion specifications>; the "
8406 "results from such conversions, if any, are stored in the locations pointed "
8407 "to by the I<pointer> arguments that follow I<format>.  Each I<pointer> "
8408 "argument must be of a type that is appropriate for the value returned by the "
8409 "corresponding conversion specification."
8410 msgstr ""
8411
8412 #. type: Plain text
8413 #: build/C/man3/scanf.3:113
8414 msgid ""
8415 "If the number of conversion specifications in I<format> exceeds the number "
8416 "of I<pointer> arguments, the results are undefined.  If the number of "
8417 "I<pointer> arguments exceeds the number of conversion specifications, then "
8418 "the excess I<pointer> arguments are evaluated, but are otherwise ignored."
8419 msgstr ""
8420
8421 #. type: Plain text
8422 #: build/C/man3/scanf.3:125
8423 msgid ""
8424 "The B<scanf>()  function reads input from the standard input stream "
8425 "I<stdin>, B<fscanf>()  reads input from the stream pointer I<stream>, and "
8426 "B<sscanf>()  reads its input from the character string pointed to by I<str>."
8427 msgstr ""
8428
8429 #. type: Plain text
8430 #: build/C/man3/scanf.3:143
8431 msgid ""
8432 "The B<vfscanf>()  function is analogous to B<vfprintf>(3)  and reads input "
8433 "from the stream pointer I<stream> using a variable argument list of pointers "
8434 "(see B<stdarg>(3).  The B<vscanf>()  function scans a variable argument list "
8435 "from the standard input and the B<vsscanf>()  function scans it from a "
8436 "string; these are analogous to the B<vprintf>(3)  and B<vsprintf>(3)  "
8437 "functions respectively."
8438 msgstr ""
8439
8440 #. type: Plain text
8441 #: build/C/man3/scanf.3:157
8442 msgid ""
8443 "The I<format> string consists of a sequence of I<directives> which describe "
8444 "how to process the sequence of input characters.  If processing of a "
8445 "directive fails, no further input is read, and B<scanf>()  returns.  A "
8446 "\"failure\" can be either of the following: I<input failure>, meaning that "
8447 "input characters were unavailable, or I<matching failure>, meaning that the "
8448 "input was inappropriate (see below)."
8449 msgstr ""
8450
8451 #. type: Plain text
8452 #: build/C/man3/scanf.3:159
8453 msgid "A directive is one of the following:"
8454 msgstr ""
8455
8456 #. type: TP
8457 #: build/C/man3/scanf.3:159 build/C/man3/scanf.3:165 build/C/man3/scanf.3:169 build/C/man3/scanf.3:188 build/C/man3/scanf.3:199 build/C/man3/scanf.3:217 build/C/man3/scanf.3:229 build/C/man3/scanf.3:243
8458 #, no-wrap
8459 msgid "\\(bu"
8460 msgstr ""
8461
8462 #. type: Plain text
8463 #: build/C/man3/scanf.3:165
8464 msgid ""
8465 "A sequence of white-space characters (space, tab, newline, etc.; see "
8466 "B<isspace>(3)).  This directive matches any amount of white space, including "
8467 "none, in the input."
8468 msgstr ""
8469
8470 #. type: Plain text
8471 #: build/C/man3/scanf.3:169
8472 msgid ""
8473 "An ordinary character (i.e., one other than white space or \\(aq%\\(aq).  "
8474 "This character must exactly match the next character of input."
8475 msgstr ""
8476
8477 #. type: Plain text
8478 #: build/C/man3/scanf.3:180
8479 msgid ""
8480 "A conversion specification, which commences with a \\(aq%\\(aq (percent) "
8481 "character.  A sequence of characters from the input is converted according "
8482 "to this specification, and the result is placed in the corresponding "
8483 "I<pointer> argument.  If the next item of input does not match the "
8484 "conversion specification, the conversion fails\\(emthis is a I<matching "
8485 "failure>."
8486 msgstr ""
8487
8488 #. type: Plain text
8489 #: build/C/man3/scanf.3:188
8490 msgid ""
8491 "Each I<conversion specification> in I<format> begins with either the "
8492 "character \\(aq%\\(aq or the character sequence \"B<%>I<n>B<$>\" (see below "
8493 "for the distinction) followed by:"
8494 msgstr ""
8495
8496 #. type: Plain text
8497 #: build/C/man3/scanf.3:199
8498 msgid ""
8499 "An optional \\(aq*\\(aq assignment-suppression character: B<scanf>()  reads "
8500 "input as directed by the conversion specification, but discards the input.  "
8501 "No corresponding I<pointer> argument is required, and this specification is "
8502 "not included in the count of successful assignments returned by B<scanf>()."
8503 msgstr ""
8504
8505 #. type: Plain text
8506 #: build/C/man3/scanf.3:217
8507 msgid ""
8508 "An optional \\(aqa\\(aq character.  This is used with string conversions, "
8509 "and relieves the caller of the need to allocate a corresponding buffer to "
8510 "hold the input: instead, B<scanf>()  allocates a buffer of sufficient size, "
8511 "and assigns the address of this buffer to the corresponding I<pointer> "
8512 "argument, which should be a pointer to a I<char *> variable (this variable "
8513 "does not need to be initialized before the call).  The caller should "
8514 "subsequently B<free>(3)  this buffer when it is no longer required.  This is "
8515 "a GNU extension; C99 employs the \\(aqa\\(aq character as a conversion "
8516 "specifier (and it can also be used as such in the GNU implementation)."
8517 msgstr ""
8518
8519 #. type: Plain text
8520 #: build/C/man3/scanf.3:229
8521 msgid ""
8522 "An optional decimal integer which specifies the I<maximum field width>.  "
8523 "Reading of characters stops either when this maximum is reached or when a "
8524 "nonmatching character is found, whichever happens first.  Most conversions "
8525 "discard initial white space characters (the exceptions are noted below), and "
8526 "these discarded characters don't count toward the maximum field width.  "
8527 "String input conversions store a terminating null byte (\\(aq\\e0\\(aq)  to "
8528 "mark the end of the input; the maximum field width does not include this "
8529 "terminator."
8530 msgstr ""
8531
8532 #. type: Plain text
8533 #: build/C/man3/scanf.3:243
8534 msgid ""
8535 "An optional I<type modifier character>.  For example, the B<l> type modifier "
8536 "is used with integer conversions such as B<%d> to specify that the "
8537 "corresponding I<pointer> argument refers to a I<long int> rather than a "
8538 "pointer to an I<int>."
8539 msgstr ""
8540
8541 #. type: Plain text
8542 #: build/C/man3/scanf.3:248
8543 msgid ""
8544 "A I<conversion specifier> that specifies the type of input conversion to be "
8545 "performed."
8546 msgstr ""
8547
8548 #. type: Plain text
8549 #: build/C/man3/scanf.3:277
8550 msgid ""
8551 "The conversion specifications in I<format> are of two forms, either "
8552 "beginning with \\(aq%\\(aq or beginning with \"B<%>I<n>B<$>\".  The two "
8553 "forms should not be mixed in the same I<format> string, except that a string "
8554 "containing \"B<%>I<n>B<$>\" specifications can include B<%%> and B<%*>.  If "
8555 "I<format> contains \\(aq%\\(aq specifications then these correspond in order "
8556 "with successive I<pointer> arguments.  In the \"B<%>I<n>B<$>\" form (which "
8557 "is specified in POSIX.1-2001, but not C99), I<n> is a decimal integer that "
8558 "specifies that the converted input should be placed in the location referred "
8559 "to by the I<n>-th I<pointer> argument following I<format>."
8560 msgstr ""
8561
8562 #. type: SS
8563 #: build/C/man3/scanf.3:277
8564 #, no-wrap
8565 msgid "Conversions"
8566 msgstr ""
8567
8568 #. type: Plain text
8569 #: build/C/man3/scanf.3:281
8570 msgid ""
8571 "The following I<type modifier characters> can appear in a conversion "
8572 "specification:"
8573 msgstr ""
8574
8575 #. type: Plain text
8576 #: build/C/man3/scanf.3:291
8577 msgid ""
8578 "Indicates that the conversion will be one of B<d>, B<i>, B<o>, B<u>, B<x>, "
8579 "B<X>, or B<n> and the next pointer is a pointer to a I<short int> or "
8580 "I<unsigned short int> (rather than I<int>)."
8581 msgstr ""
8582
8583 #. type: Plain text
8584 #: build/C/man3/scanf.3:299
8585 msgid ""
8586 "As for B<h>, but the next pointer is a pointer to a I<signed char> or "
8587 "I<unsigned char>."
8588 msgstr ""
8589
8590 #. type: Plain text
8591 #: build/C/man3/scanf.3:308
8592 msgid ""
8593 "As for B<h>, but the next pointer is a pointer to an I<intmax_t> or a "
8594 "I<uintmax_t>.  This modifier was introduced in C99."
8595 msgstr ""
8596
8597 #.  This use of l was introduced in Amendment 1 to ISO C90.
8598 #. type: Plain text
8599 #: build/C/man3/scanf.3:335
8600 msgid ""
8601 "Indicates either that the conversion will be one of B<d>, B<i>, B<o>, B<u>, "
8602 "B<x>, B<X>, or B<n> and the next pointer is a pointer to a I<long int> or "
8603 "I<unsigned long int> (rather than I<int>), or that the conversion will be "
8604 "one of B<e>, B<f>, or B<g> and the next pointer is a pointer to I<double> "
8605 "(rather than I<float>).  Specifying two B<l> characters is equivalent to "
8606 "B<L>.  If used with B<%c> or B<%s> the corresponding parameter is considered "
8607 "as a pointer to a wide character or wide-character string respectively."
8608 msgstr ""
8609
8610 #.  MTK, Jul 05: The following is no longer true for modern
8611 #.  ANSI C (i.e., C99):
8612 #.  (Note that long long is not an
8613 #.  ANSI C
8614 #.  type. Any program using this will not be portable to all
8615 #.  architectures).
8616 #. type: Plain text
8617 #: build/C/man3/scanf.3:351
8618 msgid ""
8619 "Indicates that the conversion will be either B<e>, B<f>, or B<g> and the "
8620 "next pointer is a pointer to I<long double> or the conversion will be B<d>, "
8621 "B<i>, B<o>, B<u>, or B<x> and the next pointer is a pointer to I<long long>."
8622 msgstr ""
8623
8624 #. type: Plain text
8625 #: build/C/man3/scanf.3:356
8626 msgid "equivalent to B<L>.  This specifier does not exist in ANSI C."
8627 msgstr ""
8628
8629 #. type: Plain text
8630 #: build/C/man3/scanf.3:363
8631 msgid ""
8632 "As for B<h>, but the next pointer is a pointer to a I<ptrdiff_t>.  This "
8633 "modifier was introduced in C99."
8634 msgstr ""
8635
8636 #. type: Plain text
8637 #: build/C/man3/scanf.3:370
8638 msgid ""
8639 "As for B<h>, but the next pointer is a pointer to a I<size_t>.  This "
8640 "modifier was introduced in C99."
8641 msgstr ""
8642
8643 #. type: Plain text
8644 #: build/C/man3/scanf.3:374
8645 msgid "The following I<conversion specifiers> are available:"
8646 msgstr ""
8647
8648 #. type: Plain text
8649 #: build/C/man3/scanf.3:383
8650 msgid ""
8651 "Matches a literal \\(aq%\\(aq.  That is, B<%\\&%> in the format string "
8652 "matches a single input \\(aq%\\(aq character.  No conversion is done (but "
8653 "initial white space characters are discarded), and assignment does not "
8654 "occur."
8655 msgstr ""
8656
8657 #. type: TP
8658 #: build/C/man3/scanf.3:383
8659 #, no-wrap
8660 msgid "B<d>"
8661 msgstr ""
8662
8663 #. type: Plain text
8664 #: build/C/man3/scanf.3:388
8665 msgid ""
8666 "Matches an optionally signed decimal integer; the next pointer must be a "
8667 "pointer to I<int>."
8668 msgstr ""
8669
8670 #. type: TP
8671 #: build/C/man3/scanf.3:388
8672 #, no-wrap
8673 msgid "B<D>"
8674 msgstr ""
8675
8676 #. type: Plain text
8677 #: build/C/man3/scanf.3:397
8678 msgid ""
8679 "Equivalent to I<ld>; this exists only for backward compatibility.  (Note: "
8680 "thus only in libc4.  In libc5 and glibc the B<%D> is silently ignored, "
8681 "causing old programs to fail mysteriously.)"
8682 msgstr ""
8683
8684 #. type: TP
8685 #: build/C/man3/scanf.3:397
8686 #, no-wrap
8687 msgid "B<i>"
8688 msgstr ""
8689
8690 #. type: Plain text
8691 #: build/C/man3/scanf.3:409
8692 msgid ""
8693 "Matches an optionally signed integer; the next pointer must be a pointer to "
8694 "I<int>.  The integer is read in base 16 if it begins with I<0x> or I<0X>, in "
8695 "base 8 if it begins with I<0>, and in base 10 otherwise.  Only characters "
8696 "that correspond to the base are used."
8697 msgstr ""
8698
8699 #. type: TP
8700 #: build/C/man3/scanf.3:409
8701 #, no-wrap
8702 msgid "B<o>"
8703 msgstr ""
8704
8705 #. type: Plain text
8706 #: build/C/man3/scanf.3:413
8707 msgid ""
8708 "Matches an unsigned octal integer; the next pointer must be a pointer to "
8709 "I<unsigned int>."
8710 msgstr ""
8711
8712 #. type: TP
8713 #: build/C/man3/scanf.3:413
8714 #, no-wrap
8715 msgid "B<u>"
8716 msgstr ""
8717
8718 #. type: Plain text
8719 #: build/C/man3/scanf.3:418
8720 msgid ""
8721 "Matches an unsigned decimal integer; the next pointer must be a pointer to "
8722 "I<unsigned int>."
8723 msgstr ""
8724
8725 #. type: Plain text
8726 #: build/C/man3/scanf.3:423
8727 msgid ""
8728 "Matches an unsigned hexadecimal integer; the next pointer must be a pointer "
8729 "to I<unsigned int>."
8730 msgstr ""
8731
8732 #. type: TP
8733 #: build/C/man3/scanf.3:423
8734 #, no-wrap
8735 msgid "B<X>"
8736 msgstr ""
8737
8738 #. type: Plain text
8739 #: build/C/man3/scanf.3:427
8740 msgid "Equivalent to B<x>."
8741 msgstr ""
8742
8743 #. type: TP
8744 #: build/C/man3/scanf.3:427
8745 #, no-wrap
8746 msgid "B<f>"
8747 msgstr ""
8748
8749 #. type: Plain text
8750 #: build/C/man3/scanf.3:432
8751 msgid ""
8752 "Matches an optionally signed floating-point number; the next pointer must be "
8753 "a pointer to I<float>."
8754 msgstr ""
8755
8756 #. type: TP
8757 #: build/C/man3/scanf.3:432
8758 #, no-wrap
8759 msgid "B<e>"
8760 msgstr ""
8761
8762 #. type: Plain text
8763 #: build/C/man3/scanf.3:436 build/C/man3/scanf.3:440 build/C/man3/scanf.3:444
8764 msgid "Equivalent to B<f>."
8765 msgstr ""
8766
8767 #. type: TP
8768 #: build/C/man3/scanf.3:436
8769 #, no-wrap
8770 msgid "B<g>"
8771 msgstr ""
8772
8773 #. type: TP
8774 #: build/C/man3/scanf.3:440
8775 #, no-wrap
8776 msgid "B<E>"
8777 msgstr ""
8778
8779 #. type: Plain text
8780 #: build/C/man3/scanf.3:448
8781 msgid "(C99) Equivalent to B<f>."
8782 msgstr ""
8783
8784 #. type: Plain text
8785 #: build/C/man3/scanf.3:456
8786 msgid ""
8787 "Matches a sequence of non-white-space characters; the next pointer must be a "
8788 "pointer to character array that is long enough to hold the input sequence "
8789 "and the terminating null byte (\\(aq\\e0\\(aq), which is added "
8790 "automatically.  The input string stops at white space or at the maximum "
8791 "field width, whichever occurs first."
8792 msgstr ""
8793
8794 #. type: Plain text
8795 #: build/C/man3/scanf.3:467
8796 msgid ""
8797 "Matches a sequence of characters whose length is specified by the I<maximum "
8798 "field width> (default 1); the next pointer must be a pointer to I<char>, and "
8799 "there must be enough room for all the characters (no terminating null byte "
8800 "is added).  The usual skip of leading white space is suppressed.  To skip "
8801 "white space first, use an explicit space in the format."
8802 msgstr ""
8803
8804 #. type: TP
8805 #: build/C/man3/scanf.3:467
8806 #, no-wrap
8807 msgid "B<\\&[>"
8808 msgstr ""
8809
8810 #. type: Plain text
8811 #: build/C/man3/scanf.3:500
8812 msgid ""
8813 "Matches a nonempty sequence of characters from the specified set of accepted "
8814 "characters; the next pointer must be a pointer to I<char>, and there must be "
8815 "enough room for all the characters in the string, plus a terminating null "
8816 "byte.  The usual skip of leading white space is suppressed.  The string is "
8817 "to be made up of characters in (or not in) a particular set; the set is "
8818 "defined by the characters between the open bracket B<[> character and a "
8819 "close bracket B<]> character.  The set I<excludes> those characters if the "
8820 "first character after the open bracket is a circumflex (B<^>).  To include a "
8821 "close bracket in the set, make it the first character after the open bracket "
8822 "or the circumflex; any other position will end the set.  The hyphen "
8823 "character B<-> is also special; when placed between two other characters, it "
8824 "adds all intervening characters to the set.  To include a hyphen, make it "
8825 "the last character before the final close bracket.  For instance, "
8826 "B<[^]0-9-]> means the set \"everything except close bracket, zero through "
8827 "nine, and hyphen\".  The string ends with the appearance of a character not "
8828 "in the (or, with a circumflex, in) set or when the field width runs out."
8829 msgstr ""
8830
8831 #. type: Plain text
8832 #: build/C/man3/scanf.3:508
8833 msgid ""
8834 "Matches a pointer value (as printed by B<%p> in B<printf>(3); the next "
8835 "pointer must be a pointer to a pointer to I<void>."
8836 msgstr ""
8837
8838 #. type: Plain text
8839 #: build/C/man3/scanf.3:528
8840 msgid ""
8841 "Nothing is expected; instead, the number of characters consumed thus far "
8842 "from the input is stored through the next pointer, which must be a pointer "
8843 "to I<int>.  This is I<not> a conversion, although it can be suppressed with "
8844 "the B<*> assignment-suppression character.  The C standard says: \"Execution "
8845 "of a B<%n> directive does not increment the assignment count returned at the "
8846 "completion of execution\" but the Corrigendum seems to contradict this.  "
8847 "Probably it is wise not to make any assumptions on the effect of B<%n> "
8848 "conversions on the return value."
8849 msgstr ""
8850
8851 #. type: Plain text
8852 #: build/C/man3/scanf.3:533
8853 msgid ""
8854 "These functions return the number of input items successfully matched and "
8855 "assigned, which can be fewer than provided for, or even zero in the event of "
8856 "an early matching failure."
8857 msgstr ""
8858
8859 #. type: Plain text
8860 #: build/C/man3/scanf.3:545
8861 msgid ""
8862 "The value B<EOF> is returned if the end of input is reached before either "
8863 "the first successful conversion or a matching failure occurs.  B<EOF> is "
8864 "also returned if a read error occurs, in which case the error indicator for "
8865 "the stream (see B<ferror>(3))  is set, and I<errno> is set indicate the "
8866 "error."
8867 msgstr ""
8868
8869 #. type: Plain text
8870 #: build/C/man3/scanf.3:551
8871 msgid ""
8872 "The file descriptor underlying I<stream> is marked nonblocking, and the read "
8873 "operation would block."
8874 msgstr ""
8875
8876 #. type: Plain text
8877 #: build/C/man3/scanf.3:556
8878 msgid ""
8879 "The file descriptor underlying I<stream> is invalid, or not open for "
8880 "reading."
8881 msgstr ""
8882
8883 #. type: Plain text
8884 #: build/C/man3/scanf.3:559
8885 msgid "Input byte sequence does not form a valid character."
8886 msgstr ""
8887
8888 #. type: Plain text
8889 #: build/C/man3/scanf.3:563
8890 msgid "The read operation was interrupted by a signal; see B<signal>(7)."
8891 msgstr ""
8892
8893 #. type: Plain text
8894 #: build/C/man3/scanf.3:568
8895 msgid "Not enough arguments; or I<format> is NULL."
8896 msgstr ""
8897
8898 #. type: Plain text
8899 #: build/C/man3/scanf.3:571
8900 msgid "Out of memory."
8901 msgstr ""
8902
8903 #. type: TP
8904 #: build/C/man3/scanf.3:571
8905 #, no-wrap
8906 msgid "B<ERANGE>"
8907 msgstr ""
8908
8909 #. type: Plain text
8910 #: build/C/man3/scanf.3:575
8911 msgid ""
8912 "The result of an integer conversion would exceed the size that can be stored "
8913 "in the corresponding integer type."
8914 msgstr ""
8915
8916 #. type: Plain text
8917 #: build/C/man3/scanf.3:585
8918 msgid ""
8919 "The functions B<fscanf>(), B<scanf>(), and B<sscanf>()  conform to C89 and "
8920 "C99 and POSIX.1-2001.  These standards do not specify the B<ERANGE> error."
8921 msgstr ""
8922
8923 #. type: Plain text
8924 #: build/C/man3/scanf.3:595
8925 msgid ""
8926 "The B<q> specifier is the 4.4BSD notation for I<long long>, while B<ll> or "
8927 "the usage of B<L> in integer conversions is the GNU notation."
8928 msgstr ""
8929
8930 #. type: Plain text
8931 #: build/C/man3/scanf.3:606
8932 msgid ""
8933 "The Linux version of these functions is based on the I<GNU> I<libio> "
8934 "library.  Take a look at the I<info> documentation of I<GNU> I<libc "
8935 "(glibc-1.08)> for a more concise description."
8936 msgstr ""
8937
8938 #.  This feature seems to be present at least as far back as glibc 2.0.
8939 #. type: Plain text
8940 #: build/C/man3/scanf.3:624
8941 msgid ""
8942 "The GNU C library supports a nonstandard extension that causes the library "
8943 "to dynamically allocate a string of sufficient size for input strings for "
8944 "the B<%s> and B<%a[>I<range>B<]> conversion specifiers.  To make use of this "
8945 "feature, specify B<a> as a length modifier (thus B<%as> or "
8946 "B<%a[>I<range>B<]>).  The caller must B<free>(3)  the returned string, as in "
8947 "the following example:"
8948 msgstr ""
8949
8950 #. type: Plain text
8951 #: build/C/man3/scanf.3:629
8952 #, no-wrap
8953 msgid ""
8954 "char *p;\n"
8955 "int n;\n"
8956 msgstr ""
8957
8958 #. type: Plain text
8959 #: build/C/man3/scanf.3:640
8960 #, no-wrap
8961 msgid ""
8962 "errno = 0;\n"
8963 "n = scanf(\"%a[a-z]\", &p);\n"
8964 "if (n == 1) {\n"
8965 "    printf(\"read: %s\\en\", p);\n"
8966 "    free(p);\n"
8967 "} else if (errno != 0) {\n"
8968 "    perror(\"scanf\");\n"
8969 "} else {\n"
8970 "    fprintf(stderr, \"No matching characters\\en\");\n"
8971 "}\n"
8972 msgstr ""
8973
8974 #. type: Plain text
8975 #: build/C/man3/scanf.3:648
8976 msgid ""
8977 "As shown in the above example, it is only necessary to call B<free>(3)  if "
8978 "the B<scanf>()  call successfully read a string."
8979 msgstr ""
8980
8981 #. type: Plain text
8982 #: build/C/man3/scanf.3:660
8983 msgid ""
8984 "The B<a> modifier is not available if the program is compiled with I<gcc "
8985 "-std=c99> or I<gcc -D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also "
8986 "specified), in which case the B<a> is interpreted as a specifier for "
8987 "floating-point numbers (see above)."
8988 msgstr ""
8989
8990 #. type: Plain text
8991 #: build/C/man3/scanf.3:669
8992 msgid ""
8993 "Since version 2.7, glibc also provides the B<m> modifier for the same "
8994 "purpose as the B<a> modifier.  The B<m> modifier has the following "
8995 "advantages:"
8996 msgstr ""
8997
8998 #. type: Plain text
8999 #: build/C/man3/scanf.3:674
9000 msgid "It may also be applied to B<%c> conversion specifiers (e.g., B<%3mc>)."
9001 msgstr ""
9002
9003 #. type: Plain text
9004 #: build/C/man3/scanf.3:680
9005 msgid ""
9006 "It avoids ambiguity with respect to the B<%a> floating-point conversion "
9007 "specifier (and is unaffected by I<gcc -std=c99> etc.)"
9008 msgstr ""
9009
9010 #. type: Plain text
9011 #: build/C/man3/scanf.3:682
9012 msgid "It is specified in the upcoming revision of the POSIX.1 standard."
9013 msgstr ""
9014
9015 #. type: Plain text
9016 #: build/C/man3/scanf.3:695
9017 msgid ""
9018 "All functions are fully C89 conformant, but provide the additional "
9019 "specifiers B<q> and B<a> as well as an additional behavior of the B<L> and "
9020 "B<l> specifiers.  The latter may be considered to be a bug, as it changes "
9021 "the behavior of specifiers defined in C89."
9022 msgstr ""
9023
9024 #. type: Plain text
9025 #: build/C/man3/scanf.3:711
9026 msgid ""
9027 "Some combinations of the type modifiers and conversion specifiers defined by "
9028 "ANSI C do not make sense (e.g.  B<%Ld>).  While they may have a well-defined "
9029 "behavior on Linux, this need not to be so on other architectures.  Therefore "
9030 "it usually is better to use modifiers that are not defined by ANSI C at all, "
9031 "that is, use B<q> instead of B<L> in combination with B<d>, B<i>, B<o>, "
9032 "B<u>, B<x>, and B<X> conversions or B<ll>."
9033 msgstr ""
9034
9035 #. type: Plain text
9036 #: build/C/man3/scanf.3:717
9037 msgid ""
9038 "The usage of B<q> is not the same as on 4.4BSD, as it may be used in float "
9039 "conversions equivalently to B<L>."
9040 msgstr ""
9041
9042 #. type: Plain text
9043 #: build/C/man3/scanf.3:723
9044 msgid ""
9045 "B<getc>(3), B<printf>(3), B<setlocale>(3), B<strtod>(3), B<strtol>(3), "
9046 "B<strtoul>(3)"
9047 msgstr ""
9048
9049 #. type: TH
9050 #: build/C/man3/setbuf.3:46
9051 #, no-wrap
9052 msgid "SETBUF"
9053 msgstr ""
9054
9055 #. type: TH
9056 #: build/C/man3/setbuf.3:46
9057 #, no-wrap
9058 msgid "2008-06-26"
9059 msgstr ""
9060
9061 #. type: Plain text
9062 #: build/C/man3/setbuf.3:49
9063 msgid "setbuf, setbuffer, setlinebuf, setvbuf - stream buffering operations"
9064 msgstr ""
9065
9066 #. type: Plain text
9067 #: build/C/man3/setbuf.3:54
9068 #, no-wrap
9069 msgid "B<void setbuf(FILE *>I<stream>B<, char *>I<buf>B<);>\n"
9070 msgstr ""
9071
9072 #. type: Plain text
9073 #: build/C/man3/setbuf.3:56
9074 #, no-wrap
9075 msgid "B<void setbuffer(FILE *>I<stream>B<, char *>I<buf>B<, size_t >I<size>B<);>\n"
9076 msgstr ""
9077
9078 #. type: Plain text
9079 #: build/C/man3/setbuf.3:58
9080 #, no-wrap
9081 msgid "B<void setlinebuf(FILE *>I<stream>B<);>\n"
9082 msgstr ""
9083
9084 #. type: Plain text
9085 #: build/C/man3/setbuf.3:61
9086 #, no-wrap
9087 msgid ""
9088 "B<int setvbuf(FILE *>I<stream>B<, char *>I<buf>B<, int >I<mode>B<, size_t "
9089 ">I<size>B<);>\n"
9090 msgstr ""
9091
9092 #. type: Plain text
9093 #: build/C/man3/setbuf.3:71
9094 msgid "B<setbuffer>(), B<setlinebuf>(): _BSD_SOURCE"
9095 msgstr ""
9096
9097 #. type: Plain text
9098 #: build/C/man3/setbuf.3:94
9099 msgid ""
9100 "The three types of buffering available are unbuffered, block buffered, and "
9101 "line buffered.  When an output stream is unbuffered, information appears on "
9102 "the destination file or terminal as soon as written; when it is block "
9103 "buffered many characters are saved up and written as a block; when it is "
9104 "line buffered characters are saved up until a newline is output or input is "
9105 "read from any stream attached to a terminal device (typically I<stdin>).  "
9106 "The function B<fflush>(3)  may be used to force the block out early.  (See "
9107 "B<fclose>(3).)  Normally all files are block buffered.  When the first I/O "
9108 "operation occurs on a file, B<malloc>(3)  is called, and a buffer is "
9109 "obtained.  If a stream refers to a terminal (as I<stdout> normally does) it "
9110 "is line buffered.  The standard error stream I<stderr> is always unbuffered "
9111 "by default."
9112 msgstr ""
9113
9114 #. type: Plain text
9115 #: build/C/man3/setbuf.3:101
9116 msgid ""
9117 "The B<setvbuf>()  function may be used on any open stream to change its "
9118 "buffer.  The I<mode> argument must be one of the following three macros:"
9119 msgstr ""
9120
9121 #. type: TP
9122 #: build/C/man3/setbuf.3:102
9123 #, no-wrap
9124 msgid "B<_IONBF>"
9125 msgstr ""
9126
9127 #. type: Plain text
9128 #: build/C/man3/setbuf.3:105
9129 msgid "unbuffered"
9130 msgstr ""
9131
9132 #. type: TP
9133 #: build/C/man3/setbuf.3:105
9134 #, no-wrap
9135 msgid "B<_IOLBF>"
9136 msgstr ""
9137
9138 #. type: Plain text
9139 #: build/C/man3/setbuf.3:108
9140 msgid "line buffered"
9141 msgstr ""
9142
9143 #. type: TP
9144 #: build/C/man3/setbuf.3:108
9145 #, no-wrap
9146 msgid "B<_IOFBF>"
9147 msgstr ""
9148
9149 #. type: Plain text
9150 #: build/C/man3/setbuf.3:111
9151 msgid "fully buffered"
9152 msgstr ""
9153
9154 #. type: Plain text
9155 #: build/C/man3/setbuf.3:127
9156 msgid ""
9157 "Except for unbuffered files, the I<buf> argument should point to a buffer at "
9158 "least I<size> bytes long; this buffer will be used instead of the current "
9159 "buffer.  If the argument I<buf> is NULL, only the mode is affected; a new "
9160 "buffer will be allocated on the next read or write operation.  The "
9161 "B<setvbuf>()  function may only be used after opening a stream and before "
9162 "any other operations have been performed on it."
9163 msgstr ""
9164
9165 #. type: Plain text
9166 #: build/C/man3/setbuf.3:133
9167 msgid ""
9168 "The other three calls are, in effect, simply aliases for calls to "
9169 "B<setvbuf>().  The B<setbuf>()  function is exactly equivalent to the call"
9170 msgstr ""
9171
9172 #. type: Plain text
9173 #: build/C/man3/setbuf.3:136
9174 msgid "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);"
9175 msgstr ""
9176
9177 #. type: Plain text
9178 #: build/C/man3/setbuf.3:146
9179 msgid ""
9180 "The B<setbuffer>()  function is the same, except that the size of the buffer "
9181 "is up to the caller, rather than being determined by the default B<BUFSIZ>.  "
9182 "The B<setlinebuf>()  function is exactly equivalent to the call:"
9183 msgstr ""
9184
9185 #. type: Plain text
9186 #: build/C/man3/setbuf.3:149
9187 msgid "setvbuf(stream, (char *) NULL, _IOLBF, 0);"
9188 msgstr ""
9189
9190 #. type: Plain text
9191 #: build/C/man3/setbuf.3:160
9192 msgid ""
9193 "The function B<setvbuf>()  returns 0 on success.  It returns nonzero on "
9194 "failure (I<mode> is invalid or the request cannot be honored).  It may set "
9195 "I<errno> on failure."
9196 msgstr ""
9197
9198 #. type: Plain text
9199 #: build/C/man3/setbuf.3:162
9200 msgid "The other functions do not return a value."
9201 msgstr ""
9202
9203 #. type: Plain text
9204 #: build/C/man3/setbuf.3:168
9205 msgid "The B<setbuf>()  and B<setvbuf>()  functions conform to C89 and C99."
9206 msgstr ""
9207
9208 #. type: Plain text
9209 #: build/C/man3/setbuf.3:178
9210 msgid ""
9211 "The B<setbuffer>()  and B<setlinebuf>()  functions are not portable to "
9212 "versions of BSD before 4.2BSD, and are available under Linux since libc "
9213 "4.5.21.  On 4.2BSD and 4.3BSD systems, B<setbuf>()  always uses a suboptimal "
9214 "buffer size and should be avoided."
9215 msgstr ""
9216
9217 #. type: Plain text
9218 #: build/C/man3/setbuf.3:185
9219 msgid ""
9220 "You must make sure that the space that I<buf> points to still exists by the "
9221 "time I<stream> is closed, which also happens at program termination.  For "
9222 "example, the following is invalid:"
9223 msgstr ""
9224
9225 #. type: Plain text
9226 #: build/C/man3/setbuf.3:188
9227 #, no-wrap
9228 msgid "#include E<lt>stdio.hE<gt>\n"
9229 msgstr ""
9230
9231 #. type: Plain text
9232 #: build/C/man3/setbuf.3:197
9233 #, no-wrap
9234 msgid ""
9235 "int\n"
9236 "main(void)\n"
9237 "{\n"
9238 "    char buf[BUFSIZ];\n"
9239 "    setbuf(stdin, buf);\n"
9240 "    printf(\"Hello, world!\\en\");\n"
9241 "    return 0;\n"
9242 "}\n"
9243 msgstr ""
9244
9245 #. type: Plain text
9246 #: build/C/man3/setbuf.3:205
9247 msgid ""
9248 "B<fclose>(3), B<fflush>(3), B<fopen>(3), B<fread>(3), B<malloc>(3), "
9249 "B<printf>(3), B<puts>(3)"
9250 msgstr ""
9251
9252 #. type: TH
9253 #: build/C/man3/stdin.3:9
9254 #, no-wrap
9255 msgid "STDIN"
9256 msgstr ""
9257
9258 #. type: TH
9259 #: build/C/man3/stdin.3:9 build/C/man3/tmpfile.3:29
9260 #, no-wrap
9261 msgid "2008-07-14"
9262 msgstr ""
9263
9264 #. type: Plain text
9265 #: build/C/man3/stdin.3:12
9266 msgid "stdin, stdout, stderr - standard I/O streams"
9267 msgstr ""
9268
9269 #. type: Plain text
9270 #: build/C/man3/stdin.3:19
9271 #, no-wrap
9272 msgid ""
9273 "B<extern FILE *>I<stdin>B<;>\n"
9274 "B<extern FILE *>I<stdout>B<;>\n"
9275 "B<extern FILE *>I<stderr>B<;>\n"
9276 msgstr ""
9277
9278 #. type: Plain text
9279 #: build/C/man3/stdin.3:31
9280 msgid ""
9281 "Under normal circumstances every UNIX program has three streams opened for "
9282 "it when it starts up, one for input, one for output, and one for printing "
9283 "diagnostic or error messages.  These are typically attached to the user's "
9284 "terminal (see B<tty>(4)  but might instead refer to files or other devices, "
9285 "depending on what the parent process chose to set up.  (See also the "
9286 "\"Redirection\" section of B<sh>(1).)"
9287 msgstr ""
9288
9289 #. type: Plain text
9290 #: build/C/man3/stdin.3:41
9291 msgid ""
9292 "The input stream is referred to as \"standard input\"; the output stream is "
9293 "referred to as \"standard output\"; and the error stream is referred to as "
9294 "\"standard error\".  These terms are abbreviated to form the symbols used to "
9295 "refer to these files, namely I<stdin>, I<stdout>, and I<stderr>."
9296 msgstr ""
9297
9298 #. type: Plain text
9299 #: build/C/man3/stdin.3:50
9300 msgid ""
9301 "Each of these symbols is a B<stdio>(3)  macro of type pointer to I<FILE>, "
9302 "and can be used with functions like B<fprintf>(3)  or B<fread>(3)."
9303 msgstr ""
9304
9305 #. type: Plain text
9306 #: build/C/man3/stdin.3:59
9307 msgid ""
9308 "Since I<FILE>s are a buffering wrapper around UNIX file descriptors, the "
9309 "same underlying files may also be accessed using the raw UNIX file "
9310 "interface, that is, the functions like B<read>(2)  and B<lseek>(2)."
9311 msgstr ""
9312
9313 #. type: Plain text
9314 #: build/C/man3/stdin.3:78
9315 msgid ""
9316 "On program startup, the integer file descriptors associated with the streams "
9317 "I<stdin>, I<stdout>, and I<stderr> are 0, 1, and 2, respectively.  The "
9318 "preprocessor symbols B<STDIN_FILENO>, B<STDOUT_FILENO>, and B<STDERR_FILENO> "
9319 "are defined with these values in I<E<lt>unistd.hE<gt>>.  (Applying "
9320 "B<freopen>(3)  to one of these streams can change the file descriptor number "
9321 "associated with the stream.)"
9322 msgstr ""
9323
9324 #. type: Plain text
9325 #: build/C/man3/stdin.3:91
9326 msgid ""
9327 "Note that mixing use of I<FILE>s and raw file descriptors can produce "
9328 "unexpected results and should generally be avoided.  (For the masochistic "
9329 "among you: POSIX.1, section 8.2.3, describes in detail how this interaction "
9330 "is supposed to work.)  A general rule is that file descriptors are handled "
9331 "in the kernel, while stdio is just a library.  This means for example, that "
9332 "after an B<exec>(3), the child inherits all open file descriptors, but all "
9333 "old streams have become inaccessible."
9334 msgstr ""
9335
9336 #. type: Plain text
9337 #: build/C/man3/stdin.3:109
9338 msgid ""
9339 "Since the symbols I<stdin>, I<stdout>, and I<stderr> are specified to be "
9340 "macros, assigning to them is nonportable.  The standard streams can be made "
9341 "to refer to different files with help of the library function B<freopen>(3), "
9342 "specially introduced to make it possible to reassign I<stdin>, I<stdout>, "
9343 "and I<stderr>.  The standard streams are closed by a call to B<exit>(3)  and "
9344 "by normal program termination."
9345 msgstr ""
9346
9347 #. type: Plain text
9348 #: build/C/man3/stdin.3:118
9349 msgid ""
9350 "The I<stdin>, I<stdout>, and I<stderr> macros conform to C89 and this "
9351 "standard also stipulates that these three streams shall be open at program "
9352 "startup."
9353 msgstr ""
9354
9355 #. type: Plain text
9356 #: build/C/man3/stdin.3:150
9357 msgid ""
9358 "The stream I<stderr> is unbuffered.  The stream I<stdout> is line-buffered "
9359 "when it points to a terminal.  Partial lines will not appear until "
9360 "B<fflush>(3)  or B<exit>(3)  is called, or a newline is printed.  This can "
9361 "produce unexpected results, especially with debugging output.  The buffering "
9362 "mode of the standard streams (or any other stream)  can be changed using the "
9363 "B<setbuf>(3)  or B<setvbuf>(3)  call.  Note that in case I<stdin> is "
9364 "associated with a terminal, there may also be input buffering in the "
9365 "terminal driver, entirely unrelated to stdio buffering.  (Indeed, normally "
9366 "terminal input is line buffered in the kernel.)  This kernel input handling "
9367 "can be modified using calls like B<tcsetattr>(3); see also B<stty>(1), and "
9368 "B<termios>(3)."
9369 msgstr ""
9370
9371 #. type: Plain text
9372 #: build/C/man3/stdin.3:155
9373 msgid "B<csh>(1), B<sh>(1), B<open>(2), B<fopen>(3), B<stdio>(3)"
9374 msgstr ""
9375
9376 #. type: TH
9377 #: build/C/man3/stdio.3:37
9378 #, no-wrap
9379 msgid "STDIO"
9380 msgstr ""
9381
9382 #. type: TH
9383 #: build/C/man3/stdio.3:37
9384 #, no-wrap
9385 msgid "2001-12-26"
9386 msgstr ""
9387
9388 #. type: Plain text
9389 #: build/C/man3/stdio.3:40
9390 msgid "stdio - standard input/output library functions"
9391 msgstr ""
9392
9393 #. type: Plain text
9394 #: build/C/man3/stdio.3:44
9395 msgid "B<FILE *>I<stdin>B<;>"
9396 msgstr ""
9397
9398 #. type: Plain text
9399 #: build/C/man3/stdio.3:46
9400 msgid "B<FILE *>I<stdout>B<;>"
9401 msgstr ""
9402
9403 #. type: Plain text
9404 #: build/C/man3/stdio.3:48
9405 msgid "B<FILE *>I<stderr>B<;>"
9406 msgstr ""
9407
9408 #. type: Plain text
9409 #: build/C/man3/stdio.3:55
9410 msgid ""
9411 "The standard I/O library provides a simple and efficient buffered stream I/O "
9412 "interface.  Input and output is mapped into logical data streams and the "
9413 "physical I/O characteristics are concealed.  The functions and macros are "
9414 "listed below; more information is available from the individual man pages."
9415 msgstr ""
9416
9417 #. type: Plain text
9418 #: build/C/man3/stdio.3:78
9419 msgid ""
9420 "A stream is associated with an external file (which may be a physical "
9421 "device) by I<opening> a file, which may involve creating a new file.  "
9422 "Creating an existing file causes its former contents to be discarded.  If a "
9423 "file can support positioning requests (such as a disk file, as opposed to a "
9424 "terminal) then a I<file position indicator> associated with the stream is "
9425 "positioned at the start of the file (byte zero), unless the file is opened "
9426 "with append mode.  If append mode is used, it is unspecified whether the "
9427 "position indicator will be placed at the start or the end of the file.  The "
9428 "position indicator is maintained by subsequent reads, writes and positioning "
9429 "requests.  All input occurs as if the characters were read by successive "
9430 "calls to the B<fgetc>(3)  function; all output takes place as if all "
9431 "characters were written by successive calls to the B<fputc>(3)  function."
9432 msgstr ""
9433
9434 #. type: Plain text
9435 #: build/C/man3/stdio.3:88
9436 msgid ""
9437 "A file is disassociated from a stream by I<closing> the file.  Output "
9438 "streams are flushed (any unwritten buffer contents are transferred to the "
9439 "host environment) before the stream is disassociated from the file.  The "
9440 "value of a pointer to a I<FILE> object is indeterminate after a file is "
9441 "closed (garbage)."
9442 msgstr ""
9443
9444 #. type: Plain text
9445 #: build/C/man3/stdio.3:101
9446 msgid ""
9447 "A file may be subsequently reopened, by the same or another program "
9448 "execution, and its contents reclaimed or modified (if it can be repositioned "
9449 "at the start).  If the main function returns to its original caller, or the "
9450 "B<exit>(3)  function is called, all open files are closed (hence all output "
9451 "streams are flushed) before program termination.  Other methods of program "
9452 "termination, such as B<abort>(3)  do not bother about closing files "
9453 "properly."
9454 msgstr ""
9455
9456 #. type: Plain text
9457 #: build/C/man3/stdio.3:117
9458 msgid ""
9459 "At program startup, three text streams are predefined and need not be opened "
9460 "explicitly: I<standard input> (for reading conventional input), I<standard "
9461 "output> (for writing conventional input), and I<standard error> (for writing "
9462 "diagnostic output).  These streams are abbreviated I<stdin>,I<stdout> and "
9463 "I<stderr>.  When opened, the standard error stream is not fully buffered; "
9464 "the standard input and output streams are fully buffered if and only if the "
9465 "streams do not to refer to an interactive device."
9466 msgstr ""
9467
9468 #. type: Plain text
9469 #: build/C/man3/stdio.3:127
9470 msgid ""
9471 "Output streams that refer to terminal devices are always line buffered by "
9472 "default; pending output to such streams is written automatically whenever an "
9473 "input stream that refers to a terminal device is read.  In cases where a "
9474 "large amount of computation is done after printing part of a line on an "
9475 "output terminal, it is necessary to B<fflush>(3)  the standard output before "
9476 "going off and computing so that the output will appear."
9477 msgstr ""
9478
9479 #. type: Plain text
9480 #: build/C/man3/stdio.3:141
9481 msgid ""
9482 "The I<stdio> library is a part of the library B<libc> and routines are "
9483 "automatically loaded as needed by the compilers B<cc>(1)  and B<pc>(1).  The "
9484 "SYNOPSIS sections of the following manual pages indicate which include files "
9485 "are to be used, what the compiler declaration for the function looks like "
9486 "and which external variables are of interest."
9487 msgstr ""
9488
9489 #.  Not on Linux: .BR fropen ,
9490 #.  Not on Linux: .BR fwopen ,
9491 #. type: Plain text
9492 #: build/C/man3/stdio.3:181
9493 msgid ""
9494 "The following are defined as macros; these names may not be reused without "
9495 "first removing their current definitions with B<#undef>: B<BUFSIZ>, B<EOF>, "
9496 "B<FILENAME_MAX>, B<FOPEN_MAX>, B<L_cuserid>, B<L_ctermid>, B<L_tmpnam>, "
9497 "B<NULL>, B<SEEK_END>, B<SEEK_SET>, B<SEEK_CUR>, B<TMP_MAX>, B<clearerr>, "
9498 "B<feof>, B<ferror>, B<fileno>, B<getc>, B<getchar>, B<putc>, B<putchar>, "
9499 "B<stderr>, B<stdin>, B<stdout>.  Function versions of the macro functions "
9500 "B<feof>, B<ferror>, B<clearerr>, B<fileno>, B<getc>, B<getchar>, B<putc>, "
9501 "and B<putchar> exist and will be used if the macros definitions are "
9502 "explicitly removed."
9503 msgstr ""
9504
9505 #. type: SS
9506 #: build/C/man3/stdio.3:181
9507 #, no-wrap
9508 msgid "List of Functions"
9509 msgstr ""
9510
9511 #. type: tbl table
9512 #: build/C/man3/stdio.3:186
9513 #, no-wrap
9514 msgid "Function\tDescription\n"
9515 msgstr ""
9516
9517 #. type: tbl table
9518 #: build/C/man3/stdio.3:187
9519 #, no-wrap
9520 msgid "_\n"
9521 msgstr ""
9522
9523 #. type: tbl table
9524 #: build/C/man3/stdio.3:188
9525 #, no-wrap
9526 msgid "clearerr\tcheck and reset stream status\n"
9527 msgstr ""
9528
9529 #. type: tbl table
9530 #: build/C/man3/stdio.3:189
9531 #, no-wrap
9532 msgid "fclose\tclose a stream\n"
9533 msgstr ""
9534
9535 #. type: tbl table
9536 #: build/C/man3/stdio.3:190
9537 #, no-wrap
9538 msgid "fdopen\tstream open functions\n"
9539 msgstr ""
9540
9541 #. type: tbl table
9542 #: build/C/man3/stdio.3:191
9543 #, no-wrap
9544 msgid "feof\tcheck and reset stream status\n"
9545 msgstr ""
9546
9547 #. type: tbl table
9548 #: build/C/man3/stdio.3:192
9549 #, no-wrap
9550 msgid "ferror\tcheck and reset stream status\n"
9551 msgstr ""
9552
9553 #. type: tbl table
9554 #: build/C/man3/stdio.3:193
9555 #, no-wrap
9556 msgid "fflush\tflush a stream\n"
9557 msgstr ""
9558
9559 #. type: tbl table
9560 #: build/C/man3/stdio.3:194
9561 #, no-wrap
9562 msgid "fgetc\tget next character or word from input stream\n"
9563 msgstr ""
9564
9565 #. type: tbl table
9566 #: build/C/man3/stdio.3:195
9567 #, no-wrap
9568 msgid "fgetpos\treposition a stream\n"
9569 msgstr ""
9570
9571 #. type: tbl table
9572 #: build/C/man3/stdio.3:196
9573 #, no-wrap
9574 msgid "fgets\tget a line from a stream\n"
9575 msgstr ""
9576
9577 #. type: tbl table
9578 #: build/C/man3/stdio.3:197
9579 #, no-wrap
9580 msgid "fileno\treturn the integer descriptor of the argument stream\n"
9581 msgstr ""
9582
9583 #. type: tbl table
9584 #: build/C/man3/stdio.3:198
9585 #, no-wrap
9586 msgid "fopen\tstream open functions\n"
9587 msgstr ""
9588
9589 #. type: tbl table
9590 #: build/C/man3/stdio.3:199
9591 #, no-wrap
9592 msgid "fprintf\tformatted output conversion\n"
9593 msgstr ""
9594
9595 #. type: tbl table
9596 #: build/C/man3/stdio.3:200
9597 #, no-wrap
9598 msgid "fpurge\tflush a stream\n"
9599 msgstr ""
9600
9601 #. type: tbl table
9602 #: build/C/man3/stdio.3:201
9603 #, no-wrap
9604 msgid "fputc\toutput a character or word to a stream\n"
9605 msgstr ""
9606
9607 #. type: tbl table
9608 #: build/C/man3/stdio.3:202
9609 #, no-wrap
9610 msgid "fputs\toutput a line to a stream\n"
9611 msgstr ""
9612
9613 #. type: tbl table
9614 #: build/C/man3/stdio.3:203
9615 #, no-wrap
9616 msgid "fread\tbinary stream input/output\n"
9617 msgstr ""
9618
9619 #. type: tbl table
9620 #: build/C/man3/stdio.3:204
9621 #, no-wrap
9622 msgid "freopen\tstream open functions\n"
9623 msgstr ""
9624
9625 #. type: tbl table
9626 #: build/C/man3/stdio.3:205
9627 #, no-wrap
9628 msgid "fscanf\tinput format conversion\n"
9629 msgstr ""
9630
9631 #. type: tbl table
9632 #: build/C/man3/stdio.3:206
9633 #, no-wrap
9634 msgid "fseek\treposition a stream\n"
9635 msgstr ""
9636
9637 #. type: tbl table
9638 #: build/C/man3/stdio.3:207
9639 #, no-wrap
9640 msgid "fsetpos\treposition a stream\n"
9641 msgstr ""
9642
9643 #. type: tbl table
9644 #: build/C/man3/stdio.3:208
9645 #, no-wrap
9646 msgid "ftell\treposition a stream\n"
9647 msgstr ""
9648
9649 #. type: tbl table
9650 #: build/C/man3/stdio.3:209
9651 #, no-wrap
9652 msgid "fwrite\tbinary stream input/output\n"
9653 msgstr ""
9654
9655 #. type: tbl table
9656 #: build/C/man3/stdio.3:210
9657 #, no-wrap
9658 msgid "getc\tget next character or word from input stream\n"
9659 msgstr ""
9660
9661 #. type: tbl table
9662 #: build/C/man3/stdio.3:211
9663 #, no-wrap
9664 msgid "getchar\tget next character or word from input stream\n"
9665 msgstr ""
9666
9667 #. type: tbl table
9668 #: build/C/man3/stdio.3:212
9669 #, no-wrap
9670 msgid "gets\tget a line from a stream\n"
9671 msgstr ""
9672
9673 #. type: tbl table
9674 #: build/C/man3/stdio.3:213
9675 #, no-wrap
9676 msgid "getw\tget next character or word from input stream\n"
9677 msgstr ""
9678
9679 #. type: tbl table
9680 #: build/C/man3/stdio.3:214
9681 #, no-wrap
9682 msgid "mktemp\tmake temporary filename (unique)\n"
9683 msgstr ""
9684
9685 #. type: tbl table
9686 #: build/C/man3/stdio.3:215
9687 #, no-wrap
9688 msgid "perror\tsystem error messages\n"
9689 msgstr ""
9690
9691 #. type: tbl table
9692 #: build/C/man3/stdio.3:216
9693 #, no-wrap
9694 msgid "printf\tformatted output conversion\n"
9695 msgstr ""
9696
9697 #. type: tbl table
9698 #: build/C/man3/stdio.3:217
9699 #, no-wrap
9700 msgid "putc\toutput a character or word to a stream\n"
9701 msgstr ""
9702
9703 #. type: tbl table
9704 #: build/C/man3/stdio.3:218
9705 #, no-wrap
9706 msgid "putchar\toutput a character or word to a stream\n"
9707 msgstr ""
9708
9709 #. type: tbl table
9710 #: build/C/man3/stdio.3:219
9711 #, no-wrap
9712 msgid "puts\toutput a line to a stream\n"
9713 msgstr ""
9714
9715 #. type: tbl table
9716 #: build/C/man3/stdio.3:220
9717 #, no-wrap
9718 msgid "putw\toutput a character or word to a stream\n"
9719 msgstr ""
9720
9721 #. type: tbl table
9722 #: build/C/man3/stdio.3:221
9723 #, no-wrap
9724 msgid "remove\tremove directory entry\n"
9725 msgstr ""
9726
9727 #. type: tbl table
9728 #: build/C/man3/stdio.3:222
9729 #, no-wrap
9730 msgid "rewind\treposition a stream\n"
9731 msgstr ""
9732
9733 #. type: tbl table
9734 #: build/C/man3/stdio.3:223
9735 #, no-wrap
9736 msgid "scanf\tinput format conversion\n"
9737 msgstr ""
9738
9739 #. type: tbl table
9740 #: build/C/man3/stdio.3:224
9741 #, no-wrap
9742 msgid "setbuf\tstream buffering operations\n"
9743 msgstr ""
9744
9745 #. type: tbl table
9746 #: build/C/man3/stdio.3:225
9747 #, no-wrap
9748 msgid "setbuffer\tstream buffering operations\n"
9749 msgstr ""
9750
9751 #. type: tbl table
9752 #: build/C/man3/stdio.3:226
9753 #, no-wrap
9754 msgid "setlinebuf\tstream buffering operations\n"
9755 msgstr ""
9756
9757 #. type: tbl table
9758 #: build/C/man3/stdio.3:227
9759 #, no-wrap
9760 msgid "setvbuf\tstream buffering operations\n"
9761 msgstr ""
9762
9763 #. type: tbl table
9764 #: build/C/man3/stdio.3:228
9765 #, no-wrap
9766 msgid "sprintf\tformatted output conversion\n"
9767 msgstr ""
9768
9769 #. type: tbl table
9770 #: build/C/man3/stdio.3:229
9771 #, no-wrap
9772 msgid "sscanf\tinput format conversion\n"
9773 msgstr ""
9774
9775 #. type: tbl table
9776 #: build/C/man3/stdio.3:230
9777 #, no-wrap
9778 msgid "strerror\tsystem error messages\n"
9779 msgstr ""
9780
9781 #. type: tbl table
9782 #: build/C/man3/stdio.3:231
9783 #, no-wrap
9784 msgid "sys_errlist\tsystem error messages\n"
9785 msgstr ""
9786
9787 #. type: tbl table
9788 #: build/C/man3/stdio.3:232
9789 #, no-wrap
9790 msgid "sys_nerr\tsystem error messages\n"
9791 msgstr ""
9792
9793 #. type: tbl table
9794 #: build/C/man3/stdio.3:233
9795 #, no-wrap
9796 msgid "tempnam\ttemporary file routines\n"
9797 msgstr ""
9798
9799 #. type: tbl table
9800 #: build/C/man3/stdio.3:234
9801 #, no-wrap
9802 msgid "tmpfile\ttemporary file routines\n"
9803 msgstr ""
9804
9805 #. type: tbl table
9806 #: build/C/man3/stdio.3:235
9807 #, no-wrap
9808 msgid "tmpnam\ttemporary file routines\n"
9809 msgstr ""
9810
9811 #. type: tbl table
9812 #: build/C/man3/stdio.3:236
9813 #, no-wrap
9814 msgid "ungetc\tun-get character from input stream\n"
9815 msgstr ""
9816
9817 #. type: tbl table
9818 #: build/C/man3/stdio.3:237
9819 #, no-wrap
9820 msgid "vfprintf\tformatted output conversion\n"
9821 msgstr ""
9822
9823 #. type: tbl table
9824 #: build/C/man3/stdio.3:238
9825 #, no-wrap
9826 msgid "vfscanf\tinput format conversion\n"
9827 msgstr ""
9828
9829 #. type: tbl table
9830 #: build/C/man3/stdio.3:239
9831 #, no-wrap
9832 msgid "vprintf\tformatted output conversion\n"
9833 msgstr ""
9834
9835 #. type: tbl table
9836 #: build/C/man3/stdio.3:240
9837 #, no-wrap
9838 msgid "vscanf\tinput format conversion\n"
9839 msgstr ""
9840
9841 #. type: tbl table
9842 #: build/C/man3/stdio.3:241
9843 #, no-wrap
9844 msgid "vsprintf\tformatted output conversion\n"
9845 msgstr ""
9846
9847 #. type: tbl table
9848 #: build/C/man3/stdio.3:242
9849 #, no-wrap
9850 msgid "vsscanf\tinput format conversion\n"
9851 msgstr ""
9852
9853 #. type: Plain text
9854 #: build/C/man3/stdio.3:248
9855 msgid "The I<stdio> library conforms to C89."
9856 msgstr ""
9857
9858 #. type: Plain text
9859 #: build/C/man3/stdio.3:254
9860 msgid ""
9861 "B<close>(2), B<open>(2), B<read>(2), B<write>(2), B<stdout>(3), "
9862 "B<unlocked_stdio>(3)"
9863 msgstr ""
9864
9865 #. type: TH
9866 #: build/C/man3/stdio_ext.3:23
9867 #, no-wrap
9868 msgid "STDIO_EXT"
9869 msgstr ""
9870
9871 #. type: TH
9872 #: build/C/man3/stdio_ext.3:23
9873 #, no-wrap
9874 msgid "2001-12-16"
9875 msgstr ""
9876
9877 #. type: Plain text
9878 #: build/C/man3/stdio_ext.3:28
9879 msgid ""
9880 "__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, "
9881 "__fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio FILE "
9882 "structure"
9883 msgstr ""
9884
9885 #. type: Plain text
9886 #: build/C/man3/stdio_ext.3:32
9887 msgid "B<#include E<lt>stdio_ext.hE<gt>>"
9888 msgstr ""
9889
9890 #. type: Plain text
9891 #: build/C/man3/stdio_ext.3:34
9892 msgid "B<size_t __fbufsize(FILE *>I<stream>B<);>"
9893 msgstr ""
9894
9895 #. type: Plain text
9896 #: build/C/man3/stdio_ext.3:36
9897 msgid "B<size_t __fpending(FILE *>I<stream>B<);>"
9898 msgstr ""
9899
9900 #. type: Plain text
9901 #: build/C/man3/stdio_ext.3:38
9902 msgid "B<int __flbf(FILE *>I<stream>B<);>"
9903 msgstr ""
9904
9905 #. type: Plain text
9906 #: build/C/man3/stdio_ext.3:40
9907 msgid "B<int __freadable(FILE *>I<stream>B<);>"
9908 msgstr ""
9909
9910 #. type: Plain text
9911 #: build/C/man3/stdio_ext.3:42
9912 msgid "B<int __fwritable(FILE *>I<stream>B<);>"
9913 msgstr ""
9914
9915 #. type: Plain text
9916 #: build/C/man3/stdio_ext.3:44
9917 msgid "B<int __freading(FILE *>I<stream>B<);>"
9918 msgstr ""
9919
9920 #. type: Plain text
9921 #: build/C/man3/stdio_ext.3:46
9922 msgid "B<int __fwriting(FILE *>I<stream>B<);>"
9923 msgstr ""
9924
9925 #. type: Plain text
9926 #: build/C/man3/stdio_ext.3:48
9927 msgid "B<int __fsetlocking(FILE *>I<stream>B<, int >I<type>B<);>"
9928 msgstr ""
9929
9930 #. type: Plain text
9931 #: build/C/man3/stdio_ext.3:50
9932 msgid "B<void _flushlbf(void);>"
9933 msgstr ""
9934
9935 #. type: Plain text
9936 #: build/C/man3/stdio_ext.3:52
9937 msgid "B<void __fpurge(FILE *>I<stream>B<);>"
9938 msgstr ""
9939
9940 #. type: Plain text
9941 #: build/C/man3/stdio_ext.3:57
9942 msgid ""
9943 "Solaris introduced routines to allow portable access to the internals of the "
9944 "I<FILE> structure, and glibc also implemented these."
9945 msgstr ""
9946
9947 #. type: Plain text
9948 #: build/C/man3/stdio_ext.3:62
9949 msgid ""
9950 "The B<__fbufsize>()  function returns the size of the buffer currently used "
9951 "by the given stream."
9952 msgstr ""
9953
9954 #. type: Plain text
9955 #: build/C/man3/stdio_ext.3:69
9956 msgid ""
9957 "The B<__fpending>()  function returns the number of bytes in the output "
9958 "buffer.  For wide-oriented streams the unit is wide characters.  This "
9959 "function is undefined on buffers in reading mode, or opened read-only."
9960 msgstr ""
9961
9962 #. type: Plain text
9963 #: build/C/man3/stdio_ext.3:74
9964 msgid ""
9965 "The B<__flbf>()  function returns a nonzero value if the stream is "
9966 "line-buffered, and zero otherwise."
9967 msgstr ""
9968
9969 #. type: Plain text
9970 #: build/C/man3/stdio_ext.3:79
9971 msgid ""
9972 "The B<__freadable>()  function returns a nonzero value if the stream allows "
9973 "reading, and zero otherwise."
9974 msgstr ""
9975
9976 #. type: Plain text
9977 #: build/C/man3/stdio_ext.3:84
9978 msgid ""
9979 "The B<__fwritable>()  function returns a nonzero value if the stream allows "
9980 "writing, and zero otherwise."
9981 msgstr ""
9982
9983 #. type: Plain text
9984 #: build/C/man3/stdio_ext.3:90
9985 msgid ""
9986 "The B<__freading>()  function returns a nonzero value if the stream is "
9987 "read-only, or if the last operation on the stream was a read operation, and "
9988 "zero otherwise."
9989 msgstr ""
9990
9991 #. type: Plain text
9992 #: build/C/man3/stdio_ext.3:96
9993 msgid ""
9994 "The B<__fwriting>()  function returns a nonzero value if the stream is "
9995 "write-only (or append-only), or if the last operation on the stream was a "
9996 "write operation, and zero otherwise."
9997 msgstr ""
9998
9999 #. type: Plain text
10000 #: build/C/man3/stdio_ext.3:104
10001 msgid ""
10002 "The B<__fsetlocking>()  function can be used to select the desired type of "
10003 "locking on the stream.  It returns the current type.  The I<type> argument "
10004 "can take the following three values:"
10005 msgstr ""
10006
10007 #. type: TP
10008 #: build/C/man3/stdio_ext.3:104
10009 #, no-wrap
10010 msgid "B<FSETLOCKING_INTERNAL>"
10011 msgstr ""
10012
10013 #. type: Plain text
10014 #: build/C/man3/stdio_ext.3:109
10015 msgid ""
10016 "Perform implicit locking around every operation on the given stream (except "
10017 "for the *_unlocked ones).  This is the default."
10018 msgstr ""
10019
10020 #. type: TP
10021 #: build/C/man3/stdio_ext.3:109
10022 #, no-wrap
10023 msgid "B<FSETLOCKING_BYCALLER>"
10024 msgstr ""
10025
10026 #. type: Plain text
10027 #: build/C/man3/stdio_ext.3:116
10028 msgid ""
10029 "The caller will take care of the locking (possibly using B<flockfile>(3)  in "
10030 "case there is more than one thread), and the stdio routines will not do "
10031 "locking until the state is reset to B<FSETLOCKING_INTERNAL>."
10032 msgstr ""
10033
10034 #. type: TP
10035 #: build/C/man3/stdio_ext.3:116
10036 #, no-wrap
10037 msgid "B<FSETLOCKING_QUERY>"
10038 msgstr ""
10039
10040 #. type: Plain text
10041 #: build/C/man3/stdio_ext.3:120
10042 msgid "Don't change the type of locking.  (Only return it.)"
10043 msgstr ""
10044
10045 #. type: Plain text
10046 #: build/C/man3/stdio_ext.3:126
10047 msgid ""
10048 "The B<_flushlbf>()  function flushes all line-buffered streams.  (Presumably "
10049 "so that output to a terminal is forced out, say before reading keyboard "
10050 "input.)"
10051 msgstr ""
10052
10053 #. type: Plain text
10054 #: build/C/man3/stdio_ext.3:130
10055 msgid "The B<__fpurge>()  function discards the contents of the stream's buffer."
10056 msgstr ""
10057
10058 #. type: Plain text
10059 #: build/C/man3/stdio_ext.3:132
10060 msgid "B<flockfile>(3), B<fpurge>(3)"
10061 msgstr ""
10062
10063 #. type: TH
10064 #: build/C/man2/symlink.2:32 build/C/man7/symlink.7:35
10065 #, no-wrap
10066 msgid "SYMLINK"
10067 msgstr ""
10068
10069 #. type: TH
10070 #: build/C/man2/symlink.2:32
10071 #, no-wrap
10072 msgid "2010-09-20"
10073 msgstr ""
10074
10075 #. type: Plain text
10076 #: build/C/man2/symlink.2:35
10077 msgid "symlink - make a new name for a file"
10078 msgstr ""
10079
10080 #. type: Plain text
10081 #: build/C/man2/symlink.2:39
10082 msgid "B<int symlink(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
10083 msgstr ""
10084
10085 #. type: Plain text
10086 #: build/C/man2/symlink.2:47
10087 msgid "B<symlink>():"
10088 msgstr ""
10089
10090 #. type: Plain text
10091 #: build/C/man2/symlink.2:58
10092 msgid ""
10093 "B<symlink>()  creates a symbolic link named I<newpath> which contains the "
10094 "string I<oldpath>."
10095 msgstr ""
10096
10097 #. type: Plain text
10098 #: build/C/man2/symlink.2:62
10099 msgid ""
10100 "Symbolic links are interpreted at run time as if the contents of the link "
10101 "had been substituted into the path being followed to find a file or "
10102 "directory."
10103 msgstr ""
10104
10105 #. type: Plain text
10106 #: build/C/man2/symlink.2:67
10107 msgid ""
10108 "Symbolic links may contain I<..> path components, which (if used at the "
10109 "start of the link) refer to the parent directories of that in which the link "
10110 "resides."
10111 msgstr ""
10112
10113 #. type: Plain text
10114 #: build/C/man2/symlink.2:71
10115 msgid ""
10116 "A symbolic link (also known as a soft link) may point to an existing file or "
10117 "to a nonexistent one; the latter case is known as a dangling link."
10118 msgstr ""
10119
10120 #. type: Plain text
10121 #: build/C/man2/symlink.2:78
10122 msgid ""
10123 "The permissions of a symbolic link are irrelevant; the ownership is ignored "
10124 "when following the link, but is checked when removal or renaming of the link "
10125 "is requested and the link is in a directory with the sticky bit (B<S_ISVTX>)  "
10126 "set."
10127 msgstr ""
10128
10129 #. type: Plain text
10130 #: build/C/man2/symlink.2:99
10131 msgid ""
10132 "Write access to the directory containing I<newpath> is denied, or one of the "
10133 "directories in the path prefix of I<newpath> did not allow search "
10134 "permission.  (See also B<path_resolution>(7).)"
10135 msgstr ""
10136
10137 #. type: Plain text
10138 #: build/C/man2/symlink.2:113
10139 msgid "Too many symbolic links were encountered in resolving I<newpath>."
10140 msgstr ""
10141
10142 #. type: Plain text
10143 #: build/C/man2/symlink.2:123
10144 msgid ""
10145 "A directory component in I<newpath> does not exist or is a dangling symbolic "
10146 "link, or I<oldpath> is the empty string."
10147 msgstr ""
10148
10149 #. type: Plain text
10150 #: build/C/man2/symlink.2:135
10151 msgid "A component used as a directory in I<newpath> is not, in fact, a directory."
10152 msgstr ""
10153
10154 #. type: Plain text
10155 #: build/C/man2/symlink.2:140
10156 msgid ""
10157 "The file system containing I<newpath> does not support the creation of "
10158 "symbolic links."
10159 msgstr ""
10160
10161 #. type: Plain text
10162 #: build/C/man2/symlink.2:144
10163 msgid "I<newpath> is on a read-only file system."
10164 msgstr ""
10165
10166 #. type: Plain text
10167 #: build/C/man2/symlink.2:154
10168 msgid "No checking of I<oldpath> is done."
10169 msgstr ""
10170
10171 #. type: Plain text
10172 #: build/C/man2/symlink.2:159
10173 msgid ""
10174 "Deleting the name referred to by a symlink will actually delete the file "
10175 "(unless it also has other hard links).  If this behavior is not desired, use "
10176 "B<link>(2)."
10177 msgstr ""
10178
10179 #. type: Plain text
10180 #: build/C/man2/symlink.2:170
10181 msgid ""
10182 "B<ln>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<open>(2), B<readlink>(2), "
10183 "B<rename>(2), B<symlinkat>(2), B<unlink>(2), B<path_resolution>(7), "
10184 "B<symlink>(7)"
10185 msgstr ""
10186
10187 #. type: TH
10188 #: build/C/man7/symlink.7:35
10189 #, no-wrap
10190 msgid "2008-06-18"
10191 msgstr ""
10192
10193 #. type: Plain text
10194 #: build/C/man7/symlink.7:38
10195 msgid "symlink - symbolic link handling"
10196 msgstr ""
10197
10198 #. type: SH
10199 #: build/C/man7/symlink.7:38
10200 #, no-wrap
10201 msgid "SYMBOLIC LINK HANDLING"
10202 msgstr ""
10203
10204 #. type: Plain text
10205 #: build/C/man7/symlink.7:42
10206 msgid ""
10207 "Symbolic links are files that act as pointers to other files.  To understand "
10208 "their behavior, you must first understand how hard links work."
10209 msgstr ""
10210
10211 #. type: Plain text
10212 #: build/C/man7/symlink.7:58
10213 msgid ""
10214 "A hard link to a file is indistinguishable from the original file because it "
10215 "is a reference to the object underlying the original filename.  (To be "
10216 "precise: each of the hard links to a file is a reference to the same "
10217 "I<i-node number>, where an i-node number is an index into the i-node table, "
10218 "which contains metadata about all files on a file system.  See B<stat>(2).)  "
10219 "Changes to a file are independent of the name used to reference the file.  "
10220 "Hard links may not refer to directories (to prevent the possibility of loops "
10221 "within the file system tree, which would confuse many programs)  and may not "
10222 "refer to files on different file systems (because i-node numbers are not "
10223 "unique across file systems)."
10224 msgstr ""
10225
10226 #. type: Plain text
10227 #: build/C/man7/symlink.7:65
10228 msgid ""
10229 "A symbolic link is a special type of file whose contents are a string that "
10230 "is the pathname another file, the file to which the link refers.  In other "
10231 "words, a symbolic link is a pointer to another name, and not to an "
10232 "underlying object.  For this reason, symbolic links may refer to directories "
10233 "and may cross file system boundaries."
10234 msgstr ""
10235
10236 #. type: Plain text
10237 #: build/C/man7/symlink.7:71
10238 msgid ""
10239 "There is no requirement that the pathname referred to by a symbolic link "
10240 "should exist.  A symbolic link that refers to a pathname that does not exist "
10241 "is said to be a I<dangling link>."
10242 msgstr ""
10243
10244 #. type: Plain text
10245 #: build/C/man7/symlink.7:83
10246 msgid ""
10247 "Because a symbolic link and its referenced object coexist in the file system "
10248 "name space, confusion can arise in distinguishing between the link itself "
10249 "and the referenced object.  On historical systems, commands and system calls "
10250 "adopted their own link-following conventions in a somewhat ad-hoc fashion.  "
10251 "Rules for a more uniform approach, as they are implemented on Linux and "
10252 "other systems, are outlined here.  It is important that site-local "
10253 "applications also conform to these rules, so that the user interface can be "
10254 "as consistent as possible."
10255 msgstr ""
10256
10257 #. type: SS
10258 #: build/C/man7/symlink.7:83
10259 #, no-wrap
10260 msgid "Symbolic link ownership, permissions, and timestamps"
10261 msgstr ""
10262
10263 #. type: Plain text
10264 #: build/C/man7/symlink.7:91
10265 msgid ""
10266 "The owner and group of an existing symbolic link can be changed using "
10267 "B<lchown>(2).  The only time that the ownership of a symbolic link matters "
10268 "is when the link is being removed or renamed in a directory that has the "
10269 "sticky bit set (see B<stat>(2))."
10270 msgstr ""
10271
10272 #. type: Plain text
10273 #: build/C/man7/symlink.7:97
10274 msgid ""
10275 "The last access and last modification timestamps of a symbolic link can be "
10276 "changed using B<utimensat>(2)  or B<lutimes>(3)."
10277 msgstr ""
10278
10279 #.  Linux does not currently implement an lchmod(2).
10280 #
10281 #.  The
10282 #.  4.4BSD
10283 #.  system differs from historical
10284 #.  4BSD
10285 #.  systems in that the system call
10286 #.  .BR chown (2)
10287 #.  has been changed to follow symbolic links.
10288 #.  The
10289 #.  .BR lchown (2)
10290 #.  system call was added later when the limitations of the new
10291 #.  .BR chown (2)
10292 #.  became apparent.
10293 #. type: Plain text
10294 #: build/C/man7/symlink.7:116
10295 msgid ""
10296 "On Linux, the permissions of a symbolic link are not used in any operations; "
10297 "the permissions are always 0777 (read, write, and execute for all user "
10298 "categories), and can't be changed."
10299 msgstr ""
10300
10301 #. type: SS
10302 #: build/C/man7/symlink.7:116
10303 #, no-wrap
10304 msgid "Handling of symbolic links by system calls and commands"
10305 msgstr ""
10306
10307 #. type: Plain text
10308 #: build/C/man7/symlink.7:131
10309 msgid ""
10310 "Symbolic links are handled either by operating on the link itself, or by "
10311 "operating on the object referred to by the link.  In the latter case, an "
10312 "application or system call is said to I<follow> the link.  Symbolic links "
10313 "may refer to other symbolic links, in which case the links are dereferenced "
10314 "until an object that is not a symbolic link is found, a symbolic link that "
10315 "refers to a file which does not exist is found, or a loop is detected.  "
10316 "(Loop detection is done by placing an upper limit on the number of links "
10317 "that may be followed, and an error results if this limit is exceeded.)"
10318 msgstr ""
10319
10320 #. type: Plain text
10321 #: build/C/man7/symlink.7:134
10322 msgid ""
10323 "There are three separate areas that need to be discussed.  They are as "
10324 "follows:"
10325 msgstr ""
10326
10327 #. type: IP
10328 #: build/C/man7/symlink.7:134
10329 #, no-wrap
10330 msgid "1."
10331 msgstr ""
10332
10333 #. type: Plain text
10334 #: build/C/man7/symlink.7:136
10335 msgid "Symbolic links used as filename arguments for system calls."
10336 msgstr ""
10337
10338 #. type: IP
10339 #: build/C/man7/symlink.7:136
10340 #, no-wrap
10341 msgid "2."
10342 msgstr ""
10343
10344 #. type: Plain text
10345 #: build/C/man7/symlink.7:139
10346 msgid ""
10347 "Symbolic links specified as command-line arguments to utilities that are not "
10348 "traversing a file tree."
10349 msgstr ""
10350
10351 #. type: IP
10352 #: build/C/man7/symlink.7:139
10353 #, no-wrap
10354 msgid "3."
10355 msgstr ""
10356
10357 #. type: Plain text
10358 #: build/C/man7/symlink.7:143
10359 msgid ""
10360 "Symbolic links encountered by utilities that are traversing a file tree "
10361 "(either specified on the command line or encountered as part of the file "
10362 "hierarchy walk)."
10363 msgstr ""
10364
10365 #. type: SS
10366 #: build/C/man7/symlink.7:143
10367 #, no-wrap
10368 msgid "System calls"
10369 msgstr ""
10370
10371 #. type: Plain text
10372 #: build/C/man7/symlink.7:146
10373 msgid ""
10374 "The first area is symbolic links used as filename arguments for system "
10375 "calls."
10376 msgstr ""
10377
10378 #. type: Plain text
10379 #: build/C/man7/symlink.7:156
10380 msgid ""
10381 "Except as noted below, all system calls follow symbolic links.  For example, "
10382 "if there were a symbolic link I<slink> which pointed to a file named "
10383 "I<afile>, the system call I<open(\"slink\" ...\\&)> would return a file "
10384 "descriptor referring to the file I<afile>."
10385 msgstr ""
10386
10387 #.  Maybe one day: .BR fchownat (2)
10388 #. type: Plain text
10389 #: build/C/man7/symlink.7:206
10390 msgid ""
10391 "Various system calls do not follow links, and operate on the symbolic link "
10392 "itself.  They are: B<lchown>(2), B<lgetxattr>(2), B<llistxattr>(2), "
10393 "B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), B<readlink>(2), "
10394 "B<rename>(2), B<rmdir>(2), and B<unlink>(2).  Certain other system calls "
10395 "optionally follow symbolic links.  They are: B<faccessat>(2), "
10396 "B<fchownat>(2), B<fstatat>(2), B<linkat>(2), B<open>(2), B<openat>(2), and "
10397 "B<utimensat>(2); see their manual pages for details.  Because B<remove>(3)  "
10398 "is an alias for B<unlink>(2), that library function also does not follow "
10399 "symbolic links.  When B<rmdir>(2)  is applied to a symbolic link, it fails "
10400 "with the error B<ENOTDIR>.  The B<link>(2)  warrants special discussion.  "
10401 "POSIX.1-2001 specifies that B<link>(2)  should dereference I<oldpath> if it "
10402 "is a symbolic link.  However, Linux does not do this.  (By default Solaris "
10403 "is the same, but the POSIX.1-2001 specified behavior can be obtained with "
10404 "suitable compiler options.)  The upcoming POSIX.1 revision changes the "
10405 "specification to allow either behavior in an implementation."
10406 msgstr ""
10407
10408 #. type: SS
10409 #: build/C/man7/symlink.7:206
10410 #, no-wrap
10411 msgid "Commands not traversing a file tree"
10412 msgstr ""
10413
10414 #. type: Plain text
10415 #: build/C/man7/symlink.7:209
10416 msgid ""
10417 "The second area is symbolic links, specified as command-line filename "
10418 "arguments, to commands which are not traversing a file tree."
10419 msgstr ""
10420
10421 #. type: Plain text
10422 #: build/C/man7/symlink.7:220
10423 msgid ""
10424 "Except as noted below, commands follow symbolic links named as command-line "
10425 "arguments.  For example, if there were a symbolic link I<slink> which "
10426 "pointed to a file named I<afile>, the command I<cat slink> would display the "
10427 "contents of the file I<afile>."
10428 msgstr ""
10429
10430 #. type: Plain text
10431 #: build/C/man7/symlink.7:228
10432 msgid ""
10433 "It is important to realize that this rule includes commands which may "
10434 "optionally traverse file trees, e.g., the command I<chown file> is included "
10435 "in this rule, while the command I<chown\\ -R file>, which performs a tree "
10436 "traversal, is not.  (The latter is described in the third area, below.)"
10437 msgstr ""
10438
10439 #. type: Plain text
10440 #: build/C/man7/symlink.7:246
10441 msgid ""
10442 "If it is explicitly intended that the command operate on the symbolic link "
10443 "instead of following the symbolic link, e.g., it is desired that I<chown "
10444 "slink> change the ownership of the file that I<slink> is, whether it is a "
10445 "symbolic link or not, the I<-h> option should be used.  In the above "
10446 "example, I<chown root slink> would change the ownership of the file referred "
10447 "to by I<slink>, while I<chown\\ -h root slink> would change the ownership of "
10448 "I<slink> itself."
10449 msgstr ""
10450
10451 #. type: Plain text
10452 #: build/C/man7/symlink.7:248
10453 msgid "There are some exceptions to this rule:"
10454 msgstr ""
10455
10456 #. type: Plain text
10457 #: build/C/man7/symlink.7:258
10458 msgid ""
10459 "The B<mv>(1)  and B<rm>(1)  commands do not follow symbolic links named as "
10460 "arguments, but respectively attempt to rename and delete them.  (Note, if "
10461 "the symbolic link references a file via a relative path, moving it to "
10462 "another directory may very well cause it to stop working, since the path may "
10463 "no longer be correct.)"
10464 msgstr ""
10465
10466 #. type: Plain text
10467 #: build/C/man7/symlink.7:288
10468 msgid ""
10469 "The B<ls>(1)  command is also an exception to this rule.  For compatibility "
10470 "with historic systems (when B<ls>(1)  is not doing a tree walk, i.e., the "
10471 "I<-R> option is not specified), the B<ls>(1)  command follows symbolic links "
10472 "named as arguments if the I<-H> or I<-L> option is specified, or if the "
10473 "I<-F>, I<-d>, or I<-l> options are not specified.  (The B<ls>(1)  command is "
10474 "the only command where the I<-H> and I<-L> options affect its behavior even "
10475 "though it is not doing a walk of a file tree.)"
10476 msgstr ""
10477
10478 #
10479 #. The 4.4BSD system differs from historical 4BSD systems in that the
10480 #. .BR chown (1)
10481 #. and
10482 #. .BR chgrp (1)
10483 #. commands follow symbolic links specified on the command line.
10484 #. type: Plain text
10485 #: build/C/man7/symlink.7:306
10486 msgid ""
10487 "The B<file>(1)  command is also an exception to this rule.  The B<file>(1)  "
10488 "command does not follow symbolic links named as argument by default.  The "
10489 "B<file>(1)  command does follow symbolic links named as argument if the "
10490 "I<-L> option is specified."
10491 msgstr ""
10492
10493 #. type: SS
10494 #: build/C/man7/symlink.7:306
10495 #, no-wrap
10496 msgid "Commands traversing a file tree"
10497 msgstr ""
10498
10499 #. type: Plain text
10500 #: build/C/man7/symlink.7:319
10501 msgid ""
10502 "The following commands either optionally or always traverse file trees: "
10503 "B<chgrp>(1), B<chmod>(1), B<chown>(1), B<cp>(1), B<du>(1), B<find>(1), "
10504 "B<ls>(1), B<pax>(1), B<rm>(1), and B<tar>(1)."
10505 msgstr ""
10506
10507 #. type: Plain text
10508 #: build/C/man7/symlink.7:323
10509 msgid ""
10510 "It is important to realize that the following rules apply equally to "
10511 "symbolic links encountered during the file tree traversal and symbolic links "
10512 "listed as command-line arguments."
10513 msgstr ""
10514
10515 #. type: Plain text
10516 #: build/C/man7/symlink.7:328
10517 msgid ""
10518 "The I<first rule> applies to symbolic links that reference files other than "
10519 "directories.  Operations that apply to symbolic links are performed on the "
10520 "links themselves, but otherwise the links are ignored."
10521 msgstr ""
10522
10523 #. type: Plain text
10524 #: build/C/man7/symlink.7:340
10525 msgid ""
10526 "The command I<rm\\ -r slink directory> will remove I<slink>, as well as any "
10527 "symbolic links encountered in the tree traversal of I<directory>, because "
10528 "symbolic links may be removed.  In no case will B<rm>(1)  affect the file "
10529 "referred to by I<slink>."
10530 msgstr ""
10531
10532 #. type: Plain text
10533 #: build/C/man7/symlink.7:345
10534 msgid ""
10535 "The I<second rule> applies to symbolic links that refer to directories.  "
10536 "Symbolic links that refer to directories are never followed by default.  "
10537 "This is often referred to as a \"physical\" walk, as opposed to a "
10538 "\"logical\" walk (where symbolic links the refer to directories are "
10539 "followed)."
10540 msgstr ""
10541
10542 #. type: Plain text
10543 #: build/C/man7/symlink.7:348
10544 msgid ""
10545 "Certain conventions are (should be) followed as consistently as possible by "
10546 "commands that perform file tree walks:"
10547 msgstr ""
10548
10549 #. type: Plain text
10550 #: build/C/man7/symlink.7:361
10551 msgid ""
10552 "A command can be made to follow any symbolic links named on the command "
10553 "line, regardless of the type of file they reference, by specifying the I<-H> "
10554 "(for \"half-logical\") flag.  This flag is intended to make the command-line "
10555 "name space look like the logical name space.  (Note, for commands that do "
10556 "not always do file tree traversals, the I<-H> flag will be ignored if the "
10557 "I<-R> flag is not also specified.)"
10558 msgstr ""
10559
10560 #. type: Plain text
10561 #: build/C/man7/symlink.7:377
10562 msgid ""
10563 "For example, the command I<chown\\ -HR user slink> will traverse the file "
10564 "hierarchy rooted in the file pointed to by I<slink>.  Note, the I<-H> is not "
10565 "the same as the previously discussed I<-h> flag.  The I<-H> flag causes "
10566 "symbolic links specified on the command line to be dereferenced for the "
10567 "purposes of both the action to be performed and the tree walk, and it is as "
10568 "if the user had specified the name of the file to which the symbolic link "
10569 "pointed."
10570 msgstr ""
10571
10572 #. type: Plain text
10573 #: build/C/man7/symlink.7:391
10574 msgid ""
10575 "A command can be made to follow any symbolic links named on the command "
10576 "line, as well as any symbolic links encountered during the traversal, "
10577 "regardless of the type of file they reference, by specifying the I<-L> (for "
10578 "\"logical\") flag.  This flag is intended to make the entire name space look "
10579 "like the logical name space.  (Note, for commands that do not always do file "
10580 "tree traversals, the I<-L> flag will be ignored if the I<-R> flag is not "
10581 "also specified.)"
10582 msgstr ""
10583
10584 #. type: Plain text
10585 #: build/C/man7/symlink.7:406
10586 msgid ""
10587 "For example, the command I<chown\\ -LR user slink> will change the owner of "
10588 "the file referred to by I<slink>.  If I<slink> refers to a directory, "
10589 "B<chown> will traverse the file hierarchy rooted in the directory that it "
10590 "references.  In addition, if any symbolic links are encountered in any file "
10591 "tree that B<chown> traverses, they will be treated in the same fashion as "
10592 "I<slink>."
10593 msgstr ""
10594
10595 #. type: Plain text
10596 #: build/C/man7/symlink.7:413
10597 msgid ""
10598 "A command can be made to provide the default behavior by specifying the "
10599 "I<-P> (for \"physical\") flag.  This flag is intended to make the entire "
10600 "name space look like the physical name space."
10601 msgstr ""
10602
10603 #. type: Plain text
10604 #: build/C/man7/symlink.7:431
10605 msgid ""
10606 "For commands that do not by default do file tree traversals, the I<-H>, "
10607 "I<-L>, and I<-P> flags are ignored if the I<-R> flag is not also specified.  "
10608 "In addition, you may specify the I<-H>, I<-L>, and I<-P> options more than "
10609 "once; the last one specified determines the command's behavior.  This is "
10610 "intended to permit you to alias commands to behave one way or the other, and "
10611 "then override that behavior on the command line."
10612 msgstr ""
10613
10614 #. type: Plain text
10615 #: build/C/man7/symlink.7:437
10616 msgid "The B<ls>(1)  and B<rm>(1)  commands have exceptions to these rules:"
10617 msgstr ""
10618
10619 #. type: Plain text
10620 #: build/C/man7/symlink.7:450
10621 msgid ""
10622 "The B<rm>(1)  command operates on the symbolic link, and not the file it "
10623 "references, and therefore never follows a symbolic link.  The B<rm>(1)  "
10624 "command does not support the I<-H>, I<-L>, or I<-P> options."
10625 msgstr ""
10626
10627 #. type: Plain text
10628 #: build/C/man7/symlink.7:470
10629 msgid ""
10630 "To maintain compatibility with historic systems, the B<ls>(1)  command acts "
10631 "a little differently.  If you do not specify the I<-F>, I<-d> or I<-l> "
10632 "options, B<ls>(1)  will follow symbolic links specified on the command "
10633 "line.  If the I<-L> flag is specified, B<ls>(1)  follows all symbolic links, "
10634 "regardless of their type, whether specified on the command line or "
10635 "encountered in the tree walk."
10636 msgstr ""
10637
10638 #. type: Plain text
10639 #: build/C/man7/symlink.7:487
10640 msgid ""
10641 "B<chgrp>(1), B<chmod>(1), B<find>(1), B<ln>(1), B<ls>(1), B<mv>(1), "
10642 "B<rm>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<readlink>(2), "
10643 "B<rename>(2), B<symlink>(2), B<unlink>(2), B<utimensat>(2), B<lutimes>(3), "
10644 "B<path_resolution>(7)"
10645 msgstr ""
10646
10647 #. type: TH
10648 #: build/C/man3/tempnam.3:23
10649 #, no-wrap
10650 msgid "TEMPNAM"
10651 msgstr ""
10652
10653 #. type: TH
10654 #: build/C/man3/tempnam.3:23
10655 #, no-wrap
10656 msgid "2008-08-06"
10657 msgstr ""
10658
10659 #. type: Plain text
10660 #: build/C/man3/tempnam.3:26
10661 msgid "tempnam - create a name for a temporary file"
10662 msgstr ""
10663
10664 #. type: Plain text
10665 #: build/C/man3/tempnam.3:31
10666 #, no-wrap
10667 msgid "B<char *tempnam(const char *>I<dir>B<, const char *>I<pfx>B<);>\n"
10668 msgstr ""
10669
10670 #. type: Plain text
10671 #: build/C/man3/tempnam.3:40
10672 msgid "B<tempnam>(): _BSD_SOURCE || _SVID_SOURCE"
10673 msgstr ""
10674
10675 #. type: Plain text
10676 #: build/C/man3/tempnam.3:54
10677 msgid ""
10678 "The B<tempnam>()  function returns a pointer to a string that is a valid "
10679 "filename, and such that a file with this name did not exist when "
10680 "B<tempnam>()  checked.  The filename suffix of the pathname generated will "
10681 "start with I<pfx> in case I<pfx> is a non-NULL string of at most five "
10682 "bytes.  The directory prefix part of the pathname generated is required to "
10683 "be \"appropriate\" (often that at least implies writable)."
10684 msgstr ""
10685
10686 #. type: Plain text
10687 #: build/C/man3/tempnam.3:57
10688 msgid "Attempts to find an appropriate directory go through the following steps:"
10689 msgstr ""
10690
10691 #. type: TP
10692 #: build/C/man3/tempnam.3:57
10693 #, no-wrap
10694 msgid "a)"
10695 msgstr ""
10696
10697 #. type: Plain text
10698 #: build/C/man3/tempnam.3:63
10699 msgid ""
10700 "In case the environment variable B<TMPDIR> exists and contains the name of "
10701 "an appropriate directory, that is used."
10702 msgstr ""
10703
10704 #. type: TP
10705 #: build/C/man3/tempnam.3:63
10706 #, no-wrap
10707 msgid "b)"
10708 msgstr ""
10709
10710 #. type: Plain text
10711 #: build/C/man3/tempnam.3:68
10712 msgid "Otherwise, if the I<dir> argument is non-NULL and appropriate, it is used."
10713 msgstr ""
10714
10715 #. type: TP
10716 #: build/C/man3/tempnam.3:68
10717 #, no-wrap
10718 msgid "c)"
10719 msgstr ""
10720
10721 #. type: Plain text
10722 #: build/C/man3/tempnam.3:75
10723 msgid ""
10724 "Otherwise, I<P_tmpdir> (as defined in I<E<lt>stdio.hE<gt>>)  is used when "
10725 "appropriate."
10726 msgstr ""
10727
10728 #. type: TP
10729 #: build/C/man3/tempnam.3:75
10730 #, no-wrap
10731 msgid "d)"
10732 msgstr ""
10733
10734 #. type: Plain text
10735 #: build/C/man3/tempnam.3:78
10736 msgid "Finally an implementation-defined directory may be used."
10737 msgstr ""
10738
10739 #. type: Plain text
10740 #: build/C/man3/tempnam.3:85
10741 msgid ""
10742 "The string returned by B<tempnam>()  is allocated using B<malloc>(3)  and "
10743 "hence should be freed by B<free>(3)."
10744 msgstr ""
10745
10746 #. type: Plain text
10747 #: build/C/man3/tempnam.3:90
10748 msgid ""
10749 "The B<tempnam>()  function returns a pointer to a unique temporary filename, "
10750 "or NULL if a unique name cannot be generated."
10751 msgstr ""
10752
10753 #. type: Plain text
10754 #: build/C/man3/tempnam.3:94
10755 msgid "Allocation of storage failed."
10756 msgstr ""
10757
10758 #. type: Plain text
10759 #: build/C/man3/tempnam.3:99
10760 msgid "SVr4, 4.3BSD, POSIX.1-2001.  POSIX.1-2008 marks B<tempnam>()  as obsolete."
10761 msgstr ""
10762
10763 #. type: Plain text
10764 #: build/C/man3/tempnam.3:118
10765 msgid ""
10766 "Although B<tempnam>()  generates names that are difficult to guess, it is "
10767 "nevertheless possible that between the time that B<tempnam>()  returns a "
10768 "pathname, and the time that the program opens it, another program might "
10769 "create that pathname using B<open>(2), or create it as a symbolic link.  "
10770 "This can lead to security holes.  To avoid such possibilities, use the "
10771 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
10772 "B<mkstemp>(3)  or B<tmpfile>(3)."
10773 msgstr ""
10774
10775 #. type: Plain text
10776 #: build/C/man3/tempnam.3:126
10777 msgid ""
10778 "SUSv2 does not mention the use of B<TMPDIR>; glibc will use it only when the "
10779 "program is not set-user-ID.  On SVr4, the directory used under B<d)> is "
10780 "I</tmp> (and this is what glibc does)."
10781 msgstr ""
10782
10783 #. type: Plain text
10784 #: build/C/man3/tempnam.3:131
10785 msgid ""
10786 "Because it dynamically allocates memory used to return the pathname, "
10787 "B<tempnam>()  is reentrant, and thus thread safe, unlike B<tmpnam>(3)."
10788 msgstr ""
10789
10790 #. type: Plain text
10791 #: build/C/man3/tempnam.3:144
10792 msgid ""
10793 "The B<tempnam>()  function generates a different string each time it is "
10794 "called, up to B<TMP_MAX> (defined in I<E<lt>stdio.hE<gt>>)  times.  If it is "
10795 "called more than B<TMP_MAX> times, the behavior is implementation defined."
10796 msgstr ""
10797
10798 #. type: Plain text
10799 #: build/C/man3/tempnam.3:148
10800 msgid "B<tempnam>()  uses at most the first five bytes from I<pfx>."
10801 msgstr ""
10802
10803 #. type: Plain text
10804 #: build/C/man3/tempnam.3:154
10805 msgid ""
10806 "The glibc implementation of B<tempnam>()  will fail with the error B<EEXIST> "
10807 "upon failure to find a unique name."
10808 msgstr ""
10809
10810 #. type: Plain text
10811 #: build/C/man3/tempnam.3:157
10812 msgid ""
10813 "The precise meaning of \"appropriate\" is undefined; it is unspecified how "
10814 "accessibility of a directory is determined."
10815 msgstr ""
10816
10817 #. type: Plain text
10818 #: build/C/man3/tempnam.3:164 build/C/man3/tmpnam.3:151
10819 msgid "Never use this function.  Use B<mkstemp>(3)  or B<tmpfile>(3)  instead."
10820 msgstr ""
10821
10822 #. type: Plain text
10823 #: build/C/man3/tempnam.3:168
10824 msgid "B<mkstemp>(3), B<mktemp>(3), B<tmpfile>(3), B<tmpnam>(3)"
10825 msgstr ""
10826
10827 #. type: TH
10828 #: build/C/man3/tmpfile.3:29
10829 #, no-wrap
10830 msgid "TMPFILE"
10831 msgstr ""
10832
10833 #. type: Plain text
10834 #: build/C/man3/tmpfile.3:32
10835 msgid "tmpfile - create a temporary file"
10836 msgstr ""
10837
10838 #. type: Plain text
10839 #: build/C/man3/tmpfile.3:37
10840 #, no-wrap
10841 msgid "B<FILE *tmpfile(void);>\n"
10842 msgstr ""
10843
10844 #. type: Plain text
10845 #: build/C/man3/tmpfile.3:45
10846 msgid ""
10847 "The B<tmpfile>()  function opens a unique temporary file in binary "
10848 "read/write (w+b) mode.  The file will be automatically deleted when it is "
10849 "closed or the program terminates."
10850 msgstr ""
10851
10852 #. type: Plain text
10853 #: build/C/man3/tmpfile.3:52
10854 msgid ""
10855 "The B<tmpfile>()  function returns a stream descriptor, or NULL if a unique "
10856 "filename cannot be generated or the unique file cannot be opened.  In the "
10857 "latter case, I<errno> is set to indicate the error."
10858 msgstr ""
10859
10860 #. type: Plain text
10861 #: build/C/man3/tmpfile.3:56
10862 msgid "Search permission denied for directory in file's path prefix."
10863 msgstr ""
10864
10865 #. type: Plain text
10866 #: build/C/man3/tmpfile.3:59
10867 msgid "Unable to generate a unique filename."
10868 msgstr ""
10869
10870 #. type: Plain text
10871 #: build/C/man3/tmpfile.3:62
10872 msgid "The call was interrupted by a signal."
10873 msgstr ""
10874
10875 #. type: Plain text
10876 #: build/C/man3/tmpfile.3:65
10877 msgid "Too many file descriptors in use by the process."
10878 msgstr ""
10879
10880 #. type: Plain text
10881 #: build/C/man3/tmpfile.3:68
10882 msgid "Too many files open in the system."
10883 msgstr ""
10884
10885 #. type: Plain text
10886 #: build/C/man3/tmpfile.3:71
10887 msgid "There was no room in the directory to add the new filename."
10888 msgstr ""
10889
10890 #. type: Plain text
10891 #: build/C/man3/tmpfile.3:74
10892 msgid "Read-only file system."
10893 msgstr ""
10894
10895 #. type: Plain text
10896 #: build/C/man3/tmpfile.3:76
10897 msgid "SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001."
10898 msgstr ""
10899
10900 #. type: Plain text
10901 #: build/C/man3/tmpfile.3:80
10902 msgid ""
10903 "POSIX.1-2001 specifies: an error message may be written to I<stdout> if the "
10904 "stream cannot be opened."
10905 msgstr ""
10906
10907 #. type: Plain text
10908 #: build/C/man3/tmpfile.3:86
10909 msgid ""
10910 "The standard does not specify the directory that B<tmpfile>()  will use.  "
10911 "Glibc will try the path prefix I<P_tmpdir> defined in I<E<lt>stdio.hE<gt>>, "
10912 "and if that fails the directory I</tmp>."
10913 msgstr ""
10914
10915 #. type: Plain text
10916 #: build/C/man3/tmpfile.3:91
10917 msgid "B<exit>(3), B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpnam>(3)"
10918 msgstr ""
10919
10920 #. type: TH
10921 #: build/C/man3/tmpnam.3:25
10922 #, no-wrap
10923 msgid "TMPNAM"
10924 msgstr ""
10925
10926 #. type: TH
10927 #: build/C/man3/tmpnam.3:25
10928 #, no-wrap
10929 msgid "2010-09-10"
10930 msgstr ""
10931
10932 #. type: Plain text
10933 #: build/C/man3/tmpnam.3:28
10934 msgid "tmpnam, tmpnam_r - create a name for a temporary file"
10935 msgstr ""
10936
10937 #. type: Plain text
10938 #: build/C/man3/tmpnam.3:33
10939 #, no-wrap
10940 msgid "B<char *tmpnam(char *>I<s>B<);>\n"
10941 msgstr ""
10942
10943 #. type: Plain text
10944 #: build/C/man3/tmpnam.3:56
10945 msgid ""
10946 "The B<tmpnam>()  function returns a pointer to a string that is a valid "
10947 "filename, and such that a file with this name did not exist at some point in "
10948 "time, so that naive programmers may think it a suitable name for a temporary "
10949 "file.  If the argument I<s> is NULL this name is generated in an internal "
10950 "static buffer and may be overwritten by the next call to B<tmpnam>().  If "
10951 "I<s> is not NULL, the name is copied to the character array (of length at "
10952 "least I<L_tmpnam>)  pointed to by I<s> and the value I<s> is returned in "
10953 "case of success."
10954 msgstr ""
10955
10956 #. type: Plain text
10957 #: build/C/man3/tmpnam.3:68
10958 msgid ""
10959 "The pathname that is created, has a directory prefix I<P_tmpdir>.  (Both "
10960 "I<L_tmpnam> and I<P_tmpdir> are defined in I<E<lt>stdio.hE<gt>>, just like "
10961 "the B<TMP_MAX> mentioned below.)"
10962 msgstr ""
10963
10964 #. type: Plain text
10965 #: build/C/man3/tmpnam.3:73
10966 msgid ""
10967 "The B<tmpnam>()  function returns a pointer to a unique temporary filename, "
10968 "or NULL if a unique name cannot be generated."
10969 msgstr ""
10970
10971 #. type: Plain text
10972 #: build/C/man3/tmpnam.3:75
10973 msgid "No errors are defined."
10974 msgstr ""
10975
10976 #. type: Plain text
10977 #: build/C/man3/tmpnam.3:80
10978 msgid ""
10979 "SVr4, 4.3BSD, C89, C99, POSIX.1-2001.  POSIX.1-2008 marks B<tmpnam>()  as "
10980 "obsolete."
10981 msgstr ""
10982
10983 #. type: Plain text
10984 #: build/C/man3/tmpnam.3:91
10985 msgid ""
10986 "The B<tmpnam>()  function generates a different string each time it is "
10987 "called, up to B<TMP_MAX> times.  If it is called more than B<TMP_MAX> times, "
10988 "the behavior is implementation defined."
10989 msgstr ""
10990
10991 #. type: Plain text
10992 #: build/C/man3/tmpnam.3:110
10993 msgid ""
10994 "Although B<tmpnam>()  generates names that are difficult to guess, it is "
10995 "nevertheless possible that between the time that B<tmpnam>()  returns a "
10996 "pathname, and the time that the program opens it, another program might "
10997 "create that pathname using B<open>(2), or create it as a symbolic link.  "
10998 "This can lead to security holes.  To avoid such possibilities, use the "
10999 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
11000 "B<mkstemp>(3)  or B<tmpfile>(3)."
11001 msgstr ""
11002
11003 #. type: Plain text
11004 #: build/C/man3/tmpnam.3:118
11005 msgid ""
11006 "Portable applications that use threads cannot call B<tmpnam>()  with a NULL "
11007 "argument if either B<_POSIX_THREADS> or B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
11008 "defined."
11009 msgstr ""
11010
11011 #. type: Plain text
11012 #: build/C/man3/tmpnam.3:122
11013 msgid "A POSIX draft proposed to use a function B<tmpnam_r>()  defined by"
11014 msgstr ""
11015
11016 #. type: Plain text
11017 #: build/C/man3/tmpnam.3:130
11018 #, no-wrap
11019 msgid ""
11020 "char *\n"
11021 "tmpnam_r(char *s)\n"
11022 "{\n"
11023 "    return s ? tmpnam(s) : NULL;\n"
11024 "}\n"
11025 msgstr ""
11026
11027 #. type: Plain text
11028 #: build/C/man3/tmpnam.3:144
11029 msgid ""
11030 "apparently as a warning not to use NULL.  A few systems implement it.  To "
11031 "get a glibc prototype for this function from I<E<lt>stdio.hE<gt>>, define "
11032 "B<_SVID_SOURCE> or B<_BSD_SOURCE> (before including I<any> header file)."
11033 msgstr ""
11034
11035 #. type: Plain text
11036 #: build/C/man3/tmpnam.3:155
11037 msgid "B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpfile>(3)"
11038 msgstr ""
11039
11040 #. type: TH
11041 #: build/C/man2/unlink.2:32
11042 #, no-wrap
11043 msgid "UNLINK"
11044 msgstr ""
11045
11046 #. type: TH
11047 #: build/C/man2/unlink.2:32
11048 #, no-wrap
11049 msgid "2011-09-15"
11050 msgstr ""
11051
11052 #. type: Plain text
11053 #: build/C/man2/unlink.2:35
11054 msgid "unlink - delete a name and possibly the file it refers to"
11055 msgstr ""
11056
11057 #. type: Plain text
11058 #: build/C/man2/unlink.2:39
11059 msgid "B<int unlink(const char *>I<pathname>B<);>"
11060 msgstr ""
11061
11062 #. type: Plain text
11063 #: build/C/man2/unlink.2:45
11064 msgid ""
11065 "B<unlink>()  deletes a name from the file system.  If that name was the last "
11066 "link to a file and no processes have the file open the file is deleted and "
11067 "the space it was using is made available for reuse."
11068 msgstr ""
11069
11070 #. type: Plain text
11071 #: build/C/man2/unlink.2:49
11072 msgid ""
11073 "If the name was the last link to a file but any processes still have the "
11074 "file open the file will remain in existence until the last file descriptor "
11075 "referring to it is closed."
11076 msgstr ""
11077
11078 #. type: Plain text
11079 #: build/C/man2/unlink.2:51
11080 msgid "If the name referred to a symbolic link the link is removed."
11081 msgstr ""
11082
11083 #. type: Plain text
11084 #: build/C/man2/unlink.2:55
11085 msgid ""
11086 "If the name referred to a socket, fifo or device the name for it is removed "
11087 "but processes which have the object open may continue to use it."
11088 msgstr ""
11089
11090 #. type: Plain text
11091 #: build/C/man2/unlink.2:71
11092 msgid ""
11093 "Write access to the directory containing I<pathname> is not allowed for the "
11094 "process's effective UID, or one of the directories in I<pathname> did not "
11095 "allow search permission.  (See also B<path_resolution>(7).)"
11096 msgstr ""
11097
11098 #. type: Plain text
11099 #: build/C/man2/unlink.2:80
11100 msgid ""
11101 "The file I<pathname> cannot be unlinked because it is being used by the "
11102 "system or another process; for example, it is a mount point or the NFS "
11103 "client software created it to represent an active but otherwise nameless "
11104 "inode (\"NFS silly renamed\")."
11105 msgstr ""
11106
11107 #. type: Plain text
11108 #: build/C/man2/unlink.2:92
11109 msgid ""
11110 "I<pathname> refers to a directory.  (This is the non-POSIX value returned by "
11111 "Linux since 2.1.132.)"
11112 msgstr ""
11113
11114 #. type: Plain text
11115 #: build/C/man2/unlink.2:96
11116 msgid "Too many symbolic links were encountered in translating I<pathname>."
11117 msgstr ""
11118
11119 #. type: Plain text
11120 #: build/C/man2/unlink.2:106
11121 msgid ""
11122 "A component in I<pathname> does not exist or is a dangling symbolic link, or "
11123 "I<pathname> is empty."
11124 msgstr ""
11125
11126 #. type: Plain text
11127 #: build/C/man2/unlink.2:114
11128 msgid "A component used as a directory in I<pathname> is not, in fact, a directory."
11129 msgstr ""
11130
11131 #. type: Plain text
11132 #: build/C/man2/unlink.2:123
11133 msgid ""
11134 "The system does not allow unlinking of directories, or unlinking of "
11135 "directories requires privileges that the calling process doesn't have.  "
11136 "(This is the POSIX prescribed error return; as noted above, Linux returns "
11137 "B<EISDIR> for this case.)"
11138 msgstr ""
11139
11140 #. type: TP
11141 #: build/C/man2/unlink.2:123
11142 #, no-wrap
11143 msgid "B<EPERM> (Linux only)"
11144 msgstr ""
11145
11146 #. type: Plain text
11147 #: build/C/man2/unlink.2:126
11148 msgid "The file system does not allow unlinking of files."
11149 msgstr ""
11150
11151 #. type: Plain text
11152 #: build/C/man2/unlink.2:137
11153 msgid ""
11154 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
11155 "and the process's effective UID is neither the UID of the file to be deleted "
11156 "nor that of the directory containing it, and the process is not privileged "
11157 "(Linux: does not have the B<CAP_FOWNER> capability)."
11158 msgstr ""
11159
11160 #. type: Plain text
11161 #: build/C/man2/unlink.2:141
11162 msgid "I<pathname> refers to a file on a read-only file system."
11163 msgstr ""
11164
11165 #. type: Plain text
11166 #: build/C/man2/unlink.2:160
11167 msgid ""
11168 "B<rm>(1), B<chmod>(2), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
11169 "B<rmdir>(2), B<unlinkat>(2), B<mkfifo>(3), B<remove>(3), "
11170 "B<path_resolution>(7), B<symlink>(7)"
11171 msgstr ""
11172
11173 #. type: TH
11174 #: build/C/man3/unlocked_stdio.3:23
11175 #, no-wrap
11176 msgid "UNLOCKED_STDIO"
11177 msgstr ""
11178
11179 #. type: Plain text
11180 #: build/C/man3/unlocked_stdio.3:27
11181 msgid ""
11182 "getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - "
11183 "nonlocking stdio functions"
11184 msgstr ""
11185
11186 #. type: Plain text
11187 #: build/C/man3/unlocked_stdio.3:35
11188 #, no-wrap
11189 msgid ""
11190 "B<int getc_unlocked(FILE *>I<stream>B<);>\n"
11191 "B<int getchar_unlocked(void);>\n"
11192 "B<int putc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11193 "B<int putchar_unlocked(int >I<c>B<);>\n"
11194 msgstr ""
11195
11196 #. type: Plain text
11197 #: build/C/man3/unlocked_stdio.3:47
11198 #, no-wrap
11199 msgid ""
11200 "B<void clearerr_unlocked(FILE *>I<stream>B<);>\n"
11201 "B<int feof_unlocked(FILE *>I<stream>B<);>\n"
11202 "B<int ferror_unlocked(FILE *>I<stream>B<);>\n"
11203 "B<int fileno_unlocked(FILE *>I<stream>B<);>\n"
11204 "B<int fflush_unlocked(FILE *>I<stream>B<);>\n"
11205 "B<int fgetc_unlocked(FILE *>I<stream>B<);>\n"
11206 "B<int fputc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11207 "B<size_t fread_unlocked(void *>I<ptr>B<, size_t >I<size>B<, size_t "
11208 ">I<n>B<,>\n"
11209 "B<                      FILE *>I<stream>B<);>\n"
11210 "B<size_t fwrite_unlocked(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
11211 ">I<n>B<,>\n"
11212 "B<                      FILE *>I<stream>B<);>\n"
11213 msgstr ""
11214
11215 #. type: Plain text
11216 #: build/C/man3/unlocked_stdio.3:50
11217 #, no-wrap
11218 msgid ""
11219 "B<char *fgets_unlocked(char *>I<s>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
11220 "B<int fputs_unlocked(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
11221 msgstr ""
11222
11223 #. type: Plain text
11224 #: build/C/man3/unlocked_stdio.3:61
11225 #, no-wrap
11226 msgid ""
11227 "B<wint_t getwc_unlocked(FILE *>I<stream>B<);>\n"
11228 "B<wint_t getwchar_unlocked(void);>\n"
11229 "B<wint_t fgetwc_unlocked(FILE *>I<stream>B<);>\n"
11230 "B<wint_t fputwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11231 "B<wint_t putwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11232 "B<wint_t putwchar_unlocked(wchar_t >I<wc>B<);>\n"
11233 "B<wchar_t *fgetws_unlocked(wchar_t *>I<ws>B<, int >I<n>B<, FILE "
11234 "*>I<stream>B<);>\n"
11235 "B<int fputws_unlocked(const wchar_t *>I<ws>B<, FILE *>I<stream>B<);>\n"
11236 msgstr ""
11237
11238 #. type: Plain text
11239 #: build/C/man3/unlocked_stdio.3:73
11240 msgid ""
11241 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
11242 "B<putchar_unlocked>():"
11243 msgstr ""
11244
11245 #. type: Plain text
11246 #: build/C/man3/unlocked_stdio.3:76
11247 msgid ""
11248 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || "
11249 "_BSD_SOURCE || _SVID_SOURCE"
11250 msgstr ""
11251
11252 #. type: Plain text
11253 #: build/C/man3/unlocked_stdio.3:87
11254 msgid ""
11255 "B<clearerr_unlocked>(), B<feof_unlocked>(), B<ferror_unlocked>(), "
11256 "B<fileno_unlocked>(), B<fflush_unlocked>(), B<fgetc_unlocked>(), "
11257 "B<fputc_unlocked>(), B<fread_unlocked>(), B<fwrite_unlocked>():"
11258 msgstr ""
11259
11260 #. type: Plain text
11261 #: build/C/man3/unlocked_stdio.3:89
11262 msgid "_BSD_SOURCE || _SVID_SOURCE"
11263 msgstr ""
11264
11265 #. type: Plain text
11266 #: build/C/man3/unlocked_stdio.3:100
11267 msgid ""
11268 "B<fgets_unlocked>(), B<fputs_unlocked>(), B<getwc_unlocked>(), "
11269 "B<getwchar_unlocked>(), B<fgetwc_unlocked>(), B<fputwc_unlocked>(), "
11270 "B<putwchar_unlocked>(), B<fgetws_unlocked>(), B<fputws_unlocked>():"
11271 msgstr ""
11272
11273 #. type: Plain text
11274 #: build/C/man3/unlocked_stdio.3:111
11275 msgid ""
11276 "Each of these functions has the same behavior as its counterpart without the "
11277 "\"_unlocked\" suffix, except that they do not use locking (they do not set "
11278 "locks themselves, and do not test for the presence of locks set by others) "
11279 "and hence are thread-unsafe.  See B<flockfile>(3)."
11280 msgstr ""
11281
11282 #. type: Plain text
11283 #: build/C/man3/unlocked_stdio.3:118
11284 msgid ""
11285 "The four functions B<getc_unlocked>(), B<getchar_unlocked>(), "
11286 "B<putc_unlocked>(), B<putchar_unlocked>()  are in POSIX.1-2001."
11287 msgstr ""
11288
11289 #.  E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
11290 #.  moved to a compatibility library.
11291 #.  Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
11292 #.  feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
11293 #.  fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
11294 #.  fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
11295 #.  ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
11296 #.  getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
11297 #.  putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
11298 #.  putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
11299 #.  ungetc_unlocked, ungetwc_unlocked.
11300 #. type: Plain text
11301 #: build/C/man3/unlocked_stdio.3:134
11302 msgid ""
11303 "The nonstandard B<*_unlocked>()  variants occur on a few UNIX systems, and "
11304 "are available in recent glibc.  They should probably not be used."
11305 msgstr ""
11306
11307 #. type: Plain text
11308 #: build/C/man3/unlocked_stdio.3:136
11309 msgid "B<flockfile>(3), B<stdio>(3)"
11310 msgstr ""
11311
11312 #. type: TH
11313 #: build/C/man3/wprintf.3:14
11314 #, no-wrap
11315 msgid "WPRINTF"
11316 msgstr ""
11317
11318 #. type: TH
11319 #: build/C/man3/wprintf.3:14
11320 #, no-wrap
11321 msgid "2011-09-17"
11322 msgstr ""
11323
11324 #. type: Plain text
11325 #: build/C/man3/wprintf.3:18
11326 msgid ""
11327 "wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - formatted "
11328 "wide-character output conversion"
11329 msgstr ""
11330
11331 #. type: Plain text
11332 #: build/C/man3/wprintf.3:22
11333 #, no-wrap
11334 msgid ""
11335 "B<#include E<lt>stdio.hE<gt>>\n"
11336 "B<#include E<lt>wchar.hE<gt>>\n"
11337 msgstr ""
11338
11339 #. type: Plain text
11340 #: build/C/man3/wprintf.3:27
11341 #, no-wrap
11342 msgid ""
11343 "B<int wprintf(const wchar_t *>I<format>B<, ...);>\n"
11344 "B<int fwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, ...);>\n"
11345 "B<int swprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11346 "B<             const wchar_t *>I<format>B<, ...);>\n"
11347 msgstr ""
11348
11349 #. type: Plain text
11350 #: build/C/man3/wprintf.3:32
11351 #, no-wrap
11352 msgid ""
11353 "B<int vwprintf(const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11354 "B<int vfwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, va_list "
11355 ">I<args>B<);>\n"
11356 "B<int vswprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11357 "B<              const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11358 msgstr ""
11359
11360 #.  .BR wprintf (),
11361 #.  .BR fwprintf (),
11362 #.  .BR swprintf (),
11363 #.  .BR vwprintf (),
11364 #.  .BR vfwprintf (),
11365 #.  .BR vswprintf ():
11366 #. type: Plain text
11367 #: build/C/man3/wprintf.3:49
11368 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE ||"
11369 msgstr ""
11370
11371 #. type: Plain text
11372 #: build/C/man3/wprintf.3:51
11373 msgid "_ISOC95_SOURCE /* Since glibc 2.12 */ ||"
11374 msgstr ""
11375
11376 #. type: Plain text
11377 #: build/C/man3/wprintf.3:53
11378 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
11379 msgstr ""
11380
11381 #. type: Plain text
11382 #: build/C/man3/wprintf.3:56
11383 msgid "or I<cc\\ -std=c99>"
11384 msgstr ""
11385
11386 #. type: Plain text
11387 #: build/C/man3/wprintf.3:67
11388 msgid ""
11389 "The B<wprintf>()  family of functions is the wide-character equivalent of "
11390 "the B<printf>(3)  family of functions.  It performs formatted output of wide "
11391 "characters."
11392 msgstr ""
11393
11394 #. type: Plain text
11395 #: build/C/man3/wprintf.3:77
11396 msgid ""
11397 "The B<wprintf>()  and B<vwprintf>()  functions perform wide-character output "
11398 "to I<stdout>.  I<stdout> must not be byte oriented; see B<fwide>(3)  for "
11399 "more information."
11400 msgstr ""
11401
11402 #. type: Plain text
11403 #: build/C/man3/wprintf.3:87
11404 msgid ""
11405 "The B<fwprintf>()  and B<vfwprintf>()  functions perform wide-character "
11406 "output to I<stream>.  I<stream> must not be byte oriented; see B<fwide>(3)  "
11407 "for more information."
11408 msgstr ""
11409
11410 #. type: Plain text
11411 #: build/C/man3/wprintf.3:98
11412 msgid ""
11413 "The B<swprintf>()  and B<vswprintf>()  functions perform wide-character "
11414 "output to an array of wide characters.  The programmer must ensure that "
11415 "there is room for at least I<maxlen> wide characters at I<wcs>."
11416 msgstr ""
11417
11418 #. type: Plain text
11419 #: build/C/man3/wprintf.3:109
11420 msgid ""
11421 "These functions are like the B<printf>(3), B<vprintf>(3), B<fprintf>(3), "
11422 "B<vfprintf>(3), B<sprintf>(3), B<vsprintf>(3)  functions except for the "
11423 "following differences:"
11424 msgstr ""
11425
11426 #. type: TP
11427 #: build/C/man3/wprintf.3:109 build/C/man3/wprintf.3:112 build/C/man3/wprintf.3:115
11428 #, no-wrap
11429 msgid "B<\\(bu>"
11430 msgstr ""
11431
11432 #. type: Plain text
11433 #: build/C/man3/wprintf.3:112
11434 msgid "The I<format> string is a wide-character string."
11435 msgstr ""
11436
11437 #. type: Plain text
11438 #: build/C/man3/wprintf.3:115
11439 msgid "The output consists of wide characters, not bytes."
11440 msgstr ""
11441
11442 #. type: Plain text
11443 #: build/C/man3/wprintf.3:130
11444 msgid ""
11445 "B<swprintf>()  and B<vswprintf>()  take a I<maxlen> argument, B<sprintf>(3)  "
11446 "and B<vsprintf>(3)  do not.  (B<snprintf>(3)  and B<vsnprintf>(3)  take a "
11447 "I<maxlen> argument, but these functions do not return -1 upon buffer "
11448 "overflow on Linux.)"
11449 msgstr ""
11450
11451 #. type: Plain text
11452 #: build/C/man3/wprintf.3:132
11453 msgid "The treatment of the conversion characters B<c> and B<s> is different:"
11454 msgstr ""
11455
11456 #. type: Plain text
11457 #: build/C/man3/wprintf.3:146
11458 msgid ""
11459 "If no B<l> modifier is present, the I<int> argument is converted to a wide "
11460 "character by a call to the B<btowc>(3)  function, and the resulting wide "
11461 "character is written.  If an B<l> modifier is present, the I<wint_t> (wide "
11462 "character) argument is written."
11463 msgstr ""
11464
11465 #. type: Plain text
11466 #: build/C/man3/wprintf.3:185
11467 msgid ""
11468 "If no B<l> modifier is present: The I<const\\ char\\ *> argument is expected "
11469 "to be a pointer to an array of character type (pointer to a string) "
11470 "containing a multibyte character sequence beginning in the initial shift "
11471 "state.  Characters from the array are converted to wide characters (each by "
11472 "a call to the B<mbrtowc>(3)  function with a conversion state starting in "
11473 "the initial state before the first byte).  The resulting wide characters are "
11474 "written up to (but not including) the terminating null wide character.  If a "
11475 "precision is specified, no more wide characters than the number specified "
11476 "are written.  Note that the precision determines the number of I<wide "
11477 "characters> written, not the number of I<bytes> or I<screen positions>.  The "
11478 "array must contain a terminating null byte, unless a precision is given and "
11479 "it is so small that the number of converted wide characters reaches it "
11480 "before the end of the array is reached.  If an B<l> modifier is present: The "
11481 "I<const\\ wchar_t\\ *> argument is expected to be a pointer to an array of "
11482 "wide characters.  Wide characters from the array are written up to (but not "
11483 "including) a terminating null wide character.  If a precision is specified, "
11484 "no more than the number specified are written.  The array must contain a "
11485 "terminating null wide character, unless a precision is given and it is "
11486 "smaller than or equal to the number of wide characters in the array."
11487 msgstr ""
11488
11489 #. type: Plain text
11490 #: build/C/man3/wprintf.3:193
11491 msgid ""
11492 "The functions return the number of wide characters written, excluding the "
11493 "terminating null wide character in case of the functions B<swprintf>()  and "
11494 "B<vswprintf>().  They return -1 when an error occurs."
11495 msgstr ""
11496
11497 #. type: Plain text
11498 #: build/C/man3/wprintf.3:195
11499 msgid "C99."
11500 msgstr ""
11501
11502 #. type: Plain text
11503 #: build/C/man3/wprintf.3:203
11504 msgid ""
11505 "The behavior of B<wprintf>()  et al. depends on the B<LC_CTYPE> category of "
11506 "the current locale."
11507 msgstr ""
11508
11509 #. type: Plain text
11510 #: build/C/man3/wprintf.3:229
11511 msgid ""
11512 "If the I<format> string contains non-ASCII wide characters, the program will "
11513 "only work correctly if the B<LC_CTYPE> category of the current locale at run "
11514 "time is the same as the B<LC_CTYPE> category of the current locale at "
11515 "compile time.  This is because the I<wchar_t> representation is platform- "
11516 "and locale-dependent.  (The glibc represents wide characters using their "
11517 "Unicode (ISO-10646) code point, but other platforms don't do this.  Also, "
11518 "the use of C99 universal character names of the form \\eunnnn does not solve "
11519 "this problem.)  Therefore, in internationalized programs, the I<format> "
11520 "string should consist of ASCII wide characters only, or should be "
11521 "constructed at run time in an internationalized way (e.g., using "
11522 "B<gettext>(3)  or B<iconv>(3), followed by B<mbstowcs>(3))."
11523 msgstr ""
11524
11525 #. type: Plain text
11526 #: build/C/man3/wprintf.3:234
11527 msgid "B<fprintf>(3), B<fputwc>(3), B<fwide>(3), B<printf>(3), B<snprintf>(3)"
11528 msgstr ""
11529
11530 #. type: TH
11531 #: build/C/man2/write.2:39
11532 #, no-wrap
11533 msgid "WRITE"
11534 msgstr ""
11535
11536 #. type: TH
11537 #: build/C/man2/write.2:39
11538 #, no-wrap
11539 msgid "2010-08-29"
11540 msgstr ""
11541
11542 #. type: Plain text
11543 #: build/C/man2/write.2:42
11544 msgid "write - write to a file descriptor"
11545 msgstr ""
11546
11547 #. type: Plain text
11548 #: build/C/man2/write.2:46
11549 msgid "B<ssize_t write(int >I<fd>B<, const void *>I<buf>B<, size_t >I<count>B<);>"
11550 msgstr ""
11551
11552 #. type: Plain text
11553 #: build/C/man2/write.2:54
11554 msgid ""
11555 "B<write>()  writes up to I<count> bytes from the buffer pointed I<buf> to "
11556 "the file referred to by the file descriptor I<fd>."
11557 msgstr ""
11558
11559 #. type: Plain text
11560 #: build/C/man2/write.2:68
11561 msgid ""
11562 "The number of bytes written may be less than I<count> if, for example, there "
11563 "is insufficient space on the underlying physical medium, or the "
11564 "B<RLIMIT_FSIZE> resource limit is encountered (see B<setrlimit>(2)), or the "
11565 "call was interrupted by a signal handler after having written less than "
11566 "I<count> bytes.  (See also B<pipe>(7).)"
11567 msgstr ""
11568
11569 #. type: Plain text
11570 #: build/C/man2/write.2:82
11571 msgid ""
11572 "For a seekable file (i.e., one to which B<lseek>(2)  may be applied, for "
11573 "example, a regular file)  writing takes place at the current file offset, "
11574 "and the file offset is incremented by the number of bytes actually written.  "
11575 "If the file was B<open>(2)ed with B<O_APPEND>, the file offset is first set "
11576 "to the end of the file before writing.  The adjustment of the file offset "
11577 "and the write operation are performed as an atomic step."
11578 msgstr ""
11579
11580 #. type: Plain text
11581 #: build/C/man2/write.2:89
11582 msgid ""
11583 "POSIX requires that a B<read>(2)  which can be proved to occur after a "
11584 "B<write>()  has returned returns the new data.  Note that not all file "
11585 "systems are POSIX conforming."
11586 msgstr ""
11587
11588 #. type: Plain text
11589 #: build/C/man2/write.2:94
11590 msgid ""
11591 "On success, the number of bytes written is returned (zero indicates nothing "
11592 "was written).  On error, -1 is returned, and I<errno> is set appropriately."
11593 msgstr ""
11594
11595 #. type: Plain text
11596 #: build/C/man2/write.2:107
11597 msgid ""
11598 "If I<count> is zero and I<fd> refers to a regular file, then B<write>()  may "
11599 "return a failure status if one of the errors below is detected.  If no "
11600 "errors are detected, 0 will be returned without causing any other effect.  "
11601 "If I<count> is zero and I<fd> refers to a file other than a regular file, "
11602 "the results are not specified."
11603 msgstr ""
11604
11605 #. type: Plain text
11606 #: build/C/man2/write.2:115
11607 msgid ""
11608 "The file descriptor I<fd> refers to a file other than a socket and has been "
11609 "marked nonblocking (B<O_NONBLOCK>), and the write would block."
11610 msgstr ""
11611
11612 #.  Actually EAGAIN on Linux
11613 #. type: Plain text
11614 #: build/C/man2/write.2:126
11615 msgid ""
11616 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
11617 "(B<O_NONBLOCK>), and the write would block.  POSIX.1-2001 allows either "
11618 "error to be returned for this case, and does not require these constants to "
11619 "have the same value, so a portable application should check for both "
11620 "possibilities."
11621 msgstr ""
11622
11623 #. type: Plain text
11624 #: build/C/man2/write.2:130
11625 msgid "I<fd> is not a valid file descriptor or is not open for writing."
11626 msgstr ""
11627
11628 #. type: TP
11629 #: build/C/man2/write.2:130
11630 #, no-wrap
11631 msgid "B<EDESTADDRREQ>"
11632 msgstr ""
11633
11634 #. type: Plain text
11635 #: build/C/man2/write.2:135
11636 msgid ""
11637 "I<fd> refers to a datagram socket for which a peer address has not been set "
11638 "using B<connect>(2)."
11639 msgstr ""
11640
11641 #. type: Plain text
11642 #: build/C/man2/write.2:144
11643 msgid ""
11644 "An attempt was made to write a file that exceeds the implementation-defined "
11645 "maximum file size or the process's file size limit, or to write at a "
11646 "position past the maximum allowed offset."
11647 msgstr ""
11648
11649 #. type: Plain text
11650 #: build/C/man2/write.2:148
11651 msgid ""
11652 "The call was interrupted by a signal before any data was written; see "
11653 "B<signal>(7)."
11654 msgstr ""
11655
11656 #. type: Plain text
11657 #: build/C/man2/write.2:159
11658 msgid ""
11659 "I<fd> is attached to an object which is unsuitable for writing; or the file "
11660 "was opened with the B<O_DIRECT> flag, and either the address specified in "
11661 "I<buf>, the value specified in I<count>, or the current file offset is not "
11662 "suitably aligned."
11663 msgstr ""
11664
11665 #. type: Plain text
11666 #: build/C/man2/write.2:162
11667 msgid "A low-level I/O error occurred while modifying the inode."
11668 msgstr ""
11669
11670 #. type: Plain text
11671 #: build/C/man2/write.2:167
11672 msgid ""
11673 "The device containing the file referred to by I<fd> has no room for the "
11674 "data."
11675 msgstr ""
11676
11677 #. type: TP
11678 #: build/C/man2/write.2:167
11679 #, no-wrap
11680 msgid "B<EPIPE>"
11681 msgstr ""
11682
11683 #. type: Plain text
11684 #: build/C/man2/write.2:176
11685 msgid ""
11686 "I<fd> is connected to a pipe or socket whose reading end is closed.  When "
11687 "this happens the writing process will also receive a B<SIGPIPE> signal.  "
11688 "(Thus, the write return value is seen only if the program catches, blocks or "
11689 "ignores this signal.)"
11690 msgstr ""
11691
11692 #. type: Plain text
11693 #: build/C/man2/write.2:179
11694 msgid "Other errors may occur, depending on the object connected to I<fd>."
11695 msgstr ""
11696
11697 #. type: Plain text
11698 #: build/C/man2/write.2:188
11699 msgid ""
11700 "Under SVr4 a write may be interrupted and return B<EINTR> at any point, not "
11701 "just before any data is written."
11702 msgstr ""
11703
11704 #. type: Plain text
11705 #: build/C/man2/write.2:197
11706 msgid ""
11707 "A successful return from B<write>()  does not make any guarantee that data "
11708 "has been committed to disk.  In fact, on some buggy implementations, it does "
11709 "not even guarantee that space has successfully been reserved for the data.  "
11710 "The only way to be sure is to call B<fsync>(2)  after you are done writing "
11711 "all your data."
11712 msgstr ""
11713
11714 #. type: Plain text
11715 #: build/C/man2/write.2:205
11716 msgid ""
11717 "If a B<write>()  is interrupted by a signal handler before any bytes are "
11718 "written, then the call fails with the error B<EINTR>; if it is interrupted "
11719 "after at least one byte has been written, the call succeeds, and returns the "
11720 "number of bytes written."
11721 msgstr ""
11722
11723 #. type: Plain text
11724 #: build/C/man2/write.2:216
11725 msgid ""
11726 "B<close>(2), B<fcntl>(2), B<fsync>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), "
11727 "B<pwrite>(2), B<read>(2), B<select>(2), B<writev>(2), B<fwrite>(3)"
11728 msgstr ""