OSDN Git Service

(split) LDP: Support po4a.
[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-03-19 23:50+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:50 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:466 build/C/man2/pipe.2:91 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:96 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:612 build/C/man3/perror.3:107 build/C/man2/pipe.2:117 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:301 build/C/man3/fopencookie.3:434 build/C/man3/fpurge.3:78 build/C/man3/fputwc.3:80 build/C/man3/fread.3:98 build/C/man3/fseek.3:166 build/C/man3/fseeko.3:81 build/C/man3/getline.3:166 build/C/man3/gets.3:164 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:851 build/C/man3/perror.3:135 build/C/man2/pipe.2:189 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:69
135 msgid "B<free>(3), B<malloc>(3), B<printf>(3)"
136 msgstr ""
137
138 #. type: SH
139 #: build/C/man3/asprintf.3:69 build/C/man3/ctermid.3:71 build/C/man3/dprintf.3:96 build/C/man3/fclose.3:106 build/C/man3/fcloseall.3:62 build/C/man3/ferror.3:117 build/C/man3/fflush.3:114 build/C/man3/fgetwc.3:87 build/C/man3/flockfile.3:129 build/C/man3/fmemopen.3:276 build/C/man3/fmtmsg.3:296 build/C/man3/fopen.3:307 build/C/man3/fopencookie.3:439 build/C/man3/fpurge.3:83 build/C/man3/fputwc.3:84 build/C/man3/fread.3:104 build/C/man3/fseek.3:169 build/C/man3/fseeko.3:83 build/C/man3/getline.3:173 build/C/man3/gets.3:179 build/C/man3/getw.3:90 build/C/man2/link.2:187 build/C/man2/llseek.2:85 build/C/man2/lseek.2:241 build/C/man3/lseek64.3:160 build/C/man2/open.2:873 build/C/man3/perror.3:140 build/C/man2/pipe.2:196 build/C/man3/popen.3:206 build/C/man3/printf.3:1083 build/C/man3/puts.3:122 build/C/man2/read.2:191 build/C/man2/readlink.2:220 build/C/man2/readv.2:286 build/C/man3/remove.3:92 build/C/man2/rename.2:251 build/C/man2/rmdir.2:141 build/C/man3/scanf.3:724 build/C/man3/setbuf.3:206 build/C/man3/stdin.3:156 build/C/man3/stdio.3:255 build/C/man3/stdio_ext.3:133 build/C/man2/symlink.2:171 build/C/man7/symlink.7:488 build/C/man3/tempnam.3:169 build/C/man3/tmpfile.3:92 build/C/man3/tmpnam.3:156 build/C/man2/unlink.2:161 build/C/man3/unlocked_stdio.3:137 build/C/man3/wprintf.3:236 build/C/man2/write.2:217
140 #, no-wrap
141 msgid "COLOPHON"
142 msgstr ""
143
144 #. type: Plain text
145 #: build/C/man3/asprintf.3:76 build/C/man3/ctermid.3:78 build/C/man3/dprintf.3:103 build/C/man3/fclose.3:113 build/C/man3/fcloseall.3:69 build/C/man3/ferror.3:124 build/C/man3/fflush.3:121 build/C/man3/fgetwc.3:94 build/C/man3/flockfile.3:136 build/C/man3/fmemopen.3:283 build/C/man3/fmtmsg.3:303 build/C/man3/fopen.3:314 build/C/man3/fopencookie.3:446 build/C/man3/fpurge.3:90 build/C/man3/fputwc.3:91 build/C/man3/fread.3:111 build/C/man3/fseek.3:176 build/C/man3/fseeko.3:90 build/C/man3/getline.3:180 build/C/man3/gets.3:186 build/C/man3/getw.3:97 build/C/man2/link.2:194 build/C/man2/llseek.2:92 build/C/man2/lseek.2:248 build/C/man3/lseek64.3:167 build/C/man2/open.2:880 build/C/man3/perror.3:147 build/C/man2/pipe.2:203 build/C/man3/popen.3:213 build/C/man3/printf.3:1090 build/C/man3/puts.3:129 build/C/man2/read.2:198 build/C/man2/readlink.2:227 build/C/man2/readv.2:293 build/C/man3/remove.3:99 build/C/man2/rename.2:258 build/C/man2/rmdir.2:148 build/C/man3/scanf.3:731 build/C/man3/setbuf.3:213 build/C/man3/stdin.3:163 build/C/man3/stdio.3:262 build/C/man3/stdio_ext.3:140 build/C/man2/symlink.2:178 build/C/man7/symlink.7:495 build/C/man3/tempnam.3:176 build/C/man3/tmpfile.3:99 build/C/man3/tmpnam.3:163 build/C/man2/unlink.2:168 build/C/man3/unlocked_stdio.3:144 build/C/man3/wprintf.3:243 build/C/man2/write.2:224
146 msgid ""
147 "This page is part of release 3.35 of the Linux I<man-pages> project.  A "
148 "description of the project, and information about reporting bugs, can be "
149 "found at http://man7.org/linux/man-pages/."
150 msgstr ""
151
152 #. type: TH
153 #: build/C/man3/ctermid.3:24
154 #, no-wrap
155 msgid "CTERMID"
156 msgstr ""
157
158 #. type: TH
159 #: build/C/man3/ctermid.3:24 build/C/man3/perror.3:30
160 #, no-wrap
161 msgid "2007-07-26"
162 msgstr ""
163
164 #. type: Plain text
165 #: build/C/man3/ctermid.3:27
166 msgid "ctermid - get controlling terminal name"
167 msgstr ""
168
169 #. type: Plain text
170 #: 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
171 #, no-wrap
172 msgid "B<#include E<lt>stdio.hE<gt>>\n"
173 msgstr ""
174
175 #. type: Plain text
176 #: build/C/man3/ctermid.3:34
177 #, no-wrap
178 msgid "B<char *ctermid(char *>I<s>B<);>\n"
179 msgstr ""
180
181 #. type: Plain text
182 #: 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
183 msgid "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
184 msgstr ""
185
186 #.  From <unistd.h>: _XOPEN_SOURCE
187 #. type: Plain text
188 #: build/C/man3/ctermid.3:44
189 msgid "B<ctermid>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
190 msgstr ""
191
192 #. type: Plain text
193 #: build/C/man3/ctermid.3:57
194 msgid ""
195 "B<ctermid>()  returns a string which is the pathname for the current "
196 "controlling terminal for this process.  If I<s> is NULL, a static buffer is "
197 "used, otherwise I<s> points to a buffer used to hold the terminal pathname.  "
198 "The symbolic constant B<L_ctermid> is the maximum number of characters in "
199 "the returned pathname."
200 msgstr ""
201
202 #. type: Plain text
203 #: build/C/man3/ctermid.3:59
204 msgid "The pointer to the pathname."
205 msgstr ""
206
207 #. type: Plain text
208 #: build/C/man3/ctermid.3:61
209 msgid "Svr4, POSIX.1-2001."
210 msgstr ""
211
212 #. type: SH
213 #: build/C/man3/ctermid.3:61 build/C/man3/fmemopen.3:201 build/C/man3/gets.3:143 build/C/man3/getw.3:80 build/C/man2/link.2:171 build/C/man2/open.2:840 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
214 #, no-wrap
215 msgid "BUGS"
216 msgstr ""
217
218 #. type: Plain text
219 #: build/C/man3/ctermid.3:65
220 msgid ""
221 "The path returned may not uniquely identify the controlling terminal; it "
222 "may, for example, be I</dev/tty>."
223 msgstr ""
224
225 #.  in glibc 2.3.x, x >= 4, the glibc headers threw an error
226 #.  if ctermid() was given an argument; fixed in 2.4.
227 #. type: Plain text
228 #: build/C/man3/ctermid.3:69
229 msgid "It is not assured that the program can open the terminal."
230 msgstr ""
231
232 #. type: Plain text
233 #: build/C/man3/ctermid.3:71
234 msgid "B<ttyname>(3)"
235 msgstr ""
236
237 #. type: TH
238 #: build/C/man3/dprintf.3:25
239 #, no-wrap
240 msgid "DPRINTF"
241 msgstr ""
242
243 #. type: TH
244 #: build/C/man3/dprintf.3:25 build/C/man3/fmemopen.3:6
245 #, no-wrap
246 msgid "2010-09-15"
247 msgstr ""
248
249 #. type: Plain text
250 #: build/C/man3/dprintf.3:28
251 msgid "dprintf, vdprintf - print to a file descriptor"
252 msgstr ""
253
254 #. type: Plain text
255 #: build/C/man3/dprintf.3:32
256 msgid "B<int dprintf(int >I<fd>B<, const char *>I<format>B<, ...);>"
257 msgstr ""
258
259 #. type: Plain text
260 #: build/C/man3/dprintf.3:34
261 msgid "B<int vdprintf(int >I<fd>B<, const char *>I<format>B<, va_list >I<ap>B<);>"
262 msgstr ""
263
264 #. type: Plain text
265 #: build/C/man3/dprintf.3:42
266 msgid "B<dprintf>(), B<vdprintf>():"
267 msgstr ""
268
269 #. type: TP
270 #: build/C/man3/dprintf.3:45 build/C/man3/fmemopen.3:33 build/C/man3/getline.3:47
271 #, no-wrap
272 msgid "Since glibc 2.10:"
273 msgstr ""
274
275 #. type: Plain text
276 #: build/C/man3/dprintf.3:48 build/C/man3/fmemopen.3:36
277 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 700 || _POSIX_C_SOURCE\\ E<gt>=\\ 200809L"
278 msgstr ""
279
280 #. type: TP
281 #: build/C/man3/dprintf.3:48 build/C/man3/fmemopen.3:36 build/C/man3/getline.3:50
282 #, no-wrap
283 msgid "Before glibc 2.10:"
284 msgstr ""
285
286 #. type: Plain text
287 #: 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
288 msgid "_GNU_SOURCE"
289 msgstr ""
290
291 #. type: Plain text
292 #: build/C/man3/dprintf.3:68
293 msgid ""
294 "The functions B<dprintf>()  and B<vdprintf>()  (as found in the glibc2 "
295 "library) are exact analogs of B<fprintf>(3)  and B<vfprintf>(3), except that "
296 "they output to a file descriptor I<fd> instead of to a I<stdio> stream."
297 msgstr ""
298
299 #.  .SH NOTES
300 #.  These functions are GNU extensions, not in C or POSIX.
301 #.  Clearly, the names were badly chosen.
302 #.  Many systems (like MacOS) have incompatible functions called
303 #.  .BR dprintf (),
304 #.  usually some debugging version of
305 #.  .BR printf (3),
306 #.  perhaps with a prototype like
307 #
308 #.  .BI "void dprintf(int level, const char *" format ", ...);"
309 #
310 #.  where the first argument is a debugging level (and output is to
311 #.  .IR stderr ).
312 #.  Moreover,
313 #.  .BR dprintf ()
314 #.  (or
315 #.  .BR DPRINTF )
316 #.  is also a popular macro name for a debugging printf.
317 #.  So, probably, it is better to avoid this function in programs
318 #.  intended to be portable.
319 #
320 #.  A better name would have been
321 #.  .BR fdprintf ().
322 #. type: Plain text
323 #: build/C/man3/dprintf.3:94
324 msgid ""
325 "These functions are GNU extensions that are nowadays specified in "
326 "POSIX.1-2008."
327 msgstr ""
328
329 #. type: Plain text
330 #: build/C/man3/dprintf.3:96
331 msgid "B<printf>(3)"
332 msgstr ""
333
334 #. type: TH
335 #: build/C/man3/fclose.3:42
336 #, no-wrap
337 msgid "FCLOSE"
338 msgstr ""
339
340 #. type: TH
341 #: build/C/man3/fclose.3:42 build/C/man3/fopen.3:42 build/C/man2/read.2:35
342 #, no-wrap
343 msgid "2009-02-23"
344 msgstr ""
345
346 #. type: Plain text
347 #: build/C/man3/fclose.3:45
348 msgid "fclose - close a stream"
349 msgstr ""
350
351 #. type: Plain text
352 #: build/C/man3/fclose.3:49
353 msgid "B<int fclose(FILE *>I<fp>B<);>"
354 msgstr ""
355
356 #. type: Plain text
357 #: build/C/man3/fclose.3:57
358 msgid ""
359 "The B<fclose>()  function will flushes the stream pointed to by I<fp> "
360 "(writing any buffered output data using B<fflush>(3))  and closes the "
361 "underlying file descriptor."
362 msgstr ""
363
364 #. type: Plain text
365 #: build/C/man3/fclose.3:68
366 msgid ""
367 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
368 "I<errno> is set to indicate the error.  In either case any further access "
369 "(including another call to B<fclose>())  to the stream results in undefined "
370 "behavior."
371 msgstr ""
372
373 #. type: SH
374 #: 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:474 build/C/man2/pipe.2:96 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
375 #, no-wrap
376 msgid "ERRORS"
377 msgstr ""
378
379 #. type: TP
380 #: 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
381 #, no-wrap
382 msgid "B<EBADF>"
383 msgstr ""
384
385 #.   This error cannot occur unless you are mixing ANSI C stdio operations and
386 #.   low-level file operations on the same stream. If you do get this error,
387 #.   you must have closed the stream's low-level file descriptor using
388 #.   something like close(fileno(fp)).
389 #. type: Plain text
390 #: build/C/man3/fclose.3:78
391 msgid "The file descriptor underlying I<fp> is not valid."
392 msgstr ""
393
394 #. type: Plain text
395 #: build/C/man3/fclose.3:88
396 msgid ""
397 "The B<fclose>()  function may also fail and set I<errno> for any of the "
398 "errors specified for the routines B<close>(2), B<write>(2)  or B<fflush>(3)."
399 msgstr ""
400
401 #. type: Plain text
402 #: build/C/man3/fclose.3:90 build/C/man3/fseek.3:166 build/C/man3/puts.3:103
403 msgid "C89, C99."
404 msgstr ""
405
406 #. type: SH
407 #: 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:638 build/C/man3/perror.3:120 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
408 #, no-wrap
409 msgid "NOTES"
410 msgstr ""
411
412 #. type: Plain text
413 #: build/C/man3/fclose.3:100
414 msgid ""
415 "Note that B<fclose>()  only flushes the user space buffers provided by the C "
416 "library.  To ensure that the data is physically stored on disk the kernel "
417 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
418 msgstr ""
419
420 #. type: Plain text
421 #: build/C/man3/fclose.3:106
422 msgid "B<close>(2), B<fcloseall>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
423 msgstr ""
424
425 #. type: TH
426 #: build/C/man3/fcloseall.3:24
427 #, no-wrap
428 msgid "FCLOSEALL"
429 msgstr ""
430
431 #. type: TH
432 #: build/C/man3/fcloseall.3:24
433 #, no-wrap
434 msgid "2006-12-27"
435 msgstr ""
436
437 #. type: Plain text
438 #: build/C/man3/fcloseall.3:27
439 msgid "fcloseall - close all open streams"
440 msgstr ""
441
442 #. type: Plain text
443 #: build/C/man3/fcloseall.3:31 build/C/man3/fopencookie.3:31
444 #, no-wrap
445 msgid ""
446 "B<#define _GNU_SOURCE>         /* See feature_test_macros(7) */\n"
447 "B<#include E<lt>stdio.hE<gt>>\n"
448 msgstr ""
449
450 #. type: Plain text
451 #: build/C/man3/fcloseall.3:33
452 #, no-wrap
453 msgid "B<int fcloseall(void);>\n"
454 msgstr ""
455
456 #. type: Plain text
457 #: build/C/man3/fcloseall.3:42
458 msgid ""
459 "The B<fcloseall>()  function closes all of the calling process's open "
460 "streams.  Buffered output for each stream is written before it is closed (as "
461 "for B<fflush>(3)); buffered input is discarded."
462 msgstr ""
463
464 #. type: Plain text
465 #: build/C/man3/fcloseall.3:49
466 msgid "The standard streams, I<stdin>, I<stdout>, and I<stderr> are also closed."
467 msgstr ""
468
469 #. type: Plain text
470 #: build/C/man3/fcloseall.3:54
471 msgid ""
472 "This function returns 0 if all files were successfully closed; on error, "
473 "B<EOF> is returned."
474 msgstr ""
475
476 #. type: Plain text
477 #: build/C/man3/fcloseall.3:56
478 msgid "This function is a GNU extension."
479 msgstr ""
480
481 #. type: Plain text
482 #: build/C/man3/fcloseall.3:62
483 msgid "B<close>(2), B<fclose>(3), B<fflush>(3), B<fopen>(3), B<setbuf>(3)"
484 msgstr ""
485
486 #. type: TH
487 #: build/C/man3/ferror.3:42
488 #, no-wrap
489 msgid "FERROR"
490 msgstr ""
491
492 #. type: TH
493 #: build/C/man3/ferror.3:42 build/C/man3/flockfile.3:23 build/C/man3/unlocked_stdio.3:23
494 #, no-wrap
495 msgid "2008-08-29"
496 msgstr ""
497
498 #. type: Plain text
499 #: build/C/man3/ferror.3:45
500 msgid "clearerr, feof, ferror, fileno - check and reset stream status"
501 msgstr ""
502
503 #. type: Plain text
504 #: build/C/man3/ferror.3:49
505 msgid "B<void clearerr(FILE *>I<stream>B<);>"
506 msgstr ""
507
508 #. type: Plain text
509 #: build/C/man3/ferror.3:51
510 msgid "B<int feof(FILE *>I<stream>B<);>"
511 msgstr ""
512
513 #. type: Plain text
514 #: build/C/man3/ferror.3:53
515 msgid "B<int ferror(FILE *>I<stream>B<);>"
516 msgstr ""
517
518 #. type: Plain text
519 #: build/C/man3/ferror.3:55
520 msgid "B<int fileno(FILE *>I<stream>B<);>"
521 msgstr ""
522
523 #. type: Plain text
524 #: build/C/man3/ferror.3:63
525 msgid "B<fileno>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
526 msgstr ""
527
528 #. type: Plain text
529 #: build/C/man3/ferror.3:68
530 msgid ""
531 "The function B<clearerr>()  clears the end-of-file and error indicators for "
532 "the stream pointed to by I<stream>."
533 msgstr ""
534
535 #. type: Plain text
536 #: build/C/man3/ferror.3:77
537 msgid ""
538 "The function B<feof>()  tests the end-of-file indicator for the stream "
539 "pointed to by I<stream>, returning nonzero if it is set.  The end-of-file "
540 "indicator can only be cleared by the function B<clearerr>()."
541 msgstr ""
542
543 #. type: Plain text
544 #: build/C/man3/ferror.3:86
545 msgid ""
546 "The function B<ferror>()  tests the error indicator for the stream pointed "
547 "to by I<stream>, returning nonzero if it is set.  The error indicator can "
548 "only be reset by the B<clearerr>()  function."
549 msgstr ""
550
551 #. type: Plain text
552 #: build/C/man3/ferror.3:92
553 msgid ""
554 "The function B<fileno>()  examines the argument I<stream> and returns its "
555 "integer descriptor."
556 msgstr ""
557
558 #. type: Plain text
559 #: 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
560 msgid "For nonlocking counterparts, see B<unlocked_stdio>(3)."
561 msgstr ""
562
563 #. type: Plain text
564 #: build/C/man3/ferror.3:105
565 msgid ""
566 "These functions should not fail and do not set the external variable "
567 "I<errno>.  (However, in case B<fileno>()  detects that its argument is not a "
568 "valid stream, it must return -1 and set I<errno> to B<EBADF>.)"
569 msgstr ""
570
571 #. type: Plain text
572 #: build/C/man3/ferror.3:112
573 msgid ""
574 "The functions B<clearerr>(), B<feof>(), and B<ferror>()  conform to C89 and "
575 "C99."
576 msgstr ""
577
578 #. type: Plain text
579 #: build/C/man3/ferror.3:117
580 msgid "B<open>(2), B<fdopen>(3), B<stdio>(3), B<unlocked_stdio>(3)"
581 msgstr ""
582
583 #. type: TH
584 #: build/C/man3/fflush.3:43
585 #, no-wrap
586 msgid "FFLUSH"
587 msgstr ""
588
589 #. type: TH
590 #: build/C/man3/fflush.3:43
591 #, no-wrap
592 msgid "2009-09-06"
593 msgstr ""
594
595 #. type: Plain text
596 #: build/C/man3/fflush.3:46
597 msgid "fflush - flush a stream"
598 msgstr ""
599
600 #. type: Plain text
601 #: build/C/man3/fflush.3:50
602 msgid "B<int fflush(FILE *>I<stream>B<);>"
603 msgstr ""
604
605 #. type: Plain text
606 #: build/C/man3/fflush.3:61
607 msgid ""
608 "For output streams, B<fflush>()  forces a write of all user-space buffered "
609 "data for the given output or update I<stream> via the stream's underlying "
610 "write function.  For input streams, B<fflush>()  discards any buffered data "
611 "that has been fetched from the underlying file, but has not been consumed by "
612 "the application.  The open status of the stream is unaffected."
613 msgstr ""
614
615 #. type: Plain text
616 #: build/C/man3/fflush.3:69
617 msgid ""
618 "If the I<stream> argument is NULL, B<fflush>()  flushes I<all> open output "
619 "streams."
620 msgstr ""
621
622 #. type: Plain text
623 #: build/C/man3/fflush.3:72
624 msgid "For a nonlocking counterpart, see B<unlocked_stdio>(3)."
625 msgstr ""
626
627 #. type: Plain text
628 #: build/C/man3/fflush.3:79
629 msgid ""
630 "Upon successful completion 0 is returned.  Otherwise, B<EOF> is returned and "
631 "I<errno> is set to indicate the error."
632 msgstr ""
633
634 #. type: Plain text
635 #: build/C/man3/fflush.3:84
636 msgid "I<Stream> is not an open stream, or is not open for writing."
637 msgstr ""
638
639 #. type: Plain text
640 #: build/C/man3/fflush.3:91
641 msgid ""
642 "The function B<fflush>()  may also fail and set I<errno> for any of the "
643 "errors specified for B<write>(2)."
644 msgstr ""
645
646 #. type: Plain text
647 #: build/C/man3/fflush.3:93
648 msgid "C89, C99, POSIX.1-2001, POSIX.1-2008."
649 msgstr ""
650
651 #.  Verified on: Solaris 8.
652 #. type: Plain text
653 #: build/C/man3/fflush.3:97
654 msgid ""
655 "The standards do not specify the behavior for input streams.  Most other "
656 "implementations behave the same as Linux."
657 msgstr ""
658
659 #. type: Plain text
660 #: build/C/man3/fflush.3:106
661 msgid ""
662 "Note that B<fflush>()  only flushes the user space buffers provided by the C "
663 "library.  To ensure that the data is physically stored on disk the kernel "
664 "buffers must be flushed too, for example, with B<sync>(2)  or B<fsync>(2)."
665 msgstr ""
666
667 #. type: Plain text
668 #: build/C/man3/fflush.3:114
669 msgid ""
670 "B<fsync>(2), B<sync>(2), B<write>(2), B<fclose>(3), B<fopen>(3), "
671 "B<setbuf>(3), B<unlocked_stdio>(3)"
672 msgstr ""
673
674 #. type: TH
675 #: build/C/man3/fgetwc.3:16
676 #, no-wrap
677 msgid "FGETWC"
678 msgstr ""
679
680 #. type: TH
681 #: build/C/man3/fgetwc.3:16 build/C/man3/fputwc.3:14
682 #, no-wrap
683 msgid "1999-07-25"
684 msgstr ""
685
686 #. type: Plain text
687 #: build/C/man3/fgetwc.3:19
688 msgid "fgetwc, getwc - read a wide character from a FILE stream"
689 msgstr ""
690
691 #. type: Plain text
692 #: 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
693 #, no-wrap
694 msgid "B<#include E<lt>wchar.hE<gt>>\n"
695 msgstr ""
696
697 #. type: Plain text
698 #: build/C/man3/fgetwc.3:27
699 #, no-wrap
700 msgid ""
701 "B<wint_t fgetwc(FILE *>I<stream>B<);>\n"
702 "B<wint_t getwc(FILE *>I<stream>B<);>\n"
703 msgstr ""
704
705 #. type: Plain text
706 #: build/C/man3/fgetwc.3:42
707 msgid ""
708 "The B<fgetwc>()  function is the wide-character equivalent of the "
709 "B<fgetc>(3)  function.  It reads a wide character from I<stream> and returns "
710 "it.  If the end of stream is reached, or if I<ferror(stream)> becomes true, "
711 "it returns B<WEOF>.  If a wide-character conversion error occurs, it sets "
712 "I<errno> to B<EILSEQ> and returns B<WEOF>."
713 msgstr ""
714
715 #. type: Plain text
716 #: build/C/man3/fgetwc.3:50
717 msgid ""
718 "The B<getwc>()  function or macro functions identically to B<fgetwc>().  It "
719 "may be implemented as a macro, and may evaluate its argument more than "
720 "once.  There is no reason ever to use it."
721 msgstr ""
722
723 #. type: Plain text
724 #: build/C/man3/fgetwc.3:59
725 msgid ""
726 "The B<fgetwc>()  function returns the next wide-character from the stream, "
727 "or B<WEOF>."
728 msgstr ""
729
730 #. type: Plain text
731 #: build/C/man3/fgetwc.3:61 build/C/man3/fputwc.3:60
732 msgid "Apart from the usual ones, there is"
733 msgstr ""
734
735 #. type: TP
736 #: build/C/man3/fgetwc.3:61 build/C/man3/fputwc.3:60 build/C/man3/scanf.3:556
737 #, no-wrap
738 msgid "B<EILSEQ>"
739 msgstr ""
740
741 #. type: Plain text
742 #: build/C/man3/fgetwc.3:65
743 msgid "The data obtained from the input stream does not form a valid character."
744 msgstr ""
745
746 #. type: Plain text
747 #: build/C/man3/fgetwc.3:67 build/C/man3/fputwc.3:65
748 msgid "C99, POSIX.1-2001."
749 msgstr ""
750
751 #. type: Plain text
752 #: build/C/man3/fgetwc.3:74
753 msgid ""
754 "The behavior of B<fgetwc>()  depends on the B<LC_CTYPE> category of the "
755 "current locale."
756 msgstr ""
757
758 #. type: Plain text
759 #: build/C/man3/fgetwc.3:82
760 msgid ""
761 "In the absence of additional information passed to the B<fopen>(3)  call, it "
762 "is reasonable to expect that B<fgetwc>()  will actually read a multibyte "
763 "sequence from the stream and then convert it to a wide character."
764 msgstr ""
765
766 #. type: Plain text
767 #: build/C/man3/fgetwc.3:87
768 msgid "B<fgetws>(3), B<fputwc>(3), B<ungetwc>(3), B<unlocked_stdio>(3)"
769 msgstr ""
770
771 #. type: TH
772 #: build/C/man3/flockfile.3:23
773 #, no-wrap
774 msgid "FLOCKFILE"
775 msgstr ""
776
777 #. type: Plain text
778 #: build/C/man3/flockfile.3:26
779 msgid "flockfile, ftrylockfile, funlockfile - lock FILE for stdio"
780 msgstr ""
781
782 #. type: Plain text
783 #: build/C/man3/flockfile.3:31
784 #, no-wrap
785 msgid "B<void flockfile(FILE *>I<filehandle>B<);>\n"
786 msgstr ""
787
788 #. type: Plain text
789 #: build/C/man3/flockfile.3:33
790 #, no-wrap
791 msgid "B<int ftrylockfile(FILE *>I<filehandle>B<);>\n"
792 msgstr ""
793
794 #. type: Plain text
795 #: build/C/man3/flockfile.3:35
796 #, no-wrap
797 msgid "B<void funlockfile(FILE *>I<filehandle>B<);>\n"
798 msgstr ""
799
800 #. type: Plain text
801 #: build/C/man3/flockfile.3:44 build/C/man3/wprintf.3:41
802 msgid "All functions shown above:"
803 msgstr ""
804
805 #. type: Plain text
806 #: build/C/man3/flockfile.3:47
807 msgid ""
808 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE "
809 "|| _POSIX_SOURCE"
810 msgstr ""
811
812 #. type: Plain text
813 #: build/C/man3/flockfile.3:61
814 msgid ""
815 "The stdio functions are thread-safe.  This is achieved by assigning to each "
816 "I<FILE> object a lockcount and (if the lockcount is nonzero)  an owning "
817 "thread.  For each library call, these functions wait until the I<FILE> "
818 "object is no longer locked by a different thread, then lock it, do the "
819 "requested I/O, and unlock the object again."
820 msgstr ""
821
822 #. type: Plain text
823 #: build/C/man3/flockfile.3:67
824 msgid ""
825 "(Note: this locking has nothing to do with the file locking done by "
826 "functions like B<flock>(2)  and B<lockf>(3).)"
827 msgstr ""
828
829 #. type: Plain text
830 #: build/C/man3/flockfile.3:75
831 msgid ""
832 "All this is invisible to the C-programmer, but there may be two reasons to "
833 "wish for more detailed control.  On the one hand, maybe a series of I/O "
834 "actions by one thread belongs together, and should not be interrupted by the "
835 "I/O of some other thread.  On the other hand, maybe the locking overhead "
836 "should be avoided for greater efficiency."
837 msgstr ""
838
839 #. type: Plain text
840 #: build/C/man3/flockfile.3:92
841 msgid ""
842 "To this end, a thread can explicitly lock the I<FILE> object, then do its "
843 "series of I/O actions, then unlock.  This prevents other threads from coming "
844 "in between.  If the reason for doing this was to achieve greater efficiency, "
845 "one does the I/O with the nonlocking versions of the stdio functions: with "
846 "B<getc_unlocked>(3)  and B<putc_unlocked>(3)  instead of B<getc>(3)  and "
847 "B<putc>(3)."
848 msgstr ""
849
850 #. type: Plain text
851 #: build/C/man3/flockfile.3:99
852 msgid ""
853 "The B<flockfile>()  function waits for I<*filehandle> to be no longer locked "
854 "by a different thread, then makes the current thread owner of "
855 "I<*filehandle>, and increments the lockcount."
856 msgstr ""
857
858 #. type: Plain text
859 #: build/C/man3/flockfile.3:103
860 msgid "The B<funlockfile>()  function decrements the lock count."
861 msgstr ""
862
863 #. type: Plain text
864 #: build/C/man3/flockfile.3:112
865 msgid ""
866 "The B<ftrylockfile>()  function is a nonblocking version of B<flockfile>().  "
867 "It does nothing in case some other thread owns I<*filehandle>, and it "
868 "obtains ownership and increments the lockcount otherwise."
869 msgstr ""
870
871 #. type: Plain text
872 #: build/C/man3/flockfile.3:117
873 msgid ""
874 "The B<ftrylockfile>()  function returns zero for success (the lock was "
875 "obtained), and nonzero for failure."
876 msgstr ""
877
878 #. type: Plain text
879 #: build/C/man3/flockfile.3:119
880 msgid "None."
881 msgstr ""
882
883 #. type: Plain text
884 #: build/C/man3/flockfile.3:121 build/C/man3/popen.3:169
885 msgid "POSIX.1-2001."
886 msgstr ""
887
888 #. type: SH
889 #: build/C/man3/flockfile.3:121
890 #, no-wrap
891 msgid "AVAILABILITY"
892 msgstr ""
893
894 #. type: Plain text
895 #: build/C/man3/flockfile.3:127
896 msgid ""
897 "These functions are available when B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
898 "defined.  They are in libc since libc 5.1.1 and in glibc since glibc 2.0."
899 msgstr ""
900
901 #. type: Plain text
902 #: build/C/man3/flockfile.3:129
903 msgid "B<unlocked_stdio>(3)"
904 msgstr ""
905
906 #. type: TH
907 #: build/C/man3/fmemopen.3:6
908 #, no-wrap
909 msgid "FMEMOPEN"
910 msgstr ""
911
912 #. type: Plain text
913 #: build/C/man3/fmemopen.3:9
914 msgid "fmemopen, open_memstream, open_wmemstream - open memory as stream"
915 msgstr ""
916
917 #. type: Plain text
918 #: build/C/man3/fmemopen.3:14
919 #, no-wrap
920 msgid ""
921 "B<FILE *fmemopen(void *>I<buf>B<, size_t >I<size>B<, const char "
922 "*>I<mode>B<);>\n"
923 msgstr ""
924
925 #. type: Plain text
926 #: build/C/man3/fmemopen.3:16
927 #, no-wrap
928 msgid "B<FILE *open_memstream(char **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
929 msgstr ""
930
931 #. type: Plain text
932 #: build/C/man3/fmemopen.3:20
933 #, no-wrap
934 msgid "B<FILE *open_wmemstream(wchar_t **>I<ptr>B<, size_t *>I<sizeloc>B<);>\n"
935 msgstr ""
936
937 #. type: Plain text
938 #: build/C/man3/fmemopen.3:30
939 msgid "B<fmemopen>(), B<open_memstream>(), B<open_wmemstream>():"
940 msgstr ""
941
942 #. type: Plain text
943 #: build/C/man3/fmemopen.3:53
944 msgid ""
945 "The B<fmemopen>()  function opens a stream that permits the access specified "
946 "by I<mode>.  The stream allows I/O to be performed on the string or memory "
947 "buffer pointed to by I<buf>.  This buffer must be at least I<size> bytes "
948 "long."
949 msgstr ""
950
951 #. type: Plain text
952 #: build/C/man3/fmemopen.3:73
953 msgid ""
954 "The argument I<mode> is the same as for B<fopen>(3).  If I<mode> specifies "
955 "an append mode, then the initial file position is set to the location of the "
956 "first null byte (\\(aq\\e0\\(aq) in the buffer; otherwise the initial file "
957 "position is set to the start of the buffer.  Since glibc 2.9, the letter 'b' "
958 "may be specified as the second character in I<mode>.  This provides "
959 "\"binary\" mode: writes don't implicitly add a terminating null byte, and "
960 "B<fseek>(3)  B<SEEK_END> is relative to the end of the buffer (i.e., the "
961 "value specified by the I<size> argument), rather than the current string "
962 "length."
963 msgstr ""
964
965 #. type: Plain text
966 #: build/C/man3/fmemopen.3:85
967 msgid ""
968 "When a stream that has been opened for writing is flushed (B<fflush>(3))  or "
969 "closed (B<fclose>(3)), a null byte is written at the end of the buffer if "
970 "there is space.  The caller should ensure that an extra byte is available in "
971 "the buffer (and that I<size> counts that byte)  to allow for this."
972 msgstr ""
973
974 #.  See http://sourceware.org/bugzilla/show_bug.cgi?id=1995
975 #.  and
976 #.  http://sources.redhat.com/ml/libc-alpha/2006-04/msg00064.html
977 #. type: Plain text
978 #: build/C/man3/fmemopen.3:103
979 msgid ""
980 "Attempts to write more than I<size> bytes to the buffer result in an error.  "
981 "(By default, such errors will only be visible when the I<stdio> buffer is "
982 "flushed.  Disabling buffering with I<setbuf(fp,\\ NULL)> may be useful to "
983 "detect errors at the time of an output operation.  Alternatively, the caller "
984 "can explicitly set I<buf> as the stdio stream buffer, at the same time "
985 "informing stdio of the buffer's size, using I<setbuffer(fp, buf, size)>.)"
986 msgstr ""
987
988 #. type: Plain text
989 #: build/C/man3/fmemopen.3:111
990 msgid ""
991 "In a stream opened for reading, null bytes (\\(aq\\e0\\(aq) in the buffer do "
992 "not cause read operations to return an end-of-file indication.  A read from "
993 "the buffer will only indicate end-of-file when the file pointer advances "
994 "I<size> bytes past the start of the buffer."
995 msgstr ""
996
997 #. type: Plain text
998 #: build/C/man3/fmemopen.3:126
999 msgid ""
1000 "If I<buf> is specified as NULL, then B<fmemopen>()  dynamically allocates a "
1001 "buffer I<size> bytes long.  This is useful for an application that wants to "
1002 "write data to a temporary buffer and then read it back again.  The buffer is "
1003 "automatically freed when the stream is closed.  Note that the caller has no "
1004 "way to obtain a pointer to the temporary buffer allocated by this call (but "
1005 "see B<open_memstream>()  below)."
1006 msgstr ""
1007
1008 #. type: Plain text
1009 #: build/C/man3/fmemopen.3:137
1010 msgid ""
1011 "The B<open_memstream>()  function opens a stream for writing to a buffer.  "
1012 "The buffer is dynamically allocated (as with B<malloc>(3)), and "
1013 "automatically grows as required.  After closing the stream, the caller "
1014 "should B<free>(3)  this buffer."
1015 msgstr ""
1016
1017 #. type: Plain text
1018 #: build/C/man3/fmemopen.3:152
1019 msgid ""
1020 "When the stream is closed (B<fclose>(3))  or flushed (B<fflush>(3)), the "
1021 "locations pointed to by I<ptr> and I<sizeloc> are updated to contain, "
1022 "respectively, a pointer to the buffer and the current size of the buffer.  "
1023 "These values remain valid only as long as the caller performs no further "
1024 "output on the stream.  If further output is performed, then the stream must "
1025 "again be flushed before trying to access these variables."
1026 msgstr ""
1027
1028 #. type: Plain text
1029 #: build/C/man3/fmemopen.3:158
1030 msgid ""
1031 "A null byte is maintained at the end of the buffer.  This byte is I<not> "
1032 "included in the size value stored at I<sizeloc>."
1033 msgstr ""
1034
1035 #. type: Plain text
1036 #: build/C/man3/fmemopen.3:166
1037 msgid ""
1038 "The stream's file position can be changed with B<fseek>(3)  or "
1039 "B<fseeko>(3).  Moving the file position past the end of the data already "
1040 "written fills the intervening space with zeros."
1041 msgstr ""
1042
1043 #. type: Plain text
1044 #: build/C/man3/fmemopen.3:172
1045 msgid ""
1046 "The B<open_wmemstream>()  is similar to B<open_memstream>(), but operates on "
1047 "wide characters instead of bytes."
1048 msgstr ""
1049
1050 #. type: Plain text
1051 #: build/C/man3/fmemopen.3:184
1052 msgid ""
1053 "Upon successful completion B<fmemopen>(), B<open_memstream>()  and "
1054 "B<open_wmemstream>()  return a I<FILE> pointer.  Otherwise, NULL is returned "
1055 "and I<errno> is set to indicate the error."
1056 msgstr ""
1057
1058 #. type: SH
1059 #: build/C/man3/fmemopen.3:184 build/C/man3/fmtmsg.3:218 build/C/man3/getline.3:130 build/C/man2/pipe.2:112 build/C/man2/readv.2:207
1060 #, no-wrap
1061 msgid "VERSIONS"
1062 msgstr ""
1063
1064 #. type: Plain text
1065 #: build/C/man3/fmemopen.3:191
1066 msgid ""
1067 "B<fmemopen>()  and B<open_memstream>()  were already available in glibc "
1068 "1.0.x.  B<open_wmemstream>()  is available since glibc 2.4."
1069 msgstr ""
1070
1071 #. type: Plain text
1072 #: build/C/man3/fmemopen.3:195
1073 msgid ""
1074 "POSIX.1-2008.  These functions are not specified in POSIX.1-2001, and are "
1075 "not widely available on other systems."
1076 msgstr ""
1077
1078 #. type: Plain text
1079 #: build/C/man3/fmemopen.3:201
1080 msgid ""
1081 "There is no file descriptor associated with the file stream returned by "
1082 "these functions (i.e., B<fileno>(3)  will return an error if called on the "
1083 "returned stream)."
1084 msgstr ""
1085
1086 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=1996
1087 #. type: Plain text
1088 #: build/C/man3/fmemopen.3:208
1089 msgid ""
1090 "In glibc before version 2.7, seeking past the end of a stream created by "
1091 "B<open_memstream>()  does not enlarge the buffer; instead the B<fseek>(3)  "
1092 "call fails, returning -1."
1093 msgstr ""
1094
1095 #. type: SH
1096 #: 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:123 build/C/man3/printf.3:974 build/C/man2/readlink.2:155 build/C/man2/readv.2:263
1097 #, no-wrap
1098 msgid "EXAMPLE"
1099 msgstr ""
1100
1101 #. type: Plain text
1102 #: build/C/man3/fmemopen.3:218
1103 msgid ""
1104 "The program below uses B<fmemopen>()  to open an input buffer, and "
1105 "B<open_memstream>()  to open a dynamically sized output buffer.  The program "
1106 "scans its input string (taken from the program's first command-line "
1107 "argument) reading integers, and writes the squares of these integers to the "
1108 "output buffer.  An example of the output produced by this program is the "
1109 "following:"
1110 msgstr ""
1111
1112 #. type: Plain text
1113 #: build/C/man3/fmemopen.3:223
1114 #, no-wrap
1115 msgid ""
1116 "$B< ./a.out \\(aq1 23 43\\(aq>\n"
1117 "size=11; ptr=1 529 1849\n"
1118 msgstr ""
1119
1120 #. type: SS
1121 #: build/C/man3/fmemopen.3:225 build/C/man3/fopencookie.3:268
1122 #, no-wrap
1123 msgid "Program source"
1124 msgstr ""
1125
1126 #. type: Plain text
1127 #: build/C/man3/fmemopen.3:232
1128 #, no-wrap
1129 msgid ""
1130 "#define _GNU_SOURCE\n"
1131 "#include E<lt>string.hE<gt>\n"
1132 "#include E<lt>stdio.hE<gt>\n"
1133 "#include E<lt>stdlib.hE<gt>\n"
1134 msgstr ""
1135
1136 #. type: Plain text
1137 #: build/C/man3/fmemopen.3:235
1138 #, no-wrap
1139 msgid ""
1140 "#define handle_error(msg) \\e\n"
1141 "    do { perror(msg); exit(EXIT_FAILURE); } while (0)\n"
1142 msgstr ""
1143
1144 #. type: Plain text
1145 #: build/C/man3/fmemopen.3:243
1146 #, no-wrap
1147 msgid ""
1148 "int\n"
1149 "main(int argc, char *argv[])\n"
1150 "{\n"
1151 "    FILE *out, *in;\n"
1152 "    int v, s;\n"
1153 "    size_t size;\n"
1154 "    char *ptr;\n"
1155 msgstr ""
1156
1157 #. type: Plain text
1158 #: build/C/man3/fmemopen.3:248
1159 #, no-wrap
1160 msgid ""
1161 "    if (argc != 2) {\n"
1162 "\tfprintf(stderr, \"Usage: %s E<lt>fileE<gt>\\en\", argv[0]);\n"
1163 "\texit(EXIT_FAILURE);\n"
1164 "    }\n"
1165 msgstr ""
1166
1167 #. type: Plain text
1168 #: build/C/man3/fmemopen.3:252
1169 #, no-wrap
1170 msgid ""
1171 "    in = fmemopen(argv[1], strlen(argv[1]), \"r\");\n"
1172 "    if (in == NULL)\n"
1173 "        handle_error(\"fmemopen\");\n"
1174 msgstr ""
1175
1176 #. type: Plain text
1177 #: build/C/man3/fmemopen.3:256
1178 #, no-wrap
1179 msgid ""
1180 "    out = open_memstream(&ptr, &size);\n"
1181 "    if (out == NULL)\n"
1182 "        handle_error(\"open_memstream\");\n"
1183 msgstr ""
1184
1185 #. type: Plain text
1186 #: build/C/man3/fmemopen.3:261
1187 #, no-wrap
1188 msgid ""
1189 "    for (;;) {\n"
1190 "        s = fscanf(in, \"%d\", &v);\n"
1191 "        if (s E<lt>= 0)\n"
1192 "            break;\n"
1193 msgstr ""
1194
1195 #. type: Plain text
1196 #: build/C/man3/fmemopen.3:272
1197 #, no-wrap
1198 msgid ""
1199 "        s = fprintf(out, \"%d \", v * v);\n"
1200 "        if (s == -1)\n"
1201 "            handle_error(\"fprintf\");\n"
1202 "    }\n"
1203 "    fclose(in);\n"
1204 "    fclose(out);\n"
1205 "    printf(\"size=%ld; ptr=%s\\en\", (long) size, ptr);\n"
1206 "    free(ptr);\n"
1207 "    exit(EXIT_SUCCESS);\n"
1208 "}\n"
1209 msgstr ""
1210
1211 #. type: Plain text
1212 #: build/C/man3/fmemopen.3:276
1213 msgid "B<fopen>(3), B<fopencookie>(3)"
1214 msgstr ""
1215
1216 #. type: TH
1217 #: build/C/man3/fmtmsg.3:9
1218 #, no-wrap
1219 msgid "FMTMSG"
1220 msgstr ""
1221
1222 #. type: TH
1223 #: build/C/man3/fmtmsg.3:9
1224 #, no-wrap
1225 msgid "2008-06-14"
1226 msgstr ""
1227
1228 #. type: Plain text
1229 #: build/C/man3/fmtmsg.3:12
1230 msgid "fmtmsg - print formatted error messages"
1231 msgstr ""
1232
1233 #. type: Plain text
1234 #: build/C/man3/fmtmsg.3:15
1235 #, no-wrap
1236 msgid "B<#include E<lt>fmtmsg.hE<gt>>\n"
1237 msgstr ""
1238
1239 #. type: Plain text
1240 #: build/C/man3/fmtmsg.3:17
1241 #, no-wrap
1242 msgid "B<int fmtmsg(long >I<classification>B<, const char *>I<label>B<,>\n"
1243 msgstr ""
1244
1245 #. type: Plain text
1246 #: build/C/man3/fmtmsg.3:19
1247 #, no-wrap
1248 msgid "B<           int >I<severity>B<, const char *>I<text>B<,>\n"
1249 msgstr ""
1250
1251 #. type: Plain text
1252 #: build/C/man3/fmtmsg.3:21
1253 #, no-wrap
1254 msgid "B<           const char *>I<action>B<, const char *>I<tag>B<);>\n"
1255 msgstr ""
1256
1257 #. type: Plain text
1258 #: build/C/man3/fmtmsg.3:32
1259 msgid ""
1260 "This function displays a message described by its arguments on the device(s)  "
1261 "specified in the I<classification> argument.  For messages written to "
1262 "I<stderr>, the format depends on the B<MSGVERB> environment variable."
1263 msgstr ""
1264
1265 #. type: Plain text
1266 #: build/C/man3/fmtmsg.3:39
1267 msgid ""
1268 "The I<label> argument identifies the source of the message.  The string must "
1269 "consist of two colon separated parts where the first part has not more than "
1270 "10 and the second part not more than 14 characters."
1271 msgstr ""
1272
1273 #. type: Plain text
1274 #: build/C/man3/fmtmsg.3:43
1275 msgid "The I<text> argument describes the condition of the error."
1276 msgstr ""
1277
1278 #. type: Plain text
1279 #: build/C/man3/fmtmsg.3:48
1280 msgid ""
1281 "The I<action> argument describes possible steps to recover from the error.  "
1282 "If it is printed, it is prefixed by \"TO FIX: \"."
1283 msgstr ""
1284
1285 #. type: Plain text
1286 #: build/C/man3/fmtmsg.3:56
1287 msgid ""
1288 "The I<tag> argument is a reference to the online documentation where more "
1289 "information can be found.  It should contain the I<label> value and a unique "
1290 "identification number."
1291 msgstr ""
1292
1293 #. type: SS
1294 #: build/C/man3/fmtmsg.3:56
1295 #, no-wrap
1296 msgid "Dummy arguments"
1297 msgstr ""
1298
1299 #. type: Plain text
1300 #: build/C/man3/fmtmsg.3:75
1301 msgid ""
1302 "Each of the arguments can have a dummy value.  The dummy classification "
1303 "value B<MM_NULLMC> (0L) does not specify any output, so nothing is printed.  "
1304 "The dummy severity value B<NO_SEV> (0) says that no severity is supplied.  "
1305 "The values B<MM_NULLLBL>, B<MM_NULLTXT>, B<MM_NULLACT>, B<MM_NULLTAG> are "
1306 "synonyms for I<((char *) 0)>, the empty string, and B<MM_NULLSEV> is a "
1307 "synonym for B<NO_SEV>."
1308 msgstr ""
1309
1310 #. type: SS
1311 #: build/C/man3/fmtmsg.3:75
1312 #, no-wrap
1313 msgid "The classification argument"
1314 msgstr ""
1315
1316 #. type: Plain text
1317 #: build/C/man3/fmtmsg.3:79
1318 msgid ""
1319 "The I<classification> argument is the sum of values describing 4 types of "
1320 "information."
1321 msgstr ""
1322
1323 #. type: Plain text
1324 #: build/C/man3/fmtmsg.3:82
1325 msgid "The first value defines the output channel."
1326 msgstr ""
1327
1328 #. type: TP
1329 #: build/C/man3/fmtmsg.3:82
1330 #, no-wrap
1331 msgid "B<MM_PRINT>"
1332 msgstr ""
1333
1334 #. type: Plain text
1335 #: build/C/man3/fmtmsg.3:86
1336 msgid "Output to I<stderr>."
1337 msgstr ""
1338
1339 #. type: TP
1340 #: build/C/man3/fmtmsg.3:86
1341 #, no-wrap
1342 msgid "B<MM_CONSOLE>"
1343 msgstr ""
1344
1345 #. type: Plain text
1346 #: build/C/man3/fmtmsg.3:89
1347 msgid "Output to the system console."
1348 msgstr ""
1349
1350 #. type: TP
1351 #: build/C/man3/fmtmsg.3:89
1352 #, no-wrap
1353 msgid "B<MM_PRINT | MM_CONSOLE>"
1354 msgstr ""
1355
1356 #. type: Plain text
1357 #: build/C/man3/fmtmsg.3:92
1358 msgid "Output to both."
1359 msgstr ""
1360
1361 #. type: Plain text
1362 #: build/C/man3/fmtmsg.3:94
1363 msgid "The second value is the source of the error:"
1364 msgstr ""
1365
1366 #. type: TP
1367 #: build/C/man3/fmtmsg.3:94
1368 #, no-wrap
1369 msgid "B<MM_HARD>"
1370 msgstr ""
1371
1372 #. type: Plain text
1373 #: build/C/man3/fmtmsg.3:97
1374 msgid "A hardware error occurred."
1375 msgstr ""
1376
1377 #. type: TP
1378 #: build/C/man3/fmtmsg.3:97
1379 #, no-wrap
1380 msgid "B<MM_FIRM>"
1381 msgstr ""
1382
1383 #. type: Plain text
1384 #: build/C/man3/fmtmsg.3:100
1385 msgid "A firmware error occurred."
1386 msgstr ""
1387
1388 #. type: TP
1389 #: build/C/man3/fmtmsg.3:100
1390 #, no-wrap
1391 msgid "B<MM_SOFT>"
1392 msgstr ""
1393
1394 #. type: Plain text
1395 #: build/C/man3/fmtmsg.3:103
1396 msgid "A software error occurred."
1397 msgstr ""
1398
1399 #. type: Plain text
1400 #: build/C/man3/fmtmsg.3:105
1401 msgid "The third value encodes the detector of the problem:"
1402 msgstr ""
1403
1404 #. type: TP
1405 #: build/C/man3/fmtmsg.3:105
1406 #, no-wrap
1407 msgid "B<MM_APPL>"
1408 msgstr ""
1409
1410 #. type: Plain text
1411 #: build/C/man3/fmtmsg.3:108
1412 msgid "It is detected by an application."
1413 msgstr ""
1414
1415 #. type: TP
1416 #: build/C/man3/fmtmsg.3:108
1417 #, no-wrap
1418 msgid "B<MM_UTIL>"
1419 msgstr ""
1420
1421 #. type: Plain text
1422 #: build/C/man3/fmtmsg.3:111
1423 msgid "It is detected by a utility."
1424 msgstr ""
1425
1426 #. type: TP
1427 #: build/C/man3/fmtmsg.3:111
1428 #, no-wrap
1429 msgid "B<MM_OPSYS>"
1430 msgstr ""
1431
1432 #. type: Plain text
1433 #: build/C/man3/fmtmsg.3:114
1434 msgid "It is detected by the operating system."
1435 msgstr ""
1436
1437 #. type: Plain text
1438 #: build/C/man3/fmtmsg.3:116
1439 msgid "The fourth value shows the severity of the incident:"
1440 msgstr ""
1441
1442 #. type: TP
1443 #: build/C/man3/fmtmsg.3:116
1444 #, no-wrap
1445 msgid "B<MM_RECOVER>"
1446 msgstr ""
1447
1448 #. type: Plain text
1449 #: build/C/man3/fmtmsg.3:119
1450 msgid "It is a recoverable error."
1451 msgstr ""
1452
1453 #. type: TP
1454 #: build/C/man3/fmtmsg.3:119
1455 #, no-wrap
1456 msgid "B<MM_NRECOV>"
1457 msgstr ""
1458
1459 #. type: Plain text
1460 #: build/C/man3/fmtmsg.3:122
1461 msgid "It is a nonrecoverable error."
1462 msgstr ""
1463
1464 #. type: SS
1465 #: build/C/man3/fmtmsg.3:122
1466 #, no-wrap
1467 msgid "The severity argument"
1468 msgstr ""
1469
1470 #. type: Plain text
1471 #: build/C/man3/fmtmsg.3:126
1472 msgid "The I<severity> argument can take one of the following values:"
1473 msgstr ""
1474
1475 #. type: TP
1476 #: build/C/man3/fmtmsg.3:126
1477 #, no-wrap
1478 msgid "B<MM_NOSEV>"
1479 msgstr ""
1480
1481 #. type: Plain text
1482 #: build/C/man3/fmtmsg.3:129
1483 msgid "No severity is printed."
1484 msgstr ""
1485
1486 #. type: TP
1487 #: build/C/man3/fmtmsg.3:129
1488 #, no-wrap
1489 msgid "B<MM_HALT>"
1490 msgstr ""
1491
1492 #. type: Plain text
1493 #: build/C/man3/fmtmsg.3:132
1494 msgid "This value is printed as HALT."
1495 msgstr ""
1496
1497 #. type: TP
1498 #: build/C/man3/fmtmsg.3:132
1499 #, no-wrap
1500 msgid "B<MM_ERROR>"
1501 msgstr ""
1502
1503 #. type: Plain text
1504 #: build/C/man3/fmtmsg.3:135
1505 msgid "This value is printed as ERROR."
1506 msgstr ""
1507
1508 #. type: TP
1509 #: build/C/man3/fmtmsg.3:135
1510 #, no-wrap
1511 msgid "B<MM_WARNING>"
1512 msgstr ""
1513
1514 #. type: Plain text
1515 #: build/C/man3/fmtmsg.3:138
1516 msgid "This value is printed as WARNING."
1517 msgstr ""
1518
1519 #. type: TP
1520 #: build/C/man3/fmtmsg.3:138
1521 #, no-wrap
1522 msgid "B<MM_INFO>"
1523 msgstr ""
1524
1525 #. type: Plain text
1526 #: build/C/man3/fmtmsg.3:141
1527 msgid "This value is printed as INFO."
1528 msgstr ""
1529
1530 #. type: Plain text
1531 #: build/C/man3/fmtmsg.3:148
1532 msgid ""
1533 "The numeric values are between 0 and 4.  Using B<addseverity>(3)  or the "
1534 "environment variable B<SEV_LEVEL> you can add more levels and strings to "
1535 "print."
1536 msgstr ""
1537
1538 #. type: Plain text
1539 #: build/C/man3/fmtmsg.3:150
1540 msgid "The function can return 4 values:"
1541 msgstr ""
1542
1543 #. type: TP
1544 #: build/C/man3/fmtmsg.3:150
1545 #, no-wrap
1546 msgid "B<MM_OK>"
1547 msgstr ""
1548
1549 #. type: Plain text
1550 #: build/C/man3/fmtmsg.3:153
1551 msgid "Everything went smooth."
1552 msgstr ""
1553
1554 #. type: TP
1555 #: build/C/man3/fmtmsg.3:153
1556 #, no-wrap
1557 msgid "B<MM_NOTOK>"
1558 msgstr ""
1559
1560 #. type: Plain text
1561 #: build/C/man3/fmtmsg.3:156
1562 msgid "Complete failure."
1563 msgstr ""
1564
1565 #. type: TP
1566 #: build/C/man3/fmtmsg.3:156
1567 #, no-wrap
1568 msgid "B<MM_NOMSG>"
1569 msgstr ""
1570
1571 #. type: Plain text
1572 #: build/C/man3/fmtmsg.3:160
1573 msgid "Error writing to I<stderr>."
1574 msgstr ""
1575
1576 #. type: TP
1577 #: build/C/man3/fmtmsg.3:160
1578 #, no-wrap
1579 msgid "B<MM_NOCON>"
1580 msgstr ""
1581
1582 #. type: Plain text
1583 #: build/C/man3/fmtmsg.3:163
1584 msgid "Error writing to the console."
1585 msgstr ""
1586
1587 #. type: SH
1588 #: build/C/man3/fmtmsg.3:163
1589 #, no-wrap
1590 msgid "ENVIRONMENT"
1591 msgstr ""
1592
1593 #. type: Plain text
1594 #: build/C/man3/fmtmsg.3:174
1595 msgid ""
1596 "The environment variable B<MSGVERB> (\"message verbosity\") can be used to "
1597 "suppress parts of the output to I<stderr>.  (It does not influence output to "
1598 "the console.)  When this variable is defined, is non-NULL, and is a "
1599 "colon-separated list of valid keywords, then only the parts of the message "
1600 "corresponding to these keywords is printed.  Valid keywords are \"label\", "
1601 "\"severity\", \"text\", \"action\" and \"tag\"."
1602 msgstr ""
1603
1604 #. type: Plain text
1605 #: build/C/man3/fmtmsg.3:186
1606 msgid ""
1607 "The environment variable B<SEV_LEVEL> can be used to introduce new severity "
1608 "levels.  By default, only the five severity levels described above are "
1609 "available.  Any other numeric value would make B<fmtmsg>()  print nothing.  "
1610 "If the user puts B<SEV_LEVEL> with a format like"
1611 msgstr ""
1612
1613 #. type: Plain text
1614 #: build/C/man3/fmtmsg.3:189
1615 msgid "SEV_LEVEL=[description[:description[:...]]]"
1616 msgstr ""
1617
1618 #. type: Plain text
1619 #: build/C/man3/fmtmsg.3:194
1620 msgid ""
1621 "in the environment of the process before the first call to B<fmtmsg>(), "
1622 "where each description is of the form"
1623 msgstr ""
1624
1625 #. type: Plain text
1626 #: build/C/man3/fmtmsg.3:197
1627 msgid "severity-keyword,level,printstring"
1628 msgstr ""
1629
1630 #. type: Plain text
1631 #: build/C/man3/fmtmsg.3:204
1632 msgid ""
1633 "then B<fmtmsg>()  will also accept the indicated values for the level (in "
1634 "addition to the standard levels 0-4), and use the indicated printstring when "
1635 "such a level occurs."
1636 msgstr ""
1637
1638 #. type: Plain text
1639 #: build/C/man3/fmtmsg.3:218
1640 msgid ""
1641 "The severity-keyword part is not used by B<fmtmsg>()  but it has to be "
1642 "present.  The level part is a string representation of a number.  The "
1643 "numeric value must be a number greater than 4.  This value must be used in "
1644 "the severity argument of B<fmtmsg>()  to select this class.  It is not "
1645 "possible to overwrite any of the predefined classes.  The printstring is the "
1646 "string printed when a message of this class is processed by B<fmtmsg>()."
1647 msgstr ""
1648
1649 #. type: Plain text
1650 #: build/C/man3/fmtmsg.3:221
1651 msgid "B<fmtmsg>()  is provided in glibc since version 2.1."
1652 msgstr ""
1653
1654 #. type: Plain text
1655 #: build/C/man3/fmtmsg.3:236
1656 msgid ""
1657 "The functions B<fmtmsg>()  and B<addseverity>(3), and environment variables "
1658 "B<MSGVERB> and B<SEV_LEVEL> come from System V.  The function B<fmtmsg>()  "
1659 "and the environment variable B<MSGVERB> are described in POSIX.1-2001."
1660 msgstr ""
1661
1662 #. type: Plain text
1663 #: build/C/man3/fmtmsg.3:240
1664 msgid ""
1665 "System V and UnixWare man pages tell us that these functions have been "
1666 "replaced by \"pfmt() and addsev()\" or by \"pfmt(), vpfmt(), lfmt(), and "
1667 "vlfmt()\", and will be removed later."
1668 msgstr ""
1669
1670 #. type: Plain text
1671 #: build/C/man3/fmtmsg.3:245
1672 #, no-wrap
1673 msgid ""
1674 "#include E<lt>stdio.hE<gt>\n"
1675 "#include E<lt>stdlib.hE<gt>\n"
1676 "#include E<lt>fmtmsg.hE<gt>\n"
1677 msgstr ""
1678
1679 #. type: Plain text
1680 #: build/C/man3/fmtmsg.3:251
1681 #, no-wrap
1682 msgid ""
1683 "int\n"
1684 "main(void)\n"
1685 "{\n"
1686 "    long class = MM_PRINT | MM_SOFT | MM_OPSYS | MM_RECOVER;\n"
1687 "    int err;\n"
1688 msgstr ""
1689
1690 #. type: Plain text
1691 #: build/C/man3/fmtmsg.3:272
1692 #, no-wrap
1693 msgid ""
1694 "    err = fmtmsg(class, \"util-linux:mount\", MM_ERROR,\n"
1695 "                \"unknown mount option\", \"See mount(8).\",\n"
1696 "                \"util-linux:mount:017\");\n"
1697 "    switch (err) {\n"
1698 "    case MM_OK:\n"
1699 "        break;\n"
1700 "    case MM_NOTOK:\n"
1701 "        printf(\"Nothing printed\\en\");\n"
1702 "        break;\n"
1703 "    case MM_NOMSG:\n"
1704 "        printf(\"Nothing printed to stderr\\en\");\n"
1705 "        break;\n"
1706 "    case MM_NOCON:\n"
1707 "        printf(\"No console output\\en\");\n"
1708 "        break;\n"
1709 "    default:\n"
1710 "        printf(\"Unknown error from fmtmsg()\\en\");\n"
1711 "    }\n"
1712 "    exit(EXIT_SUCCESS);\n"
1713 "}\n"
1714 msgstr ""
1715
1716 #. type: Plain text
1717 #: build/C/man3/fmtmsg.3:275
1718 msgid "The output should be:"
1719 msgstr ""
1720
1721 #. type: Plain text
1722 #: build/C/man3/fmtmsg.3:279
1723 #, no-wrap
1724 msgid ""
1725 "    util-linux:mount: ERROR: unknown mount option\n"
1726 "    TO FIX: See mount(8).  util-linux:mount:017\n"
1727 msgstr ""
1728
1729 #. type: Plain text
1730 #: build/C/man3/fmtmsg.3:282
1731 msgid "and after"
1732 msgstr ""
1733
1734 #. type: Plain text
1735 #: build/C/man3/fmtmsg.3:285
1736 #, no-wrap
1737 msgid "    MSGVERB=text:action; export MSGVERB\n"
1738 msgstr ""
1739
1740 #. type: Plain text
1741 #: build/C/man3/fmtmsg.3:288
1742 msgid "the output becomes:"
1743 msgstr ""
1744
1745 #. type: Plain text
1746 #: build/C/man3/fmtmsg.3:292
1747 #, no-wrap
1748 msgid ""
1749 "    unknown mount option\n"
1750 "    TO FIX: See mount(8).\n"
1751 msgstr ""
1752
1753 #. type: Plain text
1754 #: build/C/man3/fmtmsg.3:296
1755 msgid "B<addseverity>(3), B<perror>(3)"
1756 msgstr ""
1757
1758 #. type: TH
1759 #: build/C/man3/fopen.3:42
1760 #, no-wrap
1761 msgid "FOPEN"
1762 msgstr ""
1763
1764 #. type: Plain text
1765 #: build/C/man3/fopen.3:45
1766 msgid "fopen, fdopen, freopen - stream open functions"
1767 msgstr ""
1768
1769 #. type: Plain text
1770 #: build/C/man3/fopen.3:50
1771 #, no-wrap
1772 msgid "B<FILE *fopen(const char *>I<path>B<, const char *>I<mode>B<);>\n"
1773 msgstr ""
1774
1775 #. type: Plain text
1776 #: build/C/man3/fopen.3:52
1777 #, no-wrap
1778 msgid "B<FILE *fdopen(int >I<fd>B<, const char *>I<mode>B<);>\n"
1779 msgstr ""
1780
1781 #. type: Plain text
1782 #: build/C/man3/fopen.3:54
1783 #, no-wrap
1784 msgid ""
1785 "B<FILE *freopen(const char *>I<path>B<, const char *>I<mode>B<, FILE "
1786 "*>I<stream>B<);>\n"
1787 msgstr ""
1788
1789 #. type: Plain text
1790 #: build/C/man3/fopen.3:63
1791 msgid "B<fdopen>(): _POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE"
1792 msgstr ""
1793
1794 #. type: Plain text
1795 #: build/C/man3/fopen.3:69
1796 msgid ""
1797 "The B<fopen>()  function opens the file whose name is the string pointed to "
1798 "by I<path> and associates a stream with it."
1799 msgstr ""
1800
1801 #. type: Plain text
1802 #: build/C/man3/fopen.3:74
1803 msgid ""
1804 "The argument I<mode> points to a string beginning with one of the following "
1805 "sequences (Additional characters may follow these sequences.):"
1806 msgstr ""
1807
1808 #. type: TP
1809 #: build/C/man3/fopen.3:74
1810 #, no-wrap
1811 msgid "B<r>"
1812 msgstr ""
1813
1814 #. type: Plain text
1815 #: build/C/man3/fopen.3:78
1816 msgid ""
1817 "Open text file for reading.  The stream is positioned at the beginning of "
1818 "the file."
1819 msgstr ""
1820
1821 #. type: TP
1822 #: build/C/man3/fopen.3:78
1823 #, no-wrap
1824 msgid "B<r+>"
1825 msgstr ""
1826
1827 #. type: Plain text
1828 #: build/C/man3/fopen.3:82
1829 msgid ""
1830 "Open for reading and writing.  The stream is positioned at the beginning of "
1831 "the file."
1832 msgstr ""
1833
1834 #. type: TP
1835 #: build/C/man3/fopen.3:82
1836 #, no-wrap
1837 msgid "B<w>"
1838 msgstr ""
1839
1840 #. type: Plain text
1841 #: build/C/man3/fopen.3:86
1842 msgid ""
1843 "Truncate file to zero length or create text file for writing.  The stream is "
1844 "positioned at the beginning of the file."
1845 msgstr ""
1846
1847 #. type: TP
1848 #: build/C/man3/fopen.3:86
1849 #, no-wrap
1850 msgid "B<w+>"
1851 msgstr ""
1852
1853 #. type: Plain text
1854 #: build/C/man3/fopen.3:92
1855 msgid ""
1856 "Open for reading and writing.  The file is created if it does not exist, "
1857 "otherwise it is truncated.  The stream is positioned at the beginning of the "
1858 "file."
1859 msgstr ""
1860
1861 #. type: TP
1862 #: build/C/man3/fopen.3:92 build/C/man3/scanf.3:444
1863 #, no-wrap
1864 msgid "B<a>"
1865 msgstr ""
1866
1867 #. type: Plain text
1868 #: build/C/man3/fopen.3:97
1869 msgid ""
1870 "Open for appending (writing at end of file).  The file is created if it does "
1871 "not exist.  The stream is positioned at the end of the file."
1872 msgstr ""
1873
1874 #. type: TP
1875 #: build/C/man3/fopen.3:97
1876 #, no-wrap
1877 msgid "B<a+>"
1878 msgstr ""
1879
1880 #. type: Plain text
1881 #: build/C/man3/fopen.3:103
1882 msgid ""
1883 "Open for reading and appending (writing at end of file).  The file is "
1884 "created if it does not exist.  The initial file position for reading is at "
1885 "the beginning of the file, but output is always appended to the end of the "
1886 "file."
1887 msgstr ""
1888
1889 #. type: Plain text
1890 #: build/C/man3/fopen.3:116
1891 msgid ""
1892 "The I<mode> string can also include the letter \\(aqb\\(aq either as a last "
1893 "character or as a character between the characters in any of the "
1894 "two-character strings described above.  This is strictly for compatibility "
1895 "with C89 and has no effect; the \\(aqb\\(aq is ignored on all POSIX "
1896 "conforming systems, including Linux.  (Other systems may treat text files "
1897 "and binary files differently, and adding the \\(aqb\\(aq may be a good idea "
1898 "if you do I/O to a binary file and expect that your program may be ported to "
1899 "non-UNIX environments.)"
1900 msgstr ""
1901
1902 #. type: Plain text
1903 #: build/C/man3/fopen.3:119
1904 msgid "See NOTES below for details of glibc extensions for I<mode>."
1905 msgstr ""
1906
1907 #. type: Plain text
1908 #: build/C/man3/fopen.3:124
1909 msgid ""
1910 "Any created files will have mode B<S_IRUSR> | B<S_IWUSR> | B<S_IRGRP> | "
1911 "B<S_IWGRP> | B<S_IROTH> | B<S_IWOTH> (0666), as modified by the process's "
1912 "umask value (see B<umask>(2))."
1913 msgstr ""
1914
1915 #. type: Plain text
1916 #: build/C/man3/fopen.3:139
1917 msgid ""
1918 "Reads and writes may be intermixed on read/write streams in any order.  Note "
1919 "that ANSI C requires that a file positioning function intervene between "
1920 "output and input, unless an input operation encounters end-of-file.  (If "
1921 "this condition is not met, then a read is allowed to return the result of "
1922 "writes other than the most recent.)  Therefore it is good practice (and "
1923 "indeed sometimes necessary under Linux) to put an B<fseek>(3)  or "
1924 "B<fgetpos>(3)  operation between write and read operations on such a "
1925 "stream.  This operation may be an apparent no-op (as in I<fseek(..., 0L, "
1926 "SEEK_CUR)> called for its synchronizing side effect."
1927 msgstr ""
1928
1929 #. type: Plain text
1930 #: build/C/man3/fopen.3:144
1931 msgid ""
1932 "Opening a file in append mode (B<a> as the first character of I<mode>)  "
1933 "causes all subsequent write operations to this stream to occur at "
1934 "end-of-file, as if preceded by an"
1935 msgstr ""
1936
1937 #. type: Plain text
1938 #: build/C/man3/fopen.3:147
1939 #, no-wrap
1940 msgid "    fseek(stream,0,SEEK_END);\n"
1941 msgstr ""
1942
1943 #. type: Plain text
1944 #: build/C/man3/fopen.3:150
1945 msgid "call."
1946 msgstr ""
1947
1948 #. type: Plain text
1949 #: build/C/man3/fopen.3:171
1950 msgid ""
1951 "The B<fdopen>()  function associates a stream with the existing file "
1952 "descriptor, I<fd>.  The I<mode> of the stream (one of the values \"r\", "
1953 "\"r+\", \"w\", \"w+\", \"a\", \"a+\")  must be compatible with the mode of "
1954 "the file descriptor.  The file position indicator of the new stream is set "
1955 "to that belonging to I<fd>, and the error and end-of-file indicators are "
1956 "cleared.  Modes \"w\" or \"w+\" do not cause truncation of the file.  The "
1957 "file descriptor is not dup'ed, and will be closed when the stream created by "
1958 "B<fdopen>()  is closed.  The result of applying B<fdopen>()  to a shared "
1959 "memory object is undefined."
1960 msgstr ""
1961
1962 #. type: Plain text
1963 #: build/C/man3/fopen.3:189
1964 msgid ""
1965 "The B<freopen>()  function opens the file whose name is the string pointed "
1966 "to by I<path> and associates the stream pointed to by I<stream> with it.  "
1967 "The original stream (if it exists) is closed.  The I<mode> argument is used "
1968 "just as in the B<fopen>()  function.  The primary use of the B<freopen>()  "
1969 "function is to change the file associated with a standard text stream "
1970 "(I<stderr>, I<stdin>, or I<stdout>)."
1971 msgstr ""
1972
1973 #. type: Plain text
1974 #: build/C/man3/fopen.3:201
1975 msgid ""
1976 "Upon successful completion B<fopen>(), B<fdopen>()  and B<freopen>()  return "
1977 "a I<FILE> pointer.  Otherwise, NULL is returned and I<errno> is set to "
1978 "indicate the error."
1979 msgstr ""
1980
1981 #. type: TP
1982 #: 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:101 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
1983 #, no-wrap
1984 msgid "B<EINVAL>"
1985 msgstr ""
1986
1987 #. type: Plain text
1988 #: build/C/man3/fopen.3:212
1989 msgid ""
1990 "The I<mode> provided to B<fopen>(), B<fdopen>(), or B<freopen>()  was "
1991 "invalid."
1992 msgstr ""
1993
1994 #. type: Plain text
1995 #: build/C/man3/fopen.3:222
1996 msgid ""
1997 "The B<fopen>(), B<fdopen>()  and B<freopen>()  functions may also fail and "
1998 "set I<errno> for any of the errors specified for the routine B<malloc>(3)."
1999 msgstr ""
2000
2001 #. type: Plain text
2002 #: build/C/man3/fopen.3:229
2003 msgid ""
2004 "The B<fopen>()  function may also fail and set I<errno> for any of the "
2005 "errors specified for the routine B<open>(2)."
2006 msgstr ""
2007
2008 #. type: Plain text
2009 #: build/C/man3/fopen.3:236
2010 msgid ""
2011 "The B<fdopen>()  function may also fail and set I<errno> for any of the "
2012 "errors specified for the routine B<fcntl>(2)."
2013 msgstr ""
2014
2015 #. type: Plain text
2016 #: build/C/man3/fopen.3:246
2017 msgid ""
2018 "The B<freopen>()  function may also fail and set I<errno> for any of the "
2019 "errors specified for the routines B<open>(2), B<fclose>(3)  and "
2020 "B<fflush>(3)."
2021 msgstr ""
2022
2023 #. type: Plain text
2024 #: build/C/man3/fopen.3:255
2025 msgid ""
2026 "The B<fopen>()  and B<freopen>()  functions conform to C89.  The B<fdopen>()  "
2027 "function conforms to POSIX.1-1990."
2028 msgstr ""
2029
2030 #. type: SS
2031 #: build/C/man3/fopen.3:256
2032 #, no-wrap
2033 msgid "Glibc Notes"
2034 msgstr ""
2035
2036 #. type: Plain text
2037 #: build/C/man3/fopen.3:259
2038 msgid ""
2039 "The GNU C library allows the following extensions for the string specified "
2040 "in I<mode>:"
2041 msgstr ""
2042
2043 #. type: TP
2044 #: build/C/man3/fopen.3:259
2045 #, no-wrap
2046 msgid "B<c> (since glibc 2.3.3)"
2047 msgstr ""
2048
2049 #. type: Plain text
2050 #: build/C/man3/fopen.3:264
2051 msgid ""
2052 "Do not make the open operation, or subsequent read and write operations, "
2053 "thread cancellation points."
2054 msgstr ""
2055
2056 #. type: TP
2057 #: build/C/man3/fopen.3:264
2058 #, no-wrap
2059 msgid "B<e> (since glibc 2.7)"
2060 msgstr ""
2061
2062 #. type: Plain text
2063 #: build/C/man3/fopen.3:272
2064 msgid ""
2065 "Open the file with the B<O_CLOEXEC> flag.  See B<open>(2)  for more "
2066 "information."
2067 msgstr ""
2068
2069 #. type: TP
2070 #: build/C/man3/fopen.3:272
2071 #, no-wrap
2072 msgid "B<m> (since glibc 2.3)"
2073 msgstr ""
2074
2075 #.  As at glibc 2.4:
2076 #. type: Plain text
2077 #: build/C/man3/fopen.3:284
2078 msgid ""
2079 "Attempt to access the file using B<mmap>(2), rather than I/O system calls "
2080 "(B<read>(2), B<write>(2)).  Currently, use of B<mmap>(2)  is only attempted "
2081 "for a file opened for reading."
2082 msgstr ""
2083
2084 #. type: TP
2085 #: build/C/man3/fopen.3:284 build/C/man3/scanf.3:418
2086 #, no-wrap
2087 msgid "B<x>"
2088 msgstr ""
2089
2090 #.  Since glibc 2.0?
2091 #.  FIXME document /,ccs= charset/
2092 #. type: Plain text
2093 #: build/C/man3/fopen.3:301
2094 msgid ""
2095 "Open the file exclusively (like the B<O_EXCL> flag of B<open>(2)).  If the "
2096 "file already exists, B<fopen>()  fails, and sets I<errno> to B<EEXIST>.  "
2097 "This flag is ignored for B<fdopen>()."
2098 msgstr ""
2099
2100 #. type: Plain text
2101 #: build/C/man3/fopen.3:307
2102 msgid "B<open>(2), B<fclose>(3), B<fileno>(3), B<fmemopen>(3), B<fopencookie>(3)"
2103 msgstr ""
2104
2105 #. type: TH
2106 #: build/C/man3/fopencookie.3:24
2107 #, no-wrap
2108 msgid "FOPENCOOKIE"
2109 msgstr ""
2110
2111 #. type: TH
2112 #: build/C/man3/fopencookie.3:24
2113 #, no-wrap
2114 msgid "2008-12-05"
2115 msgstr ""
2116
2117 #. type: TH
2118 #: 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
2119 #, no-wrap
2120 msgid "Linux"
2121 msgstr ""
2122
2123 #. type: Plain text
2124 #: build/C/man3/fopencookie.3:27
2125 msgid "fopencookie - opening a custom stream"
2126 msgstr ""
2127
2128 #. type: Plain text
2129 #: build/C/man3/fopencookie.3:34
2130 #, no-wrap
2131 msgid ""
2132 "B<FILE *fopencookie(void *>I<cookie>B<, const char *>I<mode>B<,>\n"
2133 "B<                  cookie_io_functions_t >I<io_funcs>B<);>\n"
2134 msgstr ""
2135
2136 #. type: Plain text
2137 #: build/C/man3/fopencookie.3:47
2138 msgid ""
2139 "The B<fopencookie>()  function allows the programmer to create a custom "
2140 "implementation for a standard I/O stream.  This implementation can store the "
2141 "stream's data at a location of its own choosing; for example, "
2142 "B<fopencookie>()  is used to implement B<fmemopen>(3), which provides a "
2143 "stream interface to data that is stored in a buffer in memory."
2144 msgstr ""
2145
2146 #. type: Plain text
2147 #: build/C/man3/fopencookie.3:49
2148 msgid "In order to create a custom stream the programmer must:"
2149 msgstr ""
2150
2151 #. type: IP
2152 #: 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
2153 #, no-wrap
2154 msgid "*"
2155 msgstr ""
2156
2157 #. type: Plain text
2158 #: build/C/man3/fopencookie.3:52
2159 msgid ""
2160 "Implement four \"hook\" functions that are used internally by the standard "
2161 "I/O library when performing I/O on the stream."
2162 msgstr ""
2163
2164 #. type: Plain text
2165 #: build/C/man3/fopencookie.3:63
2166 msgid ""
2167 "Define a \"cookie\" data type, a structure that provides bookkeeping "
2168 "information (e.g., where to store data) used by the aforementioned hook "
2169 "functions.  The standard I/O package knows nothing about the contents of "
2170 "this cookie (thus it is typed as I<void\\ *> when passed to "
2171 "B<fopencookie>()), but automatically supplies the cookie as the first "
2172 "argument when calling the hook functions."
2173 msgstr ""
2174
2175 #. type: Plain text
2176 #: build/C/man3/fopencookie.3:68
2177 msgid ""
2178 "Call B<fopencookie>()  to open a new stream and associate the cookie and "
2179 "hook functions with that stream."
2180 msgstr ""
2181
2182 #. type: Plain text
2183 #: build/C/man3/fopencookie.3:76
2184 msgid ""
2185 "The B<fopencookie>()  function serves a purpose similar to B<fopen>(3): it "
2186 "opens a new stream and returns a pointer to a I<FILE> object that is used to "
2187 "operate on that stream."
2188 msgstr ""
2189
2190 #. type: Plain text
2191 #: build/C/man3/fopencookie.3:83
2192 msgid ""
2193 "The I<cookie> argument is a pointer to the caller's cookie structure that is "
2194 "to be associated with the new stream.  This pointer is supplied as the first "
2195 "argument when the standard I/O library invokes any of the hook functions "
2196 "described below."
2197 msgstr ""
2198
2199 #. type: Plain text
2200 #: build/C/man3/fopencookie.3:99
2201 msgid ""
2202 "The I<mode> argument serves the same purpose as for B<fopen>(3).  The "
2203 "following modes are supported: I<r>, I<w>, I<a>, I<r+>, I<w+>, and I<a+>.  "
2204 "See B<fopen>(3)  for details."
2205 msgstr ""
2206
2207 #. type: Plain text
2208 #: build/C/man3/fopencookie.3:105
2209 msgid ""
2210 "The I<io_funcs> argument is a structure that contains four fields pointing "
2211 "to the programmer-defined hook functions that are used to implement this "
2212 "stream.  The structure is defined as follows"
2213 msgstr ""
2214
2215 #. type: Plain text
2216 #: build/C/man3/fopencookie.3:114
2217 #, no-wrap
2218 msgid ""
2219 "struct cookie_io_functions_t {\n"
2220 "    cookie_read_function_t  *read;\n"
2221 "    cookie_write_function_t *write;\n"
2222 "    cookie_seek_function_t  *seek;\n"
2223 "    cookie_close_function_t *close;\n"
2224 "};\n"
2225 msgstr ""
2226
2227 #. type: Plain text
2228 #: build/C/man3/fopencookie.3:118
2229 msgid "The four fields are as follows:"
2230 msgstr ""
2231
2232 #. type: TP
2233 #: build/C/man3/fopencookie.3:118
2234 #, no-wrap
2235 msgid "I<cookie_read_function_t *read>"
2236 msgstr ""
2237
2238 #. type: Plain text
2239 #: build/C/man3/fopencookie.3:122
2240 msgid ""
2241 "This function implements read operations for the stream.  When called, it "
2242 "receives three arguments:"
2243 msgstr ""
2244
2245 #. type: Plain text
2246 #: build/C/man3/fopencookie.3:124
2247 #, no-wrap
2248 msgid "    ssize_t read(void *cookie, char *buf, size_t size);\n"
2249 msgstr ""
2250
2251 #. type: Plain text
2252 #: build/C/man3/fopencookie.3:139
2253 msgid ""
2254 "The I<buf> and I<size> arguments are, respectively, a buffer into which "
2255 "input data can be placed and the size of that buffer.  As its function "
2256 "result, the I<read> function should return the number of bytes copied into "
2257 "I<buf>, 0 on end of file, or -1 on error.  The I<read> function should "
2258 "update the stream offset appropriately."
2259 msgstr ""
2260
2261 #. type: Plain text
2262 #: build/C/man3/fopencookie.3:144
2263 msgid ""
2264 "If I<*read> is a NULL pointer, then reads from the custom stream always "
2265 "return end of file."
2266 msgstr ""
2267
2268 #. type: TP
2269 #: build/C/man3/fopencookie.3:144
2270 #, no-wrap
2271 msgid "I<cookie_write_function_t *write>"
2272 msgstr ""
2273
2274 #. type: Plain text
2275 #: build/C/man3/fopencookie.3:148
2276 msgid ""
2277 "This function implements write operations for the stream.  When called, it "
2278 "receives three arguments:"
2279 msgstr ""
2280
2281 #. type: Plain text
2282 #: build/C/man3/fopencookie.3:150
2283 #, no-wrap
2284 msgid "    ssize_t write(void *cookie, const char *buf, size_t size);\n"
2285 msgstr ""
2286
2287 #. type: Plain text
2288 #: build/C/man3/fopencookie.3:165
2289 msgid ""
2290 "The I<buf> and I<size> arguments are, respectively, a buffer of data to be "
2291 "output to the stream and the size of that buffer.  As its function result, "
2292 "the I<write> function should return the number of bytes copied from I<buf>, "
2293 "or -1 on error.  The I<write> function should update the stream offset "
2294 "appropriately."
2295 msgstr ""
2296
2297 #. type: Plain text
2298 #: build/C/man3/fopencookie.3:170
2299 msgid "If I<*write> is a NULL pointer, then output to the stream is discarded."
2300 msgstr ""
2301
2302 #. type: TP
2303 #: build/C/man3/fopencookie.3:170
2304 #, no-wrap
2305 msgid "I<cookie_seek_function_t *seek>"
2306 msgstr ""
2307
2308 #. type: Plain text
2309 #: build/C/man3/fopencookie.3:174
2310 msgid ""
2311 "This function implements seek operations on the stream.  When called, it "
2312 "receives three arguments:"
2313 msgstr ""
2314
2315 #. type: Plain text
2316 #: build/C/man3/fopencookie.3:176
2317 #, no-wrap
2318 msgid "    int seek(void *cookie, off64_t *offset, int whence);\n"
2319 msgstr ""
2320
2321 #. type: Plain text
2322 #: build/C/man3/fopencookie.3:182
2323 msgid ""
2324 "The I<*offset> argument specifies the new file offset depending on which of "
2325 "the following three values is supplied in I<whence>:"
2326 msgstr ""
2327
2328 #. type: TP
2329 #: build/C/man3/fopencookie.3:183 build/C/man2/lseek.2:65
2330 #, no-wrap
2331 msgid "B<SEEK_SET>"
2332 msgstr ""
2333
2334 #. type: Plain text
2335 #: build/C/man3/fopencookie.3:188
2336 msgid ""
2337 "The stream offset should be set I<*offset> bytes from the start of the "
2338 "stream."
2339 msgstr ""
2340
2341 #. type: TP
2342 #: build/C/man3/fopencookie.3:188 build/C/man2/lseek.2:70
2343 #, no-wrap
2344 msgid "B<SEEK_CUR>"
2345 msgstr ""
2346
2347 #. type: Plain text
2348 #: build/C/man3/fopencookie.3:192
2349 msgid "I<*offset> should be added to the current stream offset."
2350 msgstr ""
2351
2352 #. type: TP
2353 #: build/C/man3/fopencookie.3:192 build/C/man2/lseek.2:75
2354 #, no-wrap
2355 msgid "B<SEEK_END>"
2356 msgstr ""
2357
2358 #. type: Plain text
2359 #: build/C/man3/fopencookie.3:196
2360 msgid "The stream offset should be set to the size of the stream plus I<*offset>."
2361 msgstr ""
2362
2363 #. type: Plain text
2364 #: build/C/man3/fopencookie.3:203
2365 msgid ""
2366 "Before returning, the I<seek> function should update I<*offset> to indicate "
2367 "the new stream offset."
2368 msgstr ""
2369
2370 #. type: Plain text
2371 #: build/C/man3/fopencookie.3:207
2372 msgid ""
2373 "As its function result, the I<seek> function should return 0 on success, and "
2374 "-1 on error."
2375 msgstr ""
2376
2377 #. type: Plain text
2378 #: build/C/man3/fopencookie.3:212
2379 msgid ""
2380 "If I<*seek> is a NULL pointer, then it is not possible to perform seek "
2381 "operations on the stream."
2382 msgstr ""
2383
2384 #. type: TP
2385 #: build/C/man3/fopencookie.3:212
2386 #, no-wrap
2387 msgid "I<cookie_close_function_t *close>"
2388 msgstr ""
2389
2390 #. type: Plain text
2391 #: build/C/man3/fopencookie.3:218
2392 msgid ""
2393 "This function closes the stream.  The hook function can do things such as "
2394 "freeing buffers allocated for the stream.  When called, it receives one "
2395 "argument:"
2396 msgstr ""
2397
2398 #. type: Plain text
2399 #: build/C/man3/fopencookie.3:220
2400 #, no-wrap
2401 msgid "    int close(void *cookie);\n"
2402 msgstr ""
2403
2404 #. type: Plain text
2405 #: build/C/man3/fopencookie.3:225
2406 msgid ""
2407 "The I<cookie> argument is the cookie that the programmer supplied when "
2408 "calling B<fopencookie>()."
2409 msgstr ""
2410
2411 #. type: Plain text
2412 #: build/C/man3/fopencookie.3:231
2413 msgid ""
2414 "As its function result, the I<close> function should return 0 on success, "
2415 "and B<EOF> on error."
2416 msgstr ""
2417
2418 #. type: Plain text
2419 #: build/C/man3/fopencookie.3:235
2420 msgid ""
2421 "If I<*close> is NULL, then no special action is performed when the stream is "
2422 "closed."
2423 msgstr ""
2424
2425 #.  .SH ERRORS
2426 #.  It's not clear if errno ever gets set...
2427 #. type: Plain text
2428 #: build/C/man3/fopencookie.3:242
2429 msgid ""
2430 "On success B<fopencookie>()  returns a pointer to the new stream.  On error, "
2431 "NULL is returned."
2432 msgstr ""
2433
2434 #. type: Plain text
2435 #: build/C/man3/fopencookie.3:244
2436 msgid "This function is a nonstandard GNU extension."
2437 msgstr ""
2438
2439 #. type: Plain text
2440 #: build/C/man3/fopencookie.3:253
2441 msgid ""
2442 "The program below implements a custom stream whose functionality is similar "
2443 "(but not identical) to that available via B<fmemopen>(3).  It implements a "
2444 "stream whose data is stored in a memory buffer.  The program writes its "
2445 "command-line arguments to the stream, and then seeks through the stream "
2446 "reading two out of every five characters and writing them to standard "
2447 "output.  The following shell session demonstrates the use of the program:"
2448 msgstr ""
2449
2450 #. type: Plain text
2451 #: build/C/man3/fopencookie.3:261
2452 #, no-wrap
2453 msgid ""
2454 "$B< ./a.out \\(aqhello world\\(aq>\n"
2455 "/he/\n"
2456 "/ w/\n"
2457 "/d/\n"
2458 "Reached end of file\n"
2459 msgstr ""
2460
2461 #. type: Plain text
2462 #: build/C/man3/fopencookie.3:268
2463 msgid ""
2464 "Note that a more general version of the program below could be improved to "
2465 "more robustly handle various error situations (e.g., opening a stream with a "
2466 "cookie that already has an open stream; closing a stream that has already "
2467 "been closed)."
2468 msgstr ""
2469
2470 #. type: Plain text
2471 #: build/C/man3/fopencookie.3:277
2472 #, no-wrap
2473 msgid ""
2474 "#define _GNU_SOURCE\n"
2475 "#include E<lt>sys/types.hE<gt>\n"
2476 "#include E<lt>stdio.hE<gt>\n"
2477 "#include E<lt>stdlib.hE<gt>\n"
2478 "#include E<lt>unistd.hE<gt>\n"
2479 "#include E<lt>string.hE<gt>\n"
2480 msgstr ""
2481
2482 #. type: Plain text
2483 #: build/C/man3/fopencookie.3:279
2484 #, no-wrap
2485 msgid "#define INIT_BUF_SIZE 4\n"
2486 msgstr ""
2487
2488 #. type: Plain text
2489 #: build/C/man3/fopencookie.3:286
2490 #, no-wrap
2491 msgid ""
2492 "struct memfile_cookie {\n"
2493 "    char   *buf;        /* Dynamically sized buffer for data */\n"
2494 "    size_t  allocated;  /* Size of buf */\n"
2495 "    size_t  endpos;     /* Number of characters in buf */\n"
2496 "    off_t   offset;     /* Current file offset in buf */\n"
2497 "};\n"
2498 msgstr ""
2499
2500 #. type: Plain text
2501 #: build/C/man3/fopencookie.3:292
2502 #, no-wrap
2503 msgid ""
2504 "ssize_t\n"
2505 "memfile_write(void *c, const char *buf, size_t size)\n"
2506 "{\n"
2507 "    char *new_buff;\n"
2508 "    struct memfile_cookie *cookie = c;\n"
2509 msgstr ""
2510
2511 #. type: Plain text
2512 #: build/C/man3/fopencookie.3:294
2513 #, no-wrap
2514 msgid "    /* Buffer too small? Keep doubling size until big enough */\n"
2515 msgstr ""
2516
2517 #. type: Plain text
2518 #: build/C/man3/fopencookie.3:304
2519 #, no-wrap
2520 msgid ""
2521 "    while (size + cookie-E<gt>offset E<gt> cookie-E<gt>allocated) {\n"
2522 "        new_buff = realloc(cookie-E<gt>buf, cookie-E<gt>allocated * 2);\n"
2523 "        if (new_buff == NULL) {\n"
2524 "            return -1;\n"
2525 "        } else {\n"
2526 "            cookie-E<gt>allocated *= 2;\n"
2527 "            cookie-E<gt>buf = new_buff;\n"
2528 "        }\n"
2529 "    }\n"
2530 msgstr ""
2531
2532 #. type: Plain text
2533 #: build/C/man3/fopencookie.3:306
2534 #, no-wrap
2535 msgid "    memcpy(cookie-E<gt>buf + cookie-E<gt>offset, buf, size);\n"
2536 msgstr ""
2537
2538 #. type: Plain text
2539 #: build/C/man3/fopencookie.3:310
2540 #, no-wrap
2541 msgid ""
2542 "    cookie-E<gt>offset += size;\n"
2543 "    if (cookie-E<gt>offset E<gt> cookie-E<gt>endpos)\n"
2544 "        cookie-E<gt>endpos = cookie-E<gt>offset;\n"
2545 msgstr ""
2546
2547 #. type: Plain text
2548 #: build/C/man3/fopencookie.3:313
2549 #, no-wrap
2550 msgid ""
2551 "    return size;\n"
2552 "}\n"
2553 msgstr ""
2554
2555 #. type: Plain text
2556 #: build/C/man3/fopencookie.3:319
2557 #, no-wrap
2558 msgid ""
2559 "ssize_t\n"
2560 "memfile_read(void *c, char *buf, size_t size)\n"
2561 "{\n"
2562 "    ssize_t xbytes;\n"
2563 "    struct memfile_cookie *cookie = c;\n"
2564 msgstr ""
2565
2566 #. type: Plain text
2567 #: build/C/man3/fopencookie.3:321
2568 #, no-wrap
2569 msgid "    /* Fetch minimum of bytes requested and bytes available */\n"
2570 msgstr ""
2571
2572 #. type: Plain text
2573 #: build/C/man3/fopencookie.3:327
2574 #, no-wrap
2575 msgid ""
2576 "    xbytes = size;\n"
2577 "    if (cookie-E<gt>offset + size E<gt> cookie-E<gt>endpos)\n"
2578 "        xbytes = cookie-E<gt>endpos - cookie-E<gt>offset;\n"
2579 "    if (xbytes E<lt> 0)     /* offset may be past endpos */\n"
2580 "       xbytes = 0;\n"
2581 msgstr ""
2582
2583 #. type: Plain text
2584 #: build/C/man3/fopencookie.3:329
2585 #, no-wrap
2586 msgid "    memcpy(buf, cookie-E<gt>buf + cookie-E<gt>offset, xbytes);\n"
2587 msgstr ""
2588
2589 #. type: Plain text
2590 #: build/C/man3/fopencookie.3:333
2591 #, no-wrap
2592 msgid ""
2593 "    cookie-E<gt>offset += xbytes;\n"
2594 "    return xbytes;\n"
2595 "}\n"
2596 msgstr ""
2597
2598 #. type: Plain text
2599 #: build/C/man3/fopencookie.3:339
2600 #, no-wrap
2601 msgid ""
2602 "int\n"
2603 "memfile_seek(void *c, off64_t *offset, int whence)\n"
2604 "{\n"
2605 "    off64_t new_offset;\n"
2606 "    struct memfile_cookie *cookie = c;\n"
2607 msgstr ""
2608
2609 #. type: Plain text
2610 #: build/C/man3/fopencookie.3:348
2611 #, no-wrap
2612 msgid ""
2613 "    if (whence == SEEK_SET)\n"
2614 "        new_offset = *offset;\n"
2615 "    else if (whence == SEEK_END)\n"
2616 "        new_offset = cookie-E<gt>endpos + *offset;\n"
2617 "    else if (whence == SEEK_CUR)\n"
2618 "        new_offset = cookie-E<gt>offset + *offset;\n"
2619 "    else\n"
2620 "        return -1;\n"
2621 msgstr ""
2622
2623 #. type: Plain text
2624 #: build/C/man3/fopencookie.3:351
2625 #, no-wrap
2626 msgid ""
2627 "    if (new_offset E<lt> 0)\n"
2628 "        return -1;\n"
2629 msgstr ""
2630
2631 #. type: Plain text
2632 #: build/C/man3/fopencookie.3:356
2633 #, no-wrap
2634 msgid ""
2635 "    cookie-E<gt>offset = new_offset;\n"
2636 "    *offset = new_offset;\n"
2637 "    return 0;\n"
2638 "}\n"
2639 msgstr ""
2640
2641 #. type: Plain text
2642 #: build/C/man3/fopencookie.3:361
2643 #, no-wrap
2644 msgid ""
2645 "int\n"
2646 "memfile_close(void *c)\n"
2647 "{\n"
2648 "    struct memfile_cookie *cookie = c;\n"
2649 msgstr ""
2650
2651 #. type: Plain text
2652 #: build/C/man3/fopencookie.3:365
2653 #, no-wrap
2654 msgid ""
2655 "    free(cookie-E<gt>buf);\n"
2656 "    cookie-E<gt>allocated = 0;\n"
2657 "    cookie-E<gt>buf = NULL;\n"
2658 msgstr ""
2659
2660 #. type: Plain text
2661 #: build/C/man3/fopencookie.3:368
2662 #, no-wrap
2663 msgid ""
2664 "    return 0;\n"
2665 "}\n"
2666 msgstr ""
2667
2668 #. type: Plain text
2669 #: build/C/man3/fopencookie.3:384
2670 #, no-wrap
2671 msgid ""
2672 "int\n"
2673 "main(int argc, char *argv[])\n"
2674 "{\n"
2675 "    cookie_io_functions_t  memfile_func = {\n"
2676 "        .read  = memfile_read,\n"
2677 "        .write = memfile_write,\n"
2678 "        .seek  = memfile_seek,\n"
2679 "        .close = memfile_close\n"
2680 "    };\n"
2681 "    FILE *fp;\n"
2682 "    struct memfile_cookie mycookie;\n"
2683 "    ssize_t nread;\n"
2684 "    long p;\n"
2685 "    int j;\n"
2686 "    char buf[1000];\n"
2687 msgstr ""
2688
2689 #. type: Plain text
2690 #: build/C/man3/fopencookie.3:386
2691 #, no-wrap
2692 msgid "    /* Set up the cookie before calling fopencookie() */\n"
2693 msgstr ""
2694
2695 #. type: Plain text
2696 #: build/C/man3/fopencookie.3:392
2697 #, no-wrap
2698 msgid ""
2699 "    mycookie.buf = malloc(INIT_BUF_SIZE);\n"
2700 "    if (mycookie.buf == NULL) {\n"
2701 "        perror(\"malloc\");\n"
2702 "        exit(EXIT_FAILURE);\n"
2703 "    }\n"
2704 msgstr ""
2705
2706 #. type: Plain text
2707 #: build/C/man3/fopencookie.3:396
2708 #, no-wrap
2709 msgid ""
2710 "    mycookie.allocated = INIT_BUF_SIZE;\n"
2711 "    mycookie.offset = 0;\n"
2712 "    mycookie.endpos = 0;\n"
2713 msgstr ""
2714
2715 #. type: Plain text
2716 #: build/C/man3/fopencookie.3:402
2717 #, no-wrap
2718 msgid ""
2719 "    fp = fopencookie(&mycookie,\"w+\", memfile_func);\n"
2720 "    if (fp == NULL) {\n"
2721 "        perror(\"fopencookie\");\n"
2722 "        exit(EXIT_FAILURE);\n"
2723 "    }\n"
2724 msgstr ""
2725
2726 #. type: Plain text
2727 #: build/C/man3/fopencookie.3:404
2728 #, no-wrap
2729 msgid "    /* Write command-line arguments to our file */\n"
2730 msgstr ""
2731
2732 #. type: Plain text
2733 #: build/C/man3/fopencookie.3:410
2734 #, no-wrap
2735 msgid ""
2736 "    for (j = 1; j E<lt> argc; j++)\n"
2737 "        if (fputs(argv[j], fp) == EOF) {\n"
2738 "            perror(\"fputs\");\n"
2739 "            exit(EXIT_FAILURE);\n"
2740 "        }\n"
2741 msgstr ""
2742
2743 #. type: Plain text
2744 #: build/C/man3/fopencookie.3:412
2745 #, no-wrap
2746 msgid "    /* Read two bytes out of every five, until EOF */\n"
2747 msgstr ""
2748
2749 #. type: Plain text
2750 #: build/C/man3/fopencookie.3:427
2751 #, no-wrap
2752 msgid ""
2753 "    for (p = 0; ; p += 5) {\n"
2754 "        if (fseek(fp, p, SEEK_SET) == -1) {\n"
2755 "            perror(\"fseek\");\n"
2756 "            exit(EXIT_FAILURE);\n"
2757 "        }\n"
2758 "        nread = fread(buf, 1, 2, fp);\n"
2759 "        if (nread == -1) {\n"
2760 "            perror(\"fread\");\n"
2761 "            exit(EXIT_FAILURE);\n"
2762 "        }\n"
2763 "        if (nread == 0) {\n"
2764 "            printf(\"Reached end of file\\en\");\n"
2765 "            break;\n"
2766 "        }\n"
2767 msgstr ""
2768
2769 #. type: Plain text
2770 #: build/C/man3/fopencookie.3:430
2771 #, no-wrap
2772 msgid ""
2773 "        printf(\"/%.*s/\\en\", nread, buf);\n"
2774 "    }\n"
2775 msgstr ""
2776
2777 #. type: Plain text
2778 #: build/C/man3/fopencookie.3:433 build/C/man2/readlink.2:211
2779 #, no-wrap
2780 msgid ""
2781 "    exit(EXIT_SUCCESS);\n"
2782 "}\n"
2783 msgstr ""
2784
2785 #. type: Plain text
2786 #: build/C/man3/fopencookie.3:439
2787 msgid "B<fclose>(3), B<fmemopen>(3), B<fopen>(3), B<fseek>(3)"
2788 msgstr ""
2789
2790 #. type: TH
2791 #: build/C/man3/fpurge.3:23
2792 #, no-wrap
2793 msgid "FPURGE"
2794 msgstr ""
2795
2796 #. type: TH
2797 #: build/C/man3/fpurge.3:23
2798 #, no-wrap
2799 msgid "2001-12-15"
2800 msgstr ""
2801
2802 #. type: Plain text
2803 #: build/C/man3/fpurge.3:26
2804 msgid "fpurge, __fpurge - purge a stream"
2805 msgstr ""
2806
2807 #. type: Plain text
2808 #: build/C/man3/fpurge.3:30
2809 #, no-wrap
2810 msgid ""
2811 "/* unsupported */\n"
2812 "B<#include E<lt>stdio.hE<gt>>\n"
2813 msgstr ""
2814
2815 #. type: Plain text
2816 #: build/C/man3/fpurge.3:32
2817 #, no-wrap
2818 msgid "B<int fpurge(FILE *>I<stream>B<);>\n"
2819 msgstr ""
2820
2821 #. type: Plain text
2822 #: build/C/man3/fpurge.3:35
2823 #, no-wrap
2824 msgid ""
2825 "/* supported */\n"
2826 "B<#include E<lt>stdio.hE<gt>>\n"
2827 msgstr ""
2828
2829 #. type: Plain text
2830 #: build/C/man3/fpurge.3:37
2831 #, no-wrap
2832 msgid "B<#include E<lt>stdio_ext.hE<gt>>\n"
2833 msgstr ""
2834
2835 #. type: Plain text
2836 #: build/C/man3/fpurge.3:39
2837 #, no-wrap
2838 msgid "B<void  __fpurge(FILE *>I<stream>B<);>\n"
2839 msgstr ""
2840
2841 #. type: Plain text
2842 #: build/C/man3/fpurge.3:52
2843 msgid ""
2844 "The function B<fpurge>()  clears the buffers of the given stream.  For "
2845 "output streams this discards any unwritten output.  For input streams this "
2846 "discards any input read from the underlying object but not yet obtained via "
2847 "B<getc>(3); this includes any text pushed back via B<ungetc>(3).  See also "
2848 "B<fflush>(3)."
2849 msgstr ""
2850
2851 #. type: Plain text
2852 #: build/C/man3/fpurge.3:56
2853 msgid ""
2854 "The function B<__fpurge>()  does precisely the same, but without returning a "
2855 "value."
2856 msgstr ""
2857
2858 #. type: Plain text
2859 #: build/C/man3/fpurge.3:63
2860 msgid ""
2861 "Upon successful completion B<fpurge>()  returns 0.  On error, it returns -1 "
2862 "and sets I<errno> appropriately."
2863 msgstr ""
2864
2865 #. type: Plain text
2866 #: build/C/man3/fpurge.3:68
2867 msgid "I<stream> is not an open stream."
2868 msgstr ""
2869
2870 #. type: Plain text
2871 #: build/C/man3/fpurge.3:76
2872 msgid ""
2873 "These functions are nonstandard and not portable.  The function B<fpurge>()  "
2874 "was introduced in 4.4BSD and is not available under Linux.  The function "
2875 "B<__fpurge>()  was introduced in Solaris, and is present in glibc 2.1.95 and "
2876 "later."
2877 msgstr ""
2878
2879 #. type: Plain text
2880 #: build/C/man3/fpurge.3:78
2881 msgid "Usually it is a mistake to want to discard input buffers."
2882 msgstr ""
2883
2884 #.  .BR fclean (3),
2885 #. type: Plain text
2886 #: build/C/man3/fpurge.3:83
2887 msgid "B<fflush>(3), B<setbuf>(3), B<stdio_ext>(3)"
2888 msgstr ""
2889
2890 #. type: TH
2891 #: build/C/man3/fputwc.3:14
2892 #, no-wrap
2893 msgid "FPUTWC"
2894 msgstr ""
2895
2896 #. type: Plain text
2897 #: build/C/man3/fputwc.3:17
2898 msgid "fputwc, putwc - write a wide character to a FILE stream"
2899 msgstr ""
2900
2901 #. type: Plain text
2902 #: build/C/man3/fputwc.3:25
2903 #, no-wrap
2904 msgid ""
2905 "B<wint_t fputwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
2906 "B<wint_t putwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
2907 msgstr ""
2908
2909 #. type: Plain text
2910 #: build/C/man3/fputwc.3:41
2911 msgid ""
2912 "The B<fputwc>()  function is the wide-character equivalent of the "
2913 "B<fputc>(3)  function.  It writes the wide character I<wc> to I<stream>.  If "
2914 "I<ferror(stream)> becomes true, it returns B<WEOF>.  If a wide-character "
2915 "conversion error occurs, it sets I<errno> to B<EILSEQ> and returns B<WEOF>.  "
2916 "Otherwise it returns I<wc>."
2917 msgstr ""
2918
2919 #. type: Plain text
2920 #: build/C/man3/fputwc.3:49
2921 msgid ""
2922 "The B<putwc>()  function or macro functions identically to B<fputwc>().  It "
2923 "may be implemented as a macro, and may evaluate its argument more than "
2924 "once.  There is no reason ever to use it."
2925 msgstr ""
2926
2927 #. type: Plain text
2928 #: build/C/man3/fputwc.3:58
2929 msgid ""
2930 "The B<fputwc>()  function returns I<wc> if no error occurred, or B<WEOF> to "
2931 "indicate an error."
2932 msgstr ""
2933
2934 #. type: Plain text
2935 #: build/C/man3/fputwc.3:63
2936 msgid "Conversion of I<wc> to the stream's encoding fails."
2937 msgstr ""
2938
2939 #. type: Plain text
2940 #: build/C/man3/fputwc.3:72
2941 msgid ""
2942 "The behavior of B<fputwc>()  depends on the B<LC_CTYPE> category of the "
2943 "current locale."
2944 msgstr ""
2945
2946 #. type: Plain text
2947 #: build/C/man3/fputwc.3:80
2948 msgid ""
2949 "In the absence of additional information passed to the B<fopen>(3)  call, it "
2950 "is reasonable to expect that B<fputwc>()  will actually write the multibyte "
2951 "sequence corresponding to the wide character I<wc>."
2952 msgstr ""
2953
2954 #. type: Plain text
2955 #: build/C/man3/fputwc.3:84
2956 msgid "B<fgetwc>(3), B<fputws>(3), B<unlocked_stdio>(3)"
2957 msgstr ""
2958
2959 #. type: TH
2960 #: build/C/man3/fread.3:43
2961 #, no-wrap
2962 msgid "FREAD"
2963 msgstr ""
2964
2965 #. type: TH
2966 #: build/C/man3/fread.3:43
2967 #, no-wrap
2968 msgid "1996-05-17"
2969 msgstr ""
2970
2971 #. type: Plain text
2972 #: build/C/man3/fread.3:46
2973 msgid "fread, fwrite - binary stream input/output"
2974 msgstr ""
2975
2976 #. type: Plain text
2977 #: build/C/man3/fread.3:52
2978 #, no-wrap
2979 msgid ""
2980 "B<size_t fread(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<, FILE "
2981 "*>I<stream>B<);>\n"
2982 msgstr ""
2983
2984 #. type: Plain text
2985 #: build/C/man3/fread.3:55
2986 #, no-wrap
2987 msgid ""
2988 "B<size_t fwrite(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
2989 ">I<nmemb>B<,>\n"
2990 "B<              FILE *>I<stream>B<);>\n"
2991 msgstr ""
2992
2993 #. type: Plain text
2994 #: build/C/man3/fread.3:67
2995 msgid ""
2996 "The function B<fread>()  reads I<nmemb> elements of data, each I<size> bytes "
2997 "long, from the stream pointed to by I<stream>, storing them at the location "
2998 "given by I<ptr>."
2999 msgstr ""
3000
3001 #. type: Plain text
3002 #: build/C/man3/fread.3:78
3003 msgid ""
3004 "The function B<fwrite>()  writes I<nmemb> elements of data, each I<size> "
3005 "bytes long, to the stream pointed to by I<stream>, obtaining them from the "
3006 "location given by I<ptr>."
3007 msgstr ""
3008
3009 #. type: Plain text
3010 #: build/C/man3/fread.3:89
3011 msgid ""
3012 "B<fread>()  and B<fwrite>()  return the number of items successfully read or "
3013 "written (i.e., not the number of characters).  If an error occurs, or the "
3014 "end-of-file is reached, the return value is a short item count (or zero)."
3015 msgstr ""
3016
3017 #. type: Plain text
3018 #: build/C/man3/fread.3:96
3019 msgid ""
3020 "B<fread>()  does not distinguish between end-of-file and error, and callers "
3021 "must use B<feof>(3)  and B<ferror>(3)  to determine which occurred."
3022 msgstr ""
3023
3024 #. type: Plain text
3025 #: build/C/man3/fread.3:98
3026 msgid "C89, POSIX.1-2001."
3027 msgstr ""
3028
3029 #. type: Plain text
3030 #: build/C/man3/fread.3:104
3031 msgid "B<read>(2), B<write>(2), B<feof>(3), B<ferror>(3), B<unlocked_stdio>(3)"
3032 msgstr ""
3033
3034 #. type: TH
3035 #: build/C/man3/fseek.3:40
3036 #, no-wrap
3037 msgid "FSEEK"
3038 msgstr ""
3039
3040 #. type: TH
3041 #: build/C/man3/fseek.3:40
3042 #, no-wrap
3043 msgid "1993-11-29"
3044 msgstr ""
3045
3046 #. type: Plain text
3047 #: build/C/man3/fseek.3:43
3048 msgid "fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream"
3049 msgstr ""
3050
3051 #. type: Plain text
3052 #: build/C/man3/fseek.3:47
3053 msgid "B<int fseek(FILE *>I<stream>B<, long >I<offset>B<, int >I<whence>B<);>"
3054 msgstr ""
3055
3056 #. type: Plain text
3057 #: build/C/man3/fseek.3:49
3058 msgid "B<long ftell(FILE *>I<stream>B<);>"
3059 msgstr ""
3060
3061 #. type: Plain text
3062 #: build/C/man3/fseek.3:51
3063 msgid "B<void rewind(FILE *>I<stream>B<);>"
3064 msgstr ""
3065
3066 #. type: Plain text
3067 #: build/C/man3/fseek.3:53
3068 msgid "B<int fgetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3069 msgstr ""
3070
3071 #. type: Plain text
3072 #: build/C/man3/fseek.3:55
3073 msgid "B<int fsetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3074 msgstr ""
3075
3076 #. type: Plain text
3077 #: build/C/man3/fseek.3:79
3078 msgid ""
3079 "The B<fseek>()  function sets the file position indicator for the stream "
3080 "pointed to by I<stream>.  The new position, measured in bytes, is obtained "
3081 "by adding I<offset> bytes to the position specified by I<whence>.  If "
3082 "I<whence> is set to B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, the offset is "
3083 "relative to the start of the file, the current position indicator, or "
3084 "end-of-file, respectively.  A successful call to the B<fseek>()  function "
3085 "clears the end-of-file indicator for the stream and undoes any effects of "
3086 "the B<ungetc>(3)  function on the same stream."
3087 msgstr ""
3088
3089 #. type: Plain text
3090 #: build/C/man3/fseek.3:85
3091 msgid ""
3092 "The B<ftell>()  function obtains the current value of the file position "
3093 "indicator for the stream pointed to by I<stream>."
3094 msgstr ""
3095
3096 #. type: Plain text
3097 #: build/C/man3/fseek.3:92
3098 msgid ""
3099 "The B<rewind>()  function sets the file position indicator for the stream "
3100 "pointed to by I<stream> to the beginning of the file.  It is equivalent to:"
3101 msgstr ""
3102
3103 #. type: Plain text
3104 #: build/C/man3/fseek.3:95
3105 msgid "(void) fseek(stream, 0L, SEEK_SET)"
3106 msgstr ""
3107
3108 #. type: Plain text
3109 #: build/C/man3/fseek.3:99
3110 msgid ""
3111 "except that the error indicator for the stream is also cleared (see "
3112 "B<clearerr>(3))."
3113 msgstr ""
3114
3115 #. type: Plain text
3116 #: build/C/man3/fseek.3:117
3117 msgid ""
3118 "The B<fgetpos>()  and B<fsetpos>()  functions are alternate interfaces "
3119 "equivalent to B<ftell>()  and B<fseek>()  (with whence set to B<SEEK_SET>), "
3120 "setting and storing the current value of the file offset into or from the "
3121 "object referenced by I<pos>.  On some non-UNIX systems an I<fpos_t> object "
3122 "may be a complex object and these routines may be the only way to portably "
3123 "reposition a text stream."
3124 msgstr ""
3125
3126 #. type: Plain text
3127 #: build/C/man3/fseek.3:132
3128 msgid ""
3129 "The B<rewind>()  function returns no value.  Upon successful completion, "
3130 "B<fgetpos>(), B<fseek>(), B<fsetpos>()  return 0, and B<ftell>()  returns "
3131 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3132 "indicate the error."
3133 msgstr ""
3134
3135 #. type: Plain text
3136 #: build/C/man3/fseek.3:138
3137 msgid "The I<stream> specified is not a seekable stream."
3138 msgstr ""
3139
3140 #. type: Plain text
3141 #: build/C/man3/fseek.3:149
3142 msgid ""
3143 "The I<whence> argument to B<fseek>()  was not B<SEEK_SET>, B<SEEK_END>, or "
3144 "B<SEEK_CUR>."
3145 msgstr ""
3146
3147 #. type: Plain text
3148 #: build/C/man3/fseek.3:164
3149 msgid ""
3150 "The functions B<fgetpos>(), B<fseek>(), B<fsetpos>(), and B<ftell>()  may "
3151 "also fail and set I<errno> for any of the errors specified for the routines "
3152 "B<fflush>(3), B<fstat>(2), B<lseek>(2), and B<malloc>(3)."
3153 msgstr ""
3154
3155 #. type: Plain text
3156 #: build/C/man3/fseek.3:169
3157 msgid "B<lseek>(2), B<fseeko>(3)"
3158 msgstr ""
3159
3160 #. type: TH
3161 #: build/C/man3/fseeko.3:23
3162 #, no-wrap
3163 msgid "FSEEKO"
3164 msgstr ""
3165
3166 #. type: TH
3167 #: build/C/man3/fseeko.3:23
3168 #, no-wrap
3169 msgid "2001-11-05"
3170 msgstr ""
3171
3172 #. type: Plain text
3173 #: build/C/man3/fseeko.3:26
3174 msgid "fseeko, ftello - seek to or report file position"
3175 msgstr ""
3176
3177 #. type: Plain text
3178 #: build/C/man3/fseeko.3:31
3179 #, no-wrap
3180 msgid "B<int fseeko(FILE *>I<stream>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
3181 msgstr ""
3182
3183 #. type: Plain text
3184 #: build/C/man3/fseeko.3:34
3185 #, no-wrap
3186 msgid ""
3187 "B<off_t ftello(FILE *>I<stream>B<);>\n"
3188 "\n"
3189 msgstr ""
3190
3191 #. type: Plain text
3192 #: build/C/man3/fseeko.3:52
3193 msgid ""
3194 "The B<fseeko>()  and B<ftello>()  functions are identical to B<fseek>(3)  "
3195 "and B<ftell>(3)  (see B<fseek>(3)), respectively, except that the I<offset> "
3196 "argument of B<fseeko>()  and the return value of B<ftello>()  is of type "
3197 "I<off_t> instead of I<long>."
3198 msgstr ""
3199
3200 #. type: Plain text
3201 #: build/C/man3/fseeko.3:55
3202 msgid ""
3203 "On many architectures both I<off_t> and I<long> are 32-bit types, but "
3204 "compilation with"
3205 msgstr ""
3206
3207 #. type: Plain text
3208 #: build/C/man3/fseeko.3:59 build/C/man3/lseek64.3:79
3209 #, no-wrap
3210 msgid "#define _FILE_OFFSET_BITS 64\n"
3211 msgstr ""
3212
3213 #. type: Plain text
3214 #: build/C/man3/fseeko.3:63
3215 msgid "will turn I<off_t> into a 64-bit type."
3216 msgstr ""
3217
3218 #. type: Plain text
3219 #: build/C/man3/fseeko.3:72
3220 msgid ""
3221 "On successful completion, B<fseeko>()  returns 0, while B<ftello>()  returns "
3222 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3223 "indicate the error."
3224 msgstr ""
3225
3226 #. type: Plain text
3227 #: build/C/man3/fseeko.3:75
3228 msgid "See the ERRORS in B<fseek>(3)."
3229 msgstr ""
3230
3231 #. type: Plain text
3232 #: build/C/man3/fseeko.3:77
3233 msgid "SUSv2, POSIX.1-2001."
3234 msgstr ""
3235
3236 #. type: Plain text
3237 #: build/C/man3/fseeko.3:81
3238 msgid ""
3239 "These functions are found on System V-like systems.  They are not present in "
3240 "libc4, libc5, glibc 2.0 but are available since glibc 2.1."
3241 msgstr ""
3242
3243 #. type: Plain text
3244 #: build/C/man3/fseeko.3:83
3245 msgid "B<fseek>(3)"
3246 msgstr ""
3247
3248 #. type: TH
3249 #: build/C/man3/getline.3:24
3250 #, no-wrap
3251 msgid "GETLINE"
3252 msgstr ""
3253
3254 #. type: TH
3255 #: build/C/man3/getline.3:24
3256 #, no-wrap
3257 msgid "2010-06-12"
3258 msgstr ""
3259
3260 #. type: Plain text
3261 #: build/C/man3/getline.3:27
3262 msgid "getline, getdelim - delimited string input"
3263 msgstr ""
3264
3265 #. type: Plain text
3266 #: build/C/man3/getline.3:32
3267 #, no-wrap
3268 msgid ""
3269 "B<ssize_t getline(char **>I<lineptr>B<, size_t *>I<n>B<, FILE "
3270 "*>I<stream>B<);>\n"
3271 msgstr ""
3272
3273 #. type: Plain text
3274 #: build/C/man3/getline.3:35
3275 #, no-wrap
3276 msgid ""
3277 "B<ssize_t getdelim(char **>I<lineptr>B<, size_t *>I<n>B<, int >I<delim>B<, "
3278 "FILE *>I<stream>B<);>\n"
3279 msgstr ""
3280
3281 #. type: Plain text
3282 #: build/C/man3/getline.3:45
3283 msgid "B<getline>(), B<getdelim>():"
3284 msgstr ""
3285
3286 #. type: Plain text
3287 #: build/C/man3/getline.3:50
3288 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700"
3289 msgstr ""
3290
3291 #. type: Plain text
3292 #: build/C/man3/getline.3:63
3293 msgid ""
3294 "B<getline>()  reads an entire line from I<stream>, storing the address of "
3295 "the buffer containing the text into I<*lineptr>.  The buffer is "
3296 "null-terminated and includes the newline character, if one was found."
3297 msgstr ""
3298
3299 #. type: Plain text
3300 #: build/C/man3/getline.3:73
3301 msgid ""
3302 "If I<*lineptr> is NULL, then B<getline>()  will allocate a buffer for "
3303 "storing the line, which should be freed by the user program.  (In this case, "
3304 "the value in I<*n> is ignored.)"
3305 msgstr ""
3306
3307 #. type: Plain text
3308 #: build/C/man3/getline.3:91
3309 msgid ""
3310 "Alternatively, before calling B<getline>(), I<*lineptr> can contain a "
3311 "pointer to a B<malloc>(3)-allocated buffer I<*n> bytes in size.  If the "
3312 "buffer is not large enough to hold the line, B<getline>()  resizes it with "
3313 "B<realloc>(3), updating I<*lineptr> and I<*n> as necessary."
3314 msgstr ""
3315
3316 #. type: Plain text
3317 #: build/C/man3/getline.3:97
3318 msgid ""
3319 "In either case, on a successful call, I<*lineptr> and I<*n> will be updated "
3320 "to reflect the buffer address and allocated size respectively."
3321 msgstr ""
3322
3323 #. type: Plain text
3324 #: build/C/man3/getline.3:108
3325 msgid ""
3326 "B<getdelim>()  works like B<getline>(), except that a line delimiter other "
3327 "than newline can be specified as the I<delimiter> argument.  As with "
3328 "B<getline>(), a delimiter character is not added if one was not present in "
3329 "the input before end of file was reached."
3330 msgstr ""
3331
3332 #. type: Plain text
3333 #: build/C/man3/getline.3:117
3334 msgid ""
3335 "On success, B<getline>()  and B<getdelim>()  return the number of characters "
3336 "read, including the delimiter character, but not including the terminating "
3337 "null byte.  This value can be used to handle embedded null bytes in the line "
3338 "read."
3339 msgstr ""
3340
3341 #. type: Plain text
3342 #: build/C/man3/getline.3:120
3343 msgid ""
3344 "Both functions return -1 on failure to read a line (including end-of-file "
3345 "condition)."
3346 msgstr ""
3347
3348 #. type: Plain text
3349 #: build/C/man3/getline.3:130
3350 msgid "Bad arguments (I<n> or I<lineptr> is NULL, or I<stream> is not valid)."
3351 msgstr ""
3352
3353 #. type: Plain text
3354 #: build/C/man3/getline.3:132
3355 msgid "These functions are available since libc 4.6.27."
3356 msgstr ""
3357
3358 #. type: Plain text
3359 #: build/C/man3/getline.3:139
3360 msgid ""
3361 "Both B<getline>()  and B<getdelim>()  were originally GNU extensions.  They "
3362 "were standardized in POSIX.1-2008."
3363 msgstr ""
3364
3365 #. type: Plain text
3366 #: build/C/man3/getline.3:144
3367 #, no-wrap
3368 msgid ""
3369 "#define _GNU_SOURCE\n"
3370 "#include E<lt>stdio.hE<gt>\n"
3371 "#include E<lt>stdlib.hE<gt>\n"
3372 msgstr ""
3373
3374 #. type: Plain text
3375 #: build/C/man3/getline.3:152
3376 #, no-wrap
3377 msgid ""
3378 "int\n"
3379 "main(void)\n"
3380 "{\n"
3381 "    FILE *fp;\n"
3382 "    char *line = NULL;\n"
3383 "    size_t len = 0;\n"
3384 "    ssize_t read;\n"
3385 msgstr ""
3386
3387 #. type: Plain text
3388 #: build/C/man3/getline.3:156
3389 #, no-wrap
3390 msgid ""
3391 "    fp = fopen(\"/etc/motd\", \"r\");\n"
3392 "    if (fp == NULL)\n"
3393 "        exit(EXIT_FAILURE);\n"
3394 msgstr ""
3395
3396 #. type: Plain text
3397 #: build/C/man3/getline.3:161
3398 #, no-wrap
3399 msgid ""
3400 "    while ((read = getline(&line, &len, fp)) != -1) {\n"
3401 "        printf(\"Retrieved line of length %zu :\\en\", read);\n"
3402 "        printf(\"%s\", line);\n"
3403 "    }\n"
3404 msgstr ""
3405
3406 #. type: Plain text
3407 #: build/C/man3/getline.3:165
3408 #, no-wrap
3409 msgid ""
3410 "    free(line);\n"
3411 "    exit(EXIT_SUCCESS);\n"
3412 "}\n"
3413 msgstr ""
3414
3415 #. type: Plain text
3416 #: build/C/man3/getline.3:173
3417 msgid "B<read>(2), B<fgets>(3), B<fopen>(3), B<fread>(3), B<gets>(3), B<scanf>(3)"
3418 msgstr ""
3419
3420 #. type: TH
3421 #: build/C/man3/gets.3:25
3422 #, no-wrap
3423 msgid "GETS"
3424 msgstr ""
3425
3426 #. type: TH
3427 #: build/C/man3/gets.3:25 build/C/man3/printf.3:34 build/C/man3/puts.3:24 build/C/man3/scanf.3:50
3428 #, no-wrap
3429 msgid "2011-09-28"
3430 msgstr ""
3431
3432 #. type: Plain text
3433 #: build/C/man3/gets.3:28
3434 msgid "fgetc, fgets, getc, getchar, gets, ungetc - input of characters and strings"
3435 msgstr ""
3436
3437 #. type: Plain text
3438 #: build/C/man3/gets.3:33
3439 #, no-wrap
3440 msgid "B<int fgetc(FILE *>I<stream>B<);>\n"
3441 msgstr ""
3442
3443 #. type: Plain text
3444 #: build/C/man3/gets.3:35
3445 #, no-wrap
3446 msgid "B<char *fgets(char *>I<s>B<, int >I<size>B<, FILE *>I<stream>B<);>\n"
3447 msgstr ""
3448
3449 #. type: Plain text
3450 #: build/C/man3/gets.3:37
3451 #, no-wrap
3452 msgid "B<int getc(FILE *>I<stream>B<);>\n"
3453 msgstr ""
3454
3455 #. type: Plain text
3456 #: build/C/man3/gets.3:39
3457 #, no-wrap
3458 msgid "B<int getchar(void);>\n"
3459 msgstr ""
3460
3461 #. type: Plain text
3462 #: build/C/man3/gets.3:41
3463 #, no-wrap
3464 msgid "B<char *gets(char *>I<s>B<);>\n"
3465 msgstr ""
3466
3467 #. type: Plain text
3468 #: build/C/man3/gets.3:43
3469 #, no-wrap
3470 msgid "B<int ungetc(int >I<c>B<, FILE *>I<stream>B<);>\n"
3471 msgstr ""
3472
3473 #. type: Plain text
3474 #: build/C/man3/gets.3:55
3475 msgid ""
3476 "B<fgetc>()  reads the next character from I<stream> and returns it as an "
3477 "I<unsigned char> cast to an I<int>, or B<EOF> on end of file or error."
3478 msgstr ""
3479
3480 #. type: Plain text
3481 #: build/C/man3/gets.3:62
3482 msgid ""
3483 "B<getc>()  is equivalent to B<fgetc>()  except that it may be implemented as "
3484 "a macro which evaluates I<stream> more than once."
3485 msgstr ""
3486
3487 #. type: Plain text
3488 #: build/C/man3/gets.3:66
3489 msgid "B<getchar>()  is equivalent to B<getc(>I<stdin>B<)>."
3490 msgstr ""
3491
3492 #. type: Plain text
3493 #: build/C/man3/gets.3:76
3494 msgid ""
3495 "B<gets>()  reads a line from I<stdin> into the buffer pointed to by I<s> "
3496 "until either a terminating newline or B<EOF>, which it replaces with a null "
3497 "byte (\\(aq\\e0\\(aq).  No check for buffer overrun is performed (see BUGS "
3498 "below)."
3499 msgstr ""
3500
3501 #. type: Plain text
3502 #: build/C/man3/gets.3:90
3503 msgid ""
3504 "B<fgets>()  reads in at most one less than I<size> characters from I<stream> "
3505 "and stores them into the buffer pointed to by I<s>.  Reading stops after an "
3506 "B<EOF> or a newline.  If a newline is read, it is stored into the buffer.  A "
3507 "terminating null byte (\\(aq\\e0\\(aq)  is stored after the last character "
3508 "in the buffer."
3509 msgstr ""
3510
3511 #. type: Plain text
3512 #: build/C/man3/gets.3:101
3513 msgid ""
3514 "B<ungetc>()  pushes I<c> back to I<stream>, cast to I<unsigned char>, where "
3515 "it is available for subsequent read operations.  Pushed-back characters will "
3516 "be returned in reverse order; only one pushback is guaranteed."
3517 msgstr ""
3518
3519 #. type: Plain text
3520 #: build/C/man3/gets.3:106
3521 msgid ""
3522 "Calls to the functions described here can be mixed with each other and with "
3523 "calls to other input functions from the I<stdio> library for the same input "
3524 "stream."
3525 msgstr ""
3526
3527 #. type: Plain text
3528 #: build/C/man3/gets.3:121
3529 msgid ""
3530 "B<fgetc>(), B<getc>()  and B<getchar>()  return the character read as an "
3531 "I<unsigned char> cast to an I<int> or B<EOF> on end of file or error."
3532 msgstr ""
3533
3534 #. type: Plain text
3535 #: build/C/man3/gets.3:129
3536 msgid ""
3537 "B<gets>()  and B<fgets>()  return I<s> on success, and NULL on error or when "
3538 "end of file occurs while no characters have been read."
3539 msgstr ""
3540
3541 #. type: Plain text
3542 #: build/C/man3/gets.3:136
3543 msgid "B<ungetc>()  returns I<c> on success, or B<EOF> on error."
3544 msgstr ""
3545
3546 #. type: Plain text
3547 #: build/C/man3/gets.3:143
3548 msgid ""
3549 "C89, C99, POSIX.1-2001.  LSB deprecates B<gets>().  POSIX.1-2008 marks "
3550 "B<gets>()  obsolescent."
3551 msgstr ""
3552
3553 #. type: Plain text
3554 #: build/C/man3/gets.3:157
3555 msgid ""
3556 "Never use B<gets>().  Because it is impossible to tell without knowing the "
3557 "data in advance how many characters B<gets>()  will read, and because "
3558 "B<gets>()  will continue to store characters past the end of the buffer, it "
3559 "is extremely dangerous to use.  It has been used to break computer "
3560 "security.  Use B<fgets>()  instead."
3561 msgstr ""
3562
3563 #. type: Plain text
3564 #: build/C/man3/gets.3:164
3565 msgid ""
3566 "It is not advisable to mix calls to input functions from the I<stdio> "
3567 "library with low-level calls to B<read>(2)  for the file descriptor "
3568 "associated with the input stream; the results will be undefined and very "
3569 "probably not what you want."
3570 msgstr ""
3571
3572 #. type: Plain text
3573 #: build/C/man3/gets.3:179
3574 msgid ""
3575 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetwc>(3), B<fgetws>(3), "
3576 "B<fopen>(3), B<fread>(3), B<fseek>(3), B<getline>(3), B<getwchar>(3), "
3577 "B<puts>(3), B<scanf>(3), B<ungetwc>(3), B<unlocked_stdio>(3)"
3578 msgstr ""
3579
3580 #. type: TH
3581 #: build/C/man3/getw.3:23
3582 #, no-wrap
3583 msgid "GETW"
3584 msgstr ""
3585
3586 #. type: TH
3587 #: build/C/man3/getw.3:23
3588 #, no-wrap
3589 msgid "2010-09-26"
3590 msgstr ""
3591
3592 #. type: Plain text
3593 #: build/C/man3/getw.3:26
3594 msgid "getw, putw - input and output of words (ints)"
3595 msgstr ""
3596
3597 #. type: Plain text
3598 #: build/C/man3/getw.3:31
3599 #, no-wrap
3600 msgid "B<int getw(FILE *>I<stream>B<);>\n"
3601 msgstr ""
3602
3603 #. type: Plain text
3604 #: build/C/man3/getw.3:33
3605 #, no-wrap
3606 msgid "B<int putw(int >I<w>B<, FILE *>I<stream>B<);>\n"
3607 msgstr ""
3608
3609 #. type: Plain text
3610 #: build/C/man3/getw.3:42
3611 msgid "B<getw>(), B<putw>():"
3612 msgstr ""
3613
3614 #. type: TP
3615 #: build/C/man3/getw.3:45
3616 #, no-wrap
3617 msgid "Since glibc 2.3.3:"
3618 msgstr ""
3619
3620 #. type: Plain text
3621 #: build/C/man3/getw.3:48
3622 msgid "_SVID_SOURCE || _BSD_SOURCE ||"
3623 msgstr ""
3624
3625 #. type: Plain text
3626 #: build/C/man3/getw.3:51
3627 #, no-wrap
3628 msgid ""
3629 "(_XOPEN_SOURCE &&\n"
3630 "    !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600))\n"
3631 msgstr ""
3632
3633 #. type: TP
3634 #: build/C/man3/getw.3:51
3635 #, no-wrap
3636 msgid "Before glibc 2.3.3:"
3637 msgstr ""
3638
3639 #. type: Plain text
3640 #: build/C/man3/getw.3:54
3641 msgid "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE"
3642 msgstr ""
3643
3644 #. type: Plain text
3645 #: build/C/man3/getw.3:64
3646 msgid ""
3647 "B<getw>()  reads a word (that is, an I<int>) from I<stream>.  It's provided "
3648 "for compatibility with SVr4.  We recommend you use B<fread>(3)  instead."
3649 msgstr ""
3650
3651 #. type: Plain text
3652 #: build/C/man3/getw.3:71
3653 msgid ""
3654 "B<putw>()  writes the word I<w> (that is, an I<int>) to I<stream>.  It is "
3655 "provided for compatibility with SVr4, but we recommend you use B<fwrite>(3)  "
3656 "instead."
3657 msgstr ""
3658
3659 #. type: Plain text
3660 #: build/C/man3/getw.3:78
3661 msgid ""
3662 "Normally, B<getw>()  returns the word read, and B<putw>()  returns 0.  On "
3663 "error, they return B<EOF>."
3664 msgstr ""
3665
3666 #. type: Plain text
3667 #: build/C/man3/getw.3:80
3668 msgid "SVr4, SUSv2.  Not present in POSIX.1-2001."
3669 msgstr ""
3670
3671 #. type: Plain text
3672 #: build/C/man3/getw.3:84
3673 msgid ""
3674 "The value returned on error is also a legitimate data value.  B<ferror>(3)  "
3675 "can be used to distinguish between the two cases."
3676 msgstr ""
3677
3678 #. type: Plain text
3679 #: build/C/man3/getw.3:90
3680 msgid "B<ferror>(3), B<fread>(3), B<fwrite>(3), B<getc>(3), B<putc>(3)"
3681 msgstr ""
3682
3683 #. type: TH
3684 #: build/C/man2/link.2:31
3685 #, no-wrap
3686 msgid "LINK"
3687 msgstr ""
3688
3689 #. type: TH
3690 #: build/C/man2/link.2:31
3691 #, no-wrap
3692 msgid "2008-08-21"
3693 msgstr ""
3694
3695 #. type: Plain text
3696 #: build/C/man2/link.2:34
3697 msgid "link - make a new name for a file"
3698 msgstr ""
3699
3700 #. type: Plain text
3701 #: 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
3702 msgid "B<#include E<lt>unistd.hE<gt>>"
3703 msgstr ""
3704
3705 #. type: Plain text
3706 #: build/C/man2/link.2:38
3707 msgid "B<int link(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
3708 msgstr ""
3709
3710 #. type: Plain text
3711 #: build/C/man2/link.2:41
3712 msgid ""
3713 "B<link>()  creates a new link (also known as a hard link) to an existing "
3714 "file."
3715 msgstr ""
3716
3717 #. type: Plain text
3718 #: build/C/man2/link.2:47 build/C/man2/symlink.2:84
3719 msgid "If I<newpath> exists it will I<not> be overwritten."
3720 msgstr ""
3721
3722 #. type: Plain text
3723 #: build/C/man2/link.2:52
3724 msgid ""
3725 "This new name may be used exactly as the old one for any operation; both "
3726 "names refer to the same file (and so have the same permissions and "
3727 "ownership) and it is impossible to tell which name was the \"original\"."
3728 msgstr ""
3729
3730 #. type: Plain text
3731 #: build/C/man2/link.2:57 build/C/man2/pipe.2:96 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
3732 msgid ""
3733 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
3734 "appropriately."
3735 msgstr ""
3736
3737 #. type: TP
3738 #: build/C/man2/link.2:58 build/C/man2/open.2:475 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
3739 #, no-wrap
3740 msgid "B<EACCES>"
3741 msgstr ""
3742
3743 #. type: Plain text
3744 #: build/C/man2/link.2:69
3745 msgid ""
3746 "Write access to the directory containing I<newpath> is denied, or search "
3747 "permission is denied for one of the directories in the path prefix of "
3748 "I<oldpath> or I<newpath>.  (See also B<path_resolution>(7).)"
3749 msgstr ""
3750
3751 #. type: TP
3752 #: build/C/man2/link.2:69 build/C/man2/open.2:484 build/C/man2/symlink.2:99 build/C/man3/tmpfile.3:56
3753 #, no-wrap
3754 msgid "B<EEXIST>"
3755 msgstr ""
3756
3757 #. type: Plain text
3758 #: build/C/man2/link.2:73 build/C/man2/symlink.2:103
3759 msgid "I<newpath> already exists."
3760 msgstr ""
3761
3762 #. type: TP
3763 #: build/C/man2/link.2:73 build/C/man2/llseek.2:69 build/C/man2/open.2:490 build/C/man2/pipe.2:97 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
3764 #, no-wrap
3765 msgid "B<EFAULT>"
3766 msgstr ""
3767
3768 #. type: Plain text
3769 #: build/C/man2/link.2:76 build/C/man2/rename.2:136 build/C/man2/symlink.2:106
3770 msgid "I<oldpath> or I<newpath> points outside your accessible address space."
3771 msgstr ""
3772
3773 #. type: TP
3774 #: 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
3775 #, no-wrap
3776 msgid "B<EIO>"
3777 msgstr ""
3778
3779 #. type: Plain text
3780 #: build/C/man2/link.2:79 build/C/man2/symlink.2:109 build/C/man2/unlink.2:87
3781 msgid "An I/O error occurred."
3782 msgstr ""
3783
3784 #. type: TP
3785 #: build/C/man2/link.2:79 build/C/man2/open.2:514 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
3786 #, no-wrap
3787 msgid "B<ELOOP>"
3788 msgstr ""
3789
3790 #. type: Plain text
3791 #: build/C/man2/link.2:83 build/C/man2/rename.2:150
3792 msgid ""
3793 "Too many symbolic links were encountered in resolving I<oldpath> or "
3794 "I<newpath>."
3795 msgstr ""
3796
3797 #. type: TP
3798 #: build/C/man2/link.2:83 build/C/man2/rename.2:150
3799 #, no-wrap
3800 msgid "B<EMLINK>"
3801 msgstr ""
3802
3803 #. type: Plain text
3804 #: build/C/man2/link.2:88
3805 msgid ""
3806 "The file referred to by I<oldpath> already has the maximum number of links "
3807 "to it."
3808 msgstr ""
3809
3810 #. type: TP
3811 #: build/C/man2/link.2:88 build/C/man2/open.2:524 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
3812 #, no-wrap
3813 msgid "B<ENAMETOOLONG>"
3814 msgstr ""
3815
3816 #. type: Plain text
3817 #: build/C/man2/link.2:91 build/C/man2/rename.2:160 build/C/man2/symlink.2:116
3818 msgid "I<oldpath> or I<newpath> was too long."
3819 msgstr ""
3820
3821 #. type: TP
3822 #: build/C/man2/link.2:91 build/C/man2/open.2:538 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
3823 #, no-wrap
3824 msgid "B<ENOENT>"
3825 msgstr ""
3826
3827 #. type: Plain text
3828 #: build/C/man2/link.2:96
3829 msgid ""
3830 "A directory component in I<oldpath> or I<newpath> does not exist or is a "
3831 "dangling symbolic link."
3832 msgstr ""
3833
3834 #. type: TP
3835 #: build/C/man2/link.2:96 build/C/man2/open.2:545 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
3836 #, no-wrap
3837 msgid "B<ENOMEM>"
3838 msgstr ""
3839
3840 #. type: Plain text
3841 #: build/C/man2/link.2:99 build/C/man2/open.2:548 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
3842 msgid "Insufficient kernel memory was available."
3843 msgstr ""
3844
3845 #. type: TP
3846 #: build/C/man2/link.2:99 build/C/man2/open.2:548 build/C/man2/rename.2:176 build/C/man2/symlink.2:126 build/C/man3/tmpfile.3:68 build/C/man2/write.2:162
3847 #, no-wrap
3848 msgid "B<ENOSPC>"
3849 msgstr ""
3850
3851 #. type: Plain text
3852 #: build/C/man2/link.2:103 build/C/man2/rename.2:180 build/C/man2/symlink.2:130
3853 msgid "The device containing the file has no room for the new directory entry."
3854 msgstr ""
3855
3856 #. type: TP
3857 #: build/C/man2/link.2:103 build/C/man2/open.2:554 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
3858 #, no-wrap
3859 msgid "B<ENOTDIR>"
3860 msgstr ""
3861
3862 #. type: Plain text
3863 #: build/C/man2/link.2:108
3864 msgid ""
3865 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
3866 "a directory."
3867 msgstr ""
3868
3869 #. type: TP
3870 #: build/C/man2/link.2:108 build/C/man2/link.2:112 build/C/man2/open.2:587 build/C/man2/rmdir.2:107 build/C/man2/rmdir.2:118 build/C/man2/symlink.2:135 build/C/man2/unlink.2:114
3871 #, no-wrap
3872 msgid "B<EPERM>"
3873 msgstr ""
3874
3875 #. type: Plain text
3876 #: build/C/man2/link.2:112
3877 msgid "I<oldpath> is a directory."
3878 msgstr ""
3879
3880 #. type: Plain text
3881 #: build/C/man2/link.2:117
3882 msgid ""
3883 "The file system containing I<oldpath> and I<newpath> does not support the "
3884 "creation of hard links."
3885 msgstr ""
3886
3887 #. type: TP
3888 #: build/C/man2/link.2:117 build/C/man2/open.2:595 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
3889 #, no-wrap
3890 msgid "B<EROFS>"
3891 msgstr ""
3892
3893 #. type: Plain text
3894 #: build/C/man2/link.2:120 build/C/man2/rename.2:221
3895 msgid "The file is on a read-only file system."
3896 msgstr ""
3897
3898 #. type: TP
3899 #: build/C/man2/link.2:120 build/C/man2/rename.2:221
3900 #, no-wrap
3901 msgid "B<EXDEV>"
3902 msgstr ""
3903
3904 #. type: Plain text
3905 #: build/C/man2/link.2:128
3906 msgid ""
3907 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
3908 "permits a file system to be mounted at multiple points, but B<link>()  does "
3909 "not work across different mount points, even if the same file system is "
3910 "mounted on both.)"
3911 msgstr ""
3912
3913 #.  SVr4 documents additional ENOLINK and
3914 #.  EMULTIHOP error conditions; POSIX.1 does not document ELOOP.
3915 #.  X/OPEN does not document EFAULT, ENOMEM or EIO.
3916 #. type: Plain text
3917 #: build/C/man2/link.2:133
3918 msgid "SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES)."
3919 msgstr ""
3920
3921 #. type: Plain text
3922 #: build/C/man2/link.2:140
3923 msgid ""
3924 "Hard links, as created by B<link>(), cannot span file systems.  Use "
3925 "B<symlink>(2)  if this is required."
3926 msgstr ""
3927
3928 #.  more precisely: since kernel 1.3.56
3929 #.  For example, the default Solaris compilation environment
3930 #.  behaves like Linux, and contributors to a March 2005
3931 #.  thread in the Austin mailing list reported that some
3932 #.  other (System V) implementations did/do the same -- MTK, Apr 05
3933 #. type: Plain text
3934 #: build/C/man2/link.2:171
3935 msgid ""
3936 "POSIX.1-2001 says that B<link>()  should dereference I<oldpath> if it is a "
3937 "symbolic link.  However, since kernel 2.0, Linux does not do so: if "
3938 "I<oldpath> is a symbolic link, then I<newpath> is created as a (hard) link "
3939 "to the same symbolic link file (i.e., I<newpath> becomes a symbolic link to "
3940 "the same file that I<oldpath> refers to).  Some other implementations behave "
3941 "in the same manner as Linux.  POSIX.1-2008 changes the specification of "
3942 "B<link>(), making it implementation-dependent whether or not I<oldpath> is "
3943 "dereferenced if it is a symbolic link.  For precise control over the "
3944 "treatment of symbolic links when creating a link, see B<linkat>(2)."
3945 msgstr ""
3946
3947 #. type: Plain text
3948 #: build/C/man2/link.2:177
3949 msgid ""
3950 "On NFS file systems, the return code may be wrong in case the NFS server "
3951 "performs the link creation and dies before it can say so.  Use B<stat>(2)  "
3952 "to find out if the link got created."
3953 msgstr ""
3954
3955 #. type: Plain text
3956 #: build/C/man2/link.2:187
3957 msgid ""
3958 "B<ln>(1), B<linkat>(2), B<open>(2), B<rename>(2), B<stat>(2), B<symlink>(2), "
3959 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
3960 msgstr ""
3961
3962 #. type: TH
3963 #: build/C/man2/llseek.2:26
3964 #, no-wrap
3965 msgid "LLSEEK"
3966 msgstr ""
3967
3968 #. type: TH
3969 #: build/C/man2/llseek.2:26
3970 #, no-wrap
3971 msgid "2007-06-01"
3972 msgstr ""
3973
3974 #. type: Plain text
3975 #: build/C/man2/llseek.2:29
3976 msgid "_llseek - reposition read/write file offset"
3977 msgstr ""
3978
3979 #. type: Plain text
3980 #: build/C/man2/llseek.2:33
3981 #, no-wrap
3982 msgid ""
3983 "B<#include E<lt>sys/types.hE<gt>>\n"
3984 "B<#include E<lt>unistd.hE<gt>>\n"
3985 msgstr ""
3986
3987 #. type: Plain text
3988 #: build/C/man2/llseek.2:37
3989 #, no-wrap
3990 msgid ""
3991 "B<int _llseek(unsigned int >I<fd>B<, unsigned long >I<offset_high>B<,>\n"
3992 "B<            unsigned long >I<offset_low>B<, loff_t *>I<result>B<,>\n"
3993 "B<            unsigned int >I<whence>B<);>\n"
3994 msgstr ""
3995
3996 #. type: Plain text
3997 #: build/C/man2/llseek.2:57
3998 msgid ""
3999 "The B<_llseek>()  function repositions the offset of the open file "
4000 "associated with the file descriptor I<fd> to I<(offset_highE<lt>E<lt>32) | "
4001 "offset_low> bytes relative to the beginning of the file, the current "
4002 "position in the file, or the end of the file, depending on whether I<whence> "
4003 "is B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively.  It returns the "
4004 "resulting file position in the argument I<result>."
4005 msgstr ""
4006
4007 #. type: Plain text
4008 #: build/C/man2/llseek.2:64
4009 msgid ""
4010 "Upon successful completion, B<_llseek>()  returns 0.  Otherwise, a value of "
4011 "-1 is returned and I<errno> is set to indicate the error."
4012 msgstr ""
4013
4014 #. type: Plain text
4015 #: build/C/man2/llseek.2:69 build/C/man2/lseek.2:164
4016 msgid "I<fd> is not an open file descriptor."
4017 msgstr ""
4018
4019 #. type: Plain text
4020 #: build/C/man2/llseek.2:72
4021 msgid "Problem with copying results to user space."
4022 msgstr ""
4023
4024 #. type: Plain text
4025 #: build/C/man2/llseek.2:76
4026 msgid "I<whence> is invalid."
4027 msgstr ""
4028
4029 #. type: Plain text
4030 #: build/C/man2/llseek.2:79
4031 msgid ""
4032 "This function is Linux-specific, and should not be used in programs intended "
4033 "to be portable."
4034 msgstr ""
4035
4036 #. type: Plain text
4037 #: build/C/man2/llseek.2:82
4038 msgid ""
4039 "Glibc does not provide a wrapper for this system call; call it using "
4040 "B<syscall>(2)."
4041 msgstr ""
4042
4043 #. type: Plain text
4044 #: build/C/man2/llseek.2:85
4045 msgid "B<lseek>(2), B<lseek64>(3)"
4046 msgstr ""
4047
4048 #. type: TH
4049 #: build/C/man2/lseek.2:45
4050 #, no-wrap
4051 msgid "LSEEK"
4052 msgstr ""
4053
4054 #. type: TH
4055 #: build/C/man2/lseek.2:45
4056 #, no-wrap
4057 msgid "2011-09-25"
4058 msgstr ""
4059
4060 #. type: Plain text
4061 #: build/C/man2/lseek.2:48
4062 msgid "lseek - reposition read/write file offset"
4063 msgstr ""
4064
4065 #. type: Plain text
4066 #: build/C/man2/lseek.2:50 build/C/man3/lseek64.3:30
4067 msgid "B<#include E<lt>sys/types.hE<gt>>"
4068 msgstr ""
4069
4070 #. type: Plain text
4071 #: build/C/man2/lseek.2:54
4072 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>"
4073 msgstr ""
4074
4075 #. type: Plain text
4076 #: build/C/man2/lseek.2:65
4077 msgid ""
4078 "The B<lseek>()  function repositions the offset of the open file associated "
4079 "with the file descriptor I<fd> to the argument I<offset> according to the "
4080 "directive I<whence> as follows:"
4081 msgstr ""
4082
4083 #. type: Plain text
4084 #: build/C/man2/lseek.2:70
4085 msgid "The offset is set to I<offset> bytes."
4086 msgstr ""
4087
4088 #. type: Plain text
4089 #: build/C/man2/lseek.2:75
4090 msgid "The offset is set to its current location plus I<offset> bytes."
4091 msgstr ""
4092
4093 #. type: Plain text
4094 #: build/C/man2/lseek.2:80
4095 msgid "The offset is set to the size of the file plus I<offset> bytes."
4096 msgstr ""
4097
4098 #. type: Plain text
4099 #: build/C/man2/lseek.2:88
4100 msgid ""
4101 "The B<lseek>()  function allows the file offset to be set beyond the end of "
4102 "the file (but this does not change the size of the file).  If data is later "
4103 "written at this point, subsequent reads of the data in the gap (a \"hole\") "
4104 "return null bytes (\\(aq\\e0\\(aq) until data is actually written into the "
4105 "gap."
4106 msgstr ""
4107
4108 #. type: SS
4109 #: build/C/man2/lseek.2:88
4110 #, no-wrap
4111 msgid "Seeking file data and holes"
4112 msgstr ""
4113
4114 #. type: Plain text
4115 #: build/C/man2/lseek.2:91
4116 msgid ""
4117 "Since version 3.1, Linux supports the following additional values for "
4118 "I<whence>:"
4119 msgstr ""
4120
4121 #. type: TP
4122 #: build/C/man2/lseek.2:91
4123 #, no-wrap
4124 msgid "B<SEEK_DATA>"
4125 msgstr ""
4126
4127 #. type: Plain text
4128 #: build/C/man2/lseek.2:102
4129 msgid ""
4130 "Adjust the file offset to the next location in the file greater than or "
4131 "equal to I<offset> containing data.  If I<offset> points to data, then the "
4132 "file offset is set to I<offset>."
4133 msgstr ""
4134
4135 #. type: TP
4136 #: build/C/man2/lseek.2:102
4137 #, no-wrap
4138 msgid "B<SEEK_HOLE>"
4139 msgstr ""
4140
4141 #. type: Plain text
4142 #: build/C/man2/lseek.2:116
4143 msgid ""
4144 "Adjust the file offset to the next hole in the file greater than or equal to "
4145 "I<offset>.  If I<offset> points into the middle of a hole, then the file "
4146 "offset is set to I<offset>.  If there is no hole past I<offset>, then the "
4147 "file offset is adjusted to the end of the file (i.e., there is an implicit "
4148 "hole at the end of any file)."
4149 msgstr ""
4150
4151 #. type: Plain text
4152 #: build/C/man2/lseek.2:122
4153 msgid ""
4154 "In both of the above cases, B<lseek>()  fails if I<offset> points past the "
4155 "end of the file."
4156 msgstr ""
4157
4158 #. type: Plain text
4159 #: build/C/man2/lseek.2:128
4160 msgid ""
4161 "These operations allow applications to map holes in a sparsely allocated "
4162 "file.  This can be useful for applications such as file backup tools, which "
4163 "can save space when creating backups and preserve holes, if they have a "
4164 "mechanism for discovering holes."
4165 msgstr ""
4166
4167 #.  https://lkml.org/lkml/2011/4/22/79
4168 #.  http://lwn.net/Articles/440255/
4169 #.  http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
4170 #. type: Plain text
4171 #: build/C/man2/lseek.2:151
4172 msgid ""
4173 "For the purposes of these operations, a hole is a sequence of zeros that "
4174 "(normally) has not been allocated in the underlying file storage.  However, "
4175 "a file system is not obliged to report holes, so these operations are not a "
4176 "guaranteed mechanism for mapping the storage space actually allocated to a "
4177 "file.  (Furthermore, a sequence of zeros that actually has been written to "
4178 "the underlying storage may not be reported as a hole.)  In the simplest "
4179 "implementation, a file system can support the operations by making "
4180 "B<SEEK_HOLE> always return the offset of the end of the file, and making "
4181 "B<SEEK_DATA> always return I<offset> (i.e., even if the location referred to "
4182 "by I<offset> is a hole, it can be considered to consist of data that is a "
4183 "sequence of zeros)."
4184 msgstr ""
4185
4186 #. type: Plain text
4187 #: build/C/man2/lseek.2:159
4188 msgid ""
4189 "Upon successful completion, B<lseek>()  returns the resulting offset "
4190 "location as measured in bytes from the beginning of the file.  On error, the "
4191 "value I<(off_t)\\ -1> is returned and I<errno> is set to indicate the error."
4192 msgstr ""
4193
4194 #.  Some systems may allow negative offsets for character devices
4195 #.  and/or for remote file systems.
4196 #. type: Plain text
4197 #: build/C/man2/lseek.2:172
4198 msgid ""
4199 "I<whence> is not valid.  Or: the resulting file offset would be negative, or "
4200 "beyond the end of a seekable device."
4201 msgstr ""
4202
4203 #. type: TP
4204 #: build/C/man2/lseek.2:172 build/C/man2/open.2:567
4205 #, no-wrap
4206 msgid "B<EOVERFLOW>"
4207 msgstr ""
4208
4209 #.  HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
4210 #. type: Plain text
4211 #: build/C/man2/lseek.2:177
4212 msgid "The resulting file offset cannot be represented in an I<off_t>."
4213 msgstr ""
4214
4215 #. type: TP
4216 #: build/C/man2/lseek.2:177
4217 #, no-wrap
4218 msgid "B<ESPIPE>"
4219 msgstr ""
4220
4221 #. type: Plain text
4222 #: build/C/man2/lseek.2:181
4223 msgid "I<fd> is associated with a pipe, socket, or FIFO."
4224 msgstr ""
4225
4226 #. type: TP
4227 #: build/C/man2/lseek.2:181 build/C/man2/open.2:561
4228 #, no-wrap
4229 msgid "B<ENXIO>"
4230 msgstr ""
4231
4232 #. type: Plain text
4233 #: build/C/man2/lseek.2:189
4234 msgid ""
4235 "I<whence> is B<SEEK_DATA> or B<SEEK_HOLE>, and the current file offset is "
4236 "beyond the end of the file."
4237 msgstr ""
4238
4239 #.  SVr4 documents additional error
4240 #.  conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE.
4241 #. type: Plain text
4242 #: 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
4243 msgid "SVr4, 4.3BSD, POSIX.1-2001."
4244 msgstr ""
4245
4246 #.  FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
4247 #. type: Plain text
4248 #: build/C/man2/lseek.2:199
4249 msgid ""
4250 "B<SEEK_DATA> and B<SEEK_HOLE> are nonstandard extensions also present in "
4251 "Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the "
4252 "next POSIX revision (Issue 8)."
4253 msgstr ""
4254
4255 #. type: Plain text
4256 #: build/C/man2/lseek.2:203
4257 msgid ""
4258 "Some devices are incapable of seeking and POSIX does not specify which "
4259 "devices must support B<lseek>()."
4260 msgstr ""
4261
4262 #.  Other systems return the number of written characters,
4263 #.  using SEEK_SET to set the counter. (Of written characters.)
4264 #. type: Plain text
4265 #: build/C/man2/lseek.2:210
4266 msgid "On Linux, using B<lseek>()  on a tty device returns B<ESPIPE>."
4267 msgstr ""
4268
4269 #. type: Plain text
4270 #: build/C/man2/lseek.2:213
4271 msgid ""
4272 "When converting old code, substitute values for I<whence> with the following "
4273 "macros:"
4274 msgstr ""
4275
4276 #. type: tbl table
4277 #: build/C/man2/lseek.2:216
4278 #, no-wrap
4279 msgid "old\tnew\n"
4280 msgstr ""
4281
4282 #. type: tbl table
4283 #: build/C/man2/lseek.2:217
4284 #, no-wrap
4285 msgid "0\tSEEK_SET\n"
4286 msgstr ""
4287
4288 #. type: tbl table
4289 #: build/C/man2/lseek.2:218
4290 #, no-wrap
4291 msgid "1\tSEEK_CUR\n"
4292 msgstr ""
4293
4294 #. type: tbl table
4295 #: build/C/man2/lseek.2:219
4296 #, no-wrap
4297 msgid "2\tSEEK_END\n"
4298 msgstr ""
4299
4300 #. type: tbl table
4301 #: build/C/man2/lseek.2:220
4302 #, no-wrap
4303 msgid "L_SET\tSEEK_SET\n"
4304 msgstr ""
4305
4306 #. type: tbl table
4307 #: build/C/man2/lseek.2:221
4308 #, no-wrap
4309 msgid "L_INCR\tSEEK_CUR\n"
4310 msgstr ""
4311
4312 #. type: tbl table
4313 #: build/C/man2/lseek.2:222
4314 #, no-wrap
4315 msgid "L_XTND\tSEEK_END\n"
4316 msgstr ""
4317
4318 #. type: Plain text
4319 #: build/C/man2/lseek.2:234
4320 msgid ""
4321 "Note that file descriptors created by B<dup>(2)  or B<fork>(2)  share the "
4322 "current file position pointer, so seeking on such files may be subject to "
4323 "race conditions."
4324 msgstr ""
4325
4326 #. type: Plain text
4327 #: build/C/man2/lseek.2:241
4328 msgid ""
4329 "B<dup>(2), B<fork>(2), B<open>(2), B<fseek>(3), B<lseek64>(3), "
4330 "B<posix_fallocate>(3)"
4331 msgstr ""
4332
4333 #. type: TH
4334 #: build/C/man3/lseek64.3:23
4335 #, no-wrap
4336 msgid "LSEEK64"
4337 msgstr ""
4338
4339 #. type: TH
4340 #: build/C/man3/lseek64.3:23
4341 #, no-wrap
4342 msgid "2004-12-11"
4343 msgstr ""
4344
4345 #. type: Plain text
4346 #: build/C/man3/lseek64.3:26
4347 msgid "lseek64 - reposition 64-bit read/write file offset"
4348 msgstr ""
4349
4350 #. type: Plain text
4351 #: build/C/man3/lseek64.3:28
4352 msgid "B<#define _LARGEFILE64_SOURCE> /* See feature_test_macros(7) */"
4353 msgstr ""
4354
4355 #. type: Plain text
4356 #: build/C/man3/lseek64.3:34
4357 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>"
4358 msgstr ""
4359
4360 #. type: Plain text
4361 #: build/C/man3/lseek64.3:51
4362 msgid ""
4363 "The B<lseek>(2)  family of functions reposition the offset of the open file "
4364 "associated with the file descriptor I<fd> to I<offset> bytes relative to the "
4365 "start, current position, or end of the file, when I<whence> has the value "
4366 "B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively."
4367 msgstr ""
4368
4369 #. type: Plain text
4370 #: build/C/man3/lseek64.3:54
4371 msgid "For more details, return value, and errors, see B<lseek>(2)."
4372 msgstr ""
4373
4374 #. type: Plain text
4375 #: build/C/man3/lseek64.3:61
4376 msgid ""
4377 "Four interfaces are available: B<lseek>(2), B<lseek64>(), B<llseek>(2), and "
4378 "the raw system call B<_llseek>(2)."
4379 msgstr ""
4380
4381 #. type: SS
4382 #: build/C/man3/lseek64.3:61
4383 #, no-wrap
4384 msgid "lseek"
4385 msgstr ""
4386
4387 #. type: Plain text
4388 #: build/C/man3/lseek64.3:63 build/C/man3/lseek64.3:85 build/C/man3/lseek64.3:114
4389 msgid "Prototype:"
4390 msgstr ""
4391
4392 #. type: Plain text
4393 #: build/C/man3/lseek64.3:67
4394 #, no-wrap
4395 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
4396 msgstr ""
4397
4398 #. type: Plain text
4399 #: build/C/man3/lseek64.3:75
4400 msgid ""
4401 "B<lseek>(2)  uses the type I<off_t>.  This is a 32-bit signed type on 32-bit "
4402 "architectures, unless one compiles with"
4403 msgstr ""
4404
4405 #. type: Plain text
4406 #: build/C/man3/lseek64.3:83
4407 msgid "in which case it is a 64-bit signed type."
4408 msgstr ""
4409
4410 #. type: SS
4411 #: build/C/man3/lseek64.3:83
4412 #, no-wrap
4413 msgid "lseek64"
4414 msgstr ""
4415
4416 #. type: Plain text
4417 #: build/C/man3/lseek64.3:89
4418 #, no-wrap
4419 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>\n"
4420 msgstr ""
4421
4422 #. type: Plain text
4423 #: build/C/man3/lseek64.3:100
4424 msgid ""
4425 "The library routine B<lseek64>()  uses a 64-bit type even when I<off_t> is a "
4426 "32-bit type.  Its prototype (and the type I<off64_t>)  is available only "
4427 "when one compiles with"
4428 msgstr ""
4429
4430 #. type: Plain text
4431 #: build/C/man3/lseek64.3:104
4432 #, no-wrap
4433 msgid "#define _LARGEFILE64_SOURCE\n"
4434 msgstr ""
4435
4436 #.  in glibc 2.0.94, not in 2.0.6
4437 #. type: Plain text
4438 #: build/C/man3/lseek64.3:112
4439 msgid ""
4440 "The function B<lseek64>()  is available since glibc 2.1, and is defined to "
4441 "be an alias for B<llseek>()."
4442 msgstr ""
4443
4444 #. type: SS
4445 #: build/C/man3/lseek64.3:112
4446 #, no-wrap
4447 msgid "llseek"
4448 msgstr ""
4449
4450 #. type: Plain text
4451 #: build/C/man3/lseek64.3:118
4452 #, no-wrap
4453 msgid "B<loff_t llseek(int >I<fd>B<, loff_t >I<offset>B<, int >I<whence>B<);>\n"
4454 msgstr ""
4455
4456 #.  in libc 5.0.9, not in 4.7.6
4457 #. type: Plain text
4458 #: build/C/man3/lseek64.3:137
4459 msgid ""
4460 "The type I<loff_t> is a 64-bit signed type.  The library routine B<llseek>()  "
4461 "is available in libc5 and glibc and works without special defines.  Its "
4462 "prototype was given in I<E<lt>unistd.hE<gt>> with libc5, but glibc does not "
4463 "provide a prototype.  This is bad, since a prototype is needed.  Users "
4464 "should add the above prototype, or something equivalent, to their own "
4465 "source.  When users complained about data loss caused by a miscompilation of "
4466 "B<e2fsck>(8), glibc 2.1.3 added the link-time warning"
4467 msgstr ""
4468
4469 #. type: Plain text
4470 #: build/C/man3/lseek64.3:140
4471 msgid "the \\`llseek\\' function may be dangerous; use \\`lseek64\\' instead."
4472 msgstr ""
4473
4474 #. type: Plain text
4475 #: build/C/man3/lseek64.3:144
4476 msgid "This makes this function unusable if one desires a warning-free compilation."
4477 msgstr ""
4478
4479 #. type: SS
4480 #: build/C/man3/lseek64.3:144
4481 #, no-wrap
4482 msgid "_llseek"
4483 msgstr ""
4484
4485 #. type: Plain text
4486 #: build/C/man3/lseek64.3:147
4487 msgid ""
4488 "All the above functions are implemented in terms of this system call.  The "
4489 "prototype is:"
4490 msgstr ""
4491
4492 #. type: Plain text
4493 #: build/C/man3/lseek64.3:152
4494 #, no-wrap
4495 msgid ""
4496 "B<int _llseek(int >I<fd>B<, off_t >I<offset_hi>B<, off_t >I<offset_lo>B<,>\n"
4497 "B<            loff_t *>I<result>B<, int >I<whence>B<);>\n"
4498 msgstr ""
4499
4500 #. type: Plain text
4501 #: build/C/man3/lseek64.3:157
4502 msgid "For more details, see B<llseek>(2)."
4503 msgstr ""
4504
4505 #. type: Plain text
4506 #: build/C/man3/lseek64.3:160
4507 msgid "B<llseek>(2), B<lseek>(2)"
4508 msgstr ""
4509
4510 #. type: TH
4511 #: build/C/man2/open.2:52
4512 #, no-wrap
4513 msgid "OPEN"
4514 msgstr ""
4515
4516 #. type: TH
4517 #: build/C/man2/open.2:52
4518 #, no-wrap
4519 msgid "2011-09-08"
4520 msgstr ""
4521
4522 #. type: Plain text
4523 #: build/C/man2/open.2:55
4524 msgid "open, creat - open and possibly create a file or device"
4525 msgstr ""
4526
4527 #. type: Plain text
4528 #: build/C/man2/open.2:60
4529 #, no-wrap
4530 msgid ""
4531 "B<#include E<lt>sys/types.hE<gt>>\n"
4532 "B<#include E<lt>sys/stat.hE<gt>>\n"
4533 "B<#include E<lt>fcntl.hE<gt>>\n"
4534 msgstr ""
4535
4536 #. type: Plain text
4537 #: build/C/man2/open.2:63
4538 #, no-wrap
4539 msgid ""
4540 "B<int open(const char *>I<pathname>B<, int >I<flags>B<);>\n"
4541 "B<int open(const char *>I<pathname>B<, int >I<flags>B<, mode_t "
4542 ">I<mode>B<);>\n"
4543 msgstr ""
4544
4545 #. type: Plain text
4546 #: build/C/man2/open.2:65
4547 #, no-wrap
4548 msgid "B<int creat(const char *>I<pathname>B<, mode_t >I<mode>B<);>\n"
4549 msgstr ""
4550
4551 #. type: Plain text
4552 #: build/C/man2/open.2:76
4553 msgid ""
4554 "Given a I<pathname> for a file, B<open>()  returns a file descriptor, a "
4555 "small, nonnegative integer for use in subsequent system calls (B<read>(2), "
4556 "B<write>(2), B<lseek>(2), B<fcntl>(2), etc.).  The file descriptor returned "
4557 "by a successful call will be the lowest-numbered file descriptor not "
4558 "currently open for the process."
4559 msgstr ""
4560
4561 #. type: Plain text
4562 #: build/C/man2/open.2:88
4563 msgid ""
4564 "By default, the new file descriptor is set to remain open across an "
4565 "B<execve>(2)  (i.e., the B<FD_CLOEXEC> file descriptor flag described in "
4566 "B<fcntl>(2)  is initially disabled; the B<O_CLOEXEC> flag, described below, "
4567 "can be used to change this default).  The file offset is set to the "
4568 "beginning of the file (see B<lseek>(2))."
4569 msgstr ""
4570
4571 #. type: Plain text
4572 #: build/C/man2/open.2:107
4573 msgid ""
4574 "A call to B<open>()  creates a new I<open file description>, an entry in the "
4575 "system-wide table of open files.  This entry records the file offset and the "
4576 "file status flags (modifiable via the B<fcntl>(2)  B<F_SETFL> operation).  A "
4577 "file descriptor is a reference to one of these entries; this reference is "
4578 "unaffected if I<pathname> is subsequently removed or modified to refer to a "
4579 "different file.  The new open file description is initially not shared with "
4580 "any other process, but sharing may arise via B<fork>(2)."
4581 msgstr ""
4582
4583 #. type: Plain text
4584 #: build/C/man2/open.2:115
4585 msgid ""
4586 "The argument I<flags> must include one of the following I<access modes>: "
4587 "B<O_RDONLY>, B<O_WRONLY>, or B<O_RDWR>.  These request opening the file "
4588 "read-only, write-only, or read/write, respectively."
4589 msgstr ""
4590
4591 #.  FIXME . Actually is it true that the "file status flags" are all of the
4592 #.  remaining flags listed below?  SUSv4 divides the flags into:
4593 #.  * Access mode
4594 #.  * File creation
4595 #.  * File status
4596 #.  * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW)
4597 #.  though it's not clear what the difference between "other" and
4598 #.  "File creation" flags is.  (I've raised an Aardvark to see if this
4599 #.  can be clarified in SUSv4; 10 Oct 2008.)
4600 #. type: Plain text
4601 #: build/C/man2/open.2:142
4602 msgid ""
4603 "In addition, zero or more file creation flags and file status flags can be "
4604 "bitwise-I<or>'d in I<flags>.  The I<file creation flags> are B<O_CREAT>, "
4605 "B<O_EXCL>, B<O_NOCTTY>, and B<O_TRUNC>.  The I<file status flags> are all of "
4606 "the remaining flags listed below.  The distinction between these two groups "
4607 "of flags is that the file status flags can be retrieved and (in some cases)  "
4608 "modified using B<fcntl>(2).  The full list of file creation flags and file "
4609 "status flags is as follows:"
4610 msgstr ""
4611
4612 #. type: TP
4613 #: build/C/man2/open.2:142
4614 #, no-wrap
4615 msgid "B<O_APPEND>"
4616 msgstr ""
4617
4618 #.  For more background, see
4619 #.  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946
4620 #.  http://nfs.sourceforge.net/
4621 #. type: Plain text
4622 #: build/C/man2/open.2:159
4623 msgid ""
4624 "The file is opened in append mode.  Before each B<write>(2), the file offset "
4625 "is positioned at the end of the file, as if with B<lseek>(2).  B<O_APPEND> "
4626 "may lead to corrupted files on NFS file systems if more than one process "
4627 "appends data to a file at once.  This is because NFS does not support "
4628 "appending to a file, so the client kernel has to simulate it, which can't be "
4629 "done without a race condition."
4630 msgstr ""
4631
4632 #. type: TP
4633 #: build/C/man2/open.2:159
4634 #, no-wrap
4635 msgid "B<O_ASYNC>"
4636 msgstr ""
4637
4638 #. type: Plain text
4639 #: build/C/man2/open.2:172
4640 msgid ""
4641 "Enable signal-driven I/O: generate a signal (B<SIGIO> by default, but this "
4642 "can be changed via B<fcntl>(2))  when input or output becomes possible on "
4643 "this file descriptor.  This feature is only available for terminals, "
4644 "pseudoterminals, sockets, and (since Linux 2.6) pipes and FIFOs.  See "
4645 "B<fcntl>(2)  for further details."
4646 msgstr ""
4647
4648 #. type: TP
4649 #: build/C/man2/open.2:172
4650 #, no-wrap
4651 msgid "B<O_CLOEXEC> (Since Linux 2.6.23)"
4652 msgstr ""
4653
4654 #.  This flag fixes only one form of the race condition;
4655 #.  The race can also occur with, for example, descriptors
4656 #.  returned by accept(), pipe(), etc.
4657 #. type: Plain text
4658 #: build/C/man2/open.2:197
4659 msgid ""
4660 "Enable the close-on-exec flag for the new file descriptor.  Specifying this "
4661 "flag permits a program to avoid additional B<fcntl>(2)  B<F_SETFD> "
4662 "operations to set the B<FD_CLOEXEC> flag.  Additionally, use of this flag is "
4663 "essential in some multithreaded programs since using a separate B<fcntl>(2)  "
4664 "B<F_SETFD> operation to set the B<FD_CLOEXEC> flag does not suffice to avoid "
4665 "race conditions where one thread opens a file descriptor at the same time as "
4666 "another thread does a B<fork>(2)  plus B<execve>(2)."
4667 msgstr ""
4668
4669 #. type: TP
4670 #: build/C/man2/open.2:197
4671 #, no-wrap
4672 msgid "B<O_CREAT>"
4673 msgstr ""
4674
4675 #.  As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
4676 #.  XFS (since 2.6.14).
4677 #. type: Plain text
4678 #: build/C/man2/open.2:213
4679 msgid ""
4680 "If the file does not exist it will be created.  The owner (user ID) of the "
4681 "file is set to the effective user ID of the process.  The group ownership "
4682 "(group ID) is set either to the effective group ID of the process or to the "
4683 "group ID of the parent directory (depending on file system type and mount "
4684 "options, and the mode of the parent directory, see the mount options "
4685 "I<bsdgroups> and I<sysvgroups> described in B<mount>(8))."
4686 msgstr ""
4687
4688 #. type: Plain text
4689 #: build/C/man2/open.2:236
4690 msgid ""
4691 "I<mode> specifies the permissions to use in case a new file is created.  "
4692 "This argument must be supplied when B<O_CREAT> is specified in I<flags>; if "
4693 "B<O_CREAT> is not specified, then I<mode> is ignored.  The effective "
4694 "permissions are modified by the process's I<umask> in the usual way: The "
4695 "permissions of the created file are I<(mode\\ &\\ ~umask)>.  Note that this "
4696 "mode only applies to future accesses of the newly created file; the "
4697 "B<open>()  call that creates a read-only file may well return a read/write "
4698 "file descriptor."
4699 msgstr ""
4700
4701 #. type: Plain text
4702 #: build/C/man2/open.2:239
4703 msgid "The following symbolic constants are provided for I<mode>:"
4704 msgstr ""
4705
4706 #. type: TP
4707 #: build/C/man2/open.2:239
4708 #, no-wrap
4709 msgid "B<S_IRWXU>"
4710 msgstr ""
4711
4712 #. type: Plain text
4713 #: build/C/man2/open.2:242
4714 msgid "00700 user (file owner) has read, write and execute permission"
4715 msgstr ""
4716
4717 #. type: TP
4718 #: build/C/man2/open.2:242
4719 #, no-wrap
4720 msgid "B<S_IRUSR>"
4721 msgstr ""
4722
4723 #. type: Plain text
4724 #: build/C/man2/open.2:245
4725 msgid "00400 user has read permission"
4726 msgstr ""
4727
4728 #. type: TP
4729 #: build/C/man2/open.2:245
4730 #, no-wrap
4731 msgid "B<S_IWUSR>"
4732 msgstr ""
4733
4734 #. type: Plain text
4735 #: build/C/man2/open.2:248
4736 msgid "00200 user has write permission"
4737 msgstr ""
4738
4739 #. type: TP
4740 #: build/C/man2/open.2:248
4741 #, no-wrap
4742 msgid "B<S_IXUSR>"
4743 msgstr ""
4744
4745 #. type: Plain text
4746 #: build/C/man2/open.2:251
4747 msgid "00100 user has execute permission"
4748 msgstr ""
4749
4750 #. type: TP
4751 #: build/C/man2/open.2:251
4752 #, no-wrap
4753 msgid "B<S_IRWXG>"
4754 msgstr ""
4755
4756 #. type: Plain text
4757 #: build/C/man2/open.2:254
4758 msgid "00070 group has read, write and execute permission"
4759 msgstr ""
4760
4761 #. type: TP
4762 #: build/C/man2/open.2:254
4763 #, no-wrap
4764 msgid "B<S_IRGRP>"
4765 msgstr ""
4766
4767 #. type: Plain text
4768 #: build/C/man2/open.2:257
4769 msgid "00040 group has read permission"
4770 msgstr ""
4771
4772 #. type: TP
4773 #: build/C/man2/open.2:257
4774 #, no-wrap
4775 msgid "B<S_IWGRP>"
4776 msgstr ""
4777
4778 #. type: Plain text
4779 #: build/C/man2/open.2:260
4780 msgid "00020 group has write permission"
4781 msgstr ""
4782
4783 #. type: TP
4784 #: build/C/man2/open.2:260
4785 #, no-wrap
4786 msgid "B<S_IXGRP>"
4787 msgstr ""
4788
4789 #. type: Plain text
4790 #: build/C/man2/open.2:263
4791 msgid "00010 group has execute permission"
4792 msgstr ""
4793
4794 #. type: TP
4795 #: build/C/man2/open.2:263
4796 #, no-wrap
4797 msgid "B<S_IRWXO>"
4798 msgstr ""
4799
4800 #. type: Plain text
4801 #: build/C/man2/open.2:266
4802 msgid "00007 others have read, write and execute permission"
4803 msgstr ""
4804
4805 #. type: TP
4806 #: build/C/man2/open.2:266
4807 #, no-wrap
4808 msgid "B<S_IROTH>"
4809 msgstr ""
4810
4811 #. type: Plain text
4812 #: build/C/man2/open.2:269
4813 msgid "00004 others have read permission"
4814 msgstr ""
4815
4816 #. type: TP
4817 #: build/C/man2/open.2:269
4818 #, no-wrap
4819 msgid "B<S_IWOTH>"
4820 msgstr ""
4821
4822 #. type: Plain text
4823 #: build/C/man2/open.2:272
4824 msgid "00002 others have write permission"
4825 msgstr ""
4826
4827 #. type: TP
4828 #: build/C/man2/open.2:272
4829 #, no-wrap
4830 msgid "B<S_IXOTH>"
4831 msgstr ""
4832
4833 #. type: Plain text
4834 #: build/C/man2/open.2:275
4835 msgid "00001 others have execute permission"
4836 msgstr ""
4837
4838 #. type: TP
4839 #: build/C/man2/open.2:276
4840 #, no-wrap
4841 msgid "B<O_DIRECT> (Since Linux 2.4.10)"
4842 msgstr ""
4843
4844 #. type: Plain text
4845 #: build/C/man2/open.2:295
4846 msgid ""
4847 "Try to minimize cache effects of the I/O to and from this file.  In general "
4848 "this will degrade performance, but it is useful in special situations, such "
4849 "as when applications do their own caching.  File I/O is done directly "
4850 "to/from user space buffers.  The B<O_DIRECT> flag on its own makes at an "
4851 "effort to transfer data synchronously, but does not give the guarantees of "
4852 "the B<O_SYNC> that data and necessary metadata are transferred.  To "
4853 "guarantee synchronous I/O the B<O_SYNC> must be used in addition to "
4854 "B<O_DIRECT>.  See B<NOTES> below for further discussion."
4855 msgstr ""
4856
4857 #. type: Plain text
4858 #: build/C/man2/open.2:299
4859 msgid ""
4860 "A semantically similar (but deprecated) interface for block devices is "
4861 "described in B<raw>(8)."
4862 msgstr ""
4863
4864 #. type: TP
4865 #: build/C/man2/open.2:299
4866 #, no-wrap
4867 msgid "B<O_DIRECTORY>"
4868 msgstr ""
4869
4870 #.  But see the following and its replies:
4871 #.  http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2
4872 #.  [PATCH] open: O_DIRECTORY and O_CREAT together should fail
4873 #.  O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored.
4874 #. type: Plain text
4875 #: build/C/man2/open.2:313
4876 msgid ""
4877 "If I<pathname> is not a directory, cause the open to fail.  This flag is "
4878 "Linux-specific, and was added in kernel version 2.1.126, to avoid "
4879 "denial-of-service problems if B<opendir>(3)  is called on a FIFO or tape "
4880 "device, but should not be used outside of the implementation of "
4881 "B<opendir>(3)."
4882 msgstr ""
4883
4884 #. type: TP
4885 #: build/C/man2/open.2:313
4886 #, no-wrap
4887 msgid "B<O_EXCL>"
4888 msgstr ""
4889
4890 #. type: Plain text
4891 #: build/C/man2/open.2:323
4892 msgid ""
4893 "Ensure that this call creates the file: if this flag is specified in "
4894 "conjunction with B<O_CREAT>, and I<pathname> already exists, then B<open>()  "
4895 "will fail."
4896 msgstr ""
4897
4898 #.  POSIX.1-2001 explicitly requires this behavior.
4899 #. type: Plain text
4900 #: build/C/man2/open.2:331
4901 msgid ""
4902 "When these two flags are specified, symbolic links are not followed: if "
4903 "I<pathname> is a symbolic link, then B<open>()  fails regardless of where "
4904 "the symbolic link points to."
4905 msgstr ""
4906
4907 #. type: Plain text
4908 #: build/C/man2/open.2:347
4909 msgid ""
4910 "In general, the behavior of B<O_EXCL> is undefined if it is used without "
4911 "B<O_CREAT>.  There is one exception: on Linux 2.6 and later, B<O_EXCL> can "
4912 "be used without B<O_CREAT> if I<pathname> refers to a block device.  If the "
4913 "block device is in use by the system (e.g., mounted), B<open>()  fails with "
4914 "the error B<EBUSY>."
4915 msgstr ""
4916
4917 #. type: Plain text
4918 #: build/C/man2/open.2:369
4919 msgid ""
4920 "On NFS, B<O_EXCL> is only supported when using NFSv3 or later on kernel 2.6 "
4921 "or later.  In NFS environments where B<O_EXCL> support is not provided, "
4922 "programs that rely on it for performing locking tasks will contain a race "
4923 "condition.  Portable programs that want to perform atomic file locking using "
4924 "a lockfile, and need to avoid reliance on NFS support for B<O_EXCL>, can "
4925 "create a unique file on the same file system (e.g., incorporating hostname "
4926 "and PID), and use B<link>(2)  to make a link to the lockfile.  If B<link>(2)  "
4927 "returns 0, the lock is successful.  Otherwise, use B<stat>(2)  on the unique "
4928 "file to check if its link count has increased to 2, in which case the lock "
4929 "is also successful."
4930 msgstr ""
4931
4932 #. type: TP
4933 #: build/C/man2/open.2:369
4934 #, no-wrap
4935 msgid "B<O_LARGEFILE>"
4936 msgstr ""
4937
4938 #. type: Plain text
4939 #: build/C/man2/open.2:391
4940 msgid ""
4941 "(LFS)  Allow files whose sizes cannot be represented in an I<off_t> (but can "
4942 "be represented in an I<off64_t>)  to be opened.  The B<_LARGEFILE64_SOURCE> "
4943 "macro must be defined (before including I<any> header files)  in order to "
4944 "obtain this definition.  Setting the B<_FILE_OFFSET_BITS> feature test macro "
4945 "to 64 (rather than using B<O_LARGEFILE>)  is the preferred method of "
4946 "accessing large files on 32-bit systems (see B<feature_test_macros>(7))."
4947 msgstr ""
4948
4949 #. type: TP
4950 #: build/C/man2/open.2:391
4951 #, no-wrap
4952 msgid "B<O_NOATIME> (Since Linux 2.6.8)"
4953 msgstr ""
4954
4955 #.  The O_NOATIME flag also affects the treatment of st_atime
4956 #.  by mmap() and readdir(2), MTK, Dec 04.
4957 #. type: Plain text
4958 #: build/C/man2/open.2:402
4959 msgid ""
4960 "Do not update the file last access time (st_atime in the inode)  when the "
4961 "file is B<read>(2).  This flag is intended for use by indexing or backup "
4962 "programs, where its use can significantly reduce the amount of disk "
4963 "activity.  This flag may not be effective on all file systems.  One example "
4964 "is NFS, where the server maintains the access time."
4965 msgstr ""
4966
4967 #. type: TP
4968 #: build/C/man2/open.2:402
4969 #, no-wrap
4970 msgid "B<O_NOCTTY>"
4971 msgstr ""
4972
4973 #. type: Plain text
4974 #: build/C/man2/open.2:410
4975 msgid ""
4976 "If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(em it will "
4977 "not become the process's controlling terminal even if the process does not "
4978 "have one."
4979 msgstr ""
4980
4981 #. type: TP
4982 #: build/C/man2/open.2:410
4983 #, no-wrap
4984 msgid "B<O_NOFOLLOW>"
4985 msgstr ""
4986
4987 #.  The headers from glibc 2.0.100 and later include a
4988 #.  definition of this flag; \fIkernels before 2.1.126 will ignore it if
4989 #.  used\fP.
4990 #. type: Plain text
4991 #: build/C/man2/open.2:419
4992 msgid ""
4993 "If I<pathname> is a symbolic link, then the open fails.  This is a FreeBSD "
4994 "extension, which was added to Linux in version 2.1.126.  Symbolic links in "
4995 "earlier components of the pathname will still be followed."
4996 msgstr ""
4997
4998 #. type: TP
4999 #: build/C/man2/open.2:419
5000 #, no-wrap
5001 msgid "B<O_NONBLOCK> or B<O_NDELAY>"
5002 msgstr ""
5003
5004 #. type: Plain text
5005 #: build/C/man2/open.2:432
5006 msgid ""
5007 "When possible, the file is opened in nonblocking mode.  Neither the "
5008 "B<open>()  nor any subsequent operations on the file descriptor which is "
5009 "returned will cause the calling process to wait.  For the handling of FIFOs "
5010 "(named pipes), see also B<fifo>(7).  For a discussion of the effect of "
5011 "B<O_NONBLOCK> in conjunction with mandatory file locks and with file leases, "
5012 "see B<fcntl>(2)."
5013 msgstr ""
5014
5015 #. type: TP
5016 #: build/C/man2/open.2:432
5017 #, no-wrap
5018 msgid "B<O_SYNC>"
5019 msgstr ""
5020
5021 #. type: Plain text
5022 #: build/C/man2/open.2:440
5023 msgid ""
5024 "The file is opened for synchronous I/O.  Any B<write>(2)s on the resulting "
5025 "file descriptor will block the calling process until the data has been "
5026 "physically written to the underlying hardware.  I<But see NOTES below>."
5027 msgstr ""
5028
5029 #. type: TP
5030 #: build/C/man2/open.2:440
5031 #, no-wrap
5032 msgid "B<O_TRUNC>"
5033 msgstr ""
5034
5035 #. type: Plain text
5036 #: build/C/man2/open.2:454
5037 msgid ""
5038 "If the file already exists and is a regular file and the open mode allows "
5039 "writing (i.e., is B<O_RDWR> or B<O_WRONLY>)  it will be truncated to length "
5040 "0.  If the file is a FIFO or terminal device file, the B<O_TRUNC> flag is "
5041 "ignored.  Otherwise the effect of B<O_TRUNC> is unspecified."
5042 msgstr ""
5043
5044 #. type: Plain text
5045 #: build/C/man2/open.2:458
5046 msgid ""
5047 "Some of these optional flags can be altered using B<fcntl>(2)  after the "
5048 "file has been opened."
5049 msgstr ""
5050
5051 #. type: Plain text
5052 #: build/C/man2/open.2:466
5053 msgid ""
5054 "B<creat>()  is equivalent to B<open>()  with I<flags> equal to "
5055 "B<O_CREAT|O_WRONLY|O_TRUNC>."
5056 msgstr ""
5057
5058 #. type: Plain text
5059 #: build/C/man2/open.2:474
5060 msgid ""
5061 "B<open>()  and B<creat>()  return the new file descriptor, or -1 if an error "
5062 "occurred (in which case, I<errno> is set appropriately)."
5063 msgstr ""
5064
5065 #. type: Plain text
5066 #: build/C/man2/open.2:484
5067 msgid ""
5068 "The requested access to the file is not allowed, or search permission is "
5069 "denied for one of the directories in the path prefix of I<pathname>, or the "
5070 "file did not exist yet and write access to the parent directory is not "
5071 "allowed.  (See also B<path_resolution>(7).)"
5072 msgstr ""
5073
5074 #. type: Plain text
5075 #: build/C/man2/open.2:490
5076 msgid "I<pathname> already exists and B<O_CREAT> and B<O_EXCL> were used."
5077 msgstr ""
5078
5079 #. type: Plain text
5080 #: build/C/man2/open.2:494 build/C/man2/rmdir.2:67 build/C/man2/unlink.2:84
5081 msgid "I<pathname> points outside your accessible address space."
5082 msgstr ""
5083
5084 #. type: TP
5085 #: build/C/man2/open.2:494 build/C/man2/write.2:139
5086 #, no-wrap
5087 msgid "B<EFBIG>"
5088 msgstr ""
5089
5090 #. type: Plain text
5091 #: build/C/man2/open.2:498
5092 msgid "See B<EOVERFLOW>."
5093 msgstr ""
5094
5095 #. type: TP
5096 #: build/C/man2/open.2:498 build/C/man2/read.2:104 build/C/man3/scanf.3:559 build/C/man3/tmpfile.3:59 build/C/man2/write.2:144
5097 #, no-wrap
5098 msgid "B<EINTR>"
5099 msgstr ""
5100
5101 #. type: Plain text
5102 #: build/C/man2/open.2:505
5103 msgid ""
5104 "While blocked waiting to complete an open of a slow device (e.g., a FIFO; "
5105 "see B<fifo>(7)), the call was interrupted by a signal handler; see "
5106 "B<signal>(7)."
5107 msgstr ""
5108
5109 #. type: TP
5110 #: build/C/man2/open.2:505 build/C/man2/read.2:140 build/C/man2/rename.2:140 build/C/man2/unlink.2:87
5111 #, no-wrap
5112 msgid "B<EISDIR>"
5113 msgstr ""
5114
5115 #. type: Plain text
5116 #: build/C/man2/open.2:514
5117 msgid ""
5118 "I<pathname> refers to a directory and the access requested involved writing "
5119 "(that is, B<O_WRONLY> or B<O_RDWR> is set)."
5120 msgstr ""
5121
5122 #. type: Plain text
5123 #: build/C/man2/open.2:521
5124 msgid ""
5125 "Too many symbolic links were encountered in resolving I<pathname>, or "
5126 "B<O_NOFOLLOW> was specified but I<pathname> was a symbolic link."
5127 msgstr ""
5128
5129 #. type: TP
5130 #: build/C/man2/open.2:521 build/C/man2/pipe.2:106 build/C/man3/tmpfile.3:62
5131 #, no-wrap
5132 msgid "B<EMFILE>"
5133 msgstr ""
5134
5135 #. type: Plain text
5136 #: build/C/man2/open.2:524
5137 msgid "The process already has the maximum number of files open."
5138 msgstr ""
5139
5140 #. type: Plain text
5141 #: build/C/man2/open.2:528 build/C/man2/rmdir.2:80 build/C/man2/unlink.2:99
5142 msgid "I<pathname> was too long."
5143 msgstr ""
5144
5145 #. type: TP
5146 #: build/C/man2/open.2:528 build/C/man2/pipe.2:109 build/C/man3/tmpfile.3:65
5147 #, no-wrap
5148 msgid "B<ENFILE>"
5149 msgstr ""
5150
5151 #. type: Plain text
5152 #: build/C/man2/open.2:531 build/C/man2/pipe.2:112
5153 msgid "The system limit on the total number of open files has been reached."
5154 msgstr ""
5155
5156 #. type: TP
5157 #: build/C/man2/open.2:531
5158 #, no-wrap
5159 msgid "B<ENODEV>"
5160 msgstr ""
5161
5162 #. type: Plain text
5163 #: build/C/man2/open.2:538
5164 msgid ""
5165 "I<pathname> refers to a device special file and no corresponding device "
5166 "exists.  (This is a Linux kernel bug; in this situation B<ENXIO> must be "
5167 "returned.)"
5168 msgstr ""
5169
5170 #. type: Plain text
5171 #: build/C/man2/open.2:545
5172 msgid ""
5173 "B<O_CREAT> is not set and the named file does not exist.  Or, a directory "
5174 "component in I<pathname> does not exist or is a dangling symbolic link."
5175 msgstr ""
5176
5177 #. type: Plain text
5178 #: build/C/man2/open.2:554
5179 msgid ""
5180 "I<pathname> was to be created but the device containing I<pathname> has no "
5181 "room for the new file."
5182 msgstr ""
5183
5184 #. type: Plain text
5185 #: build/C/man2/open.2:561
5186 msgid ""
5187 "A component used as a directory in I<pathname> is not, in fact, a directory, "
5188 "or B<O_DIRECTORY> was specified and I<pathname> was not a directory."
5189 msgstr ""
5190
5191 #. type: Plain text
5192 #: build/C/man2/open.2:567
5193 msgid ""
5194 "B<O_NONBLOCK> | B<O_WRONLY> is set, the named file is a FIFO and no process "
5195 "has the file open for reading.  Or, the file is a device special file and no "
5196 "corresponding device exists."
5197 msgstr ""
5198
5199 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=7253
5200 #.  "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW"
5201 #.  Reported 2006-10-03
5202 #. type: Plain text
5203 #: build/C/man2/open.2:587
5204 msgid ""
5205 "I<pathname> refers to a regular file that is too large to be opened.  The "
5206 "usual scenario here is that an application compiled on a 32-bit platform "
5207 "without I<-D_FILE_OFFSET_BITS=64> tried to open a file whose size exceeds "
5208 "I<(2E<lt>E<lt>31)-1> bits; see also B<O_LARGEFILE> above.  This is the error "
5209 "specified by POSIX.1-2001; in kernels before 2.6.24, Linux gave the error "
5210 "B<EFBIG> for this case."
5211 msgstr ""
5212
5213 #.  Strictly speaking, it's the file system UID... (MTK)
5214 #. type: Plain text
5215 #: build/C/man2/open.2:595
5216 msgid ""
5217 "The B<O_NOATIME> flag was specified, but the effective user ID of the caller "
5218 "did not match the owner of the file and the caller was not privileged "
5219 "(B<CAP_FOWNER>)."
5220 msgstr ""
5221
5222 #. type: Plain text
5223 #: build/C/man2/open.2:600
5224 msgid ""
5225 "I<pathname> refers to a file on a read-only file system and write access was "
5226 "requested."
5227 msgstr ""
5228
5229 #. type: TP
5230 #: build/C/man2/open.2:600
5231 #, no-wrap
5232 msgid "B<ETXTBSY>"
5233 msgstr ""
5234
5235 #. type: Plain text
5236 #: build/C/man2/open.2:605
5237 msgid ""
5238 "I<pathname> refers to an executable image which is currently being executed "
5239 "and write access was requested."
5240 msgstr ""
5241
5242 #. type: TP
5243 #: build/C/man2/open.2:605
5244 #, no-wrap
5245 msgid "B<EWOULDBLOCK>"
5246 msgstr ""
5247
5248 #. type: Plain text
5249 #: build/C/man2/open.2:612
5250 msgid ""
5251 "The B<O_NONBLOCK> flag was specified, and an incompatible lease was held on "
5252 "the file (see B<fcntl>(2))."
5253 msgstr ""
5254
5255 #. type: Plain text
5256 #: build/C/man2/open.2:625
5257 msgid ""
5258 "SVr4, 4.3BSD, POSIX.1-2001.  The B<O_DIRECTORY>, B<O_NOATIME>, and "
5259 "B<O_NOFOLLOW> flags are Linux-specific, and one may need to define "
5260 "B<_GNU_SOURCE> (before including I<any> header files)  to obtain their "
5261 "definitions."
5262 msgstr ""
5263
5264 #. type: Plain text
5265 #: build/C/man2/open.2:630
5266 msgid ""
5267 "The B<O_CLOEXEC> flag is not specified in POSIX.1-2001, but is specified in "
5268 "POSIX.1-2008."
5269 msgstr ""
5270
5271 #. type: Plain text
5272 #: build/C/man2/open.2:638
5273 msgid ""
5274 "B<O_DIRECT> is not specified in POSIX; one has to define B<_GNU_SOURCE> "
5275 "(before including I<any> header files)  to get its definition."
5276 msgstr ""
5277
5278 #. type: Plain text
5279 #: build/C/man2/open.2:646
5280 msgid ""
5281 "Under Linux, the B<O_NONBLOCK> flag indicates that one wants to open but "
5282 "does not necessarily have the intention to read or write.  This is typically "
5283 "used to open devices in order to get a file descriptor for use with "
5284 "B<ioctl>(2)."
5285 msgstr ""
5286
5287 #.  See for example util-linux's disk-utils/setfdprm.c
5288 #.  For some background on access mode 3, see
5289 #.  http://thread.gmane.org/gmane.linux.kernel/653123
5290 #.  "[RFC] correct flags to f_mode conversion in __dentry_open"
5291 #.  LKML, 12 Mar 2008
5292 #. type: Plain text
5293 #: build/C/man2/open.2:675
5294 msgid ""
5295 "Unlike the other values that can be specified in I<flags>, the I<access "
5296 "mode> values B<O_RDONLY>, B<O_WRONLY>, and B<O_RDWR>, do not specify "
5297 "individual bits.  Rather, they define the low order two bits of I<flags>, "
5298 "and are defined respectively as 0, 1, and 2.  In other words, the "
5299 "combination B<O_RDONLY | O_WRONLY> is a logical error, and certainly does "
5300 "not have the same meaning as B<O_RDWR>.  Linux reserves the special, "
5301 "nonstandard access mode 3 (binary 11) in I<flags> to mean: check for read "
5302 "and write permission on the file and return a descriptor that can't be used "
5303 "for reading or writing.  This nonstandard access mode is used by some Linux "
5304 "drivers to return a descriptor that is only to be used for device-specific "
5305 "B<ioctl>(2)  operations."
5306 msgstr ""
5307
5308 #.  Linux 2.0, 2.5: truncate
5309 #.  Solaris 5.7, 5.8: truncate
5310 #.  Irix 6.5: truncate
5311 #.  Tru64 5.1B: truncate
5312 #.  HP-UX 11.22: truncate
5313 #.  FreeBSD 4.7: truncate
5314 #. type: Plain text
5315 #: build/C/man2/open.2:686
5316 msgid ""
5317 "The (undefined) effect of B<O_RDONLY | O_TRUNC> varies among "
5318 "implementations.  On many systems the file is actually truncated."
5319 msgstr ""
5320
5321 #. type: Plain text
5322 #: build/C/man2/open.2:690
5323 msgid ""
5324 "There are many infelicities in the protocol underlying NFS, affecting "
5325 "amongst others B<O_SYNC> and B<O_NDELAY>."
5326 msgstr ""
5327
5328 #. type: Plain text
5329 #: build/C/man2/open.2:712
5330 msgid ""
5331 "POSIX provides for three different variants of synchronized I/O, "
5332 "corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>.  Currently "
5333 "(2.6.31), Linux only implements B<O_SYNC>, but glibc maps B<O_DSYNC> and "
5334 "B<O_RSYNC> to the same numerical value as B<O_SYNC>.  Most Linux file "
5335 "systems don't actually implement the POSIX B<O_SYNC> semantics, which "
5336 "require all metadata updates of a write to be on disk on returning to "
5337 "userspace, but only the B<O_DSYNC> semantics, which require only actual file "
5338 "data and metadata necessary to retrieve it to be on disk by the time the "
5339 "system call returns."
5340 msgstr ""
5341
5342 #. type: Plain text
5343 #: build/C/man2/open.2:720
5344 msgid ""
5345 "Note that B<open>()  can open device special files, but B<creat>()  cannot "
5346 "create them; use B<mknod>(2)  instead."
5347 msgstr ""
5348
5349 #. type: Plain text
5350 #: build/C/man2/open.2:733
5351 msgid ""
5352 "On NFS file systems with UID mapping enabled, B<open>()  may return a file "
5353 "descriptor but, for example, B<read>(2)  requests are denied with "
5354 "B<EACCES>.  This is because the client performs B<open>()  by checking the "
5355 "permissions, but UID mapping is performed by the server upon read and write "
5356 "requests."
5357 msgstr ""
5358
5359 #. type: Plain text
5360 #: build/C/man2/open.2:752
5361 msgid ""
5362 "If the file is newly created, its I<st_atime>, I<st_ctime>, I<st_mtime> "
5363 "fields (respectively, time of last access, time of last status change, and "
5364 "time of last modification; see B<stat>(2))  are set to the current time, and "
5365 "so are the I<st_ctime> and I<st_mtime> fields of the parent directory.  "
5366 "Otherwise, if the file is modified because of the B<O_TRUNC> flag, its "
5367 "st_ctime and st_mtime fields are set to the current time."
5368 msgstr ""
5369
5370 #. type: SS
5371 #: build/C/man2/open.2:752
5372 #, no-wrap
5373 msgid "O_DIRECT"
5374 msgstr ""
5375
5376 #. type: Plain text
5377 #: build/C/man2/open.2:769
5378 msgid ""
5379 "The B<O_DIRECT> flag may impose alignment restrictions on the length and "
5380 "address of userspace buffers and the file offset of I/Os.  In Linux "
5381 "alignment restrictions vary by file system and kernel version and might be "
5382 "absent entirely.  However there is currently no file system-independent "
5383 "interface for an application to discover these restrictions for a given file "
5384 "or file system.  Some file systems provide their own interfaces for doing "
5385 "so, for example the B<XFS_IOC_DIOINFO> operation in B<xfsctl>(3)."
5386 msgstr ""
5387
5388 #. type: Plain text
5389 #: build/C/man2/open.2:775
5390 msgid ""
5391 "Under Linux 2.4, transfer sizes, and the alignment of the user buffer and "
5392 "the file offset must all be multiples of the logical block size of the file "
5393 "system.  Under Linux 2.6, alignment to 512-byte boundaries suffices."
5394 msgstr ""
5395
5396 #. type: Plain text
5397 #: build/C/man2/open.2:785
5398 msgid ""
5399 "The B<O_DIRECT> flag was introduced in SGI IRIX, where it has alignment "
5400 "restrictions similar to those of Linux 2.4.  IRIX has also a B<fcntl>(2)  "
5401 "call to query appropriate alignments, and sizes.  FreeBSD 4.x introduced a "
5402 "flag of the same name, but without alignment restrictions."
5403 msgstr ""
5404
5405 #. type: Plain text
5406 #: build/C/man2/open.2:794
5407 msgid ""
5408 "B<O_DIRECT> support was added under Linux in kernel version 2.4.10.  Older "
5409 "Linux kernels simply ignore this flag.  Some file systems may not implement "
5410 "the flag and B<open>()  will fail with B<EINVAL> if it is used."
5411 msgstr ""
5412
5413 #. type: Plain text
5414 #: build/C/man2/open.2:805
5415 msgid ""
5416 "Applications should avoid mixing B<O_DIRECT> and normal I/O to the same "
5417 "file, and especially to overlapping byte regions in the same file.  Even "
5418 "when the file system correctly handles the coherency issues in this "
5419 "situation, overall I/O throughput is likely to be slower than using either "
5420 "mode alone.  Likewise, applications should avoid mixing B<mmap>(2)  of files "
5421 "with direct I/O to the same files."
5422 msgstr ""
5423
5424 #. type: Plain text
5425 #: build/C/man2/open.2:827
5426 msgid ""
5427 "The behaviour of B<O_DIRECT> with NFS will differ from local file systems.  "
5428 "Older kernels, or kernels configured in certain ways, may not support this "
5429 "combination.  The NFS protocol does not support passing the flag to the "
5430 "server, so B<O_DIRECT> I/O will only bypass the page cache on the client; "
5431 "the server may still cache the I/O.  The client asks the server to make the "
5432 "I/O synchronous to preserve the synchronous semantics of B<O_DIRECT>.  Some "
5433 "servers will perform poorly under these circumstances, especially if the I/O "
5434 "size is small.  Some servers may also be configured to lie to clients about "
5435 "the I/O having reached stable storage; this will avoid the performance "
5436 "penalty at some risk to data integrity in the event of server power "
5437 "failure.  The Linux NFS client places no alignment restrictions on "
5438 "B<O_DIRECT> I/O."
5439 msgstr ""
5440
5441 #. type: Plain text
5442 #: build/C/man2/open.2:834
5443 msgid ""
5444 "In summary, B<O_DIRECT> is a potentially powerful tool that should be used "
5445 "with caution.  It is recommended that applications treat use of B<O_DIRECT> "
5446 "as a performance option which is disabled by default."
5447 msgstr ""
5448
5449 #. type: Plain text
5450 #: build/C/man2/open.2:839
5451 msgid ""
5452 "\"The thing that has always disturbed me about O_DIRECT is that the whole "
5453 "interface is just stupid, and was probably designed by a deranged monkey on "
5454 "some serious mind-controlling substances.\"\\(emLinus"
5455 msgstr ""
5456
5457 #.  FIXME . Check bugzilla report on open(O_ASYNC)
5458 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=5993
5459 #. type: Plain text
5460 #: build/C/man2/open.2:851
5461 msgid ""
5462 "Currently, it is not possible to enable signal-driven I/O by specifying "
5463 "B<O_ASYNC> when calling B<open>(); use B<fcntl>(2)  to enable this flag."
5464 msgstr ""
5465
5466 #. type: Plain text
5467 #: build/C/man2/open.2:873
5468 msgid ""
5469 "B<chmod>(2), B<chown>(2), B<close>(2), B<dup>(2), B<fcntl>(2), B<link>(2), "
5470 "B<lseek>(2), B<mknod>(2), B<mmap>(2), B<mount>(2), B<openat>(2), B<read>(2), "
5471 "B<socket>(2), B<stat>(2), B<umask>(2), B<unlink>(2), B<write>(2), "
5472 "B<fopen>(3), B<fifo>(7), B<path_resolution>(7), B<symlink>(7)"
5473 msgstr ""
5474
5475 #. type: TH
5476 #: build/C/man3/perror.3:30
5477 #, no-wrap
5478 msgid "PERROR"
5479 msgstr ""
5480
5481 #. type: Plain text
5482 #: build/C/man3/perror.3:33
5483 msgid "perror - print a system error message"
5484 msgstr ""
5485
5486 #. type: Plain text
5487 #: build/C/man3/perror.3:37
5488 msgid "B<void perror(const char *>I<s>B<);>"
5489 msgstr ""
5490
5491 #. type: Plain text
5492 #: build/C/man3/perror.3:39
5493 msgid "B<#include E<lt>errno.hE<gt>>"
5494 msgstr ""
5495
5496 #. type: Plain text
5497 #: build/C/man3/perror.3:41
5498 msgid "B<const char *>I<sys_errlist>B<[];>"
5499 msgstr ""
5500
5501 #. type: Plain text
5502 #: build/C/man3/perror.3:43
5503 msgid "B<int >I<sys_nerr>B<;>"
5504 msgstr ""
5505
5506 #. type: Plain text
5507 #: build/C/man3/perror.3:45
5508 msgid "B<int >I<errno>B<;>"
5509 msgstr ""
5510
5511 #. type: Plain text
5512 #: build/C/man3/perror.3:54
5513 msgid "I<sys_errlist>, I<sys_nerr>: _BSD_SOURCE"
5514 msgstr ""
5515
5516 #. type: Plain text
5517 #: build/C/man3/perror.3:67
5518 msgid ""
5519 "The routine B<perror>()  produces a message on the standard error output, "
5520 "describing the last error encountered during a call to a system or library "
5521 "function.  First (if I<s> is not NULL and I<*s> is not a null byte "
5522 "(\\(aq\\e0\\(aq)) the argument string I<s> is printed, followed by a colon "
5523 "and a blank.  Then the message and a new-line."
5524 msgstr ""
5525
5526 #. type: Plain text
5527 #: build/C/man3/perror.3:75
5528 msgid ""
5529 "To be of most use, the argument string should include the name of the "
5530 "function that incurred the error.  The error number is taken from the "
5531 "external variable I<errno>, which is set when errors occur but not cleared "
5532 "when successful calls are made."
5533 msgstr ""
5534
5535 #. type: Plain text
5536 #: build/C/man3/perror.3:86
5537 msgid ""
5538 "The global error list I<sys_errlist>[] indexed by I<errno> can be used to "
5539 "obtain the error message without the newline.  The largest message number "
5540 "provided in the table is I<sys_nerr> -1.  Be careful when directly accessing "
5541 "this list because new error values may not have been added to "
5542 "I<sys_errlist>[]."
5543 msgstr ""
5544
5545 #. type: Plain text
5546 #: build/C/man3/perror.3:107
5547 msgid ""
5548 "When a system call fails, it usually returns -1 and sets the variable "
5549 "I<errno> to a value describing what went wrong.  (These values can be found "
5550 "in I<E<lt>errno.hE<gt>>.)  Many library functions do likewise.  The function "
5551 "B<perror>()  serves to translate this error code into human-readable form.  "
5552 "Note that I<errno> is undefined after a successful library call: this call "
5553 "may well change this variable, even though it succeeds, for example because "
5554 "it internally used some other library function that failed.  Thus, if a "
5555 "failing call is not immediately followed by a call to B<perror>(), the value "
5556 "of I<errno> should be saved."
5557 msgstr ""
5558
5559 #. type: Plain text
5560 #: build/C/man3/perror.3:120
5561 msgid ""
5562 "The function B<perror>()  and the external I<errno> (see B<errno>(3))  "
5563 "conform to C89, C99, 4.3BSD, POSIX.1-2001.  The externals I<sys_nerr> and "
5564 "I<sys_errlist> conform to BSD."
5565 msgstr ""
5566
5567 #.  and only when _BSD_SOURCE is defined.
5568 #.  When
5569 #.  .B _GNU_SOURCE
5570 #.  is defined, the symbols
5571 #.  .I _sys_nerr
5572 #.  and
5573 #.  .I _sys_errlist
5574 #.  are provided.
5575 #. type: Plain text
5576 #: build/C/man3/perror.3:135
5577 msgid ""
5578 "The externals I<sys_nerr> and I<sys_errlist> are defined by glibc, but in "
5579 "I<E<lt>stdio.hE<gt>>."
5580 msgstr ""
5581
5582 #. type: Plain text
5583 #: build/C/man3/perror.3:140
5584 msgid "B<err>(3), B<errno>(3), B<error>(3), B<strerror>(3)"
5585 msgstr ""
5586
5587 #. type: TH
5588 #: build/C/man2/pipe.2:36
5589 #, no-wrap
5590 msgid "PIPE"
5591 msgstr ""
5592
5593 #. type: TH
5594 #: build/C/man2/pipe.2:36 build/C/man3/tmpnam.3:25
5595 #, no-wrap
5596 msgid "2010-09-10"
5597 msgstr ""
5598
5599 #. type: Plain text
5600 #: build/C/man2/pipe.2:39
5601 msgid "pipe, pipe2 - create pipe"
5602 msgstr ""
5603
5604 #. type: Plain text
5605 #: build/C/man2/pipe.2:42 build/C/man2/read.2:41
5606 #, no-wrap
5607 msgid "B<#include E<lt>unistd.hE<gt>>\n"
5608 msgstr ""
5609
5610 #. type: Plain text
5611 #: build/C/man2/pipe.2:44
5612 #, no-wrap
5613 msgid "B<int pipe(int >I<pipefd>B<[2]);>\n"
5614 msgstr ""
5615
5616 #. type: Plain text
5617 #: build/C/man2/pipe.2:47
5618 #, no-wrap
5619 msgid ""
5620 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
5621 "B<#include E<lt>unistd.hE<gt>>\n"
5622 msgstr ""
5623
5624 #. type: Plain text
5625 #: build/C/man2/pipe.2:49
5626 #, no-wrap
5627 msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
5628 msgstr ""
5629
5630 #. type: Plain text
5631 #: build/C/man2/pipe.2:65
5632 msgid ""
5633 "B<pipe>()  creates a pipe, a unidirectional data channel that can be used "
5634 "for interprocess communication.  The array I<pipefd> is used to return two "
5635 "file descriptors referring to the ends of the pipe.  I<pipefd[0]> refers to "
5636 "the read end of the pipe.  I<pipefd[1]> refers to the write end of the "
5637 "pipe.  Data written to the write end of the pipe is buffered by the kernel "
5638 "until it is read from the read end of the pipe.  For further details, see "
5639 "B<pipe>(7)."
5640 msgstr ""
5641
5642 #. type: Plain text
5643 #: build/C/man2/pipe.2:75
5644 msgid ""
5645 "If I<flags> is 0, then B<pipe2>()  is the same as B<pipe>().  The following "
5646 "values can be bitwise ORed in I<flags> to obtain different behavior:"
5647 msgstr ""
5648
5649 #. type: TP
5650 #: build/C/man2/pipe.2:75
5651 #, no-wrap
5652 msgid "B<O_NONBLOCK>"
5653 msgstr ""
5654
5655 #. type: Plain text
5656 #: build/C/man2/pipe.2:83
5657 msgid ""
5658 "Set the B<O_NONBLOCK> file status flag on the two new open file "
5659 "descriptions.  Using this flag saves extra calls to B<fcntl>(2)  to achieve "
5660 "the same result."
5661 msgstr ""
5662
5663 #. type: TP
5664 #: build/C/man2/pipe.2:83
5665 #, no-wrap
5666 msgid "B<O_CLOEXEC>"
5667 msgstr ""
5668
5669 #. type: Plain text
5670 #: build/C/man2/pipe.2:91
5671 msgid ""
5672 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the two new file "
5673 "descriptors.  See the description of the same flag in B<open>(2)  for "
5674 "reasons why this may be useful."
5675 msgstr ""
5676
5677 #. type: Plain text
5678 #: build/C/man2/pipe.2:101
5679 msgid "I<pipefd> is not valid."
5680 msgstr ""
5681
5682 #. type: Plain text
5683 #: build/C/man2/pipe.2:106
5684 msgid "(B<pipe2>())  Invalid value in I<flags>."
5685 msgstr ""
5686
5687 #. type: Plain text
5688 #: build/C/man2/pipe.2:109
5689 msgid "Too many file descriptors are in use by the process."
5690 msgstr ""
5691
5692 #. type: Plain text
5693 #: build/C/man2/pipe.2:117
5694 msgid ""
5695 "B<pipe2>()  was added to Linux in version 2.6.27; glibc support is available "
5696 "starting with version 2.9."
5697 msgstr ""
5698
5699 #. type: Plain text
5700 #: build/C/man2/pipe.2:120
5701 msgid "B<pipe>(): POSIX.1-2001."
5702 msgstr ""
5703
5704 #. type: Plain text
5705 #: build/C/man2/pipe.2:123
5706 msgid "B<pipe2>()  is Linux-specific."
5707 msgstr ""
5708
5709 #.  fork.2 refers to this example program.
5710 #. type: Plain text
5711 #: build/C/man2/pipe.2:139
5712 msgid ""
5713 "The following program creates a pipe, and then B<fork>(2)s to create a child "
5714 "process; the child inherits a duplicate set of file descriptors that refer "
5715 "to the same pipe.  After the B<fork>(2), each process closes the descriptors "
5716 "that it doesn't need for the pipe (see B<pipe>(7)).  The parent then writes "
5717 "the string contained in the program's command-line argument to the pipe, and "
5718 "the child reads this string a byte at a time from the pipe and echoes it on "
5719 "standard output."
5720 msgstr ""
5721
5722 #. type: Plain text
5723 #: build/C/man2/pipe.2:146
5724 #, no-wrap
5725 msgid ""
5726 "#include E<lt>sys/wait.hE<gt>\n"
5727 "#include E<lt>stdio.hE<gt>\n"
5728 "#include E<lt>stdlib.hE<gt>\n"
5729 "#include E<lt>unistd.hE<gt>\n"
5730 "#include E<lt>string.hE<gt>\n"
5731 msgstr ""
5732
5733 #. type: Plain text
5734 #: build/C/man2/pipe.2:153
5735 #, no-wrap
5736 msgid ""
5737 "int\n"
5738 "main(int argc, char *argv[])\n"
5739 "{\n"
5740 "    int pipefd[2];\n"
5741 "    pid_t cpid;\n"
5742 "    char buf;\n"
5743 msgstr ""
5744
5745 #. type: Plain text
5746 #: build/C/man2/pipe.2:158
5747 #, no-wrap
5748 msgid ""
5749 "    if (argc != 2) {\n"
5750 "\tfprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\en\", argv[0]);\n"
5751 "\texit(EXIT_FAILURE);\n"
5752 "    }\n"
5753 msgstr ""
5754
5755 #. type: Plain text
5756 #: build/C/man2/pipe.2:163
5757 #, no-wrap
5758 msgid ""
5759 "    if (pipe(pipefd) == -1) {\n"
5760 "        perror(\"pipe\");\n"
5761 "        exit(EXIT_FAILURE);\n"
5762 "    }\n"
5763 msgstr ""
5764
5765 #. type: Plain text
5766 #: build/C/man2/pipe.2:169
5767 #, no-wrap
5768 msgid ""
5769 "    cpid = fork();\n"
5770 "    if (cpid == -1) {\n"
5771 "        perror(\"fork\");\n"
5772 "        exit(EXIT_FAILURE);\n"
5773 "    }\n"
5774 msgstr ""
5775
5776 #. type: Plain text
5777 #: build/C/man2/pipe.2:172
5778 #, no-wrap
5779 msgid ""
5780 "    if (cpid == 0) {    /* Child reads from pipe */\n"
5781 "        close(pipefd[1]);          /* Close unused write end */\n"
5782 msgstr ""
5783
5784 #. type: Plain text
5785 #: build/C/man2/pipe.2:175
5786 #, no-wrap
5787 msgid ""
5788 "        while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
5789 "            write(STDOUT_FILENO, &buf, 1);\n"
5790 msgstr ""
5791
5792 #. type: Plain text
5793 #: build/C/man2/pipe.2:179
5794 #, no-wrap
5795 msgid ""
5796 "        write(STDOUT_FILENO, \"\\en\", 1);\n"
5797 "        close(pipefd[0]);\n"
5798 "        _exit(EXIT_SUCCESS);\n"
5799 msgstr ""
5800
5801 #. type: Plain text
5802 #: build/C/man2/pipe.2:188
5803 #, no-wrap
5804 msgid ""
5805 "    } else {            /* Parent writes argv[1] to pipe */\n"
5806 "        close(pipefd[0]);          /* Close unused read end */\n"
5807 "        write(pipefd[1], argv[1], strlen(argv[1]));\n"
5808 "        close(pipefd[1]);          /* Reader will see EOF */\n"
5809 "        wait(NULL);                /* Wait for child */\n"
5810 "        exit(EXIT_SUCCESS);\n"
5811 "    }\n"
5812 "}\n"
5813 msgstr ""
5814
5815 #. type: Plain text
5816 #: build/C/man2/pipe.2:196
5817 msgid ""
5818 "B<fork>(2), B<read>(2), B<socketpair>(2), B<write>(2), B<popen>(3), "
5819 "B<pipe>(7)"
5820 msgstr ""
5821
5822 #. type: TH
5823 #: build/C/man3/popen.3:38
5824 #, no-wrap
5825 msgid "POPEN"
5826 msgstr ""
5827
5828 #. type: TH
5829 #: build/C/man3/popen.3:38
5830 #, no-wrap
5831 msgid "2010-02-03"
5832 msgstr ""
5833
5834 #. type: Plain text
5835 #: build/C/man3/popen.3:41
5836 msgid "popen, pclose - pipe stream to or from a process"
5837 msgstr ""
5838
5839 #. type: Plain text
5840 #: build/C/man3/popen.3:46
5841 #, no-wrap
5842 msgid "B<FILE *popen(const char *>I<command>B<, const char *>I<type>B<);>\n"
5843 msgstr ""
5844
5845 #. type: Plain text
5846 #: build/C/man3/popen.3:48
5847 #, no-wrap
5848 msgid "B<int pclose(FILE *>I<stream>B<);>\n"
5849 msgstr ""
5850
5851 #. type: Plain text
5852 #: build/C/man3/popen.3:58
5853 msgid "B<popen>(), B<pclose>():"
5854 msgstr ""
5855
5856 #. type: Plain text
5857 #: build/C/man3/popen.3:60
5858 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE"
5859 msgstr ""
5860
5861 #. type: Plain text
5862 #: build/C/man3/popen.3:71
5863 msgid ""
5864 "The B<popen>()  function opens a process by creating a pipe, forking, and "
5865 "invoking the shell.  Since a pipe is by definition unidirectional, the "
5866 "I<type> argument may specify only reading or writing, not both; the "
5867 "resulting stream is correspondingly read-only or write-only."
5868 msgstr ""
5869
5870 #. type: Plain text
5871 #: build/C/man3/popen.3:95
5872 msgid ""
5873 "The I<command> argument is a pointer to a null-terminated string containing "
5874 "a shell command line.  This command is passed to I</bin/sh> using the B<-c> "
5875 "flag; interpretation, if any, is performed by the shell.  The I<type> "
5876 "argument is a pointer to a null-terminated string which must contain either "
5877 "the letter \\(aqr\\(aq for reading or the letter \\(aqw\\(aq for writing.  "
5878 "Since glibc 2.9, this argument can additionally include the letter "
5879 "\\(aqe\\(aq, which causes the close-on-exec flag (B<FD_CLOEXEC>)  to be set "
5880 "on the underlying file descriptor; see the description of the B<O_CLOEXEC> "
5881 "flag in B<open>(2)  for reasons why this may be useful."
5882 msgstr ""
5883
5884 #. type: Plain text
5885 #: build/C/man3/popen.3:111
5886 msgid ""
5887 "The return value from B<popen>()  is a normal standard I/O stream in all "
5888 "respects save that it must be closed with B<pclose>()  rather than "
5889 "B<fclose>(3).  Writing to such a stream writes to the standard input of the "
5890 "command; the command's standard output is the same as that of the process "
5891 "that called B<popen>(), unless this is altered by the command itself.  "
5892 "Conversely, reading from a \"popened\" stream reads the command's standard "
5893 "output, and the command's standard input is the same as that of the process "
5894 "that called B<popen>()."
5895 msgstr ""
5896
5897 #. type: Plain text
5898 #: build/C/man3/popen.3:115
5899 msgid "Note that output B<popen>()  streams are fully buffered by default."
5900 msgstr ""
5901
5902 #. type: Plain text
5903 #: build/C/man3/popen.3:121
5904 msgid ""
5905 "The B<pclose>()  function waits for the associated process to terminate and "
5906 "returns the exit status of the command as returned by B<wait4>(2)."
5907 msgstr ""
5908
5909 #. type: Plain text
5910 #: build/C/man3/popen.3:129
5911 msgid ""
5912 "The B<popen>()  function returns NULL if the B<fork>(2)  or B<pipe>(2)  "
5913 "calls fail, or if it cannot allocate memory."
5914 msgstr ""
5915
5916 #.  These conditions actually give undefined results, so I commented
5917 #.  them out.
5918 #.  .I stream
5919 #.  is not associated with a "popen()ed" command, if
5920 #. .I stream
5921 #.  already "pclose()d", or if
5922 #. type: Plain text
5923 #: build/C/man3/popen.3:141
5924 msgid ""
5925 "The B<pclose>()  function returns -1 if B<wait4>(2)  returns an error, or "
5926 "some other error is detected."
5927 msgstr ""
5928
5929 #. type: Plain text
5930 #: build/C/man3/popen.3:160
5931 msgid ""
5932 "The B<popen>()  function does not set I<errno> if memory allocation fails.  "
5933 "If the underlying B<fork>(2)  or B<pipe>(2)  fails, I<errno> is set "
5934 "appropriately.  If the I<type> argument is invalid, and this condition is "
5935 "detected, I<errno> is set to B<EINVAL>."
5936 msgstr ""
5937
5938 #. type: Plain text
5939 #: build/C/man3/popen.3:167
5940 msgid ""
5941 "If B<pclose>()  cannot obtain the child status, I<errno> is set to "
5942 "B<ECHILD>."
5943 msgstr ""
5944
5945 #. type: Plain text
5946 #: build/C/man3/popen.3:173
5947 msgid "The \\(aqe\\(aq value for I<type> is a Linux extension."
5948 msgstr ""
5949
5950 #. type: Plain text
5951 #: build/C/man3/popen.3:186
5952 msgid ""
5953 "Since the standard input of a command opened for reading shares its seek "
5954 "offset with the process that called B<popen>(), if the original process has "
5955 "done a buffered read, the command's input position may not be as expected.  "
5956 "Similarly, the output from a command opened for writing may become "
5957 "intermingled with that of the original process.  The latter can be avoided "
5958 "by calling B<fflush>(3)  before B<popen>()."
5959 msgstr ""
5960
5961 #.  .SH HISTORY
5962 #.  A
5963 #.  .BR popen ()
5964 #.  and a
5965 #.  .BR pclose ()
5966 #.  function appeared in Version 7 AT&T UNIX.
5967 #. type: Plain text
5968 #: build/C/man3/popen.3:196
5969 msgid ""
5970 "Failure to execute the shell is indistinguishable from the shell's failure "
5971 "to execute command, or an immediate exit of the command.  The only hint is "
5972 "an exit status of 127."
5973 msgstr ""
5974
5975 #. type: Plain text
5976 #: build/C/man3/popen.3:206
5977 msgid ""
5978 "B<sh>(1), B<fork>(2), B<pipe>(2), B<wait4>(2), B<fclose>(3), B<fflush>(3), "
5979 "B<fopen>(3), B<stdio>(3), B<system>(3)"
5980 msgstr ""
5981
5982 #. type: TH
5983 #: build/C/man3/printf.3:34
5984 #, no-wrap
5985 msgid "PRINTF"
5986 msgstr ""
5987
5988 #. type: Plain text
5989 #: build/C/man3/printf.3:38
5990 msgid ""
5991 "printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - "
5992 "formatted output conversion"
5993 msgstr ""
5994
5995 #. type: Plain text
5996 #: build/C/man3/printf.3:42
5997 msgid "B<int printf(const char *>I<format>B<, ...);>"
5998 msgstr ""
5999
6000 #. type: Plain text
6001 #: build/C/man3/printf.3:44
6002 msgid "B<int fprintf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>"
6003 msgstr ""
6004
6005 #. type: Plain text
6006 #: build/C/man3/printf.3:46
6007 msgid "B<int sprintf(char *>I<str>B<, const char *>I<format>B<, ...);>"
6008 msgstr ""
6009
6010 #. type: Plain text
6011 #: build/C/man3/printf.3:48
6012 msgid ""
6013 "B<int snprintf(char *>I<str>B<, size_t >I<size>B<, const char *>I<format>B<, "
6014 "...);>"
6015 msgstr ""
6016
6017 #. type: Plain text
6018 #: build/C/man3/printf.3:50
6019 msgid "B<#include E<lt>stdarg.hE<gt>>"
6020 msgstr ""
6021
6022 #. type: Plain text
6023 #: build/C/man3/printf.3:52
6024 msgid "B<int vprintf(const char *>I<format>B<, va_list >I<ap>B<);>"
6025 msgstr ""
6026
6027 #. type: Plain text
6028 #: build/C/man3/printf.3:54
6029 msgid ""
6030 "B<int vfprintf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
6031 ">I<ap>B<);>"
6032 msgstr ""
6033
6034 #. type: Plain text
6035 #: build/C/man3/printf.3:56
6036 msgid ""
6037 "B<int vsprintf(char *>I<str>B<, const char *>I<format>B<, va_list "
6038 ">I<ap>B<);>"
6039 msgstr ""
6040
6041 #. type: Plain text
6042 #: build/C/man3/printf.3:59
6043 msgid ""
6044 "B<int vsnprintf(char *>I<str>B<, size_t >I<size>B<, const char "
6045 "*>I<format>B<, va_list >I<ap>B<);>"
6046 msgstr ""
6047
6048 #. type: Plain text
6049 #: build/C/man3/printf.3:68
6050 msgid "B<snprintf>(), B<vsnprintf>():"
6051 msgstr ""
6052
6053 #. type: Plain text
6054 #: build/C/man3/printf.3:71
6055 msgid ""
6056 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE || "
6057 "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
6058 msgstr ""
6059
6060 #. type: Plain text
6061 #: build/C/man3/printf.3:74 build/C/man3/scanf.3:83
6062 msgid "or I<cc -std=c99>"
6063 msgstr ""
6064
6065 #. type: Plain text
6066 #: build/C/man3/printf.3:101
6067 msgid ""
6068 "The functions in the B<printf>()  family produce output according to a "
6069 "I<format> as described below.  The functions B<printf>()  and B<vprintf>()  "
6070 "write output to I<stdout>, the standard output stream; B<fprintf>()  and "
6071 "B<vfprintf>()  write output to the given output I<stream>; B<sprintf>(), "
6072 "B<snprintf>(), B<vsprintf>()  and B<vsnprintf>()  write to the character "
6073 "string I<str>."
6074 msgstr ""
6075
6076 #. type: Plain text
6077 #: build/C/man3/printf.3:110
6078 msgid ""
6079 "The functions B<snprintf>()  and B<vsnprintf>()  write at most I<size> bytes "
6080 "(including the terminating null byte (\\(aq\\e0\\(aq)) to I<str>."
6081 msgstr ""
6082
6083 #. type: Plain text
6084 #: build/C/man3/printf.3:134
6085 msgid ""
6086 "The functions B<vprintf>(), B<vfprintf>(), B<vsprintf>(), B<vsnprintf>()  "
6087 "are equivalent to the functions B<printf>(), B<fprintf>(), B<sprintf>(), "
6088 "B<snprintf>(), respectively, except that they are called with a I<va_list> "
6089 "instead of a variable number of arguments.  These functions do not call the "
6090 "I<va_end> macro.  Because they invoke the I<va_arg> macro, the value of "
6091 "I<ap> is undefined after the call.  See B<stdarg>(3)."
6092 msgstr ""
6093
6094 #. type: Plain text
6095 #: build/C/man3/printf.3:141
6096 msgid ""
6097 "These eight functions write the output under the control of a I<format> "
6098 "string that specifies how subsequent arguments (or arguments accessed via "
6099 "the variable-length argument facilities of B<stdarg>(3))  are converted for "
6100 "output."
6101 msgstr ""
6102
6103 #. type: Plain text
6104 #: build/C/man3/printf.3:152
6105 msgid ""
6106 "C99 and POSIX.1-2001 specify that the results are undefined if a call to "
6107 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), or B<vsnprintf>()  would cause "
6108 "copying to take place between objects that overlap (e.g., if the target "
6109 "string array and one of the supplied input arguments refer to the same "
6110 "buffer).  See NOTES."
6111 msgstr ""
6112
6113 #. type: SS
6114 #: build/C/man3/printf.3:152
6115 #, no-wrap
6116 msgid "Return value"
6117 msgstr ""
6118
6119 #. type: Plain text
6120 #: build/C/man3/printf.3:155
6121 msgid ""
6122 "Upon successful return, these functions return the number of characters "
6123 "printed (excluding the null byte used to end output to strings)."
6124 msgstr ""
6125
6126 #. type: Plain text
6127 #: build/C/man3/printf.3:171
6128 msgid ""
6129 "The functions B<snprintf>()  and B<vsnprintf>()  do not write more than "
6130 "I<size> bytes (including the terminating null byte (\\(aq\\e0\\(aq)).  If "
6131 "the output was truncated due to this limit then the return value is the "
6132 "number of characters (excluding the terminating null byte)  which would have "
6133 "been written to the final string if enough space had been available.  Thus, "
6134 "a return value of I<size> or more means that the output was truncated.  (See "
6135 "also below under NOTES.)"
6136 msgstr ""
6137
6138 #. type: Plain text
6139 #: build/C/man3/printf.3:173
6140 msgid "If an output error is encountered, a negative value is returned."
6141 msgstr ""
6142
6143 #. type: SS
6144 #: build/C/man3/printf.3:173
6145 #, no-wrap
6146 msgid "Format of the format string"
6147 msgstr ""
6148
6149 #. type: Plain text
6150 #: build/C/man3/printf.3:195
6151 msgid ""
6152 "The format string is a character string, beginning and ending in its initial "
6153 "shift state, if any.  The format string is composed of zero or more "
6154 "directives: ordinary characters (not B<%>), which are copied unchanged to "
6155 "the output stream; and conversion specifications, each of which results in "
6156 "fetching zero or more subsequent arguments.  Each conversion specification "
6157 "is introduced by the character B<%>, and ends with a I<conversion "
6158 "specifier>.  In between there may be (in this order) zero or more I<flags>, "
6159 "an optional minimum I<field width>, an optional I<precision> and an optional "
6160 "I<length modifier>."
6161 msgstr ""
6162
6163 #. type: Plain text
6164 #: build/C/man3/printf.3:208
6165 msgid ""
6166 "The arguments must correspond properly (after type promotion) with the "
6167 "conversion specifier.  By default, the arguments are used in the order "
6168 "given, where each \\(aq*\\(aq and each conversion specifier asks for the "
6169 "next argument (and it is an error if insufficiently many arguments are "
6170 "given).  One can also specify explicitly which argument is taken, at each "
6171 "place where an argument is required, by writing \"%m$\" instead of "
6172 "\\(aq%\\(aq and \"*m$\" instead of \\(aq*\\(aq, where the decimal integer m "
6173 "denotes the position in the argument list of the desired argument, indexed "
6174 "starting from 1.  Thus,"
6175 msgstr ""
6176
6177 #. type: Plain text
6178 #: build/C/man3/printf.3:212
6179 #, no-wrap
6180 msgid "printf(\"%*d\", width, num);\n"
6181 msgstr ""
6182
6183 #. type: Plain text
6184 #: build/C/man3/printf.3:216
6185 msgid "and"
6186 msgstr ""
6187
6188 #. type: Plain text
6189 #: build/C/man3/printf.3:220
6190 #, no-wrap
6191 msgid "printf(\"%2$*1$d\", width, num);\n"
6192 msgstr ""
6193
6194 #. type: Plain text
6195 #: build/C/man3/printf.3:236
6196 msgid ""
6197 "are equivalent.  The second style allows repeated references to the same "
6198 "argument.  The C99 standard does not include the style using \\(aq$\\(aq, "
6199 "which comes from the Single UNIX Specification.  If the style using "
6200 "\\(aq$\\(aq is used, it must be used throughout for all conversions taking "
6201 "an argument and all width and precision arguments, but it may be mixed with "
6202 "\"%%\" formats which do not consume an argument.  There may be no gaps in "
6203 "the numbers of arguments specified using \\(aq$\\(aq; for example, if "
6204 "arguments 1 and 3 are specified, argument 2 must also be specified somewhere "
6205 "in the format string."
6206 msgstr ""
6207
6208 #. type: Plain text
6209 #: build/C/man3/printf.3:246
6210 msgid ""
6211 "For some numeric conversions a radix character (\"decimal point\") or "
6212 "thousands' grouping character is used.  The actual character used depends on "
6213 "the B<LC_NUMERIC> part of the locale.  The POSIX locale uses \\(aq.\\(aq as "
6214 "radix character, and does not have a grouping character.  Thus,"
6215 msgstr ""
6216
6217 #. type: Plain text
6218 #: build/C/man3/printf.3:250
6219 #, no-wrap
6220 msgid "    printf(\"%\\(aq.2f\", 1234567.89);\n"
6221 msgstr ""
6222
6223 #. type: Plain text
6224 #: build/C/man3/printf.3:255
6225 msgid ""
6226 "results in \"1234567.89\" in the POSIX locale, in \"1234567,89\" in the "
6227 "nl_NL locale, and in \"1.234.567,89\" in the da_DK locale."
6228 msgstr ""
6229
6230 #. type: SS
6231 #: build/C/man3/printf.3:255
6232 #, no-wrap
6233 msgid "The flag characters"
6234 msgstr ""
6235
6236 #. type: Plain text
6237 #: build/C/man3/printf.3:257
6238 msgid "The character % is followed by zero or more of the following flags:"
6239 msgstr ""
6240
6241 #. type: TP
6242 #: build/C/man3/printf.3:257
6243 #, no-wrap
6244 msgid "B<#>"
6245 msgstr ""
6246
6247 #. type: Plain text
6248 #: build/C/man3/printf.3:291
6249 msgid ""
6250 "The value should be converted to an \"alternate form\".  For B<o> "
6251 "conversions, the first character of the output string is made zero (by "
6252 "prefixing a 0 if it was not zero already).  For B<x> and B<X> conversions, a "
6253 "nonzero result has the string \"0x\" (or \"0X\" for B<X> conversions) "
6254 "prepended to it.  For B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> "
6255 "conversions, the result will always contain a decimal point, even if no "
6256 "digits follow it (normally, a decimal point appears in the results of those "
6257 "conversions only if a digit follows).  For B<g> and B<G> conversions, "
6258 "trailing zeros are not removed from the result as they would otherwise be.  "
6259 "For other conversions, the result is undefined."
6260 msgstr ""
6261
6262 #. type: TP
6263 #: build/C/man3/printf.3:291
6264 #, no-wrap
6265 msgid "B<\\&0>"
6266 msgstr ""
6267
6268 #. type: Plain text
6269 #: build/C/man3/printf.3:331
6270 msgid ""
6271 "The value should be zero padded.  For B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, "
6272 "B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> conversions, the "
6273 "converted value is padded on the left with zeros rather than blanks.  If the "
6274 "B<\\&0> and B<-> flags both appear, the B<\\&0> flag is ignored.  If a "
6275 "precision is given with a numeric conversion (B<d>, B<i>, B<o>, B<u>, B<x>, "
6276 "and B<X>), the B<\\&0> flag is ignored.  For other conversions, the behavior "
6277 "is undefined."
6278 msgstr ""
6279
6280 #. type: TP
6281 #: build/C/man3/printf.3:331
6282 #, no-wrap
6283 msgid "B<->"
6284 msgstr ""
6285
6286 #. type: Plain text
6287 #: build/C/man3/printf.3:344
6288 msgid ""
6289 "The converted value is to be left adjusted on the field boundary.  (The "
6290 "default is right justification.)  Except for B<n> conversions, the converted "
6291 "value is padded on the right with blanks, rather than on the left with "
6292 "blanks or zeros.  A B<-> overrides a B<\\&0> if both are given."
6293 msgstr ""
6294
6295 #. type: TP
6296 #: build/C/man3/printf.3:344
6297 #, no-wrap
6298 msgid "B<\\(aq \\(aq>"
6299 msgstr ""
6300
6301 #. type: Plain text
6302 #: build/C/man3/printf.3:348
6303 msgid ""
6304 "(a space) A blank should be left before a positive number (or empty string) "
6305 "produced by a signed conversion."
6306 msgstr ""
6307
6308 #. type: TP
6309 #: build/C/man3/printf.3:348
6310 #, no-wrap
6311 msgid "B<+>"
6312 msgstr ""
6313
6314 #. type: Plain text
6315 #: build/C/man3/printf.3:356
6316 msgid ""
6317 "A sign (+ or -) should always be placed before a number produced by a signed "
6318 "conversion.  By default a sign is used only for negative numbers.  A B<+> "
6319 "overrides a space if both are used."
6320 msgstr ""
6321
6322 #. type: Plain text
6323 #: build/C/man3/printf.3:359
6324 msgid ""
6325 "The five flag characters above are defined in the C standard.  The SUSv2 "
6326 "specifies one further flag character."
6327 msgstr ""
6328
6329 #. type: TP
6330 #: build/C/man3/printf.3:359
6331 #, no-wrap
6332 msgid "B<\\(aq>"
6333 msgstr ""
6334
6335 #. type: Plain text
6336 #: build/C/man3/printf.3:376
6337 msgid ""
6338 "For decimal conversion (B<i>, B<d>, B<u>, B<f>, B<F>, B<g>, B<G>)  the "
6339 "output is to be grouped with thousands' grouping characters if the locale "
6340 "information indicates any.  Note that many versions of B<gcc>(1)  cannot "
6341 "parse this option and will issue a warning.  SUSv2 does not include "
6342 "I<%\\(aqF>."
6343 msgstr ""
6344
6345 #. type: Plain text
6346 #: build/C/man3/printf.3:378
6347 msgid "glibc 2.2 adds one further flag character."
6348 msgstr ""
6349
6350 #. type: TP
6351 #: build/C/man3/printf.3:378
6352 #, no-wrap
6353 msgid "B<I>"
6354 msgstr ""
6355
6356 #.  outdigits keyword in locale file
6357 #. type: Plain text
6358 #: build/C/man3/printf.3:388
6359 msgid ""
6360 "For decimal integer conversion (B<i>, B<d>, B<u>)  the output uses the "
6361 "locale's alternative output digits, if any.  For example, since glibc 2.2.3 "
6362 "this will give Arabic-Indic digits in the Persian (\"fa_IR\") locale."
6363 msgstr ""
6364
6365 #. type: SS
6366 #: build/C/man3/printf.3:388
6367 #, no-wrap
6368 msgid "The field width"
6369 msgstr ""
6370
6371 #. type: Plain text
6372 #: build/C/man3/printf.3:404
6373 msgid ""
6374 "An optional decimal digit string (with nonzero first digit) specifying a "
6375 "minimum field width.  If the converted value has fewer characters than the "
6376 "field width, it will be padded with spaces on the left (or right, if the "
6377 "left-adjustment flag has been given).  Instead of a decimal digit string one "
6378 "may write \"*\" or \"*m$\" (for some decimal integer I<m>) to specify that "
6379 "the field width is given in the next argument, or in the I<m>-th argument, "
6380 "respectively, which must be of type I<int>.  A negative field width is taken "
6381 "as a \\(aq-\\(aq flag followed by a positive field width.  In no case does a "
6382 "nonexistent or small field width cause truncation of a field; if the result "
6383 "of a conversion is wider than the field width, the field is expanded to "
6384 "contain the conversion result."
6385 msgstr ""
6386
6387 #. type: SS
6388 #: build/C/man3/printf.3:404
6389 #, no-wrap
6390 msgid "The precision"
6391 msgstr ""
6392
6393 #. type: Plain text
6394 #: build/C/man3/printf.3:440
6395 msgid ""
6396 "An optional precision, in the form of a period (\\(aq.\\(aq)  followed by an "
6397 "optional decimal digit string.  Instead of a decimal digit string one may "
6398 "write \"*\" or \"*m$\" (for some decimal integer m) to specify that the "
6399 "precision is given in the next argument, or in the m-th argument, "
6400 "respectively, which must be of type I<int>.  If the precision is given as "
6401 "just \\(aq.\\(aq, or the precision is negative, the precision is taken to be "
6402 "zero.  This gives the minimum number of digits to appear for B<d>, B<i>, "
6403 "B<o>, B<u>, B<x>, and B<X> conversions, the number of digits to appear after "
6404 "the radix character for B<a>, B<A>, B<e>, B<E>, B<f>, and B<F> conversions, "
6405 "the maximum number of significant digits for B<g> and B<G> conversions, or "
6406 "the maximum number of characters to be printed from a string for B<s> and "
6407 "B<S> conversions."
6408 msgstr ""
6409
6410 #. type: SS
6411 #: build/C/man3/printf.3:440
6412 #, no-wrap
6413 msgid "The length modifier"
6414 msgstr ""
6415
6416 #. type: Plain text
6417 #: build/C/man3/printf.3:450
6418 msgid ""
6419 "Here, \"integer conversion\" stands for B<d>, B<i>, B<o>, B<u>, B<x>, or "
6420 "B<X> conversion."
6421 msgstr ""
6422
6423 #. type: TP
6424 #: build/C/man3/printf.3:450 build/C/man3/scanf.3:291
6425 #, no-wrap
6426 msgid "B<hh>"
6427 msgstr ""
6428
6429 #. type: Plain text
6430 #: build/C/man3/printf.3:461
6431 msgid ""
6432 "A following integer conversion corresponds to a I<signed char> or I<unsigned "
6433 "char> argument, or a following B<n> conversion corresponds to a pointer to a "
6434 "I<signed char> argument."
6435 msgstr ""
6436
6437 #. type: TP
6438 #: build/C/man3/printf.3:461 build/C/man3/scanf.3:281
6439 #, no-wrap
6440 msgid "B<h>"
6441 msgstr ""
6442
6443 #. type: Plain text
6444 #: build/C/man3/printf.3:472
6445 msgid ""
6446 "A following integer conversion corresponds to a I<short int> or I<unsigned "
6447 "short int> argument, or a following B<n> conversion corresponds to a pointer "
6448 "to a I<short int> argument."
6449 msgstr ""
6450
6451 #. type: TP
6452 #: build/C/man3/printf.3:472 build/C/man3/scanf.3:308
6453 #, no-wrap
6454 msgid "B<l>"
6455 msgstr ""
6456
6457 #. type: Plain text
6458 #: build/C/man3/printf.3:491
6459 msgid ""
6460 "(ell) A following integer conversion corresponds to a I<long int> or "
6461 "I<unsigned long int> argument, or a following B<n> conversion corresponds to "
6462 "a pointer to a I<long int> argument, or a following B<c> conversion "
6463 "corresponds to a I<wint_t> argument, or a following B<s> conversion "
6464 "corresponds to a pointer to I<wchar_t> argument."
6465 msgstr ""
6466
6467 #. type: TP
6468 #: build/C/man3/printf.3:491
6469 #, no-wrap
6470 msgid "B<ll>"
6471 msgstr ""
6472
6473 #. type: Plain text
6474 #: build/C/man3/printf.3:503
6475 msgid ""
6476 "(ell-ell).  A following integer conversion corresponds to a I<long long int> "
6477 "or I<unsigned long long int> argument, or a following B<n> conversion "
6478 "corresponds to a pointer to a I<long long int> argument."
6479 msgstr ""
6480
6481 #. type: TP
6482 #: build/C/man3/printf.3:503 build/C/man3/scanf.3:335
6483 #, no-wrap
6484 msgid "B<L>"
6485 msgstr ""
6486
6487 #. type: Plain text
6488 #: build/C/man3/printf.3:519
6489 msgid ""
6490 "A following B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, or B<G> conversion "
6491 "corresponds to a I<long double> argument.  (C99 allows %LF, but SUSv2 does "
6492 "not.)"
6493 msgstr ""
6494
6495 #. type: TP
6496 #: build/C/man3/printf.3:519 build/C/man3/scanf.3:351
6497 #, no-wrap
6498 msgid "B<q>"
6499 msgstr ""
6500
6501 #. type: Plain text
6502 #: build/C/man3/printf.3:525
6503 msgid ""
6504 "(\"quad\". 4.4BSD and Linux libc5 only.  Don't use.)  This is a synonym for "
6505 "B<ll>."
6506 msgstr ""
6507
6508 #. type: TP
6509 #: build/C/man3/printf.3:525 build/C/man3/scanf.3:299
6510 #, no-wrap
6511 msgid "B<j>"
6512 msgstr ""
6513
6514 #. type: Plain text
6515 #: build/C/man3/printf.3:532
6516 msgid ""
6517 "A following integer conversion corresponds to an I<intmax_t> or I<uintmax_t> "
6518 "argument."
6519 msgstr ""
6520
6521 #. type: TP
6522 #: build/C/man3/printf.3:532 build/C/man3/scanf.3:363
6523 #, no-wrap
6524 msgid "B<z>"
6525 msgstr ""
6526
6527 #. type: Plain text
6528 #: build/C/man3/printf.3:543
6529 msgid ""
6530 "A following integer conversion corresponds to a I<size_t> or I<ssize_t> "
6531 "argument.  (Linux libc5 has B<Z> with this meaning.  Don't use it.)"
6532 msgstr ""
6533
6534 #. type: TP
6535 #: build/C/man3/printf.3:543 build/C/man3/scanf.3:356
6536 #, no-wrap
6537 msgid "B<t>"
6538 msgstr ""
6539
6540 #. type: Plain text
6541 #: build/C/man3/printf.3:548
6542 msgid "A following integer conversion corresponds to a I<ptrdiff_t> argument."
6543 msgstr ""
6544
6545 #. type: Plain text
6546 #: build/C/man3/printf.3:577
6547 msgid ""
6548 "The SUSv2 only knows about the length modifiers B<h> (in B<hd>, B<hi>, "
6549 "B<ho>, B<hx>, B<hX>, B<hn>)  and B<l> (in B<ld>, B<li>, B<lo>, B<lx>, B<lX>, "
6550 "B<ln>, B<lc>, B<ls>)  and B<L> (in B<Le>, B<LE>, B<Lf>, B<Lg>, B<LG>)."
6551 msgstr ""
6552
6553 #. type: SS
6554 #: build/C/man3/printf.3:577
6555 #, no-wrap
6556 msgid "The conversion specifier"
6557 msgstr ""
6558
6559 #. type: Plain text
6560 #: build/C/man3/printf.3:580
6561 msgid ""
6562 "A character that specifies the type of conversion to be applied.  The "
6563 "conversion specifiers and their meanings are:"
6564 msgstr ""
6565
6566 #. type: TP
6567 #: build/C/man3/printf.3:580
6568 #, no-wrap
6569 msgid "B<d>, B<i>"
6570 msgstr ""
6571
6572 #. type: Plain text
6573 #: build/C/man3/printf.3:590
6574 msgid ""
6575 "The I<int> argument is converted to signed decimal notation.  The precision, "
6576 "if any, gives the minimum number of digits that must appear; if the "
6577 "converted value requires fewer digits, it is padded on the left with zeros.  "
6578 "The default precision is 1.  When 0 is printed with an explicit precision 0, "
6579 "the output is empty."
6580 msgstr ""
6581
6582 #. type: TP
6583 #: build/C/man3/printf.3:590
6584 #, no-wrap
6585 msgid "B<o>, B<u>, B<x>, B<X>"
6586 msgstr ""
6587
6588 #. type: Plain text
6589 #: build/C/man3/printf.3:617
6590 msgid ""
6591 "The I<unsigned int> argument is converted to unsigned octal (B<o>), unsigned "
6592 "decimal (B<u>), or unsigned hexadecimal (B<x> and B<X>)  notation.  The "
6593 "letters B<abcdef> are used for B<x> conversions; the letters B<ABCDEF> are "
6594 "used for B<X> conversions.  The precision, if any, gives the minimum number "
6595 "of digits that must appear; if the converted value requires fewer digits, it "
6596 "is padded on the left with zeros.  The default precision is 1.  When 0 is "
6597 "printed with an explicit precision 0, the output is empty."
6598 msgstr ""
6599
6600 #. type: TP
6601 #: build/C/man3/printf.3:617
6602 #, no-wrap
6603 msgid "B<e>, B<E>"
6604 msgstr ""
6605
6606 #. type: Plain text
6607 #: build/C/man3/printf.3:622
6608 msgid "The I<double> argument is rounded and converted in the style"
6609 msgstr ""
6610
6611 #. type: Plain text
6612 #: build/C/man3/printf.3:637
6613 msgid ""
6614 "[-]dB<\\&.>dddB<e>\\*(Pmdd where there is one digit before the decimal-point "
6615 "character and the number of digits after it is equal to the precision; if "
6616 "the precision is missing, it is taken as 6; if the precision is zero, no "
6617 "decimal-point character appears.  An B<E> conversion uses the letter B<E> "
6618 "(rather than B<e>)  to introduce the exponent.  The exponent always contains "
6619 "at least two digits; if the value is zero, the exponent is 00."
6620 msgstr ""
6621
6622 #. type: TP
6623 #: build/C/man3/printf.3:637
6624 #, no-wrap
6625 msgid "B<f>, B<F>"
6626 msgstr ""
6627
6628 #. type: Plain text
6629 #: build/C/man3/printf.3:648
6630 msgid ""
6631 "The I<double> argument is rounded and converted to decimal notation in the "
6632 "style [-]dddB<\\&.>ddd, where the number of digits after the decimal-point "
6633 "character is equal to the precision specification.  If the precision is "
6634 "missing, it is taken as 6; if the precision is explicitly zero, no "
6635 "decimal-point character appears.  If a decimal point appears, at least one "
6636 "digit appears before it."
6637 msgstr ""
6638
6639 #. type: Plain text
6640 #: build/C/man3/printf.3:659
6641 msgid ""
6642 "(The SUSv2 does not know about B<F> and says that character string "
6643 "representations for infinity and NaN may be made available.  The C99 "
6644 "standard specifies \"[-]inf\" or \"[-]infinity\" for infinity, and a string "
6645 "starting with \"nan\" for NaN, in the case of B<f> conversion, and "
6646 "\"[-]INF\" or \"[-]INFINITY\" or \"NAN*\" in the case of B<F> conversion.)"
6647 msgstr ""
6648
6649 #. type: TP
6650 #: build/C/man3/printf.3:659
6651 #, no-wrap
6652 msgid "B<g>, B<G>"
6653 msgstr ""
6654
6655 #. type: Plain text
6656 #: build/C/man3/printf.3:684
6657 msgid ""
6658 "The I<double> argument is converted in style B<f> or B<e> (or B<F> or B<E> "
6659 "for B<G> conversions).  The precision specifies the number of significant "
6660 "digits.  If the precision is missing, 6 digits are given; if the precision "
6661 "is zero, it is treated as 1.  Style B<e> is used if the exponent from its "
6662 "conversion is less than -4 or greater than or equal to the precision.  "
6663 "Trailing zeros are removed from the fractional part of the result; a decimal "
6664 "point appears only if it is followed by at least one digit."
6665 msgstr ""
6666
6667 #. type: TP
6668 #: build/C/man3/printf.3:684
6669 #, no-wrap
6670 msgid "B<a>, B<A>"
6671 msgstr ""
6672
6673 #. type: Plain text
6674 #: build/C/man3/printf.3:708
6675 msgid ""
6676 "(C99; not in SUSv2) For B<a> conversion, the I<double> argument is converted "
6677 "to hexadecimal notation (using the letters abcdef)  in the style "
6678 "[-]B<0x>hB<\\&.>hhhhB<p>\\*(Pmd; for B<A> conversion the prefix B<0X>, the "
6679 "letters ABCDEF, and the exponent separator B<P> is used.  There is one "
6680 "hexadecimal digit before the decimal point, and the number of digits after "
6681 "it is equal to the precision.  The default precision suffices for an exact "
6682 "representation of the value if an exact representation in base 2 exists and "
6683 "otherwise is sufficiently large to distinguish values of type I<double>.  "
6684 "The digit before the decimal point is unspecified for nonnormalized numbers, "
6685 "and nonzero but otherwise unspecified for normalized numbers."
6686 msgstr ""
6687
6688 #. type: TP
6689 #: build/C/man3/printf.3:708 build/C/man3/scanf.3:456 build/C/man3/wprintf.3:132
6690 #, no-wrap
6691 msgid "B<c>"
6692 msgstr ""
6693
6694 #. type: Plain text
6695 #: build/C/man3/printf.3:726
6696 msgid ""
6697 "If no B<l> modifier is present, the I<int> argument is converted to an "
6698 "I<unsigned char>, and the resulting character is written.  If an B<l> "
6699 "modifier is present, the I<wint_t> (wide character) argument is converted to "
6700 "a multibyte sequence by a call to the B<wcrtomb>(3)  function, with a "
6701 "conversion state starting in the initial state, and the resulting multibyte "
6702 "string is written."
6703 msgstr ""
6704
6705 #. type: TP
6706 #: build/C/man3/printf.3:726 build/C/man3/scanf.3:448 build/C/man3/wprintf.3:146
6707 #, no-wrap
6708 msgid "B<s>"
6709 msgstr ""
6710
6711 #. type: Plain text
6712 #: build/C/man3/printf.3:741
6713 msgid ""
6714 "If no B<l> modifier is present: The I<const char *> argument is expected to "
6715 "be a pointer to an array of character type (pointer to a string).  "
6716 "Characters from the array are written up to (but not including) a "
6717 "terminating null byte (\\(aq\\e0\\(aq); if a precision is specified, no more "
6718 "than the number specified are written.  If a precision is given, no null "
6719 "byte need be present; if the precision is not specified, or is greater than "
6720 "the size of the array, the array must contain a terminating null byte."
6721 msgstr ""
6722
6723 #. type: Plain text
6724 #: build/C/man3/printf.3:768
6725 msgid ""
6726 "If an B<l> modifier is present: The I<const wchar_t *> argument is expected "
6727 "to be a pointer to an array of wide characters.  Wide characters from the "
6728 "array are converted to multibyte characters (each by a call to the "
6729 "B<wcrtomb>(3)  function, with a conversion state starting in the initial "
6730 "state before the first wide character), up to and including a terminating "
6731 "null wide character.  The resulting multibyte characters are written up to "
6732 "(but not including) the terminating null byte.  If a precision is specified, "
6733 "no more bytes than the number specified are written, but no partial "
6734 "multibyte characters are written.  Note that the precision determines the "
6735 "number of I<bytes> written, not the number of I<wide characters> or I<screen "
6736 "positions>.  The array must contain a terminating null wide character, "
6737 "unless a precision is given and it is so small that the number of bytes "
6738 "written exceeds it before the end of the array is reached."
6739 msgstr ""
6740
6741 #. type: TP
6742 #: build/C/man3/printf.3:768
6743 #, no-wrap
6744 msgid "B<C>"
6745 msgstr ""
6746
6747 #. type: Plain text
6748 #: build/C/man3/printf.3:774
6749 msgid "(Not in C99, but in SUSv2.)  Synonym for B<lc>.  Don't use."
6750 msgstr ""
6751
6752 #. type: TP
6753 #: build/C/man3/printf.3:774
6754 #, no-wrap
6755 msgid "B<S>"
6756 msgstr ""
6757
6758 #. type: Plain text
6759 #: build/C/man3/printf.3:780
6760 msgid "(Not in C99, but in SUSv2.)  Synonym for B<ls>.  Don't use."
6761 msgstr ""
6762
6763 #. type: TP
6764 #: build/C/man3/printf.3:780 build/C/man3/scanf.3:500
6765 #, no-wrap
6766 msgid "B<p>"
6767 msgstr ""
6768
6769 #. type: Plain text
6770 #: build/C/man3/printf.3:788
6771 msgid ""
6772 "The I<void *> pointer argument is printed in hexadecimal (as if by B<%#x> or "
6773 "B<%#lx>)."
6774 msgstr ""
6775
6776 #. type: TP
6777 #: build/C/man3/printf.3:788 build/C/man3/scanf.3:508
6778 #, no-wrap
6779 msgid "B<n>"
6780 msgstr ""
6781
6782 #. type: Plain text
6783 #: build/C/man3/printf.3:795
6784 msgid ""
6785 "The number of characters written so far is stored into the integer indicated "
6786 "by the I<int *> (or variant) pointer argument.  No argument is converted."
6787 msgstr ""
6788
6789 #. type: TP
6790 #: build/C/man3/printf.3:795
6791 #, no-wrap
6792 msgid "B<m>"
6793 msgstr ""
6794
6795 #. type: Plain text
6796 #: build/C/man3/printf.3:801
6797 msgid ""
6798 "(Glibc extension.)  Print output of I<strerror(errno)>.  No argument is "
6799 "required."
6800 msgstr ""
6801
6802 #. type: TP
6803 #: build/C/man3/printf.3:801 build/C/man3/scanf.3:374
6804 #, no-wrap
6805 msgid "B<%>"
6806 msgstr ""
6807
6808 #. type: Plain text
6809 #: build/C/man3/printf.3:807
6810 msgid ""
6811 "A \\(aq%\\(aq is written.  No argument is converted.  The complete "
6812 "conversion specification is \\(aq%%\\(aq."
6813 msgstr ""
6814
6815 #. type: Plain text
6816 #: build/C/man3/printf.3:822
6817 msgid ""
6818 "The B<fprintf>(), B<printf>(), B<sprintf>(), B<vprintf>(), B<vfprintf>(), "
6819 "and B<vsprintf>()  functions conform to C89 and C99.  The B<snprintf>()  and "
6820 "B<vsnprintf>()  functions conform to C99."
6821 msgstr ""
6822
6823 #. type: Plain text
6824 #: build/C/man3/printf.3:835
6825 msgid ""
6826 "Concerning the return value of B<snprintf>(), SUSv2 and C99 contradict each "
6827 "other: when B<snprintf>()  is called with I<size>=0 then SUSv2 stipulates an "
6828 "unspecified return value less than 1, while C99 allows I<str> to be NULL in "
6829 "this case, and gives the return value (as always)  as the number of "
6830 "characters that would have been written in case the output string has been "
6831 "large enough."
6832 msgstr ""
6833
6834 #. type: Plain text
6835 #: build/C/man3/printf.3:849
6836 msgid ""
6837 "Linux libc4 knows about the five C standard flags.  It knows about the "
6838 "length modifiers B<h>, B<l>, B<L>, and the conversions B<c>, B<d>, B<e>, "
6839 "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 "
6840 "B<X>, where B<F> is a synonym for B<f>.  Additionally, it accepts B<D>, "
6841 "B<O>, and B<U> as synonyms for B<ld>, B<lo>, and B<lu>.  (This is bad, and "
6842 "caused serious bugs later, when support for B<%D> disappeared.)  No "
6843 "locale-dependent radix character, no thousands' separator, no NaN or "
6844 "infinity, no \"%m$\" and \"*m$\"."
6845 msgstr ""
6846
6847 #. type: Plain text
6848 #: build/C/man3/printf.3:860
6849 msgid ""
6850 "Linux libc5 knows about the five C standard flags and the \\(aq flag, "
6851 "locale, \"%m$\" and \"*m$\".  It knows about the length modifiers B<h>, "
6852 "B<l>, B<L>, B<Z>, and B<q>, but accepts B<L> and B<q> both for I<long "
6853 "double> and for I<long long int> (this is a bug).  It no longer recognizes "
6854 "B<F>, B<D>, B<O>, and B<U>, but adds the conversion character B<m>, which "
6855 "outputs I<strerror(errno)>."
6856 msgstr ""
6857
6858 #. type: Plain text
6859 #: build/C/man3/printf.3:862
6860 msgid "glibc 2.0 adds conversion characters B<C> and B<S>."
6861 msgstr ""
6862
6863 #. type: Plain text
6864 #: build/C/man3/printf.3:865
6865 msgid ""
6866 "glibc 2.1 adds length modifiers B<hh>, B<j>, B<t>, and B<z> and conversion "
6867 "characters B<a> and B<A>."
6868 msgstr ""
6869
6870 #. type: Plain text
6871 #: build/C/man3/printf.3:868
6872 msgid ""
6873 "glibc 2.2 adds the conversion character B<F> with C99 semantics, and the "
6874 "flag character B<I>."
6875 msgstr ""
6876
6877 #. type: Plain text
6878 #: build/C/man3/printf.3:870
6879 msgid "Some programs imprudently rely on code such as the following"
6880 msgstr ""
6881
6882 #. type: Plain text
6883 #: build/C/man3/printf.3:872
6884 #, no-wrap
6885 msgid "    sprintf(buf, \"%s some further text\", buf);\n"
6886 msgstr ""
6887
6888 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7075
6889 #. type: Plain text
6890 #: build/C/man3/printf.3:888
6891 msgid ""
6892 "to append text to I<buf>.  However, the standards explicitly note that the "
6893 "results are undefined if source and destination buffers overlap when calling "
6894 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), and B<vsnprintf>().  Depending "
6895 "on the version of B<gcc>(1)  used, and the compiler options employed, calls "
6896 "such as the above will B<not> produce the expected results."
6897 msgstr ""
6898
6899 #.  .SH HISTORY
6900 #.  UNIX V7 defines the three routines
6901 #.  .BR printf (),
6902 #.  .BR fprintf (),
6903 #.  .BR sprintf (),
6904 #.  and has the flag \-, the width or precision *, the length modifier l,
6905 #.  and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx.
6906 #.  This is still true for 2.9.1BSD, but 2.10BSD has the flags
6907 #.  #, + and <space> and no longer mentions D,O,U,X.
6908 #.  2.11BSD has
6909 #.  .BR vprintf (),
6910 #.  .BR vfprintf (),
6911 #.  .BR vsprintf (),
6912 #.  and warns not to use D,O,U,X.
6913 #.  4.3BSD Reno has the flag 0, the length modifiers h and L,
6914 #.  and the conversions n, p, E, G, X (with current meaning)
6915 #.  and deprecates D,O,U.
6916 #.  4.4BSD introduces the functions
6917 #.  .BR snprintf ()
6918 #.  and
6919 #.  .BR vsnprintf (),
6920 #.  and the length modifier q.
6921 #.  FreeBSD also has functions
6922 #.  .BR asprintf ()
6923 #.  and
6924 #.  .BR vasprintf (),
6925 #.  that allocate a buffer large enough for
6926 #.  .BR sprintf ().
6927 #.  In glibc there are functions
6928 #.  .BR dprintf ()
6929 #.  and
6930 #.  .BR vdprintf ()
6931 #.  that print to a file descriptor instead of a stream.
6932 #. type: Plain text
6933 #: build/C/man3/printf.3:930
6934 msgid ""
6935 "The glibc implementation of the functions B<snprintf>()  and B<vsnprintf>()  "
6936 "conforms to the C99 standard, that is, behaves as described above, since "
6937 "glibc version 2.1.  Until glibc 2.0.6 they would return -1 when the output "
6938 "was truncated."
6939 msgstr ""
6940
6941 #. type: Plain text
6942 #: build/C/man3/printf.3:947
6943 msgid ""
6944 "Because B<sprintf>()  and B<vsprintf>()  assume an arbitrarily long string, "
6945 "callers must be careful not to overflow the actual space; this is often "
6946 "impossible to assure.  Note that the length of the strings produced is "
6947 "locale-dependent and difficult to predict.  Use B<snprintf>()  and "
6948 "B<vsnprintf>()  instead (or B<asprintf>(3)  and B<vasprintf>(3))."
6949 msgstr ""
6950
6951 #. type: Plain text
6952 #: build/C/man3/printf.3:960
6953 msgid ""
6954 "Linux libc4.[45] does not have a B<snprintf>(), but provides a libbsd that "
6955 "contains an B<snprintf>()  equivalent to B<sprintf>(), that is, one that "
6956 "ignores the I<size> argument.  Thus, the use of B<snprintf>()  with early "
6957 "libc4 leads to serious security problems."
6958 msgstr ""
6959
6960 #.  .PP
6961 #.  Some floating-point conversions under early libc4
6962 #.  caused memory leaks.
6963 #. type: Plain text
6964 #: build/C/man3/printf.3:974
6965 msgid ""
6966 "Code such as B<printf(>I<foo>B<);> often indicates a bug, since I<foo> may "
6967 "contain a % character.  If I<foo> comes from untrusted user input, it may "
6968 "contain B<%n>, causing the B<printf>()  call to write to memory and creating "
6969 "a security hole."
6970 msgstr ""
6971
6972 #. type: Plain text
6973 #: build/C/man3/printf.3:977
6974 msgid "To print \\*(Pi to five decimal places:"
6975 msgstr ""
6976
6977 #. type: Plain text
6978 #: build/C/man3/printf.3:983
6979 #, no-wrap
6980 msgid ""
6981 "#include E<lt>math.hE<gt>\n"
6982 "#include E<lt>stdio.hE<gt>\n"
6983 "fprintf(stdout, \"pi = %.5f\\en\", 4 * atan(1.0));\n"
6984 msgstr ""
6985
6986 #. type: Plain text
6987 #: build/C/man3/printf.3:992
6988 msgid ""
6989 "To print a date and time in the form \"Sunday, July 3, 10:02\", where "
6990 "I<weekday> and I<month> are pointers to strings:"
6991 msgstr ""
6992
6993 #. type: Plain text
6994 #: build/C/man3/printf.3:998
6995 #, no-wrap
6996 msgid ""
6997 "#include E<lt>stdio.hE<gt>\n"
6998 "fprintf(stdout, \"%s, %s %d, %.2d:%.2d\\en\",\n"
6999 "        weekday, month, day, hour, min);\n"
7000 msgstr ""
7001
7002 #. type: Plain text
7003 #: build/C/man3/printf.3:1004
7004 msgid ""
7005 "Many countries use the day-month-year order.  Hence, an internationalized "
7006 "version must be able to print the arguments in an order specified by the "
7007 "format:"
7008 msgstr ""
7009
7010 #. type: Plain text
7011 #: build/C/man3/printf.3:1010
7012 #, no-wrap
7013 msgid ""
7014 "#include E<lt>stdio.hE<gt>\n"
7015 "fprintf(stdout, format,\n"
7016 "        weekday, month, day, hour, min);\n"
7017 msgstr ""
7018
7019 #. type: Plain text
7020 #: build/C/man3/printf.3:1017
7021 msgid ""
7022 "where I<format> depends on locale, and may permute the arguments.  With the "
7023 "value:"
7024 msgstr ""
7025
7026 #. type: Plain text
7027 #: build/C/man3/printf.3:1021
7028 #, no-wrap
7029 msgid "\"%1$s, %3$d. %2$s, %4$d:%5$.2d\\en\"\n"
7030 msgstr ""
7031
7032 #. type: Plain text
7033 #: build/C/man3/printf.3:1025
7034 msgid "one might obtain \"Sonntag, 3. Juli, 10:02\"."
7035 msgstr ""
7036
7037 #. type: Plain text
7038 #: build/C/man3/printf.3:1028
7039 msgid ""
7040 "To allocate a sufficiently large string and print into it (code correct for "
7041 "both glibc 2.0 and glibc 2.1):"
7042 msgstr ""
7043
7044 #. type: Plain text
7045 #: build/C/man3/printf.3:1033
7046 #, no-wrap
7047 msgid ""
7048 "#include E<lt>stdio.hE<gt>\n"
7049 "#include E<lt>stdlib.hE<gt>\n"
7050 "#include E<lt>stdarg.hE<gt>\n"
7051 msgstr ""
7052
7053 #. type: Plain text
7054 #: build/C/man3/printf.3:1041
7055 #, no-wrap
7056 msgid ""
7057 "char *\n"
7058 "make_message(const char *fmt, ...)\n"
7059 "{\n"
7060 "    int n;\n"
7061 "    int size = 100;     /* Guess we need no more than 100 bytes. */\n"
7062 "    char *p, *np;\n"
7063 "    va_list ap;\n"
7064 msgstr ""
7065
7066 #. type: Plain text
7067 #: build/C/man3/printf.3:1044
7068 #, no-wrap
7069 msgid ""
7070 "    if ((p = malloc(size)) == NULL)\n"
7071 "        return NULL;\n"
7072 msgstr ""
7073
7074 #. type: Plain text
7075 #: build/C/man3/printf.3:1046
7076 #, no-wrap
7077 msgid "    while (1) {\n"
7078 msgstr ""
7079
7080 #. type: Plain text
7081 #: build/C/man3/printf.3:1048
7082 #, no-wrap
7083 msgid "        /* Try to print in the allocated space. */\n"
7084 msgstr ""
7085
7086 #. type: Plain text
7087 #: build/C/man3/printf.3:1052
7088 #, no-wrap
7089 msgid ""
7090 "        va_start(ap, fmt);\n"
7091 "        n = vsnprintf(p, size, fmt, ap);\n"
7092 "        va_end(ap);\n"
7093 msgstr ""
7094
7095 #. type: Plain text
7096 #: build/C/man3/printf.3:1054
7097 #, no-wrap
7098 msgid "        /* If that worked, return the string. */\n"
7099 msgstr ""
7100
7101 #. type: Plain text
7102 #: build/C/man3/printf.3:1057
7103 #, no-wrap
7104 msgid ""
7105 "        if (n E<gt> -1 && n E<lt> size)\n"
7106 "            return p;\n"
7107 msgstr ""
7108
7109 #. type: Plain text
7110 #: build/C/man3/printf.3:1059
7111 #, no-wrap
7112 msgid "        /* Else try again with more space. */\n"
7113 msgstr ""
7114
7115 #. type: Plain text
7116 #: build/C/man3/printf.3:1064
7117 #, no-wrap
7118 msgid ""
7119 "        if (n E<gt> -1)    /* glibc 2.1 */\n"
7120 "            size = n+1; /* precisely what is needed */\n"
7121 "        else           /* glibc 2.0 */\n"
7122 "            size *= 2;  /* twice the old size */\n"
7123 msgstr ""
7124
7125 #. type: Plain text
7126 #: build/C/man3/printf.3:1073
7127 #, no-wrap
7128 msgid ""
7129 "        if ((np = realloc (p, size)) == NULL) {\n"
7130 "            free(p);\n"
7131 "            return NULL;\n"
7132 "        } else {\n"
7133 "            p = np;\n"
7134 "        }\n"
7135 "    }\n"
7136 "}\n"
7137 msgstr ""
7138
7139 #. type: Plain text
7140 #: build/C/man3/printf.3:1083
7141 msgid ""
7142 "B<printf>(1), B<asprintf>(3), B<dprintf>(3), B<scanf>(3), B<setlocale>(3), "
7143 "B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)"
7144 msgstr ""
7145
7146 #. type: TH
7147 #: build/C/man3/puts.3:24
7148 #, no-wrap
7149 msgid "PUTS"
7150 msgstr ""
7151
7152 #. type: Plain text
7153 #: build/C/man3/puts.3:27
7154 msgid "fputc, fputs, putc, putchar, puts - output of characters and strings"
7155 msgstr ""
7156
7157 #. type: Plain text
7158 #: build/C/man3/puts.3:32
7159 #, no-wrap
7160 msgid "B<int fputc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7161 msgstr ""
7162
7163 #. type: Plain text
7164 #: build/C/man3/puts.3:34
7165 #, no-wrap
7166 msgid "B<int fputs(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
7167 msgstr ""
7168
7169 #. type: Plain text
7170 #: build/C/man3/puts.3:36
7171 #, no-wrap
7172 msgid "B<int putc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7173 msgstr ""
7174
7175 #. type: Plain text
7176 #: build/C/man3/puts.3:38
7177 #, no-wrap
7178 msgid "B<int putchar(int >I<c>B<);>\n"
7179 msgstr ""
7180
7181 #. type: Plain text
7182 #: build/C/man3/puts.3:40
7183 #, no-wrap
7184 msgid "B<int puts(const char *>I<s>B<);>\n"
7185 msgstr ""
7186
7187 #. type: Plain text
7188 #: build/C/man3/puts.3:49
7189 msgid ""
7190 "B<fputc>()  writes the character I<c>, cast to an I<unsigned char>, to "
7191 "I<stream>."
7192 msgstr ""
7193
7194 #. type: Plain text
7195 #: build/C/man3/puts.3:56
7196 msgid ""
7197 "B<fputs>()  writes the string I<s> to I<stream>, without its terminating "
7198 "null byte (\\(aq\\e0\\(aq)."
7199 msgstr ""
7200
7201 #. type: Plain text
7202 #: build/C/man3/puts.3:63
7203 msgid ""
7204 "B<putc>()  is equivalent to B<fputc>()  except that it may be implemented as "
7205 "a macro which evaluates I<stream> more than once."
7206 msgstr ""
7207
7208 #. type: Plain text
7209 #: build/C/man3/puts.3:67
7210 msgid "B<putchar(>I<c>B<);> is equivalent to B<putc(>I<c>B<,>I<stdout>B<).>"
7211 msgstr ""
7212
7213 #. type: Plain text
7214 #: build/C/man3/puts.3:74
7215 msgid "B<puts>()  writes the string I<s> and a trailing newline to I<stdout>."
7216 msgstr ""
7217
7218 #. type: Plain text
7219 #: build/C/man3/puts.3:79
7220 msgid ""
7221 "Calls to the functions described here can be mixed with each other and with "
7222 "calls to other output functions from the I<stdio> library for the same "
7223 "output stream."
7224 msgstr ""
7225
7226 #. type: Plain text
7227 #: build/C/man3/puts.3:94
7228 msgid ""
7229 "B<fputc>(), B<putc>()  and B<putchar>()  return the character written as an "
7230 "I<unsigned char> cast to an I<int> or B<EOF> on error."
7231 msgstr ""
7232
7233 #. type: Plain text
7234 #: build/C/man3/puts.3:101
7235 msgid ""
7236 "B<puts>()  and B<fputs>()  return a nonnegative number on success, or B<EOF> "
7237 "on error."
7238 msgstr ""
7239
7240 #. type: Plain text
7241 #: build/C/man3/puts.3:110
7242 msgid ""
7243 "It is not advisable to mix calls to output functions from the I<stdio> "
7244 "library with low-level calls to B<write>(2)  for the file descriptor "
7245 "associated with the same output stream; the results will be undefined and "
7246 "very probably not what you want."
7247 msgstr ""
7248
7249 #. type: Plain text
7250 #: build/C/man3/puts.3:122
7251 msgid ""
7252 "B<write>(2), B<ferror>(3), B<fopen>(3), B<fputwc>(3), B<fputws>(3), "
7253 "B<fseek>(3), B<fwrite>(3), B<gets>(3), B<putwchar>(3), B<scanf>(3), "
7254 "B<unlocked_stdio>(3)"
7255 msgstr ""
7256
7257 #. type: TH
7258 #: build/C/man2/read.2:35
7259 #, no-wrap
7260 msgid "READ"
7261 msgstr ""
7262
7263 #. type: Plain text
7264 #: build/C/man2/read.2:38
7265 msgid "read - read from a file descriptor"
7266 msgstr ""
7267
7268 #. type: Plain text
7269 #: build/C/man2/read.2:43
7270 #, no-wrap
7271 msgid "B<ssize_t read(int >I<fd>B<, void *>I<buf>B<, size_t >I<count>B<);>\n"
7272 msgstr ""
7273
7274 #. type: Plain text
7275 #: build/C/man2/read.2:52
7276 msgid ""
7277 "B<read>()  attempts to read up to I<count> bytes from file descriptor I<fd> "
7278 "into the buffer starting at I<buf>."
7279 msgstr ""
7280
7281 #. type: Plain text
7282 #: build/C/man2/read.2:63
7283 msgid ""
7284 "If I<count> is zero, B<read>()  returns zero and has no other results.  If "
7285 "I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
7286 msgstr ""
7287
7288 #. type: Plain text
7289 #: build/C/man2/read.2:77
7290 msgid ""
7291 "On success, the number of bytes read is returned (zero indicates end of "
7292 "file), and the file position is advanced by this number.  It is not an error "
7293 "if this number is smaller than the number of bytes requested; this may "
7294 "happen for example because fewer bytes are actually available right now "
7295 "(maybe because we were close to end-of-file, or because we are reading from "
7296 "a pipe, or from a terminal), or because B<read>()  was interrupted by a "
7297 "signal.  On error, -1 is returned, and I<errno> is set appropriately.  In "
7298 "this case it is left unspecified whether the file position (if any) changes."
7299 msgstr ""
7300
7301 #. type: TP
7302 #: build/C/man2/read.2:78 build/C/man3/scanf.3:546 build/C/man2/write.2:108
7303 #, no-wrap
7304 msgid "B<EAGAIN>"
7305 msgstr ""
7306
7307 #. type: Plain text
7308 #: build/C/man2/read.2:85
7309 msgid ""
7310 "The file descriptor I<fd> refers to a file other than a socket and has been "
7311 "marked nonblocking (B<O_NONBLOCK>), and the read would block."
7312 msgstr ""
7313
7314 #. type: TP
7315 #: build/C/man2/read.2:85 build/C/man2/write.2:115
7316 #, no-wrap
7317 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
7318 msgstr ""
7319
7320 #.  Actually EAGAIN on Linux
7321 #. type: Plain text
7322 #: build/C/man2/read.2:96
7323 msgid ""
7324 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
7325 "(B<O_NONBLOCK>), and the read would block.  POSIX.1-2001 allows either error "
7326 "to be returned for this case, and does not require these constants to have "
7327 "the same value, so a portable application should check for both "
7328 "possibilities."
7329 msgstr ""
7330
7331 #. type: Plain text
7332 #: build/C/man2/read.2:100
7333 msgid "I<fd> is not a valid file descriptor or is not open for reading."
7334 msgstr ""
7335
7336 #. type: Plain text
7337 #: build/C/man2/read.2:104 build/C/man2/write.2:139
7338 msgid "I<buf> is outside your accessible address space."
7339 msgstr ""
7340
7341 #. type: Plain text
7342 #: build/C/man2/read.2:108
7343 msgid ""
7344 "The call was interrupted by a signal before any data was read; see "
7345 "B<signal>(7)."
7346 msgstr ""
7347
7348 #. type: Plain text
7349 #: build/C/man2/read.2:119
7350 msgid ""
7351 "I<fd> is attached to an object which is unsuitable for reading; or the file "
7352 "was opened with the B<O_DIRECT> flag, and either the address specified in "
7353 "I<buf>, the value specified in I<count>, or the current file offset is not "
7354 "suitably aligned."
7355 msgstr ""
7356
7357 #. type: Plain text
7358 #: build/C/man2/read.2:129
7359 msgid ""
7360 "I<fd> was created via a call to B<timerfd_create>(2)  and the wrong size "
7361 "buffer was given to B<read>(); see B<timerfd_create>(2)  for further "
7362 "information."
7363 msgstr ""
7364
7365 #. type: Plain text
7366 #: build/C/man2/read.2:140
7367 msgid ""
7368 "I/O error.  This will happen for example when the process is in a background "
7369 "process group, tries to read from its controlling tty, and either it is "
7370 "ignoring or blocking B<SIGTTIN> or its process group is orphaned.  It may "
7371 "also occur when there is a low-level I/O error while reading from a disk or "
7372 "tape."
7373 msgstr ""
7374
7375 #. type: Plain text
7376 #: build/C/man2/read.2:144
7377 msgid "I<fd> refers to a directory."
7378 msgstr ""
7379
7380 #. type: Plain text
7381 #: build/C/man2/read.2:155
7382 msgid ""
7383 "Other errors may occur, depending on the object connected to I<fd>.  POSIX "
7384 "allows a B<read>()  that is interrupted after reading some data to return -1 "
7385 "(with I<errno> set to B<EINTR>)  or to return the number of bytes already "
7386 "read."
7387 msgstr ""
7388
7389 #. type: Plain text
7390 #: build/C/man2/read.2:169
7391 msgid ""
7392 "On NFS file systems, reading small amounts of data will only update the "
7393 "timestamp the first time, subsequent calls may not do so.  This is caused by "
7394 "client side attribute caching, because most if not all NFS clients leave "
7395 "st_atime (last file access time)  updates to the server and client side "
7396 "reads satisfied from the client's cache will not cause st_atime updates on "
7397 "the server as there are no server side reads.  UNIX semantics can be "
7398 "obtained by disabling client side attribute caching, but in most situations "
7399 "this will substantially increase server load and decrease performance."
7400 msgstr ""
7401
7402 #. type: Plain text
7403 #: build/C/man2/read.2:178
7404 msgid ""
7405 "Many file systems and disks were considered to be fast enough that the "
7406 "implementation of B<O_NONBLOCK> was deemed unnecessary.  So, B<O_NONBLOCK> "
7407 "may not be available on files and/or disks."
7408 msgstr ""
7409
7410 #. type: Plain text
7411 #: build/C/man2/read.2:191
7412 msgid ""
7413 "B<close>(2), B<fcntl>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), B<pread>(2), "
7414 "B<readdir>(2), B<readlink>(2), B<readv>(2), B<select>(2), B<write>(2), "
7415 "B<fread>(3)"
7416 msgstr ""
7417
7418 #. type: TH
7419 #: build/C/man2/readlink.2:41
7420 #, no-wrap
7421 msgid "READLINK"
7422 msgstr ""
7423
7424 #. type: TH
7425 #: build/C/man2/readlink.2:41
7426 #, no-wrap
7427 msgid "2011-09-20"
7428 msgstr ""
7429
7430 #. type: Plain text
7431 #: build/C/man2/readlink.2:44
7432 msgid "readlink - read value of a symbolic link"
7433 msgstr ""
7434
7435 #. type: Plain text
7436 #: build/C/man2/readlink.2:48
7437 msgid ""
7438 "B<ssize_t readlink(const char *>I<path>B<, char *>I<buf>B<, size_t "
7439 ">I<bufsiz>B<);>"
7440 msgstr ""
7441
7442 #. type: Plain text
7443 #: build/C/man2/readlink.2:56
7444 msgid "B<readlink>():"
7445 msgstr ""
7446
7447 #. type: Plain text
7448 #: build/C/man2/readlink.2:59 build/C/man2/symlink.2:50
7449 msgid ""
7450 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
7451 "_XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
7452 msgstr ""
7453
7454 #. type: Plain text
7455 #: build/C/man2/readlink.2:75
7456 msgid ""
7457 "B<readlink>()  places the contents of the symbolic link I<path> in the "
7458 "buffer I<buf>, which has size I<bufsiz>.  B<readlink>()  does not append a "
7459 "null byte to I<buf>.  It will truncate the contents (to a length of "
7460 "I<bufsiz> characters), in case the buffer is too small to hold all of the "
7461 "contents."
7462 msgstr ""
7463
7464 #. type: Plain text
7465 #: build/C/man2/readlink.2:83
7466 msgid ""
7467 "On success, B<readlink>()  returns the number of bytes placed in I<buf>.  On "
7468 "error, -1 is returned and I<errno> is set to indicate the error."
7469 msgstr ""
7470
7471 #. type: Plain text
7472 #: build/C/man2/readlink.2:89
7473 msgid ""
7474 "Search permission is denied for a component of the path prefix.  (See also "
7475 "B<path_resolution>(7).)"
7476 msgstr ""
7477
7478 #. type: Plain text
7479 #: build/C/man2/readlink.2:93
7480 msgid "I<buf> extends outside the process's allocated address space."
7481 msgstr ""
7482
7483 #.  At the glibc level, bufsiz is unsigned, so this error can only occur
7484 #.  if bufsiz==0.  However, the in the kernel syscall, bufsiz is signed,
7485 #.  and this error can also occur if bufsiz < 0.
7486 #.  See: http://thread.gmane.org/gmane.linux.man/380
7487 #.  Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
7488 #. type: Plain text
7489 #: build/C/man2/readlink.2:102
7490 msgid "I<bufsiz> is not positive."
7491 msgstr ""
7492
7493 #. type: Plain text
7494 #: build/C/man2/readlink.2:105
7495 msgid "The named file is not a symbolic link."
7496 msgstr ""
7497
7498 #. type: Plain text
7499 #: build/C/man2/readlink.2:108
7500 msgid "An I/O error occurred while reading from the file system."
7501 msgstr ""
7502
7503 #. type: Plain text
7504 #: build/C/man2/readlink.2:111
7505 msgid "Too many symbolic links were encountered in translating the pathname."
7506 msgstr ""
7507
7508 #. type: Plain text
7509 #: build/C/man2/readlink.2:114
7510 msgid "A pathname, or a component of a pathname, was too long."
7511 msgstr ""
7512
7513 #. type: Plain text
7514 #: build/C/man2/readlink.2:117
7515 msgid "The named file does not exist."
7516 msgstr ""
7517
7518 #. type: Plain text
7519 #: build/C/man2/readlink.2:123
7520 msgid "A component of the path prefix is not a directory."
7521 msgstr ""
7522
7523 #. type: Plain text
7524 #: build/C/man2/readlink.2:128
7525 msgid "4.4BSD (B<readlink>()  first appeared in 4.2BSD), POSIX.1-2001."
7526 msgstr ""
7527
7528 #. type: Plain text
7529 #: build/C/man2/readlink.2:136
7530 msgid ""
7531 "In versions of glibc up to and including glibc 2.4, the return type of "
7532 "B<readlink>()  was declared as I<int>.  Nowadays, the return type is "
7533 "declared as I<ssize_t>, as (newly) required in POSIX.1-2001."
7534 msgstr ""
7535
7536 #. type: Plain text
7537 #: build/C/man2/readlink.2:155
7538 msgid ""
7539 "Using a statically sized buffer might not provide enough room for the "
7540 "symbolic link contents.  The required size for the buffer can be obtained "
7541 "from the I<stat.st_size> value returned by a call to B<lstat>(2)  on the "
7542 "link.  However, the number of bytes written by B<readlink>()  should be "
7543 "checked to make sure that the size of the symbolic link did not increase "
7544 "between the calls.  Dynamically allocating the buffer for B<readlink>()  "
7545 "also addresses a common portability problem when using I<PATH_MAX> for the "
7546 "buffer size, as this constant is not guaranteed to be defined per POSIX if "
7547 "the system does not have such limit."
7548 msgstr ""
7549
7550 #. type: Plain text
7551 #: build/C/man2/readlink.2:161
7552 msgid ""
7553 "The following program allocates the buffer needed by B<readlink>()  "
7554 "dynamically from the information provided by B<lstat>(), making sure there's "
7555 "no race condition between the calls."
7556 msgstr ""
7557
7558 #. type: Plain text
7559 #: build/C/man2/readlink.2:168
7560 #, no-wrap
7561 msgid ""
7562 "#include E<lt>sys/types.hE<gt>\n"
7563 "#include E<lt>sys/stat.hE<gt>\n"
7564 "#include E<lt>stdio.hE<gt>\n"
7565 "#include E<lt>stdlib.hE<gt>\n"
7566 "#include E<lt>unistd.hE<gt>\n"
7567 msgstr ""
7568
7569 #. type: Plain text
7570 #: build/C/man2/readlink.2:175
7571 #, no-wrap
7572 msgid ""
7573 "int\n"
7574 "main(int argc, char *argv[])\n"
7575 "{\n"
7576 "    struct stat sb;\n"
7577 "    char *linkname;\n"
7578 "    ssize_t r;\n"
7579 msgstr ""
7580
7581 #. type: Plain text
7582 #: build/C/man2/readlink.2:180
7583 #, no-wrap
7584 msgid ""
7585 "    if (argc != 2) {\n"
7586 "        fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt>\\en\", argv[0]);\n"
7587 "        exit(EXIT_FAILURE);\n"
7588 "    }\n"
7589 msgstr ""
7590
7591 #. type: Plain text
7592 #: build/C/man2/readlink.2:185
7593 #, no-wrap
7594 msgid ""
7595 "    if (lstat(argv[1], &sb) == -1) {\n"
7596 "        perror(\"lstat\");\n"
7597 "        exit(EXIT_FAILURE);\n"
7598 "    }\n"
7599 msgstr ""
7600
7601 #. type: Plain text
7602 #: build/C/man2/readlink.2:191
7603 #, no-wrap
7604 msgid ""
7605 "    linkname = malloc(sb.st_size + 1);\n"
7606 "    if (linkname == NULL) {\n"
7607 "        fprintf(stderr, \"insufficient memory\\en\");\n"
7608 "        exit(EXIT_FAILURE);\n"
7609 "    }\n"
7610 msgstr ""
7611
7612 #. type: Plain text
7613 #: build/C/man2/readlink.2:193
7614 #, no-wrap
7615 msgid "    r = readlink(argv[1], linkname, sb.st_size + 1);\n"
7616 msgstr ""
7617
7618 #. type: Plain text
7619 #: build/C/man2/readlink.2:198
7620 #, no-wrap
7621 msgid ""
7622 "    if (r E<lt> 0) {\n"
7623 "        perror(\"lstat\");\n"
7624 "        exit(EXIT_FAILURE);\n"
7625 "    }\n"
7626 msgstr ""
7627
7628 #. type: Plain text
7629 #: build/C/man2/readlink.2:204
7630 #, no-wrap
7631 msgid ""
7632 "    if (r E<gt> sb.st_size) {\n"
7633 "        fprintf(stderr, \"symlink increased in size \"\n"
7634 "                        \"between lstat() and readlink()\\en\");\n"
7635 "        exit(EXIT_FAILURE);\n"
7636 "    }\n"
7637 msgstr ""
7638
7639 #. type: Plain text
7640 #: build/C/man2/readlink.2:206
7641 #, no-wrap
7642 msgid "    linkname[sb.st_size] = \\(aq\\e0\\(aq;\n"
7643 msgstr ""
7644
7645 #. type: Plain text
7646 #: build/C/man2/readlink.2:208
7647 #, no-wrap
7648 msgid ""
7649 "    printf(\"\\(aq%s\\(aq points to \\(aq%s\\(aq\\en\", argv[1], "
7650 "linkname);\n"
7651 msgstr ""
7652
7653 #. type: Plain text
7654 #: build/C/man2/readlink.2:220
7655 msgid ""
7656 "B<readlink>(1), B<lstat>(2), B<readlinkat>(2), B<stat>(2), B<symlink>(2), "
7657 "B<path_resolution>(7), B<symlink>(7)"
7658 msgstr ""
7659
7660 #. type: TH
7661 #: build/C/man2/readv.2:30
7662 #, no-wrap
7663 msgid "READV"
7664 msgstr ""
7665
7666 #. type: TH
7667 #: build/C/man2/readv.2:30
7668 #, no-wrap
7669 msgid "2010-11-17"
7670 msgstr ""
7671
7672 #. type: Plain text
7673 #: build/C/man2/readv.2:33
7674 msgid "readv, writev, preadv, pwritev - read or write data into multiple buffers"
7675 msgstr ""
7676
7677 #. type: Plain text
7678 #: build/C/man2/readv.2:36
7679 #, no-wrap
7680 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
7681 msgstr ""
7682
7683 #. type: Plain text
7684 #: build/C/man2/readv.2:38
7685 #, no-wrap
7686 msgid ""
7687 "B<ssize_t readv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7688 ">I<iovcnt>B<);>\n"
7689 msgstr ""
7690
7691 #. type: Plain text
7692 #: build/C/man2/readv.2:40
7693 #, no-wrap
7694 msgid ""
7695 "B<ssize_t writev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7696 ">I<iovcnt>B<);>\n"
7697 msgstr ""
7698
7699 #. type: Plain text
7700 #: build/C/man2/readv.2:43
7701 #, no-wrap
7702 msgid ""
7703 "B<ssize_t preadv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7704 ">I<iovcnt>B<,>\n"
7705 "B<               off_t >I<offset>B<);>\n"
7706 msgstr ""
7707
7708 #. type: Plain text
7709 #: build/C/man2/readv.2:46
7710 #, no-wrap
7711 msgid ""
7712 "B<ssize_t pwritev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7713 ">I<iovcnt>B<,>\n"
7714 "B<                off_t >I<offset>B<);>\n"
7715 msgstr ""
7716
7717 #. type: Plain text
7718 #: build/C/man2/readv.2:56
7719 msgid "B<preadv>(), B<pwritev>(): _BSD_SOURCE"
7720 msgstr ""
7721
7722 #. type: Plain text
7723 #: build/C/man2/readv.2:66
7724 msgid ""
7725 "The B<readv>()  system call reads I<iovcnt> buffers from the file associated "
7726 "with the file descriptor I<fd> into the buffers described by I<iov> "
7727 "(\"scatter input\")."
7728 msgstr ""
7729
7730 #. type: Plain text
7731 #: build/C/man2/readv.2:76
7732 msgid ""
7733 "The B<writev>()  system call writes I<iovcnt> buffers of data described by "
7734 "I<iov> to the file associated with the file descriptor I<fd> (\"gather "
7735 "output\")."
7736 msgstr ""
7737
7738 #. type: Plain text
7739 #: build/C/man2/readv.2:85
7740 msgid ""
7741 "The pointer I<iov> points to an array of I<iovec> structures, defined in "
7742 "I<E<lt>sys/uio.hE<gt>> as:"
7743 msgstr ""
7744
7745 #. type: Plain text
7746 #: build/C/man2/readv.2:93
7747 #, no-wrap
7748 msgid ""
7749 "struct iovec {\n"
7750 "    void  *iov_base;    /* Starting address */\n"
7751 "    size_t iov_len;     /* Number of bytes to transfer */\n"
7752 "};\n"
7753 msgstr ""
7754
7755 #. type: Plain text
7756 #: build/C/man2/readv.2:101
7757 msgid ""
7758 "The B<readv>()  system call works just like B<read>(2)  except that multiple "
7759 "buffers are filled."
7760 msgstr ""
7761
7762 #. type: Plain text
7763 #: build/C/man2/readv.2:107
7764 msgid ""
7765 "The B<writev>()  system call works just like B<write>(2)  except that "
7766 "multiple buffers are written out."
7767 msgstr ""
7768
7769 #. type: Plain text
7770 #: build/C/man2/readv.2:126
7771 msgid ""
7772 "Buffers are processed in array order.  This means that B<readv>()  "
7773 "completely fills I<iov>[0] before proceeding to I<iov>[1], and so on.  (If "
7774 "there is insufficient data, then not all buffers pointed to by I<iov> may be "
7775 "filled.)  Similarly, B<writev>()  writes out the entire contents of "
7776 "I<iov>[0] before proceeding to I<iov>[1], and so on."
7777 msgstr ""
7778
7779 #. type: Plain text
7780 #: build/C/man2/readv.2:144
7781 msgid ""
7782 "The data transfers performed by B<readv>()  and B<writev>()  are atomic: the "
7783 "data written by B<writev>()  is written as a single block that is not "
7784 "intermingled with output from writes in other processes (but see B<pipe>(7)  "
7785 "for an exception); analogously, B<readv>()  is guaranteed to read a "
7786 "contiguous block of data from the file, regardless of read operations "
7787 "performed in other threads or processes that have file descriptors referring "
7788 "to the same open file description (see B<open>(2))."
7789 msgstr ""
7790
7791 #. type: SS
7792 #: build/C/man2/readv.2:144
7793 #, no-wrap
7794 msgid "preadv() and pwritev()"
7795 msgstr ""
7796
7797 #. type: Plain text
7798 #: build/C/man2/readv.2:157
7799 msgid ""
7800 "The B<preadv>()  system call combines the functionality of B<readv>()  and "
7801 "B<pread>(2).  It performs the same task as B<readv>(), but adds a fourth "
7802 "argument, I<offset>, which specifies the file offset at which the input "
7803 "operation is to be performed."
7804 msgstr ""
7805
7806 #. type: Plain text
7807 #: build/C/man2/readv.2:170
7808 msgid ""
7809 "The B<pwritev>()  system call combines the functionality of B<writev>()  and "
7810 "B<pwrite>(2).  It performs the same task as B<writev>(), but adds a fourth "
7811 "argument, I<offset>, which specifies the file offset at which the output "
7812 "operation is to be performed."
7813 msgstr ""
7814
7815 #. type: Plain text
7816 #: build/C/man2/readv.2:175
7817 msgid ""
7818 "The file offset is not changed by these system calls.  The file referred to "
7819 "by I<fd> must be capable of seeking."
7820 msgstr ""
7821
7822 #. type: Plain text
7823 #: build/C/man2/readv.2:186
7824 msgid ""
7825 "On success, B<readv>()  and B<preadv>()  return the number of bytes read; "
7826 "B<writev>()  and B<pwritev>()  return the number of bytes written.  On "
7827 "error, -1 is returned, and I<errno> is set appropriately."
7828 msgstr ""
7829
7830 #. type: Plain text
7831 #: build/C/man2/readv.2:198
7832 msgid ""
7833 "The errors are as given for B<read>(2)  and B<write>(2).  Furthermore, "
7834 "B<preadv>()  and B<pwritev>()  can also fail for the same reasons as "
7835 "B<lseek>(2).  Additionally, the following error is defined:"
7836 msgstr ""
7837
7838 #. type: Plain text
7839 #: build/C/man2/readv.2:207
7840 msgid ""
7841 "The sum of the I<iov_len> values overflows an I<ssize_t> value.  Or, the "
7842 "vector count I<iovcnt> is less than zero or greater than the permitted "
7843 "maximum."
7844 msgstr ""
7845
7846 #. type: Plain text
7847 #: build/C/man2/readv.2:212
7848 msgid ""
7849 "B<preadv>()  and B<pwritev>()  first appeared in Linux 2.6.30; library "
7850 "support was added in glibc 2.10."
7851 msgstr ""
7852
7853 #.  The readv/writev system calls were buggy before Linux 1.3.40.
7854 #.  (Says release.libc.)
7855 #. type: Plain text
7856 #: build/C/man2/readv.2:220
7857 msgid ""
7858 "B<readv>(), B<writev>(): 4.4BSD (these system calls first appeared in "
7859 "4.2BSD), POSIX.1-2001.  Linux libc5 used I<size_t> as the type of the "
7860 "I<iovcnt> argument, and I<int> as the return type."
7861 msgstr ""
7862
7863 #. type: Plain text
7864 #: build/C/man2/readv.2:224
7865 msgid "B<preadv>(), B<pwritev>(): nonstandard, but present also on the modern BSDs."
7866 msgstr ""
7867
7868 #. type: SS
7869 #: build/C/man2/readv.2:225
7870 #, no-wrap
7871 msgid "Linux Notes"
7872 msgstr ""
7873
7874 #. type: Plain text
7875 #: build/C/man2/readv.2:256
7876 msgid ""
7877 "POSIX.1-2001 allows an implementation to place a limit on the number of "
7878 "items that can be passed in I<iov>.  An implementation can advertise its "
7879 "limit by defining B<IOV_MAX> in I<E<lt>limits.hE<gt>> or at run time via the "
7880 "return value from I<sysconf(_SC_IOV_MAX)>.  On Linux, the limit advertised "
7881 "by these mechanisms is 1024, which is the true kernel limit.  However, the "
7882 "glibc wrapper functions do some extra work if they detect that the "
7883 "underlying kernel system call failed because this limit was exceeded.  In "
7884 "the case of B<readv>()  the wrapper function allocates a temporary buffer "
7885 "large enough for all of the items specified by I<iov>, passes that buffer in "
7886 "a call to B<read>(2), copies data from the buffer to the locations specified "
7887 "by the I<iov_base> fields of the elements of I<iov>, and then frees the "
7888 "buffer.  The wrapper function for B<writev>()  performs the analogous task "
7889 "using a temporary buffer and a call to B<write>(2)."
7890 msgstr ""
7891
7892 #. type: Plain text
7893 #: build/C/man2/readv.2:263
7894 msgid ""
7895 "It is not advisable to mix calls to B<readv>()  or B<writev>(), which "
7896 "operate on file descriptors, with the functions from the stdio library; the "
7897 "results will be undefined and probably not what you want."
7898 msgstr ""
7899
7900 #. type: Plain text
7901 #: build/C/man2/readv.2:266
7902 msgid "The following code sample demonstrates the use of B<writev>():"
7903 msgstr ""
7904
7905 #. type: Plain text
7906 #: build/C/man2/readv.2:273
7907 #, no-wrap
7908 msgid ""
7909 "char *str0 = \"hello \";\n"
7910 "char *str1 = \"world\\en\";\n"
7911 "struct iovec iov[2];\n"
7912 "ssize_t nwritten;\n"
7913 msgstr ""
7914
7915 #. type: Plain text
7916 #: build/C/man2/readv.2:278
7917 #, no-wrap
7918 msgid ""
7919 "iov[0].iov_base = str0;\n"
7920 "iov[0].iov_len = strlen(str0);\n"
7921 "iov[1].iov_base = str1;\n"
7922 "iov[1].iov_len = strlen(str1);\n"
7923 msgstr ""
7924
7925 #. type: Plain text
7926 #: build/C/man2/readv.2:280
7927 #, no-wrap
7928 msgid "nwritten = writev(STDOUT_FILENO, iov, 2);\n"
7929 msgstr ""
7930
7931 #. type: Plain text
7932 #: build/C/man2/readv.2:286
7933 msgid "B<pread>(2), B<read>(2), B<write>(2)"
7934 msgstr ""
7935
7936 #. type: TH
7937 #: build/C/man3/remove.3:31
7938 #, no-wrap
7939 msgid "REMOVE"
7940 msgstr ""
7941
7942 #. type: TH
7943 #: build/C/man3/remove.3:31
7944 #, no-wrap
7945 msgid "2008-12-03"
7946 msgstr ""
7947
7948 #. type: Plain text
7949 #: build/C/man3/remove.3:34
7950 msgid "remove - remove a file or directory"
7951 msgstr ""
7952
7953 #. type: Plain text
7954 #: build/C/man3/remove.3:38
7955 msgid "B<int remove(const char *>I<pathname>B<);>"
7956 msgstr ""
7957
7958 #. type: Plain text
7959 #: build/C/man3/remove.3:46
7960 msgid ""
7961 "B<remove>()  deletes a name from the file system.  It calls B<unlink>(2)  "
7962 "for files, and B<rmdir>(2)  for directories."
7963 msgstr ""
7964
7965 #. type: Plain text
7966 #: build/C/man3/remove.3:50
7967 msgid ""
7968 "If the removed name was the last link to a file and no processes have the "
7969 "file open, the file is deleted and the space it was using is made available "
7970 "for reuse."
7971 msgstr ""
7972
7973 #. type: Plain text
7974 #: build/C/man3/remove.3:55
7975 msgid ""
7976 "If the name was the last link to a file, but any processes still have the "
7977 "file open, the file will remain in existence until the last file descriptor "
7978 "referring to it is closed."
7979 msgstr ""
7980
7981 #. type: Plain text
7982 #: build/C/man3/remove.3:57
7983 msgid "If the name referred to a symbolic link, the link is removed."
7984 msgstr ""
7985
7986 #. type: Plain text
7987 #: build/C/man3/remove.3:60
7988 msgid ""
7989 "If the name referred to a socket, FIFO, or device, the name is removed, but "
7990 "processes which have the object open may continue to use it."
7991 msgstr ""
7992
7993 #. type: Plain text
7994 #: build/C/man3/remove.3:70
7995 msgid "The errors that occur are those for B<unlink>(2)  and B<rmdir>(2)."
7996 msgstr ""
7997
7998 #. type: Plain text
7999 #: build/C/man3/remove.3:72
8000 msgid "C89, C99, 4.3BSD, POSIX.1-2001."
8001 msgstr ""
8002
8003 #. type: Plain text
8004 #: build/C/man3/remove.3:78
8005 msgid ""
8006 "Under libc4 and libc5, B<remove>()  was an alias for B<unlink>(2)  (and "
8007 "hence would not remove directories)."
8008 msgstr ""
8009
8010 #. type: Plain text
8011 #: build/C/man3/remove.3:81 build/C/man2/unlink.2:148
8012 msgid ""
8013 "Infelicities in the protocol underlying NFS can cause the unexpected "
8014 "disappearance of files which are still being used."
8015 msgstr ""
8016
8017 #. type: Plain text
8018 #: build/C/man3/remove.3:92
8019 msgid ""
8020 "B<rm>(1), B<unlink>(1), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
8021 "B<rmdir>(2), B<unlink>(2), B<mkfifo>(3), B<symlink>(7)"
8022 msgstr ""
8023
8024 #. type: TH
8025 #: build/C/man2/rename.2:32
8026 #, no-wrap
8027 msgid "RENAME"
8028 msgstr ""
8029
8030 #. type: TH
8031 #: build/C/man2/rename.2:32
8032 #, no-wrap
8033 msgid "2009-03-30"
8034 msgstr ""
8035
8036 #. type: Plain text
8037 #: build/C/man2/rename.2:35
8038 msgid "rename - change the name or location of a file"
8039 msgstr ""
8040
8041 #. type: Plain text
8042 #: build/C/man2/rename.2:39
8043 msgid "B<int rename(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
8044 msgstr ""
8045
8046 #. type: Plain text
8047 #: build/C/man2/rename.2:48
8048 msgid ""
8049 "B<rename>()  renames a file, moving it between directories if required.  Any "
8050 "other hard links to the file (as created using B<link>(2))  are unaffected.  "
8051 "Open file descriptors for I<oldpath> are also unaffected."
8052 msgstr ""
8053
8054 #. type: Plain text
8055 #: build/C/man2/rename.2:56
8056 msgid ""
8057 "If I<newpath> already exists it will be atomically replaced (subject to a "
8058 "few conditions; see ERRORS below), so that there is no point at which "
8059 "another process attempting to access I<newpath> will find it missing."
8060 msgstr ""
8061
8062 #. type: Plain text
8063 #: build/C/man2/rename.2:64
8064 msgid ""
8065 "If I<oldpath> and I<newpath> are existing hard links referring to the same "
8066 "file, then B<rename>()  does nothing, and returns a success status."
8067 msgstr ""
8068
8069 #. type: Plain text
8070 #: build/C/man2/rename.2:72
8071 msgid ""
8072 "If I<newpath> exists but the operation fails for some reason B<rename>()  "
8073 "guarantees to leave an instance of I<newpath> in place."
8074 msgstr ""
8075
8076 #. type: Plain text
8077 #: build/C/man2/rename.2:78
8078 msgid ""
8079 "I<oldpath> can specify a directory.  In this case, I<newpath> must either "
8080 "not exist, or it must specify an empty directory."
8081 msgstr ""
8082
8083 #. type: Plain text
8084 #: build/C/man2/rename.2:85
8085 msgid ""
8086 "However, when overwriting there will probably be a window in which both "
8087 "I<oldpath> and I<newpath> refer to the file being renamed."
8088 msgstr ""
8089
8090 #. type: Plain text
8091 #: build/C/man2/rename.2:91
8092 msgid ""
8093 "If I<oldpath> refers to a symbolic link the link is renamed; if I<newpath> "
8094 "refers to a symbolic link the link will be overwritten."
8095 msgstr ""
8096
8097 #. type: Plain text
8098 #: build/C/man2/rename.2:116
8099 msgid ""
8100 "Write permission is denied for the directory containing I<oldpath> or "
8101 "I<newpath>, or, search permission is denied for one of the directories in "
8102 "the path prefix of I<oldpath> or I<newpath>, or I<oldpath> is a directory "
8103 "and does not allow write permission (needed to update the I<..> entry).  "
8104 "(See also B<path_resolution>(7).)"
8105 msgstr ""
8106
8107 #. type: TP
8108 #: build/C/man2/rename.2:116 build/C/man2/rmdir.2:55 build/C/man2/unlink.2:71
8109 #, no-wrap
8110 msgid "B<EBUSY>"
8111 msgstr ""
8112
8113 #. type: Plain text
8114 #: build/C/man2/rename.2:133
8115 msgid ""
8116 "The rename fails because I<oldpath> or I<newpath> is a directory that is in "
8117 "use by some process (perhaps as current working directory, or as root "
8118 "directory, or because it was open for reading) or is in use by the system "
8119 "(for example as mount point), while the system considers this an error.  "
8120 "(Note that there is no requirement to return B<EBUSY> in such "
8121 "cases\\(emthere is nothing wrong with doing the rename anyway\\(embut it is "
8122 "allowed to return B<EBUSY> if the system cannot otherwise handle such "
8123 "situations.)"
8124 msgstr ""
8125
8126 #. type: Plain text
8127 #: build/C/man2/rename.2:140
8128 msgid ""
8129 "The new pathname contained a path prefix of the old, or, more generally, an "
8130 "attempt was made to make a directory a subdirectory of itself."
8131 msgstr ""
8132
8133 #. type: Plain text
8134 #: build/C/man2/rename.2:146
8135 msgid "I<newpath> is an existing directory, but I<oldpath> is not a directory."
8136 msgstr ""
8137
8138 #. type: Plain text
8139 #: build/C/man2/rename.2:157
8140 msgid ""
8141 "I<oldpath> already has the maximum number of links to it, or it was a "
8142 "directory and the directory containing I<newpath> has the maximum number of "
8143 "links."
8144 msgstr ""
8145
8146 #. type: Plain text
8147 #: build/C/man2/rename.2:173
8148 msgid ""
8149 "The link named by I<oldpath> does not exist; or, a directory component in "
8150 "I<newpath> does not exist; or, I<oldpath> or I<newpath> is an empty string."
8151 msgstr ""
8152
8153 #. type: Plain text
8154 #: build/C/man2/rename.2:190
8155 msgid ""
8156 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
8157 "a directory.  Or, I<oldpath> is a directory, and I<newpath> exists but is "
8158 "not a directory."
8159 msgstr ""
8160
8161 #. type: TP
8162 #: build/C/man2/rename.2:190
8163 #, no-wrap
8164 msgid "B<ENOTEMPTY> or B<EEXIST>"
8165 msgstr ""
8166
8167 #. type: Plain text
8168 #: build/C/man2/rename.2:194
8169 msgid ""
8170 "I<newpath> is a nonempty directory, that is, contains entries other than "
8171 "\".\" and \"..\"."
8172 msgstr ""
8173
8174 #. type: TP
8175 #: build/C/man2/rename.2:194 build/C/man2/unlink.2:126
8176 #, no-wrap
8177 msgid "B<EPERM> or B<EACCES>"
8178 msgstr ""
8179
8180 #. type: Plain text
8181 #: build/C/man2/rename.2:218
8182 msgid ""
8183 "The directory containing I<oldpath> has the sticky bit (B<S_ISVTX>)  set and "
8184 "the process's effective user ID is neither the user ID of the file to be "
8185 "deleted nor that of the directory containing it, and the process is not "
8186 "privileged (Linux: does not have the B<CAP_FOWNER> capability); or "
8187 "I<newpath> is an existing file and the directory containing it has the "
8188 "sticky bit set and the process's effective user ID is neither the user ID of "
8189 "the file to be replaced nor that of the directory containing it, and the "
8190 "process is not privileged (Linux: does not have the B<CAP_FOWNER> "
8191 "capability); or the file system containing I<pathname> does not support "
8192 "renaming of the type requested."
8193 msgstr ""
8194
8195 #. type: Plain text
8196 #: build/C/man2/rename.2:229
8197 msgid ""
8198 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
8199 "permits a file system to be mounted at multiple points, but B<rename>()  "
8200 "does not work across different mount points, even if the same file system is "
8201 "mounted on both.)"
8202 msgstr ""
8203
8204 #. type: Plain text
8205 #: build/C/man2/rename.2:231
8206 msgid "4.3BSD, C89, C99, POSIX.1-2001."
8207 msgstr ""
8208
8209 #. type: Plain text
8210 #: build/C/man2/rename.2:242
8211 msgid ""
8212 "On NFS file systems, you can not assume that if the operation failed the "
8213 "file was not renamed.  If the server does the rename operation and then "
8214 "crashes, the retransmitted RPC which will be processed when the server is up "
8215 "again causes a failure.  The application is expected to deal with this.  See "
8216 "B<link>(2)  for a similar problem."
8217 msgstr ""
8218
8219 #. type: Plain text
8220 #: build/C/man2/rename.2:251
8221 msgid ""
8222 "B<mv>(1), B<chmod>(2), B<link>(2), B<renameat>(2), B<symlink>(2), "
8223 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
8224 msgstr ""
8225
8226 #. type: TH
8227 #: build/C/man2/rmdir.2:30
8228 #, no-wrap
8229 msgid "RMDIR"
8230 msgstr ""
8231
8232 #. type: TH
8233 #: build/C/man2/rmdir.2:30
8234 #, no-wrap
8235 msgid "2008-05-08"
8236 msgstr ""
8237
8238 #. type: Plain text
8239 #: build/C/man2/rmdir.2:33
8240 msgid "rmdir - delete a directory"
8241 msgstr ""
8242
8243 #. type: Plain text
8244 #: build/C/man2/rmdir.2:37
8245 msgid "B<int rmdir(const char *>I<pathname>B<);>"
8246 msgstr ""
8247
8248 #. type: Plain text
8249 #: build/C/man2/rmdir.2:40
8250 msgid "B<rmdir>()  deletes a directory, which must be empty."
8251 msgstr ""
8252
8253 #. type: Plain text
8254 #: build/C/man2/rmdir.2:55
8255 msgid ""
8256 "Write access to the directory containing I<pathname> was not allowed, or one "
8257 "of the directories in the path prefix of I<pathname> did not allow search "
8258 "permission.  (See also B<path_resolution>(7)."
8259 msgstr ""
8260
8261 #. type: Plain text
8262 #: build/C/man2/rmdir.2:64
8263 msgid ""
8264 "I<pathname> is currently in use by the system or some process that prevents "
8265 "its removal.  On Linux this means I<pathname> is currently used as a mount "
8266 "point or is the root directory of the calling process."
8267 msgstr ""
8268
8269 #. type: Plain text
8270 #: build/C/man2/rmdir.2:73
8271 msgid "I<pathname> has I<.> as last component."
8272 msgstr ""
8273
8274 #. type: Plain text
8275 #: build/C/man2/rmdir.2:77
8276 msgid "Too many symbolic links were encountered in resolving I<pathname>."
8277 msgstr ""
8278
8279 #. type: Plain text
8280 #: build/C/man2/rmdir.2:85
8281 msgid ""
8282 "A directory component in I<pathname> does not exist or is a dangling "
8283 "symbolic link."
8284 msgstr ""
8285
8286 #. type: Plain text
8287 #: build/C/man2/rmdir.2:94
8288 msgid ""
8289 "I<pathname>, or a component used as a directory in I<pathname>, is not, in "
8290 "fact, a directory."
8291 msgstr ""
8292
8293 #. type: TP
8294 #: build/C/man2/rmdir.2:94
8295 #, no-wrap
8296 msgid "B<ENOTEMPTY>"
8297 msgstr ""
8298
8299 #. type: Plain text
8300 #: build/C/man2/rmdir.2:107
8301 msgid ""
8302 "I<pathname> contains entries other than I<.> and I<..> ; or, I<pathname> has "
8303 "I<..> as its final component.  POSIX.1-2001 also allows B<EEXIST> for this "
8304 "condition."
8305 msgstr ""
8306
8307 #. type: Plain text
8308 #: build/C/man2/rmdir.2:118
8309 msgid ""
8310 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
8311 "and the process's effective user ID is neither the user ID of the file to be "
8312 "deleted nor that of the directory containing it, and the process is not "
8313 "privileged (Linux: does not have the B<CAP_FOWNER> capability)."
8314 msgstr ""
8315
8316 #. type: Plain text
8317 #: build/C/man2/rmdir.2:123
8318 msgid ""
8319 "The file system containing I<pathname> does not support the removal of "
8320 "directories."
8321 msgstr ""
8322
8323 #. type: Plain text
8324 #: build/C/man2/rmdir.2:127
8325 msgid "I<pathname> refers to a directory on a read-only file system."
8326 msgstr ""
8327
8328 #. type: Plain text
8329 #: build/C/man2/rmdir.2:132
8330 msgid ""
8331 "Infelicities in the protocol underlying NFS can cause the unexpected "
8332 "disappearance of directories which are still being used."
8333 msgstr ""
8334
8335 #. type: Plain text
8336 #: build/C/man2/rmdir.2:141
8337 msgid ""
8338 "B<rm>(1), B<rmdir>(1), B<chdir>(2), B<chmod>(2), B<mkdir>(2), B<rename>(2), "
8339 "B<unlink>(2), B<unlinkat>(2)"
8340 msgstr ""
8341
8342 #. type: TH
8343 #: build/C/man3/scanf.3:50
8344 #, no-wrap
8345 msgid "SCANF"
8346 msgstr ""
8347
8348 #. type: Plain text
8349 #: build/C/man3/scanf.3:53
8350 msgid "scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion"
8351 msgstr ""
8352
8353 #. type: Plain text
8354 #: build/C/man3/scanf.3:60
8355 #, no-wrap
8356 msgid ""
8357 "B<int scanf(const char *>I<format>B<, ...);>\n"
8358 "B<int fscanf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>\n"
8359 "B<int sscanf(const char *>I<str>B<, const char *>I<format>B<, ...);>\n"
8360 msgstr ""
8361
8362 #. type: Plain text
8363 #: build/C/man3/scanf.3:62
8364 #, no-wrap
8365 msgid "B<#include E<lt>stdarg.hE<gt>>\n"
8366 msgstr ""
8367
8368 #. type: Plain text
8369 #: build/C/man3/scanf.3:66
8370 #, no-wrap
8371 msgid ""
8372 "B<int vscanf(const char *>I<format>B<, va_list >I<ap>B<);>\n"
8373 "B<int vsscanf(const char *>I<str>B<, const char *>I<format>B<, va_list "
8374 ">I<ap>B<);>\n"
8375 "B<int vfscanf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
8376 ">I<ap>B<);>\n"
8377 msgstr ""
8378
8379 #. type: Plain text
8380 #: build/C/man3/scanf.3:77
8381 msgid "B<vscanf>(), B<vsscanf>(), B<vfscanf>():"
8382 msgstr ""
8383
8384 #. type: Plain text
8385 #: build/C/man3/scanf.3:80
8386 msgid ""
8387 "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ "
8388 "200112L;"
8389 msgstr ""
8390
8391 #. type: Plain text
8392 #: build/C/man3/scanf.3:102
8393 msgid ""
8394 "The B<scanf>()  family of functions scans input according to I<format> as "
8395 "described below.  This format may contain I<conversion specifications>; the "
8396 "results from such conversions, if any, are stored in the locations pointed "
8397 "to by the I<pointer> arguments that follow I<format>.  Each I<pointer> "
8398 "argument must be of a type that is appropriate for the value returned by the "
8399 "corresponding conversion specification."
8400 msgstr ""
8401
8402 #. type: Plain text
8403 #: build/C/man3/scanf.3:113
8404 msgid ""
8405 "If the number of conversion specifications in I<format> exceeds the number "
8406 "of I<pointer> arguments, the results are undefined.  If the number of "
8407 "I<pointer> arguments exceeds the number of conversion specifications, then "
8408 "the excess I<pointer> arguments are evaluated, but are otherwise ignored."
8409 msgstr ""
8410
8411 #. type: Plain text
8412 #: build/C/man3/scanf.3:125
8413 msgid ""
8414 "The B<scanf>()  function reads input from the standard input stream "
8415 "I<stdin>, B<fscanf>()  reads input from the stream pointer I<stream>, and "
8416 "B<sscanf>()  reads its input from the character string pointed to by I<str>."
8417 msgstr ""
8418
8419 #. type: Plain text
8420 #: build/C/man3/scanf.3:143
8421 msgid ""
8422 "The B<vfscanf>()  function is analogous to B<vfprintf>(3)  and reads input "
8423 "from the stream pointer I<stream> using a variable argument list of pointers "
8424 "(see B<stdarg>(3).  The B<vscanf>()  function scans a variable argument list "
8425 "from the standard input and the B<vsscanf>()  function scans it from a "
8426 "string; these are analogous to the B<vprintf>(3)  and B<vsprintf>(3)  "
8427 "functions respectively."
8428 msgstr ""
8429
8430 #. type: Plain text
8431 #: build/C/man3/scanf.3:157
8432 msgid ""
8433 "The I<format> string consists of a sequence of I<directives> which describe "
8434 "how to process the sequence of input characters.  If processing of a "
8435 "directive fails, no further input is read, and B<scanf>()  returns.  A "
8436 "\"failure\" can be either of the following: I<input failure>, meaning that "
8437 "input characters were unavailable, or I<matching failure>, meaning that the "
8438 "input was inappropriate (see below)."
8439 msgstr ""
8440
8441 #. type: Plain text
8442 #: build/C/man3/scanf.3:159
8443 msgid "A directive is one of the following:"
8444 msgstr ""
8445
8446 #. type: TP
8447 #: 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
8448 #, no-wrap
8449 msgid "\\(bu"
8450 msgstr ""
8451
8452 #. type: Plain text
8453 #: build/C/man3/scanf.3:165
8454 msgid ""
8455 "A sequence of white-space characters (space, tab, newline, etc.; see "
8456 "B<isspace>(3)).  This directive matches any amount of white space, including "
8457 "none, in the input."
8458 msgstr ""
8459
8460 #. type: Plain text
8461 #: build/C/man3/scanf.3:169
8462 msgid ""
8463 "An ordinary character (i.e., one other than white space or \\(aq%\\(aq).  "
8464 "This character must exactly match the next character of input."
8465 msgstr ""
8466
8467 #. type: Plain text
8468 #: build/C/man3/scanf.3:180
8469 msgid ""
8470 "A conversion specification, which commences with a \\(aq%\\(aq (percent) "
8471 "character.  A sequence of characters from the input is converted according "
8472 "to this specification, and the result is placed in the corresponding "
8473 "I<pointer> argument.  If the next item of input does not match the "
8474 "conversion specification, the conversion fails\\(emthis is a I<matching "
8475 "failure>."
8476 msgstr ""
8477
8478 #. type: Plain text
8479 #: build/C/man3/scanf.3:188
8480 msgid ""
8481 "Each I<conversion specification> in I<format> begins with either the "
8482 "character \\(aq%\\(aq or the character sequence \"B<%>I<n>B<$>\" (see below "
8483 "for the distinction) followed by:"
8484 msgstr ""
8485
8486 #. type: Plain text
8487 #: build/C/man3/scanf.3:199
8488 msgid ""
8489 "An optional \\(aq*\\(aq assignment-suppression character: B<scanf>()  reads "
8490 "input as directed by the conversion specification, but discards the input.  "
8491 "No corresponding I<pointer> argument is required, and this specification is "
8492 "not included in the count of successful assignments returned by B<scanf>()."
8493 msgstr ""
8494
8495 #. type: Plain text
8496 #: build/C/man3/scanf.3:217
8497 msgid ""
8498 "An optional \\(aqa\\(aq character.  This is used with string conversions, "
8499 "and relieves the caller of the need to allocate a corresponding buffer to "
8500 "hold the input: instead, B<scanf>()  allocates a buffer of sufficient size, "
8501 "and assigns the address of this buffer to the corresponding I<pointer> "
8502 "argument, which should be a pointer to a I<char *> variable (this variable "
8503 "does not need to be initialized before the call).  The caller should "
8504 "subsequently B<free>(3)  this buffer when it is no longer required.  This is "
8505 "a GNU extension; C99 employs the \\(aqa\\(aq character as a conversion "
8506 "specifier (and it can also be used as such in the GNU implementation)."
8507 msgstr ""
8508
8509 #. type: Plain text
8510 #: build/C/man3/scanf.3:229
8511 msgid ""
8512 "An optional decimal integer which specifies the I<maximum field width>.  "
8513 "Reading of characters stops either when this maximum is reached or when a "
8514 "nonmatching character is found, whichever happens first.  Most conversions "
8515 "discard initial white space characters (the exceptions are noted below), and "
8516 "these discarded characters don't count toward the maximum field width.  "
8517 "String input conversions store a terminating null byte (\\(aq\\e0\\(aq)  to "
8518 "mark the end of the input; the maximum field width does not include this "
8519 "terminator."
8520 msgstr ""
8521
8522 #. type: Plain text
8523 #: build/C/man3/scanf.3:243
8524 msgid ""
8525 "An optional I<type modifier character>.  For example, the B<l> type modifier "
8526 "is used with integer conversions such as B<%d> to specify that the "
8527 "corresponding I<pointer> argument refers to a I<long int> rather than a "
8528 "pointer to an I<int>."
8529 msgstr ""
8530
8531 #. type: Plain text
8532 #: build/C/man3/scanf.3:248
8533 msgid ""
8534 "A I<conversion specifier> that specifies the type of input conversion to be "
8535 "performed."
8536 msgstr ""
8537
8538 #. type: Plain text
8539 #: build/C/man3/scanf.3:277
8540 msgid ""
8541 "The conversion specifications in I<format> are of two forms, either "
8542 "beginning with \\(aq%\\(aq or beginning with \"B<%>I<n>B<$>\".  The two "
8543 "forms should not be mixed in the same I<format> string, except that a string "
8544 "containing \"B<%>I<n>B<$>\" specifications can include B<%%> and B<%*>.  If "
8545 "I<format> contains \\(aq%\\(aq specifications then these correspond in order "
8546 "with successive I<pointer> arguments.  In the \"B<%>I<n>B<$>\" form (which "
8547 "is specified in POSIX.1-2001, but not C99), I<n> is a decimal integer that "
8548 "specifies that the converted input should be placed in the location referred "
8549 "to by the I<n>-th I<pointer> argument following I<format>."
8550 msgstr ""
8551
8552 #. type: SS
8553 #: build/C/man3/scanf.3:277
8554 #, no-wrap
8555 msgid "Conversions"
8556 msgstr ""
8557
8558 #. type: Plain text
8559 #: build/C/man3/scanf.3:281
8560 msgid ""
8561 "The following I<type modifier characters> can appear in a conversion "
8562 "specification:"
8563 msgstr ""
8564
8565 #. type: Plain text
8566 #: build/C/man3/scanf.3:291
8567 msgid ""
8568 "Indicates that the conversion will be one of B<d>, B<i>, B<o>, B<u>, B<x>, "
8569 "B<X>, or B<n> and the next pointer is a pointer to a I<short int> or "
8570 "I<unsigned short int> (rather than I<int>)."
8571 msgstr ""
8572
8573 #. type: Plain text
8574 #: build/C/man3/scanf.3:299
8575 msgid ""
8576 "As for B<h>, but the next pointer is a pointer to a I<signed char> or "
8577 "I<unsigned char>."
8578 msgstr ""
8579
8580 #. type: Plain text
8581 #: build/C/man3/scanf.3:308
8582 msgid ""
8583 "As for B<h>, but the next pointer is a pointer to an I<intmax_t> or a "
8584 "I<uintmax_t>.  This modifier was introduced in C99."
8585 msgstr ""
8586
8587 #.  This use of l was introduced in Amendment 1 to ISO C90.
8588 #. type: Plain text
8589 #: build/C/man3/scanf.3:335
8590 msgid ""
8591 "Indicates either that the conversion will be one of B<d>, B<i>, B<o>, B<u>, "
8592 "B<x>, B<X>, or B<n> and the next pointer is a pointer to a I<long int> or "
8593 "I<unsigned long int> (rather than I<int>), or that the conversion will be "
8594 "one of B<e>, B<f>, or B<g> and the next pointer is a pointer to I<double> "
8595 "(rather than I<float>).  Specifying two B<l> characters is equivalent to "
8596 "B<L>.  If used with B<%c> or B<%s> the corresponding parameter is considered "
8597 "as a pointer to a wide character or wide-character string respectively."
8598 msgstr ""
8599
8600 #.  MTK, Jul 05: The following is no longer true for modern
8601 #.  ANSI C (i.e., C99):
8602 #.  (Note that long long is not an
8603 #.  ANSI C
8604 #.  type. Any program using this will not be portable to all
8605 #.  architectures).
8606 #. type: Plain text
8607 #: build/C/man3/scanf.3:351
8608 msgid ""
8609 "Indicates that the conversion will be either B<e>, B<f>, or B<g> and the "
8610 "next pointer is a pointer to I<long double> or the conversion will be B<d>, "
8611 "B<i>, B<o>, B<u>, or B<x> and the next pointer is a pointer to I<long long>."
8612 msgstr ""
8613
8614 #. type: Plain text
8615 #: build/C/man3/scanf.3:356
8616 msgid "equivalent to B<L>.  This specifier does not exist in ANSI C."
8617 msgstr ""
8618
8619 #. type: Plain text
8620 #: build/C/man3/scanf.3:363
8621 msgid ""
8622 "As for B<h>, but the next pointer is a pointer to a I<ptrdiff_t>.  This "
8623 "modifier was introduced in C99."
8624 msgstr ""
8625
8626 #. type: Plain text
8627 #: build/C/man3/scanf.3:370
8628 msgid ""
8629 "As for B<h>, but the next pointer is a pointer to a I<size_t>.  This "
8630 "modifier was introduced in C99."
8631 msgstr ""
8632
8633 #. type: Plain text
8634 #: build/C/man3/scanf.3:374
8635 msgid "The following I<conversion specifiers> are available:"
8636 msgstr ""
8637
8638 #. type: Plain text
8639 #: build/C/man3/scanf.3:383
8640 msgid ""
8641 "Matches a literal \\(aq%\\(aq.  That is, B<%\\&%> in the format string "
8642 "matches a single input \\(aq%\\(aq character.  No conversion is done (but "
8643 "initial white space characters are discarded), and assignment does not "
8644 "occur."
8645 msgstr ""
8646
8647 #. type: TP
8648 #: build/C/man3/scanf.3:383
8649 #, no-wrap
8650 msgid "B<d>"
8651 msgstr ""
8652
8653 #. type: Plain text
8654 #: build/C/man3/scanf.3:388
8655 msgid ""
8656 "Matches an optionally signed decimal integer; the next pointer must be a "
8657 "pointer to I<int>."
8658 msgstr ""
8659
8660 #. type: TP
8661 #: build/C/man3/scanf.3:388
8662 #, no-wrap
8663 msgid "B<D>"
8664 msgstr ""
8665
8666 #. type: Plain text
8667 #: build/C/man3/scanf.3:397
8668 msgid ""
8669 "Equivalent to I<ld>; this exists only for backward compatibility.  (Note: "
8670 "thus only in libc4.  In libc5 and glibc the B<%D> is silently ignored, "
8671 "causing old programs to fail mysteriously.)"
8672 msgstr ""
8673
8674 #. type: TP
8675 #: build/C/man3/scanf.3:397
8676 #, no-wrap
8677 msgid "B<i>"
8678 msgstr ""
8679
8680 #. type: Plain text
8681 #: build/C/man3/scanf.3:409
8682 msgid ""
8683 "Matches an optionally signed integer; the next pointer must be a pointer to "
8684 "I<int>.  The integer is read in base 16 if it begins with I<0x> or I<0X>, in "
8685 "base 8 if it begins with I<0>, and in base 10 otherwise.  Only characters "
8686 "that correspond to the base are used."
8687 msgstr ""
8688
8689 #. type: TP
8690 #: build/C/man3/scanf.3:409
8691 #, no-wrap
8692 msgid "B<o>"
8693 msgstr ""
8694
8695 #. type: Plain text
8696 #: build/C/man3/scanf.3:413
8697 msgid ""
8698 "Matches an unsigned octal integer; the next pointer must be a pointer to "
8699 "I<unsigned int>."
8700 msgstr ""
8701
8702 #. type: TP
8703 #: build/C/man3/scanf.3:413
8704 #, no-wrap
8705 msgid "B<u>"
8706 msgstr ""
8707
8708 #. type: Plain text
8709 #: build/C/man3/scanf.3:418
8710 msgid ""
8711 "Matches an unsigned decimal integer; the next pointer must be a pointer to "
8712 "I<unsigned int>."
8713 msgstr ""
8714
8715 #. type: Plain text
8716 #: build/C/man3/scanf.3:423
8717 msgid ""
8718 "Matches an unsigned hexadecimal integer; the next pointer must be a pointer "
8719 "to I<unsigned int>."
8720 msgstr ""
8721
8722 #. type: TP
8723 #: build/C/man3/scanf.3:423
8724 #, no-wrap
8725 msgid "B<X>"
8726 msgstr ""
8727
8728 #. type: Plain text
8729 #: build/C/man3/scanf.3:427
8730 msgid "Equivalent to B<x>."
8731 msgstr ""
8732
8733 #. type: TP
8734 #: build/C/man3/scanf.3:427
8735 #, no-wrap
8736 msgid "B<f>"
8737 msgstr ""
8738
8739 #. type: Plain text
8740 #: build/C/man3/scanf.3:432
8741 msgid ""
8742 "Matches an optionally signed floating-point number; the next pointer must be "
8743 "a pointer to I<float>."
8744 msgstr ""
8745
8746 #. type: TP
8747 #: build/C/man3/scanf.3:432
8748 #, no-wrap
8749 msgid "B<e>"
8750 msgstr ""
8751
8752 #. type: Plain text
8753 #: build/C/man3/scanf.3:436 build/C/man3/scanf.3:440 build/C/man3/scanf.3:444
8754 msgid "Equivalent to B<f>."
8755 msgstr ""
8756
8757 #. type: TP
8758 #: build/C/man3/scanf.3:436
8759 #, no-wrap
8760 msgid "B<g>"
8761 msgstr ""
8762
8763 #. type: TP
8764 #: build/C/man3/scanf.3:440
8765 #, no-wrap
8766 msgid "B<E>"
8767 msgstr ""
8768
8769 #. type: Plain text
8770 #: build/C/man3/scanf.3:448
8771 msgid "(C99) Equivalent to B<f>."
8772 msgstr ""
8773
8774 #. type: Plain text
8775 #: build/C/man3/scanf.3:456
8776 msgid ""
8777 "Matches a sequence of non-white-space characters; the next pointer must be a "
8778 "pointer to character array that is long enough to hold the input sequence "
8779 "and the terminating null byte (\\(aq\\e0\\(aq), which is added "
8780 "automatically.  The input string stops at white space or at the maximum "
8781 "field width, whichever occurs first."
8782 msgstr ""
8783
8784 #. type: Plain text
8785 #: build/C/man3/scanf.3:467
8786 msgid ""
8787 "Matches a sequence of characters whose length is specified by the I<maximum "
8788 "field width> (default 1); the next pointer must be a pointer to I<char>, and "
8789 "there must be enough room for all the characters (no terminating null byte "
8790 "is added).  The usual skip of leading white space is suppressed.  To skip "
8791 "white space first, use an explicit space in the format."
8792 msgstr ""
8793
8794 #. type: TP
8795 #: build/C/man3/scanf.3:467
8796 #, no-wrap
8797 msgid "B<\\&[>"
8798 msgstr ""
8799
8800 #. type: Plain text
8801 #: build/C/man3/scanf.3:500
8802 msgid ""
8803 "Matches a nonempty sequence of characters from the specified set of accepted "
8804 "characters; the next pointer must be a pointer to I<char>, and there must be "
8805 "enough room for all the characters in the string, plus a terminating null "
8806 "byte.  The usual skip of leading white space is suppressed.  The string is "
8807 "to be made up of characters in (or not in) a particular set; the set is "
8808 "defined by the characters between the open bracket B<[> character and a "
8809 "close bracket B<]> character.  The set I<excludes> those characters if the "
8810 "first character after the open bracket is a circumflex (B<^>).  To include a "
8811 "close bracket in the set, make it the first character after the open bracket "
8812 "or the circumflex; any other position will end the set.  The hyphen "
8813 "character B<-> is also special; when placed between two other characters, it "
8814 "adds all intervening characters to the set.  To include a hyphen, make it "
8815 "the last character before the final close bracket.  For instance, "
8816 "B<[^]0-9-]> means the set \"everything except close bracket, zero through "
8817 "nine, and hyphen\".  The string ends with the appearance of a character not "
8818 "in the (or, with a circumflex, in) set or when the field width runs out."
8819 msgstr ""
8820
8821 #. type: Plain text
8822 #: build/C/man3/scanf.3:508
8823 msgid ""
8824 "Matches a pointer value (as printed by B<%p> in B<printf>(3); the next "
8825 "pointer must be a pointer to a pointer to I<void>."
8826 msgstr ""
8827
8828 #. type: Plain text
8829 #: build/C/man3/scanf.3:528
8830 msgid ""
8831 "Nothing is expected; instead, the number of characters consumed thus far "
8832 "from the input is stored through the next pointer, which must be a pointer "
8833 "to I<int>.  This is I<not> a conversion, although it can be suppressed with "
8834 "the B<*> assignment-suppression character.  The C standard says: \"Execution "
8835 "of a B<%n> directive does not increment the assignment count returned at the "
8836 "completion of execution\" but the Corrigendum seems to contradict this.  "
8837 "Probably it is wise not to make any assumptions on the effect of B<%n> "
8838 "conversions on the return value."
8839 msgstr ""
8840
8841 #. type: Plain text
8842 #: build/C/man3/scanf.3:533
8843 msgid ""
8844 "These functions return the number of input items successfully matched and "
8845 "assigned, which can be fewer than provided for, or even zero in the event of "
8846 "an early matching failure."
8847 msgstr ""
8848
8849 #. type: Plain text
8850 #: build/C/man3/scanf.3:545
8851 msgid ""
8852 "The value B<EOF> is returned if the end of input is reached before either "
8853 "the first successful conversion or a matching failure occurs.  B<EOF> is "
8854 "also returned if a read error occurs, in which case the error indicator for "
8855 "the stream (see B<ferror>(3))  is set, and I<errno> is set indicate the "
8856 "error."
8857 msgstr ""
8858
8859 #. type: Plain text
8860 #: build/C/man3/scanf.3:551
8861 msgid ""
8862 "The file descriptor underlying I<stream> is marked nonblocking, and the read "
8863 "operation would block."
8864 msgstr ""
8865
8866 #. type: Plain text
8867 #: build/C/man3/scanf.3:556
8868 msgid ""
8869 "The file descriptor underlying I<stream> is invalid, or not open for "
8870 "reading."
8871 msgstr ""
8872
8873 #. type: Plain text
8874 #: build/C/man3/scanf.3:559
8875 msgid "Input byte sequence does not form a valid character."
8876 msgstr ""
8877
8878 #. type: Plain text
8879 #: build/C/man3/scanf.3:563
8880 msgid "The read operation was interrupted by a signal; see B<signal>(7)."
8881 msgstr ""
8882
8883 #. type: Plain text
8884 #: build/C/man3/scanf.3:568
8885 msgid "Not enough arguments; or I<format> is NULL."
8886 msgstr ""
8887
8888 #. type: Plain text
8889 #: build/C/man3/scanf.3:571
8890 msgid "Out of memory."
8891 msgstr ""
8892
8893 #. type: TP
8894 #: build/C/man3/scanf.3:571
8895 #, no-wrap
8896 msgid "B<ERANGE>"
8897 msgstr ""
8898
8899 #. type: Plain text
8900 #: build/C/man3/scanf.3:575
8901 msgid ""
8902 "The result of an integer conversion would exceed the size that can be stored "
8903 "in the corresponding integer type."
8904 msgstr ""
8905
8906 #. type: Plain text
8907 #: build/C/man3/scanf.3:585
8908 msgid ""
8909 "The functions B<fscanf>(), B<scanf>(), and B<sscanf>()  conform to C89 and "
8910 "C99 and POSIX.1-2001.  These standards do not specify the B<ERANGE> error."
8911 msgstr ""
8912
8913 #. type: Plain text
8914 #: build/C/man3/scanf.3:595
8915 msgid ""
8916 "The B<q> specifier is the 4.4BSD notation for I<long long>, while B<ll> or "
8917 "the usage of B<L> in integer conversions is the GNU notation."
8918 msgstr ""
8919
8920 #. type: Plain text
8921 #: build/C/man3/scanf.3:606
8922 msgid ""
8923 "The Linux version of these functions is based on the I<GNU> I<libio> "
8924 "library.  Take a look at the I<info> documentation of I<GNU> I<libc "
8925 "(glibc-1.08)> for a more concise description."
8926 msgstr ""
8927
8928 #.  This feature seems to be present at least as far back as glibc 2.0.
8929 #. type: Plain text
8930 #: build/C/man3/scanf.3:624
8931 msgid ""
8932 "The GNU C library supports a nonstandard extension that causes the library "
8933 "to dynamically allocate a string of sufficient size for input strings for "
8934 "the B<%s> and B<%a[>I<range>B<]> conversion specifiers.  To make use of this "
8935 "feature, specify B<a> as a length modifier (thus B<%as> or "
8936 "B<%a[>I<range>B<]>).  The caller must B<free>(3)  the returned string, as in "
8937 "the following example:"
8938 msgstr ""
8939
8940 #. type: Plain text
8941 #: build/C/man3/scanf.3:629
8942 #, no-wrap
8943 msgid ""
8944 "char *p;\n"
8945 "int n;\n"
8946 msgstr ""
8947
8948 #. type: Plain text
8949 #: build/C/man3/scanf.3:640
8950 #, no-wrap
8951 msgid ""
8952 "errno = 0;\n"
8953 "n = scanf(\"%a[a-z]\", &p);\n"
8954 "if (n == 1) {\n"
8955 "    printf(\"read: %s\\en\", p);\n"
8956 "    free(p);\n"
8957 "} else if (errno != 0) {\n"
8958 "    perror(\"scanf\");\n"
8959 "} else {\n"
8960 "    fprintf(stderr, \"No matching characters\\en\"):\n"
8961 "}\n"
8962 msgstr ""
8963
8964 #. type: Plain text
8965 #: build/C/man3/scanf.3:648
8966 msgid ""
8967 "As shown in the above example, it is only necessary to call B<free>(3)  if "
8968 "the B<scanf>()  call successfully read a string."
8969 msgstr ""
8970
8971 #. type: Plain text
8972 #: build/C/man3/scanf.3:660
8973 msgid ""
8974 "The B<a> modifier is not available if the program is compiled with I<gcc "
8975 "-std=c99> or I<gcc -D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also "
8976 "specified), in which case the B<a> is interpreted as a specifier for "
8977 "floating-point numbers (see above)."
8978 msgstr ""
8979
8980 #. type: Plain text
8981 #: build/C/man3/scanf.3:669
8982 msgid ""
8983 "Since version 2.7, glibc also provides the B<m> modifier for the same "
8984 "purpose as the B<a> modifier.  The B<m> modifier has the following "
8985 "advantages:"
8986 msgstr ""
8987
8988 #. type: Plain text
8989 #: build/C/man3/scanf.3:674
8990 msgid "It may also be applied to B<%c> conversion specifiers (e.g., B<%3mc>)."
8991 msgstr ""
8992
8993 #. type: Plain text
8994 #: build/C/man3/scanf.3:680
8995 msgid ""
8996 "It avoids ambiguity with respect to the B<%a> floating-point conversion "
8997 "specifier (and is unaffected by I<gcc -std=c99> etc.)"
8998 msgstr ""
8999
9000 #. type: Plain text
9001 #: build/C/man3/scanf.3:682
9002 msgid "It is specified in the upcoming revision of the POSIX.1 standard."
9003 msgstr ""
9004
9005 #. type: Plain text
9006 #: build/C/man3/scanf.3:695
9007 msgid ""
9008 "All functions are fully C89 conformant, but provide the additional "
9009 "specifiers B<q> and B<a> as well as an additional behavior of the B<L> and "
9010 "B<l> specifiers.  The latter may be considered to be a bug, as it changes "
9011 "the behavior of specifiers defined in C89."
9012 msgstr ""
9013
9014 #. type: Plain text
9015 #: build/C/man3/scanf.3:711
9016 msgid ""
9017 "Some combinations of the type modifiers and conversion specifiers defined by "
9018 "ANSI C do not make sense (e.g.  B<%Ld>).  While they may have a well-defined "
9019 "behavior on Linux, this need not to be so on other architectures.  Therefore "
9020 "it usually is better to use modifiers that are not defined by ANSI C at all, "
9021 "that is, use B<q> instead of B<L> in combination with B<d>, B<i>, B<o>, "
9022 "B<u>, B<x>, and B<X> conversions or B<ll>."
9023 msgstr ""
9024
9025 #. type: Plain text
9026 #: build/C/man3/scanf.3:717
9027 msgid ""
9028 "The usage of B<q> is not the same as on 4.4BSD, as it may be used in float "
9029 "conversions equivalently to B<L>."
9030 msgstr ""
9031
9032 #. type: Plain text
9033 #: build/C/man3/scanf.3:724
9034 msgid ""
9035 "B<getc>(3), B<printf>(3), B<setlocale>(3), B<strtod>(3), B<strtol>(3), "
9036 "B<strtoul>(3)"
9037 msgstr ""
9038
9039 #. type: TH
9040 #: build/C/man3/setbuf.3:46
9041 #, no-wrap
9042 msgid "SETBUF"
9043 msgstr ""
9044
9045 #. type: TH
9046 #: build/C/man3/setbuf.3:46
9047 #, no-wrap
9048 msgid "2008-06-26"
9049 msgstr ""
9050
9051 #. type: Plain text
9052 #: build/C/man3/setbuf.3:49
9053 msgid "setbuf, setbuffer, setlinebuf, setvbuf - stream buffering operations"
9054 msgstr ""
9055
9056 #. type: Plain text
9057 #: build/C/man3/setbuf.3:54
9058 #, no-wrap
9059 msgid "B<void setbuf(FILE *>I<stream>B<, char *>I<buf>B<);>\n"
9060 msgstr ""
9061
9062 #. type: Plain text
9063 #: build/C/man3/setbuf.3:56
9064 #, no-wrap
9065 msgid "B<void setbuffer(FILE *>I<stream>B<, char *>I<buf>B<, size_t >I<size>B<);>\n"
9066 msgstr ""
9067
9068 #. type: Plain text
9069 #: build/C/man3/setbuf.3:58
9070 #, no-wrap
9071 msgid "B<void setlinebuf(FILE *>I<stream>B<);>\n"
9072 msgstr ""
9073
9074 #. type: Plain text
9075 #: build/C/man3/setbuf.3:61
9076 #, no-wrap
9077 msgid ""
9078 "B<int setvbuf(FILE *>I<stream>B<, char *>I<buf>B<, int >I<mode>B<, size_t "
9079 ">I<size>B<);>\n"
9080 msgstr ""
9081
9082 #. type: Plain text
9083 #: build/C/man3/setbuf.3:71
9084 msgid "B<setbuffer>(), B<setlinebuf>(): _BSD_SOURCE"
9085 msgstr ""
9086
9087 #. type: Plain text
9088 #: build/C/man3/setbuf.3:94
9089 msgid ""
9090 "The three types of buffering available are unbuffered, block buffered, and "
9091 "line buffered.  When an output stream is unbuffered, information appears on "
9092 "the destination file or terminal as soon as written; when it is block "
9093 "buffered many characters are saved up and written as a block; when it is "
9094 "line buffered characters are saved up until a newline is output or input is "
9095 "read from any stream attached to a terminal device (typically I<stdin>).  "
9096 "The function B<fflush>(3)  may be used to force the block out early.  (See "
9097 "B<fclose>(3).)  Normally all files are block buffered.  When the first I/O "
9098 "operation occurs on a file, B<malloc>(3)  is called, and a buffer is "
9099 "obtained.  If a stream refers to a terminal (as I<stdout> normally does) it "
9100 "is line buffered.  The standard error stream I<stderr> is always unbuffered "
9101 "by default."
9102 msgstr ""
9103
9104 #. type: Plain text
9105 #: build/C/man3/setbuf.3:101
9106 msgid ""
9107 "The B<setvbuf>()  function may be used on any open stream to change its "
9108 "buffer.  The I<mode> argument must be one of the following three macros:"
9109 msgstr ""
9110
9111 #. type: TP
9112 #: build/C/man3/setbuf.3:102
9113 #, no-wrap
9114 msgid "B<_IONBF>"
9115 msgstr ""
9116
9117 #. type: Plain text
9118 #: build/C/man3/setbuf.3:105
9119 msgid "unbuffered"
9120 msgstr ""
9121
9122 #. type: TP
9123 #: build/C/man3/setbuf.3:105
9124 #, no-wrap
9125 msgid "B<_IOLBF>"
9126 msgstr ""
9127
9128 #. type: Plain text
9129 #: build/C/man3/setbuf.3:108
9130 msgid "line buffered"
9131 msgstr ""
9132
9133 #. type: TP
9134 #: build/C/man3/setbuf.3:108
9135 #, no-wrap
9136 msgid "B<_IOFBF>"
9137 msgstr ""
9138
9139 #. type: Plain text
9140 #: build/C/man3/setbuf.3:111
9141 msgid "fully buffered"
9142 msgstr ""
9143
9144 #. type: Plain text
9145 #: build/C/man3/setbuf.3:127
9146 msgid ""
9147 "Except for unbuffered files, the I<buf> argument should point to a buffer at "
9148 "least I<size> bytes long; this buffer will be used instead of the current "
9149 "buffer.  If the argument I<buf> is NULL, only the mode is affected; a new "
9150 "buffer will be allocated on the next read or write operation.  The "
9151 "B<setvbuf>()  function may only be used after opening a stream and before "
9152 "any other operations have been performed on it."
9153 msgstr ""
9154
9155 #. type: Plain text
9156 #: build/C/man3/setbuf.3:133
9157 msgid ""
9158 "The other three calls are, in effect, simply aliases for calls to "
9159 "B<setvbuf>().  The B<setbuf>()  function is exactly equivalent to the call"
9160 msgstr ""
9161
9162 #. type: Plain text
9163 #: build/C/man3/setbuf.3:136
9164 msgid "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);"
9165 msgstr ""
9166
9167 #. type: Plain text
9168 #: build/C/man3/setbuf.3:146
9169 msgid ""
9170 "The B<setbuffer>()  function is the same, except that the size of the buffer "
9171 "is up to the caller, rather than being determined by the default B<BUFSIZ>.  "
9172 "The B<setlinebuf>()  function is exactly equivalent to the call:"
9173 msgstr ""
9174
9175 #. type: Plain text
9176 #: build/C/man3/setbuf.3:149
9177 msgid "setvbuf(stream, (char *) NULL, _IOLBF, 0);"
9178 msgstr ""
9179
9180 #. type: Plain text
9181 #: build/C/man3/setbuf.3:160
9182 msgid ""
9183 "The function B<setvbuf>()  returns 0 on success.  It returns nonzero on "
9184 "failure (I<mode> is invalid or the request cannot be honored).  It may set "
9185 "I<errno> on failure."
9186 msgstr ""
9187
9188 #. type: Plain text
9189 #: build/C/man3/setbuf.3:162
9190 msgid "The other functions do not return a value."
9191 msgstr ""
9192
9193 #. type: Plain text
9194 #: build/C/man3/setbuf.3:168
9195 msgid "The B<setbuf>()  and B<setvbuf>()  functions conform to C89 and C99."
9196 msgstr ""
9197
9198 #. type: Plain text
9199 #: build/C/man3/setbuf.3:178
9200 msgid ""
9201 "The B<setbuffer>()  and B<setlinebuf>()  functions are not portable to "
9202 "versions of BSD before 4.2BSD, and are available under Linux since libc "
9203 "4.5.21.  On 4.2BSD and 4.3BSD systems, B<setbuf>()  always uses a suboptimal "
9204 "buffer size and should be avoided."
9205 msgstr ""
9206
9207 #. type: Plain text
9208 #: build/C/man3/setbuf.3:185
9209 msgid ""
9210 "You must make sure that the space that I<buf> points to still exists by the "
9211 "time I<stream> is closed, which also happens at program termination.  For "
9212 "example, the following is invalid:"
9213 msgstr ""
9214
9215 #. type: Plain text
9216 #: build/C/man3/setbuf.3:188
9217 #, no-wrap
9218 msgid "#include E<lt>stdio.hE<gt>\n"
9219 msgstr ""
9220
9221 #. type: Plain text
9222 #: build/C/man3/setbuf.3:197
9223 #, no-wrap
9224 msgid ""
9225 "int\n"
9226 "main(void)\n"
9227 "{\n"
9228 "    char buf[BUFSIZ];\n"
9229 "    setbuf(stdin, buf);\n"
9230 "    printf(\"Hello, world!\\en\");\n"
9231 "    return 0;\n"
9232 "}\n"
9233 msgstr ""
9234
9235 #. type: Plain text
9236 #: build/C/man3/setbuf.3:206
9237 msgid ""
9238 "B<fclose>(3), B<fflush>(3), B<fopen>(3), B<fread>(3), B<malloc>(3), "
9239 "B<printf>(3), B<puts>(3)"
9240 msgstr ""
9241
9242 #. type: TH
9243 #: build/C/man3/stdin.3:9
9244 #, no-wrap
9245 msgid "STDIN"
9246 msgstr ""
9247
9248 #. type: TH
9249 #: build/C/man3/stdin.3:9 build/C/man3/tmpfile.3:29
9250 #, no-wrap
9251 msgid "2008-07-14"
9252 msgstr ""
9253
9254 #. type: Plain text
9255 #: build/C/man3/stdin.3:12
9256 msgid "stdin, stdout, stderr - standard I/O streams"
9257 msgstr ""
9258
9259 #. type: Plain text
9260 #: build/C/man3/stdin.3:19
9261 #, no-wrap
9262 msgid ""
9263 "B<extern FILE *>I<stdin>B<;>\n"
9264 "B<extern FILE *>I<stdout>B<;>\n"
9265 "B<extern FILE *>I<stderr>B<;>\n"
9266 msgstr ""
9267
9268 #. type: Plain text
9269 #: build/C/man3/stdin.3:31
9270 msgid ""
9271 "Under normal circumstances every UNIX program has three streams opened for "
9272 "it when it starts up, one for input, one for output, and one for printing "
9273 "diagnostic or error messages.  These are typically attached to the user's "
9274 "terminal (see B<tty>(4)  but might instead refer to files or other devices, "
9275 "depending on what the parent process chose to set up.  (See also the "
9276 "\"Redirection\" section of B<sh>(1).)"
9277 msgstr ""
9278
9279 #. type: Plain text
9280 #: build/C/man3/stdin.3:41
9281 msgid ""
9282 "The input stream is referred to as \"standard input\"; the output stream is "
9283 "referred to as \"standard output\"; and the error stream is referred to as "
9284 "\"standard error\".  These terms are abbreviated to form the symbols used to "
9285 "refer to these files, namely I<stdin>, I<stdout>, and I<stderr>."
9286 msgstr ""
9287
9288 #. type: Plain text
9289 #: build/C/man3/stdin.3:50
9290 msgid ""
9291 "Each of these symbols is a B<stdio>(3)  macro of type pointer to I<FILE>, "
9292 "and can be used with functions like B<fprintf>(3)  or B<fread>(3)."
9293 msgstr ""
9294
9295 #. type: Plain text
9296 #: build/C/man3/stdin.3:59
9297 msgid ""
9298 "Since I<FILE>s are a buffering wrapper around UNIX file descriptors, the "
9299 "same underlying files may also be accessed using the raw UNIX file "
9300 "interface, that is, the functions like B<read>(2)  and B<lseek>(2)."
9301 msgstr ""
9302
9303 #. type: Plain text
9304 #: build/C/man3/stdin.3:78
9305 msgid ""
9306 "On program startup, the integer file descriptors associated with the streams "
9307 "I<stdin>, I<stdout>, and I<stderr> are 0, 1, and 2, respectively.  The "
9308 "preprocessor symbols B<STDIN_FILENO>, B<STDOUT_FILENO>, and B<STDERR_FILENO> "
9309 "are defined with these values in I<E<lt>unistd.hE<gt>>.  (Applying "
9310 "B<freopen>(3)  to one of these streams can change the file descriptor number "
9311 "associated with the stream.)"
9312 msgstr ""
9313
9314 #. type: Plain text
9315 #: build/C/man3/stdin.3:91
9316 msgid ""
9317 "Note that mixing use of I<FILE>s and raw file descriptors can produce "
9318 "unexpected results and should generally be avoided.  (For the masochistic "
9319 "among you: POSIX.1, section 8.2.3, describes in detail how this interaction "
9320 "is supposed to work.)  A general rule is that file descriptors are handled "
9321 "in the kernel, while stdio is just a library.  This means for example, that "
9322 "after an B<exec>(3), the child inherits all open file descriptors, but all "
9323 "old streams have become inaccessible."
9324 msgstr ""
9325
9326 #. type: Plain text
9327 #: build/C/man3/stdin.3:109
9328 msgid ""
9329 "Since the symbols I<stdin>, I<stdout>, and I<stderr> are specified to be "
9330 "macros, assigning to them is nonportable.  The standard streams can be made "
9331 "to refer to different files with help of the library function B<freopen>(3), "
9332 "specially introduced to make it possible to reassign I<stdin>, I<stdout>, "
9333 "and I<stderr>.  The standard streams are closed by a call to B<exit>(3)  and "
9334 "by normal program termination."
9335 msgstr ""
9336
9337 #. type: Plain text
9338 #: build/C/man3/stdin.3:118
9339 msgid ""
9340 "The I<stdin>, I<stdout>, and I<stderr> macros conform to C89 and this "
9341 "standard also stipulates that these three streams shall be open at program "
9342 "startup."
9343 msgstr ""
9344
9345 #. type: Plain text
9346 #: build/C/man3/stdin.3:150
9347 msgid ""
9348 "The stream I<stderr> is unbuffered.  The stream I<stdout> is line-buffered "
9349 "when it points to a terminal.  Partial lines will not appear until "
9350 "B<fflush>(3)  or B<exit>(3)  is called, or a newline is printed.  This can "
9351 "produce unexpected results, especially with debugging output.  The buffering "
9352 "mode of the standard streams (or any other stream)  can be changed using the "
9353 "B<setbuf>(3)  or B<setvbuf>(3)  call.  Note that in case I<stdin> is "
9354 "associated with a terminal, there may also be input buffering in the "
9355 "terminal driver, entirely unrelated to stdio buffering.  (Indeed, normally "
9356 "terminal input is line buffered in the kernel.)  This kernel input handling "
9357 "can be modified using calls like B<tcsetattr>(3); see also B<stty>(1), and "
9358 "B<termios>(3)."
9359 msgstr ""
9360
9361 #. type: Plain text
9362 #: build/C/man3/stdin.3:156
9363 msgid "B<csh>(1), B<sh>(1), B<open>(2), B<fopen>(3), B<stdio>(3)"
9364 msgstr ""
9365
9366 #. type: TH
9367 #: build/C/man3/stdio.3:37
9368 #, no-wrap
9369 msgid "STDIO"
9370 msgstr ""
9371
9372 #. type: TH
9373 #: build/C/man3/stdio.3:37
9374 #, no-wrap
9375 msgid "2001-12-26"
9376 msgstr ""
9377
9378 #. type: Plain text
9379 #: build/C/man3/stdio.3:40
9380 msgid "stdio - standard input/output library functions"
9381 msgstr ""
9382
9383 #. type: Plain text
9384 #: build/C/man3/stdio.3:44
9385 msgid "B<FILE *>I<stdin>B<;>"
9386 msgstr ""
9387
9388 #. type: Plain text
9389 #: build/C/man3/stdio.3:46
9390 msgid "B<FILE *>I<stdout>B<;>"
9391 msgstr ""
9392
9393 #. type: Plain text
9394 #: build/C/man3/stdio.3:48
9395 msgid "B<FILE *>I<stderr>B<;>"
9396 msgstr ""
9397
9398 #. type: Plain text
9399 #: build/C/man3/stdio.3:55
9400 msgid ""
9401 "The standard I/O library provides a simple and efficient buffered stream I/O "
9402 "interface.  Input and output is mapped into logical data streams and the "
9403 "physical I/O characteristics are concealed.  The functions and macros are "
9404 "listed below; more information is available from the individual man pages."
9405 msgstr ""
9406
9407 #. type: Plain text
9408 #: build/C/man3/stdio.3:78
9409 msgid ""
9410 "A stream is associated with an external file (which may be a physical "
9411 "device) by I<opening> a file, which may involve creating a new file.  "
9412 "Creating an existing file causes its former contents to be discarded.  If a "
9413 "file can support positioning requests (such as a disk file, as opposed to a "
9414 "terminal) then a I<file position indicator> associated with the stream is "
9415 "positioned at the start of the file (byte zero), unless the file is opened "
9416 "with append mode.  If append mode is used, it is unspecified whether the "
9417 "position indicator will be placed at the start or the end of the file.  The "
9418 "position indicator is maintained by subsequent reads, writes and positioning "
9419 "requests.  All input occurs as if the characters were read by successive "
9420 "calls to the B<fgetc>(3)  function; all output takes place as if all "
9421 "characters were written by successive calls to the B<fputc>(3)  function."
9422 msgstr ""
9423
9424 #. type: Plain text
9425 #: build/C/man3/stdio.3:88
9426 msgid ""
9427 "A file is disassociated from a stream by I<closing> the file.  Output "
9428 "streams are flushed (any unwritten buffer contents are transferred to the "
9429 "host environment) before the stream is disassociated from the file.  The "
9430 "value of a pointer to a I<FILE> object is indeterminate after a file is "
9431 "closed (garbage)."
9432 msgstr ""
9433
9434 #. type: Plain text
9435 #: build/C/man3/stdio.3:101
9436 msgid ""
9437 "A file may be subsequently reopened, by the same or another program "
9438 "execution, and its contents reclaimed or modified (if it can be repositioned "
9439 "at the start).  If the main function returns to its original caller, or the "
9440 "B<exit>(3)  function is called, all open files are closed (hence all output "
9441 "streams are flushed) before program termination.  Other methods of program "
9442 "termination, such as B<abort>(3)  do not bother about closing files "
9443 "properly."
9444 msgstr ""
9445
9446 #. type: Plain text
9447 #: build/C/man3/stdio.3:117
9448 msgid ""
9449 "At program startup, three text streams are predefined and need not be opened "
9450 "explicitly: I<standard input> (for reading conventional input), I<standard "
9451 "output> (for writing conventional input), and I<standard error> (for writing "
9452 "diagnostic output).  These streams are abbreviated I<stdin>,I<stdout> and "
9453 "I<stderr>.  When opened, the standard error stream is not fully buffered; "
9454 "the standard input and output streams are fully buffered if and only if the "
9455 "streams do not to refer to an interactive device."
9456 msgstr ""
9457
9458 #. type: Plain text
9459 #: build/C/man3/stdio.3:127
9460 msgid ""
9461 "Output streams that refer to terminal devices are always line buffered by "
9462 "default; pending output to such streams is written automatically whenever an "
9463 "input stream that refers to a terminal device is read.  In cases where a "
9464 "large amount of computation is done after printing part of a line on an "
9465 "output terminal, it is necessary to B<fflush>(3)  the standard output before "
9466 "going off and computing so that the output will appear."
9467 msgstr ""
9468
9469 #. type: Plain text
9470 #: build/C/man3/stdio.3:141
9471 msgid ""
9472 "The I<stdio> library is a part of the library B<libc> and routines are "
9473 "automatically loaded as needed by the compilers B<cc>(1)  and B<pc>(1).  The "
9474 "SYNOPSIS sections of the following manual pages indicate which include files "
9475 "are to be used, what the compiler declaration for the function looks like "
9476 "and which external variables are of interest."
9477 msgstr ""
9478
9479 #.  Not on Linux: .BR fropen ,
9480 #.  Not on Linux: .BR fwopen ,
9481 #. type: Plain text
9482 #: build/C/man3/stdio.3:181
9483 msgid ""
9484 "The following are defined as macros; these names may not be reused without "
9485 "first removing their current definitions with B<#undef>: B<BUFSIZ>, B<EOF>, "
9486 "B<FILENAME_MAX>, B<FOPEN_MAX>, B<L_cuserid>, B<L_ctermid>, B<L_tmpnam>, "
9487 "B<NULL>, B<SEEK_END>, B<SEEK_SET>, B<SEEK_CUR>, B<TMP_MAX>, B<clearerr>, "
9488 "B<feof>, B<ferror>, B<fileno>, B<getc>, B<getchar>, B<putc>, B<putchar>, "
9489 "B<stderr>, B<stdin>, B<stdout>.  Function versions of the macro functions "
9490 "B<feof>, B<ferror>, B<clearerr>, B<fileno>, B<getc>, B<getchar>, B<putc>, "
9491 "and B<putchar> exist and will be used if the macros definitions are "
9492 "explicitly removed."
9493 msgstr ""
9494
9495 #. type: SS
9496 #: build/C/man3/stdio.3:181
9497 #, no-wrap
9498 msgid "List of Functions"
9499 msgstr ""
9500
9501 #. type: tbl table
9502 #: build/C/man3/stdio.3:186
9503 #, no-wrap
9504 msgid "Function\tDescription\n"
9505 msgstr ""
9506
9507 #. type: tbl table
9508 #: build/C/man3/stdio.3:187
9509 #, no-wrap
9510 msgid "_\n"
9511 msgstr ""
9512
9513 #. type: tbl table
9514 #: build/C/man3/stdio.3:188
9515 #, no-wrap
9516 msgid "clearerr\tcheck and reset stream status\n"
9517 msgstr ""
9518
9519 #. type: tbl table
9520 #: build/C/man3/stdio.3:189
9521 #, no-wrap
9522 msgid "fclose\tclose a stream\n"
9523 msgstr ""
9524
9525 #. type: tbl table
9526 #: build/C/man3/stdio.3:190
9527 #, no-wrap
9528 msgid "fdopen\tstream open functions\n"
9529 msgstr ""
9530
9531 #. type: tbl table
9532 #: build/C/man3/stdio.3:191
9533 #, no-wrap
9534 msgid "feof\tcheck and reset stream status\n"
9535 msgstr ""
9536
9537 #. type: tbl table
9538 #: build/C/man3/stdio.3:192
9539 #, no-wrap
9540 msgid "ferror\tcheck and reset stream status\n"
9541 msgstr ""
9542
9543 #. type: tbl table
9544 #: build/C/man3/stdio.3:193
9545 #, no-wrap
9546 msgid "fflush\tflush a stream\n"
9547 msgstr ""
9548
9549 #. type: tbl table
9550 #: build/C/man3/stdio.3:194
9551 #, no-wrap
9552 msgid "fgetc\tget next character or word from input stream\n"
9553 msgstr ""
9554
9555 #. type: tbl table
9556 #: build/C/man3/stdio.3:195
9557 #, no-wrap
9558 msgid "fgetpos\treposition a stream\n"
9559 msgstr ""
9560
9561 #. type: tbl table
9562 #: build/C/man3/stdio.3:196
9563 #, no-wrap
9564 msgid "fgets\tget a line from a stream\n"
9565 msgstr ""
9566
9567 #. type: tbl table
9568 #: build/C/man3/stdio.3:197
9569 #, no-wrap
9570 msgid "fileno\treturn the integer descriptor of the argument stream\n"
9571 msgstr ""
9572
9573 #. type: tbl table
9574 #: build/C/man3/stdio.3:198
9575 #, no-wrap
9576 msgid "fopen\tstream open functions\n"
9577 msgstr ""
9578
9579 #. type: tbl table
9580 #: build/C/man3/stdio.3:199
9581 #, no-wrap
9582 msgid "fprintf\tformatted output conversion\n"
9583 msgstr ""
9584
9585 #. type: tbl table
9586 #: build/C/man3/stdio.3:200
9587 #, no-wrap
9588 msgid "fpurge\tflush a stream\n"
9589 msgstr ""
9590
9591 #. type: tbl table
9592 #: build/C/man3/stdio.3:201
9593 #, no-wrap
9594 msgid "fputc\toutput a character or word to a stream\n"
9595 msgstr ""
9596
9597 #. type: tbl table
9598 #: build/C/man3/stdio.3:202
9599 #, no-wrap
9600 msgid "fputs\toutput a line to a stream\n"
9601 msgstr ""
9602
9603 #. type: tbl table
9604 #: build/C/man3/stdio.3:203
9605 #, no-wrap
9606 msgid "fread\tbinary stream input/output\n"
9607 msgstr ""
9608
9609 #. type: tbl table
9610 #: build/C/man3/stdio.3:204
9611 #, no-wrap
9612 msgid "freopen\tstream open functions\n"
9613 msgstr ""
9614
9615 #. type: tbl table
9616 #: build/C/man3/stdio.3:205
9617 #, no-wrap
9618 msgid "fscanf\tinput format conversion\n"
9619 msgstr ""
9620
9621 #. type: tbl table
9622 #: build/C/man3/stdio.3:206
9623 #, no-wrap
9624 msgid "fseek\treposition a stream\n"
9625 msgstr ""
9626
9627 #. type: tbl table
9628 #: build/C/man3/stdio.3:207
9629 #, no-wrap
9630 msgid "fsetpos\treposition a stream\n"
9631 msgstr ""
9632
9633 #. type: tbl table
9634 #: build/C/man3/stdio.3:208
9635 #, no-wrap
9636 msgid "ftell\treposition a stream\n"
9637 msgstr ""
9638
9639 #. type: tbl table
9640 #: build/C/man3/stdio.3:209
9641 #, no-wrap
9642 msgid "fwrite\tbinary stream input/output\n"
9643 msgstr ""
9644
9645 #. type: tbl table
9646 #: build/C/man3/stdio.3:210
9647 #, no-wrap
9648 msgid "getc\tget next character or word from input stream\n"
9649 msgstr ""
9650
9651 #. type: tbl table
9652 #: build/C/man3/stdio.3:211
9653 #, no-wrap
9654 msgid "getchar\tget next character or word from input stream\n"
9655 msgstr ""
9656
9657 #. type: tbl table
9658 #: build/C/man3/stdio.3:212
9659 #, no-wrap
9660 msgid "gets\tget a line from a stream\n"
9661 msgstr ""
9662
9663 #. type: tbl table
9664 #: build/C/man3/stdio.3:213
9665 #, no-wrap
9666 msgid "getw\tget next character or word from input stream\n"
9667 msgstr ""
9668
9669 #. type: tbl table
9670 #: build/C/man3/stdio.3:214
9671 #, no-wrap
9672 msgid "mktemp\tmake temporary filename (unique)\n"
9673 msgstr ""
9674
9675 #. type: tbl table
9676 #: build/C/man3/stdio.3:215
9677 #, no-wrap
9678 msgid "perror\tsystem error messages\n"
9679 msgstr ""
9680
9681 #. type: tbl table
9682 #: build/C/man3/stdio.3:216
9683 #, no-wrap
9684 msgid "printf\tformatted output conversion\n"
9685 msgstr ""
9686
9687 #. type: tbl table
9688 #: build/C/man3/stdio.3:217
9689 #, no-wrap
9690 msgid "putc\toutput a character or word to a stream\n"
9691 msgstr ""
9692
9693 #. type: tbl table
9694 #: build/C/man3/stdio.3:218
9695 #, no-wrap
9696 msgid "putchar\toutput a character or word to a stream\n"
9697 msgstr ""
9698
9699 #. type: tbl table
9700 #: build/C/man3/stdio.3:219
9701 #, no-wrap
9702 msgid "puts\toutput a line to a stream\n"
9703 msgstr ""
9704
9705 #. type: tbl table
9706 #: build/C/man3/stdio.3:220
9707 #, no-wrap
9708 msgid "putw\toutput a character or word to a stream\n"
9709 msgstr ""
9710
9711 #. type: tbl table
9712 #: build/C/man3/stdio.3:221
9713 #, no-wrap
9714 msgid "remove\tremove directory entry\n"
9715 msgstr ""
9716
9717 #. type: tbl table
9718 #: build/C/man3/stdio.3:222
9719 #, no-wrap
9720 msgid "rewind\treposition a stream\n"
9721 msgstr ""
9722
9723 #. type: tbl table
9724 #: build/C/man3/stdio.3:223
9725 #, no-wrap
9726 msgid "scanf\tinput format conversion\n"
9727 msgstr ""
9728
9729 #. type: tbl table
9730 #: build/C/man3/stdio.3:224
9731 #, no-wrap
9732 msgid "setbuf\tstream buffering operations\n"
9733 msgstr ""
9734
9735 #. type: tbl table
9736 #: build/C/man3/stdio.3:225
9737 #, no-wrap
9738 msgid "setbuffer\tstream buffering operations\n"
9739 msgstr ""
9740
9741 #. type: tbl table
9742 #: build/C/man3/stdio.3:226
9743 #, no-wrap
9744 msgid "setlinebuf\tstream buffering operations\n"
9745 msgstr ""
9746
9747 #. type: tbl table
9748 #: build/C/man3/stdio.3:227
9749 #, no-wrap
9750 msgid "setvbuf\tstream buffering operations\n"
9751 msgstr ""
9752
9753 #. type: tbl table
9754 #: build/C/man3/stdio.3:228
9755 #, no-wrap
9756 msgid "sprintf\tformatted output conversion\n"
9757 msgstr ""
9758
9759 #. type: tbl table
9760 #: build/C/man3/stdio.3:229
9761 #, no-wrap
9762 msgid "sscanf\tinput format conversion\n"
9763 msgstr ""
9764
9765 #. type: tbl table
9766 #: build/C/man3/stdio.3:230
9767 #, no-wrap
9768 msgid "strerror\tsystem error messages\n"
9769 msgstr ""
9770
9771 #. type: tbl table
9772 #: build/C/man3/stdio.3:231
9773 #, no-wrap
9774 msgid "sys_errlist\tsystem error messages\n"
9775 msgstr ""
9776
9777 #. type: tbl table
9778 #: build/C/man3/stdio.3:232
9779 #, no-wrap
9780 msgid "sys_nerr\tsystem error messages\n"
9781 msgstr ""
9782
9783 #. type: tbl table
9784 #: build/C/man3/stdio.3:233
9785 #, no-wrap
9786 msgid "tempnam\ttemporary file routines\n"
9787 msgstr ""
9788
9789 #. type: tbl table
9790 #: build/C/man3/stdio.3:234
9791 #, no-wrap
9792 msgid "tmpfile\ttemporary file routines\n"
9793 msgstr ""
9794
9795 #. type: tbl table
9796 #: build/C/man3/stdio.3:235
9797 #, no-wrap
9798 msgid "tmpnam\ttemporary file routines\n"
9799 msgstr ""
9800
9801 #. type: tbl table
9802 #: build/C/man3/stdio.3:236
9803 #, no-wrap
9804 msgid "ungetc\tun-get character from input stream\n"
9805 msgstr ""
9806
9807 #. type: tbl table
9808 #: build/C/man3/stdio.3:237
9809 #, no-wrap
9810 msgid "vfprintf\tformatted output conversion\n"
9811 msgstr ""
9812
9813 #. type: tbl table
9814 #: build/C/man3/stdio.3:238
9815 #, no-wrap
9816 msgid "vfscanf\tinput format conversion\n"
9817 msgstr ""
9818
9819 #. type: tbl table
9820 #: build/C/man3/stdio.3:239
9821 #, no-wrap
9822 msgid "vprintf\tformatted output conversion\n"
9823 msgstr ""
9824
9825 #. type: tbl table
9826 #: build/C/man3/stdio.3:240
9827 #, no-wrap
9828 msgid "vscanf\tinput format conversion\n"
9829 msgstr ""
9830
9831 #. type: tbl table
9832 #: build/C/man3/stdio.3:241
9833 #, no-wrap
9834 msgid "vsprintf\tformatted output conversion\n"
9835 msgstr ""
9836
9837 #. type: tbl table
9838 #: build/C/man3/stdio.3:242
9839 #, no-wrap
9840 msgid "vsscanf\tinput format conversion\n"
9841 msgstr ""
9842
9843 #. type: Plain text
9844 #: build/C/man3/stdio.3:248
9845 msgid "The I<stdio> library conforms to C89."
9846 msgstr ""
9847
9848 #. type: Plain text
9849 #: build/C/man3/stdio.3:255
9850 msgid ""
9851 "B<close>(2), B<open>(2), B<read>(2), B<write>(2), B<stdout>(3), "
9852 "B<unlocked_stdio>(3)"
9853 msgstr ""
9854
9855 #. type: TH
9856 #: build/C/man3/stdio_ext.3:23
9857 #, no-wrap
9858 msgid "STDIO_EXT"
9859 msgstr ""
9860
9861 #. type: TH
9862 #: build/C/man3/stdio_ext.3:23
9863 #, no-wrap
9864 msgid "2001-12-16"
9865 msgstr ""
9866
9867 #. type: Plain text
9868 #: build/C/man3/stdio_ext.3:28
9869 msgid ""
9870 "__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, "
9871 "__fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio FILE "
9872 "structure"
9873 msgstr ""
9874
9875 #. type: Plain text
9876 #: build/C/man3/stdio_ext.3:32
9877 msgid "B<#include E<lt>stdio_ext.hE<gt>>"
9878 msgstr ""
9879
9880 #. type: Plain text
9881 #: build/C/man3/stdio_ext.3:34
9882 msgid "B<size_t __fbufsize(FILE *>I<stream>B<);>"
9883 msgstr ""
9884
9885 #. type: Plain text
9886 #: build/C/man3/stdio_ext.3:36
9887 msgid "B<size_t __fpending(FILE *>I<stream>B<);>"
9888 msgstr ""
9889
9890 #. type: Plain text
9891 #: build/C/man3/stdio_ext.3:38
9892 msgid "B<int __flbf(FILE *>I<stream>B<);>"
9893 msgstr ""
9894
9895 #. type: Plain text
9896 #: build/C/man3/stdio_ext.3:40
9897 msgid "B<int __freadable(FILE *>I<stream>B<);>"
9898 msgstr ""
9899
9900 #. type: Plain text
9901 #: build/C/man3/stdio_ext.3:42
9902 msgid "B<int __fwritable(FILE *>I<stream>B<);>"
9903 msgstr ""
9904
9905 #. type: Plain text
9906 #: build/C/man3/stdio_ext.3:44
9907 msgid "B<int __freading(FILE *>I<stream>B<);>"
9908 msgstr ""
9909
9910 #. type: Plain text
9911 #: build/C/man3/stdio_ext.3:46
9912 msgid "B<int __fwriting(FILE *>I<stream>B<);>"
9913 msgstr ""
9914
9915 #. type: Plain text
9916 #: build/C/man3/stdio_ext.3:48
9917 msgid "B<int __fsetlocking(FILE *>I<stream>B<, int >I<type>B<);>"
9918 msgstr ""
9919
9920 #. type: Plain text
9921 #: build/C/man3/stdio_ext.3:50
9922 msgid "B<void _flushlbf(void);>"
9923 msgstr ""
9924
9925 #. type: Plain text
9926 #: build/C/man3/stdio_ext.3:52
9927 msgid "B<void __fpurge(FILE *>I<stream>B<);>"
9928 msgstr ""
9929
9930 #. type: Plain text
9931 #: build/C/man3/stdio_ext.3:57
9932 msgid ""
9933 "Solaris introduced routines to allow portable access to the internals of the "
9934 "I<FILE> structure, and glibc also implemented these."
9935 msgstr ""
9936
9937 #. type: Plain text
9938 #: build/C/man3/stdio_ext.3:62
9939 msgid ""
9940 "The B<__fbufsize>()  function returns the size of the buffer currently used "
9941 "by the given stream."
9942 msgstr ""
9943
9944 #. type: Plain text
9945 #: build/C/man3/stdio_ext.3:69
9946 msgid ""
9947 "The B<__fpending>()  function returns the number of bytes in the output "
9948 "buffer.  For wide-oriented streams the unit is wide characters.  This "
9949 "function is undefined on buffers in reading mode, or opened read-only."
9950 msgstr ""
9951
9952 #. type: Plain text
9953 #: build/C/man3/stdio_ext.3:74
9954 msgid ""
9955 "The B<__flbf>()  function returns a nonzero value if the stream is "
9956 "line-buffered, and zero otherwise."
9957 msgstr ""
9958
9959 #. type: Plain text
9960 #: build/C/man3/stdio_ext.3:79
9961 msgid ""
9962 "The B<__freadable>()  function returns a nonzero value if the stream allows "
9963 "reading, and zero otherwise."
9964 msgstr ""
9965
9966 #. type: Plain text
9967 #: build/C/man3/stdio_ext.3:84
9968 msgid ""
9969 "The B<__fwritable>()  function returns a nonzero value if the stream allows "
9970 "writing, and zero otherwise."
9971 msgstr ""
9972
9973 #. type: Plain text
9974 #: build/C/man3/stdio_ext.3:90
9975 msgid ""
9976 "The B<__freading>()  function returns a nonzero value if the stream is "
9977 "read-only, or if the last operation on the stream was a read operation, and "
9978 "zero otherwise."
9979 msgstr ""
9980
9981 #. type: Plain text
9982 #: build/C/man3/stdio_ext.3:96
9983 msgid ""
9984 "The B<__fwriting>()  function returns a nonzero value if the stream is "
9985 "write-only (or append-only), or if the last operation on the stream was a "
9986 "write operation, and zero otherwise."
9987 msgstr ""
9988
9989 #. type: Plain text
9990 #: build/C/man3/stdio_ext.3:104
9991 msgid ""
9992 "The B<__fsetlocking>()  function can be used to select the desired type of "
9993 "locking on the stream.  It returns the current type.  The I<type> argument "
9994 "can take the following three values:"
9995 msgstr ""
9996
9997 #. type: TP
9998 #: build/C/man3/stdio_ext.3:104
9999 #, no-wrap
10000 msgid "B<FSETLOCKING_INTERNAL>"
10001 msgstr ""
10002
10003 #. type: Plain text
10004 #: build/C/man3/stdio_ext.3:109
10005 msgid ""
10006 "Perform implicit locking around every operation on the given stream (except "
10007 "for the *_unlocked ones).  This is the default."
10008 msgstr ""
10009
10010 #. type: TP
10011 #: build/C/man3/stdio_ext.3:109
10012 #, no-wrap
10013 msgid "B<FSETLOCKING_BYCALLER>"
10014 msgstr ""
10015
10016 #. type: Plain text
10017 #: build/C/man3/stdio_ext.3:116
10018 msgid ""
10019 "The caller will take care of the locking (possibly using B<flockfile>(3)  in "
10020 "case there is more than one thread), and the stdio routines will not do "
10021 "locking until the state is reset to B<FSETLOCKING_INTERNAL>."
10022 msgstr ""
10023
10024 #. type: TP
10025 #: build/C/man3/stdio_ext.3:116
10026 #, no-wrap
10027 msgid "B<FSETLOCKING_QUERY>"
10028 msgstr ""
10029
10030 #. type: Plain text
10031 #: build/C/man3/stdio_ext.3:120
10032 msgid "Don't change the type of locking.  (Only return it.)"
10033 msgstr ""
10034
10035 #. type: Plain text
10036 #: build/C/man3/stdio_ext.3:126
10037 msgid ""
10038 "The B<_flushlbf>()  function flushes all line-buffered streams.  (Presumably "
10039 "so that output to a terminal is forced out, say before reading keyboard "
10040 "input.)"
10041 msgstr ""
10042
10043 #. type: Plain text
10044 #: build/C/man3/stdio_ext.3:130
10045 msgid "The B<__fpurge>()  function discards the contents of the stream's buffer."
10046 msgstr ""
10047
10048 #. type: Plain text
10049 #: build/C/man3/stdio_ext.3:133
10050 msgid "B<flockfile>(3), B<fpurge>(3)"
10051 msgstr ""
10052
10053 #. type: TH
10054 #: build/C/man2/symlink.2:32 build/C/man7/symlink.7:35
10055 #, no-wrap
10056 msgid "SYMLINK"
10057 msgstr ""
10058
10059 #. type: TH
10060 #: build/C/man2/symlink.2:32
10061 #, no-wrap
10062 msgid "2010-09-20"
10063 msgstr ""
10064
10065 #. type: Plain text
10066 #: build/C/man2/symlink.2:35
10067 msgid "symlink - make a new name for a file"
10068 msgstr ""
10069
10070 #. type: Plain text
10071 #: build/C/man2/symlink.2:39
10072 msgid "B<int symlink(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
10073 msgstr ""
10074
10075 #. type: Plain text
10076 #: build/C/man2/symlink.2:47
10077 msgid "B<symlink>():"
10078 msgstr ""
10079
10080 #. type: Plain text
10081 #: build/C/man2/symlink.2:58
10082 msgid ""
10083 "B<symlink>()  creates a symbolic link named I<newpath> which contains the "
10084 "string I<oldpath>."
10085 msgstr ""
10086
10087 #. type: Plain text
10088 #: build/C/man2/symlink.2:62
10089 msgid ""
10090 "Symbolic links are interpreted at run time as if the contents of the link "
10091 "had been substituted into the path being followed to find a file or "
10092 "directory."
10093 msgstr ""
10094
10095 #. type: Plain text
10096 #: build/C/man2/symlink.2:67
10097 msgid ""
10098 "Symbolic links may contain I<..> path components, which (if used at the "
10099 "start of the link) refer to the parent directories of that in which the link "
10100 "resides."
10101 msgstr ""
10102
10103 #. type: Plain text
10104 #: build/C/man2/symlink.2:71
10105 msgid ""
10106 "A symbolic link (also known as a soft link) may point to an existing file or "
10107 "to a nonexistent one; the latter case is known as a dangling link."
10108 msgstr ""
10109
10110 #. type: Plain text
10111 #: build/C/man2/symlink.2:78
10112 msgid ""
10113 "The permissions of a symbolic link are irrelevant; the ownership is ignored "
10114 "when following the link, but is checked when removal or renaming of the link "
10115 "is requested and the link is in a directory with the sticky bit (B<S_ISVTX>)  "
10116 "set."
10117 msgstr ""
10118
10119 #. type: Plain text
10120 #: build/C/man2/symlink.2:99
10121 msgid ""
10122 "Write access to the directory containing I<newpath> is denied, or one of the "
10123 "directories in the path prefix of I<newpath> did not allow search "
10124 "permission.  (See also B<path_resolution>(7).)"
10125 msgstr ""
10126
10127 #. type: Plain text
10128 #: build/C/man2/symlink.2:113
10129 msgid "Too many symbolic links were encountered in resolving I<newpath>."
10130 msgstr ""
10131
10132 #. type: Plain text
10133 #: build/C/man2/symlink.2:123
10134 msgid ""
10135 "A directory component in I<newpath> does not exist or is a dangling symbolic "
10136 "link, or I<oldpath> is the empty string."
10137 msgstr ""
10138
10139 #. type: Plain text
10140 #: build/C/man2/symlink.2:135
10141 msgid "A component used as a directory in I<newpath> is not, in fact, a directory."
10142 msgstr ""
10143
10144 #. type: Plain text
10145 #: build/C/man2/symlink.2:140
10146 msgid ""
10147 "The file system containing I<newpath> does not support the creation of "
10148 "symbolic links."
10149 msgstr ""
10150
10151 #. type: Plain text
10152 #: build/C/man2/symlink.2:144
10153 msgid "I<newpath> is on a read-only file system."
10154 msgstr ""
10155
10156 #. type: Plain text
10157 #: build/C/man2/symlink.2:154
10158 msgid "No checking of I<oldpath> is done."
10159 msgstr ""
10160
10161 #. type: Plain text
10162 #: build/C/man2/symlink.2:159
10163 msgid ""
10164 "Deleting the name referred to by a symlink will actually delete the file "
10165 "(unless it also has other hard links).  If this behavior is not desired, use "
10166 "B<link>(2)."
10167 msgstr ""
10168
10169 #. type: Plain text
10170 #: build/C/man2/symlink.2:171
10171 msgid ""
10172 "B<ln>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<open>(2), B<readlink>(2), "
10173 "B<rename>(2), B<symlinkat>(2), B<unlink>(2), B<path_resolution>(7), "
10174 "B<symlink>(7)"
10175 msgstr ""
10176
10177 #. type: TH
10178 #: build/C/man7/symlink.7:35
10179 #, no-wrap
10180 msgid "2008-06-18"
10181 msgstr ""
10182
10183 #. type: Plain text
10184 #: build/C/man7/symlink.7:38
10185 msgid "symlink - symbolic link handling"
10186 msgstr ""
10187
10188 #. type: SH
10189 #: build/C/man7/symlink.7:38
10190 #, no-wrap
10191 msgid "SYMBOLIC LINK HANDLING"
10192 msgstr ""
10193
10194 #. type: Plain text
10195 #: build/C/man7/symlink.7:42
10196 msgid ""
10197 "Symbolic links are files that act as pointers to other files.  To understand "
10198 "their behavior, you must first understand how hard links work."
10199 msgstr ""
10200
10201 #. type: Plain text
10202 #: build/C/man7/symlink.7:58
10203 msgid ""
10204 "A hard link to a file is indistinguishable from the original file because it "
10205 "is a reference to the object underlying the original filename.  (To be "
10206 "precise: each of the hard links to a file is a reference to the same "
10207 "I<i-node number>, where an i-node number is an index into the i-node table, "
10208 "which contains metadata about all files on a file system.  See B<stat>(2).)  "
10209 "Changes to a file are independent of the name used to reference the file.  "
10210 "Hard links may not refer to directories (to prevent the possibility of loops "
10211 "within the file system tree, which would confuse many programs)  and may not "
10212 "refer to files on different file systems (because i-node numbers are not "
10213 "unique across file systems)."
10214 msgstr ""
10215
10216 #. type: Plain text
10217 #: build/C/man7/symlink.7:65
10218 msgid ""
10219 "A symbolic link is a special type of file whose contents are a string that "
10220 "is the pathname another file, the file to which the link refers.  In other "
10221 "words, a symbolic link is a pointer to another name, and not to an "
10222 "underlying object.  For this reason, symbolic links may refer to directories "
10223 "and may cross file system boundaries."
10224 msgstr ""
10225
10226 #. type: Plain text
10227 #: build/C/man7/symlink.7:71
10228 msgid ""
10229 "There is no requirement that the pathname referred to by a symbolic link "
10230 "should exist.  A symbolic link that refers to a pathname that does not exist "
10231 "is said to be a I<dangling link>."
10232 msgstr ""
10233
10234 #. type: Plain text
10235 #: build/C/man7/symlink.7:83
10236 msgid ""
10237 "Because a symbolic link and its referenced object coexist in the file system "
10238 "name space, confusion can arise in distinguishing between the link itself "
10239 "and the referenced object.  On historical systems, commands and system calls "
10240 "adopted their own link-following conventions in a somewhat ad-hoc fashion.  "
10241 "Rules for a more uniform approach, as they are implemented on Linux and "
10242 "other systems, are outlined here.  It is important that site-local "
10243 "applications also conform to these rules, so that the user interface can be "
10244 "as consistent as possible."
10245 msgstr ""
10246
10247 #. type: SS
10248 #: build/C/man7/symlink.7:83
10249 #, no-wrap
10250 msgid "Symbolic link ownership, permissions, and timestamps"
10251 msgstr ""
10252
10253 #. type: Plain text
10254 #: build/C/man7/symlink.7:91
10255 msgid ""
10256 "The owner and group of an existing symbolic link can be changed using "
10257 "B<lchown>(2).  The only time that the ownership of a symbolic link matters "
10258 "is when the link is being removed or renamed in a directory that has the "
10259 "sticky bit set (see B<stat>(2))."
10260 msgstr ""
10261
10262 #. type: Plain text
10263 #: build/C/man7/symlink.7:97
10264 msgid ""
10265 "The last access and last modification timestamps of a symbolic link can be "
10266 "changed using B<utimensat>(2)  or B<lutimes>(3)."
10267 msgstr ""
10268
10269 #.  Linux does not currently implement an lchmod(2).
10270 #
10271 #.  The
10272 #.  4.4BSD
10273 #.  system differs from historical
10274 #.  4BSD
10275 #.  systems in that the system call
10276 #.  .BR chown (2)
10277 #.  has been changed to follow symbolic links.
10278 #.  The
10279 #.  .BR lchown (2)
10280 #.  system call was added later when the limitations of the new
10281 #.  .BR chown (2)
10282 #.  became apparent.
10283 #. type: Plain text
10284 #: build/C/man7/symlink.7:116
10285 msgid ""
10286 "On Linux, the permissions of a symbolic link are not used in any operations; "
10287 "the permissions are always 0777 (read, write, and execute for all user "
10288 "categories), and can't be changed."
10289 msgstr ""
10290
10291 #. type: SS
10292 #: build/C/man7/symlink.7:116
10293 #, no-wrap
10294 msgid "Handling of symbolic links by system calls and commands"
10295 msgstr ""
10296
10297 #. type: Plain text
10298 #: build/C/man7/symlink.7:131
10299 msgid ""
10300 "Symbolic links are handled either by operating on the link itself, or by "
10301 "operating on the object referred to by the link.  In the latter case, an "
10302 "application or system call is said to I<follow> the link.  Symbolic links "
10303 "may refer to other symbolic links, in which case the links are dereferenced "
10304 "until an object that is not a symbolic link is found, a symbolic link that "
10305 "refers to a file which does not exist is found, or a loop is detected.  "
10306 "(Loop detection is done by placing an upper limit on the number of links "
10307 "that may be followed, and an error results if this limit is exceeded.)"
10308 msgstr ""
10309
10310 #. type: Plain text
10311 #: build/C/man7/symlink.7:134
10312 msgid ""
10313 "There are three separate areas that need to be discussed.  They are as "
10314 "follows:"
10315 msgstr ""
10316
10317 #. type: IP
10318 #: build/C/man7/symlink.7:134
10319 #, no-wrap
10320 msgid "1."
10321 msgstr ""
10322
10323 #. type: Plain text
10324 #: build/C/man7/symlink.7:136
10325 msgid "Symbolic links used as filename arguments for system calls."
10326 msgstr ""
10327
10328 #. type: IP
10329 #: build/C/man7/symlink.7:136
10330 #, no-wrap
10331 msgid "2."
10332 msgstr ""
10333
10334 #. type: Plain text
10335 #: build/C/man7/symlink.7:139
10336 msgid ""
10337 "Symbolic links specified as command-line arguments to utilities that are not "
10338 "traversing a file tree."
10339 msgstr ""
10340
10341 #. type: IP
10342 #: build/C/man7/symlink.7:139
10343 #, no-wrap
10344 msgid "3."
10345 msgstr ""
10346
10347 #. type: Plain text
10348 #: build/C/man7/symlink.7:143
10349 msgid ""
10350 "Symbolic links encountered by utilities that are traversing a file tree "
10351 "(either specified on the command line or encountered as part of the file "
10352 "hierarchy walk)."
10353 msgstr ""
10354
10355 #. type: SS
10356 #: build/C/man7/symlink.7:143
10357 #, no-wrap
10358 msgid "System calls"
10359 msgstr ""
10360
10361 #. type: Plain text
10362 #: build/C/man7/symlink.7:146
10363 msgid ""
10364 "The first area is symbolic links used as filename arguments for system "
10365 "calls."
10366 msgstr ""
10367
10368 #. type: Plain text
10369 #: build/C/man7/symlink.7:156
10370 msgid ""
10371 "Except as noted below, all system calls follow symbolic links.  For example, "
10372 "if there were a symbolic link I<slink> which pointed to a file named "
10373 "I<afile>, the system call I<open(\"slink\" ...\\&)> would return a file "
10374 "descriptor referring to the file I<afile>."
10375 msgstr ""
10376
10377 #.  Maybe one day: .BR fchownat (2)
10378 #. type: Plain text
10379 #: build/C/man7/symlink.7:206
10380 msgid ""
10381 "Various system calls do not follow links, and operate on the symbolic link "
10382 "itself.  They are: B<lchown>(2), B<lgetxattr>(2), B<llistxattr>(2), "
10383 "B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), B<readlink>(2), "
10384 "B<rename>(2), B<rmdir>(2), and B<unlink>(2).  Certain other system calls "
10385 "optionally follow symbolic links.  They are: B<faccessat>(2), "
10386 "B<fchownat>(2), B<fstatat>(2), B<linkat>(2), B<open>(2), B<openat>(2), and "
10387 "B<utimensat>(2); see their manual pages for details.  Because B<remove>(3)  "
10388 "is an alias for B<unlink>(2), that library function also does not follow "
10389 "symbolic links.  When B<rmdir>(2)  is applied to a symbolic link, it fails "
10390 "with the error B<ENOTDIR>.  The B<link>(2)  warrants special discussion.  "
10391 "POSIX.1-2001 specifies that B<link>(2)  should dereference I<oldpath> if it "
10392 "is a symbolic link.  However, Linux does not do this.  (By default Solaris "
10393 "is the same, but the POSIX.1-2001 specified behavior can be obtained with "
10394 "suitable compiler options.)  The upcoming POSIX.1 revision changes the "
10395 "specification to allow either behavior in an implementation."
10396 msgstr ""
10397
10398 #. type: SS
10399 #: build/C/man7/symlink.7:206
10400 #, no-wrap
10401 msgid "Commands not traversing a file tree"
10402 msgstr ""
10403
10404 #. type: Plain text
10405 #: build/C/man7/symlink.7:209
10406 msgid ""
10407 "The second area is symbolic links, specified as command-line filename "
10408 "arguments, to commands which are not traversing a file tree."
10409 msgstr ""
10410
10411 #. type: Plain text
10412 #: build/C/man7/symlink.7:220
10413 msgid ""
10414 "Except as noted below, commands follow symbolic links named as command-line "
10415 "arguments.  For example, if there were a symbolic link I<slink> which "
10416 "pointed to a file named I<afile>, the command I<cat slink> would display the "
10417 "contents of the file I<afile>."
10418 msgstr ""
10419
10420 #. type: Plain text
10421 #: build/C/man7/symlink.7:228
10422 msgid ""
10423 "It is important to realize that this rule includes commands which may "
10424 "optionally traverse file trees, e.g., the command I<chown file> is included "
10425 "in this rule, while the command I<chown\\ -R file>, which performs a tree "
10426 "traversal, is not.  (The latter is described in the third area, below.)"
10427 msgstr ""
10428
10429 #. type: Plain text
10430 #: build/C/man7/symlink.7:246
10431 msgid ""
10432 "If it is explicitly intended that the command operate on the symbolic link "
10433 "instead of following the symbolic link, e.g., it is desired that I<chown "
10434 "slink> change the ownership of the file that I<slink> is, whether it is a "
10435 "symbolic link or not, the I<-h> option should be used.  In the above "
10436 "example, I<chown root slink> would change the ownership of the file referred "
10437 "to by I<slink>, while I<chown\\ -h root slink> would change the ownership of "
10438 "I<slink> itself."
10439 msgstr ""
10440
10441 #. type: Plain text
10442 #: build/C/man7/symlink.7:248
10443 msgid "There are some exceptions to this rule:"
10444 msgstr ""
10445
10446 #. type: Plain text
10447 #: build/C/man7/symlink.7:258
10448 msgid ""
10449 "The B<mv>(1)  and B<rm>(1)  commands do not follow symbolic links named as "
10450 "arguments, but respectively attempt to rename and delete them.  (Note, if "
10451 "the symbolic link references a file via a relative path, moving it to "
10452 "another directory may very well cause it to stop working, since the path may "
10453 "no longer be correct.)"
10454 msgstr ""
10455
10456 #. type: Plain text
10457 #: build/C/man7/symlink.7:288
10458 msgid ""
10459 "The B<ls>(1)  command is also an exception to this rule.  For compatibility "
10460 "with historic systems (when B<ls>(1)  is not doing a tree walk, i.e., the "
10461 "I<-R> option is not specified), the B<ls>(1)  command follows symbolic links "
10462 "named as arguments if the I<-H> or I<-L> option is specified, or if the "
10463 "I<-F>, I<-d>, or I<-l> options are not specified.  (The B<ls>(1)  command is "
10464 "the only command where the I<-H> and I<-L> options affect its behavior even "
10465 "though it is not doing a walk of a file tree.)"
10466 msgstr ""
10467
10468 #
10469 #. The 4.4BSD system differs from historical 4BSD systems in that the
10470 #. .BR chown (1)
10471 #. and
10472 #. .BR chgrp (1)
10473 #. commands follow symbolic links specified on the command line.
10474 #. type: Plain text
10475 #: build/C/man7/symlink.7:306
10476 msgid ""
10477 "The B<file>(1)  command is also an exception to this rule.  The B<file>(1)  "
10478 "command does not follow symbolic links named as argument by default.  The "
10479 "B<file>(1)  command does follow symbolic links named as argument if the "
10480 "I<-L> option is specified."
10481 msgstr ""
10482
10483 #. type: SS
10484 #: build/C/man7/symlink.7:306
10485 #, no-wrap
10486 msgid "Commands traversing a file tree"
10487 msgstr ""
10488
10489 #. type: Plain text
10490 #: build/C/man7/symlink.7:319
10491 msgid ""
10492 "The following commands either optionally or always traverse file trees: "
10493 "B<chgrp>(1), B<chmod>(1), B<chown>(1), B<cp>(1), B<du>(1), B<find>(1), "
10494 "B<ls>(1), B<pax>(1), B<rm>(1), and B<tar>(1)."
10495 msgstr ""
10496
10497 #. type: Plain text
10498 #: build/C/man7/symlink.7:323
10499 msgid ""
10500 "It is important to realize that the following rules apply equally to "
10501 "symbolic links encountered during the file tree traversal and symbolic links "
10502 "listed as command-line arguments."
10503 msgstr ""
10504
10505 #. type: Plain text
10506 #: build/C/man7/symlink.7:328
10507 msgid ""
10508 "The I<first rule> applies to symbolic links that reference files other than "
10509 "directories.  Operations that apply to symbolic links are performed on the "
10510 "links themselves, but otherwise the links are ignored."
10511 msgstr ""
10512
10513 #. type: Plain text
10514 #: build/C/man7/symlink.7:340
10515 msgid ""
10516 "The command I<rm\\ -r slink directory> will remove I<slink>, as well as any "
10517 "symbolic links encountered in the tree traversal of I<directory>, because "
10518 "symbolic links may be removed.  In no case will B<rm>(1)  affect the file "
10519 "referred to by I<slink>."
10520 msgstr ""
10521
10522 #. type: Plain text
10523 #: build/C/man7/symlink.7:345
10524 msgid ""
10525 "The I<second rule> applies to symbolic links that refer to directories.  "
10526 "Symbolic links that refer to directories are never followed by default.  "
10527 "This is often referred to as a \"physical\" walk, as opposed to a "
10528 "\"logical\" walk (where symbolic links the refer to directories are "
10529 "followed)."
10530 msgstr ""
10531
10532 #. type: Plain text
10533 #: build/C/man7/symlink.7:348
10534 msgid ""
10535 "Certain conventions are (should be) followed as consistently as possible by "
10536 "commands that perform file tree walks:"
10537 msgstr ""
10538
10539 #. type: Plain text
10540 #: build/C/man7/symlink.7:361
10541 msgid ""
10542 "A command can be made to follow any symbolic links named on the command "
10543 "line, regardless of the type of file they reference, by specifying the I<-H> "
10544 "(for \"half-logical\") flag.  This flag is intended to make the command-line "
10545 "name space look like the logical name space.  (Note, for commands that do "
10546 "not always do file tree traversals, the I<-H> flag will be ignored if the "
10547 "I<-R> flag is not also specified.)"
10548 msgstr ""
10549
10550 #. type: Plain text
10551 #: build/C/man7/symlink.7:377
10552 msgid ""
10553 "For example, the command I<chown\\ -HR user slink> will traverse the file "
10554 "hierarchy rooted in the file pointed to by I<slink>.  Note, the I<-H> is not "
10555 "the same as the previously discussed I<-h> flag.  The I<-H> flag causes "
10556 "symbolic links specified on the command line to be dereferenced for the "
10557 "purposes of both the action to be performed and the tree walk, and it is as "
10558 "if the user had specified the name of the file to which the symbolic link "
10559 "pointed."
10560 msgstr ""
10561
10562 #. type: Plain text
10563 #: build/C/man7/symlink.7:391
10564 msgid ""
10565 "A command can be made to follow any symbolic links named on the command "
10566 "line, as well as any symbolic links encountered during the traversal, "
10567 "regardless of the type of file they reference, by specifying the I<-L> (for "
10568 "\"logical\") flag.  This flag is intended to make the entire name space look "
10569 "like the logical name space.  (Note, for commands that do not always do file "
10570 "tree traversals, the I<-L> flag will be ignored if the I<-R> flag is not "
10571 "also specified.)"
10572 msgstr ""
10573
10574 #. type: Plain text
10575 #: build/C/man7/symlink.7:406
10576 msgid ""
10577 "For example, the command I<chown\\ -LR user slink> will change the owner of "
10578 "the file referred to by I<slink>.  If I<slink> refers to a directory, "
10579 "B<chown> will traverse the file hierarchy rooted in the directory that it "
10580 "references.  In addition, if any symbolic links are encountered in any file "
10581 "tree that B<chown> traverses, they will be treated in the same fashion as "
10582 "I<slink>."
10583 msgstr ""
10584
10585 #. type: Plain text
10586 #: build/C/man7/symlink.7:413
10587 msgid ""
10588 "A command can be made to provide the default behavior by specifying the "
10589 "I<-P> (for \"physical\") flag.  This flag is intended to make the entire "
10590 "name space look like the physical name space."
10591 msgstr ""
10592
10593 #. type: Plain text
10594 #: build/C/man7/symlink.7:431
10595 msgid ""
10596 "For commands that do not by default do file tree traversals, the I<-H>, "
10597 "I<-L>, and I<-P> flags are ignored if the I<-R> flag is not also specified.  "
10598 "In addition, you may specify the I<-H>, I<-L>, and I<-P> options more than "
10599 "once; the last one specified determines the command's behavior.  This is "
10600 "intended to permit you to alias commands to behave one way or the other, and "
10601 "then override that behavior on the command line."
10602 msgstr ""
10603
10604 #. type: Plain text
10605 #: build/C/man7/symlink.7:437
10606 msgid "The B<ls>(1)  and B<rm>(1)  commands have exceptions to these rules:"
10607 msgstr ""
10608
10609 #. type: Plain text
10610 #: build/C/man7/symlink.7:450
10611 msgid ""
10612 "The B<rm>(1)  command operates on the symbolic link, and not the file it "
10613 "references, and therefore never follows a symbolic link.  The B<rm>(1)  "
10614 "command does not support the I<-H>, I<-L>, or I<-P> options."
10615 msgstr ""
10616
10617 #. type: Plain text
10618 #: build/C/man7/symlink.7:470
10619 msgid ""
10620 "To maintain compatibility with historic systems, the B<ls>(1)  command acts "
10621 "a little differently.  If you do not specify the I<-F>, I<-d> or I<-l> "
10622 "options, B<ls>(1)  will follow symbolic links specified on the command "
10623 "line.  If the I<-L> flag is specified, B<ls>(1)  follows all symbolic links, "
10624 "regardless of their type, whether specified on the command line or "
10625 "encountered in the tree walk."
10626 msgstr ""
10627
10628 #. type: Plain text
10629 #: build/C/man7/symlink.7:488
10630 msgid ""
10631 "B<chgrp>(1), B<chmod>(1), B<find>(1), B<ln>(1), B<ls>(1), B<mv>(1), "
10632 "B<rm>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<readlink>(2), "
10633 "B<rename>(2), B<symlink>(2), B<unlink>(2), B<utimensat>(2), B<lutimes>(3), "
10634 "B<path_resolution>(7)"
10635 msgstr ""
10636
10637 #. type: TH
10638 #: build/C/man3/tempnam.3:23
10639 #, no-wrap
10640 msgid "TEMPNAM"
10641 msgstr ""
10642
10643 #. type: TH
10644 #: build/C/man3/tempnam.3:23
10645 #, no-wrap
10646 msgid "2008-08-06"
10647 msgstr ""
10648
10649 #. type: Plain text
10650 #: build/C/man3/tempnam.3:26
10651 msgid "tempnam - create a name for a temporary file"
10652 msgstr ""
10653
10654 #. type: Plain text
10655 #: build/C/man3/tempnam.3:31
10656 #, no-wrap
10657 msgid "B<char *tempnam(const char *>I<dir>B<, const char *>I<pfx>B<);>\n"
10658 msgstr ""
10659
10660 #. type: Plain text
10661 #: build/C/man3/tempnam.3:40
10662 msgid "B<tempnam>(): _BSD_SOURCE || _SVID_SOURCE"
10663 msgstr ""
10664
10665 #. type: Plain text
10666 #: build/C/man3/tempnam.3:54
10667 msgid ""
10668 "The B<tempnam>()  function returns a pointer to a string that is a valid "
10669 "filename, and such that a file with this name did not exist when "
10670 "B<tempnam>()  checked.  The filename suffix of the pathname generated will "
10671 "start with I<pfx> in case I<pfx> is a non-NULL string of at most five "
10672 "bytes.  The directory prefix part of the pathname generated is required to "
10673 "be \"appropriate\" (often that at least implies writable)."
10674 msgstr ""
10675
10676 #. type: Plain text
10677 #: build/C/man3/tempnam.3:57
10678 msgid "Attempts to find an appropriate directory go through the following steps:"
10679 msgstr ""
10680
10681 #. type: TP
10682 #: build/C/man3/tempnam.3:57
10683 #, no-wrap
10684 msgid "a)"
10685 msgstr ""
10686
10687 #. type: Plain text
10688 #: build/C/man3/tempnam.3:63
10689 msgid ""
10690 "In case the environment variable B<TMPDIR> exists and contains the name of "
10691 "an appropriate directory, that is used."
10692 msgstr ""
10693
10694 #. type: TP
10695 #: build/C/man3/tempnam.3:63
10696 #, no-wrap
10697 msgid "b)"
10698 msgstr ""
10699
10700 #. type: Plain text
10701 #: build/C/man3/tempnam.3:68
10702 msgid "Otherwise, if the I<dir> argument is non-NULL and appropriate, it is used."
10703 msgstr ""
10704
10705 #. type: TP
10706 #: build/C/man3/tempnam.3:68
10707 #, no-wrap
10708 msgid "c)"
10709 msgstr ""
10710
10711 #. type: Plain text
10712 #: build/C/man3/tempnam.3:75
10713 msgid ""
10714 "Otherwise, I<P_tmpdir> (as defined in I<E<lt>stdio.hE<gt>>)  is used when "
10715 "appropriate."
10716 msgstr ""
10717
10718 #. type: TP
10719 #: build/C/man3/tempnam.3:75
10720 #, no-wrap
10721 msgid "d)"
10722 msgstr ""
10723
10724 #. type: Plain text
10725 #: build/C/man3/tempnam.3:78
10726 msgid "Finally an implementation-defined directory may be used."
10727 msgstr ""
10728
10729 #. type: Plain text
10730 #: build/C/man3/tempnam.3:85
10731 msgid ""
10732 "The string returned by B<tempnam>()  is allocated using B<malloc>(3)  and "
10733 "hence should be freed by B<free>(3)."
10734 msgstr ""
10735
10736 #. type: Plain text
10737 #: build/C/man3/tempnam.3:90
10738 msgid ""
10739 "The B<tempnam>()  function returns a pointer to a unique temporary filename, "
10740 "or NULL if a unique name cannot be generated."
10741 msgstr ""
10742
10743 #. type: Plain text
10744 #: build/C/man3/tempnam.3:94
10745 msgid "Allocation of storage failed."
10746 msgstr ""
10747
10748 #. type: Plain text
10749 #: build/C/man3/tempnam.3:99
10750 msgid "SVr4, 4.3BSD, POSIX.1-2001.  POSIX.1-2008 marks B<tempnam>()  as obsolete."
10751 msgstr ""
10752
10753 #. type: Plain text
10754 #: build/C/man3/tempnam.3:118
10755 msgid ""
10756 "Although B<tempnam>()  generates names that are difficult to guess, it is "
10757 "nevertheless possible that between the time that B<tempnam>()  returns a "
10758 "pathname, and the time that the program opens it, another program might "
10759 "create that pathname using B<open>(2), or create it as a symbolic link.  "
10760 "This can lead to security holes.  To avoid such possibilities, use the "
10761 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
10762 "B<mkstemp>(3)  or B<tmpfile>(3)."
10763 msgstr ""
10764
10765 #. type: Plain text
10766 #: build/C/man3/tempnam.3:126
10767 msgid ""
10768 "SUSv2 does not mention the use of B<TMPDIR>; glibc will use it only when the "
10769 "program is not set-user-ID.  On SVr4, the directory used under B<d)> is "
10770 "I</tmp> (and this is what glibc does)."
10771 msgstr ""
10772
10773 #. type: Plain text
10774 #: build/C/man3/tempnam.3:131
10775 msgid ""
10776 "Because it dynamically allocates memory used to return the pathname, "
10777 "B<tempnam>()  is reentrant, and thus thread safe, unlike B<tmpnam>(3)."
10778 msgstr ""
10779
10780 #. type: Plain text
10781 #: build/C/man3/tempnam.3:144
10782 msgid ""
10783 "The B<tempnam>()  function generates a different string each time it is "
10784 "called, up to B<TMP_MAX> (defined in I<E<lt>stdio.hE<gt>>)  times.  If it is "
10785 "called more than B<TMP_MAX> times, the behavior is implementation defined."
10786 msgstr ""
10787
10788 #. type: Plain text
10789 #: build/C/man3/tempnam.3:148
10790 msgid "B<tempnam>()  uses at most the first five bytes from I<pfx>."
10791 msgstr ""
10792
10793 #. type: Plain text
10794 #: build/C/man3/tempnam.3:154
10795 msgid ""
10796 "The glibc implementation of B<tempnam>()  will fail with the error B<EEXIST> "
10797 "upon failure to find a unique name."
10798 msgstr ""
10799
10800 #. type: Plain text
10801 #: build/C/man3/tempnam.3:157
10802 msgid ""
10803 "The precise meaning of \"appropriate\" is undefined; it is unspecified how "
10804 "accessibility of a directory is determined."
10805 msgstr ""
10806
10807 #. type: Plain text
10808 #: build/C/man3/tempnam.3:164 build/C/man3/tmpnam.3:151
10809 msgid "Never use this function.  Use B<mkstemp>(3)  or B<tmpfile>(3)  instead."
10810 msgstr ""
10811
10812 #. type: Plain text
10813 #: build/C/man3/tempnam.3:169
10814 msgid "B<mkstemp>(3), B<mktemp>(3), B<tmpfile>(3), B<tmpnam>(3)"
10815 msgstr ""
10816
10817 #. type: TH
10818 #: build/C/man3/tmpfile.3:29
10819 #, no-wrap
10820 msgid "TMPFILE"
10821 msgstr ""
10822
10823 #. type: Plain text
10824 #: build/C/man3/tmpfile.3:32
10825 msgid "tmpfile - create a temporary file"
10826 msgstr ""
10827
10828 #. type: Plain text
10829 #: build/C/man3/tmpfile.3:37
10830 #, no-wrap
10831 msgid "B<FILE *tmpfile(void);>\n"
10832 msgstr ""
10833
10834 #. type: Plain text
10835 #: build/C/man3/tmpfile.3:45
10836 msgid ""
10837 "The B<tmpfile>()  function opens a unique temporary file in binary "
10838 "read/write (w+b) mode.  The file will be automatically deleted when it is "
10839 "closed or the program terminates."
10840 msgstr ""
10841
10842 #. type: Plain text
10843 #: build/C/man3/tmpfile.3:52
10844 msgid ""
10845 "The B<tmpfile>()  function returns a stream descriptor, or NULL if a unique "
10846 "filename cannot be generated or the unique file cannot be opened.  In the "
10847 "latter case, I<errno> is set to indicate the error."
10848 msgstr ""
10849
10850 #. type: Plain text
10851 #: build/C/man3/tmpfile.3:56
10852 msgid "Search permission denied for directory in file's path prefix."
10853 msgstr ""
10854
10855 #. type: Plain text
10856 #: build/C/man3/tmpfile.3:59
10857 msgid "Unable to generate a unique filename."
10858 msgstr ""
10859
10860 #. type: Plain text
10861 #: build/C/man3/tmpfile.3:62
10862 msgid "The call was interrupted by a signal."
10863 msgstr ""
10864
10865 #. type: Plain text
10866 #: build/C/man3/tmpfile.3:65
10867 msgid "Too many file descriptors in use by the process."
10868 msgstr ""
10869
10870 #. type: Plain text
10871 #: build/C/man3/tmpfile.3:68
10872 msgid "Too many files open in the system."
10873 msgstr ""
10874
10875 #. type: Plain text
10876 #: build/C/man3/tmpfile.3:71
10877 msgid "There was no room in the directory to add the new filename."
10878 msgstr ""
10879
10880 #. type: Plain text
10881 #: build/C/man3/tmpfile.3:74
10882 msgid "Read-only file system."
10883 msgstr ""
10884
10885 #. type: Plain text
10886 #: build/C/man3/tmpfile.3:76
10887 msgid "SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001."
10888 msgstr ""
10889
10890 #. type: Plain text
10891 #: build/C/man3/tmpfile.3:80
10892 msgid ""
10893 "POSIX.1-2001 specifies: an error message may be written to I<stdout> if the "
10894 "stream cannot be opened."
10895 msgstr ""
10896
10897 #. type: Plain text
10898 #: build/C/man3/tmpfile.3:86
10899 msgid ""
10900 "The standard does not specify the directory that B<tmpfile>()  will use.  "
10901 "Glibc will try the path prefix I<P_tmpdir> defined in I<E<lt>stdio.hE<gt>>, "
10902 "and if that fails the directory I</tmp>."
10903 msgstr ""
10904
10905 #. type: Plain text
10906 #: build/C/man3/tmpfile.3:92
10907 msgid "B<exit>(3), B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpnam>(3)"
10908 msgstr ""
10909
10910 #. type: TH
10911 #: build/C/man3/tmpnam.3:25
10912 #, no-wrap
10913 msgid "TMPNAM"
10914 msgstr ""
10915
10916 #. type: Plain text
10917 #: build/C/man3/tmpnam.3:28
10918 msgid "tmpnam, tmpnam_r - create a name for a temporary file"
10919 msgstr ""
10920
10921 #. type: Plain text
10922 #: build/C/man3/tmpnam.3:33
10923 #, no-wrap
10924 msgid "B<char *tmpnam(char *>I<s>B<);>\n"
10925 msgstr ""
10926
10927 #. type: Plain text
10928 #: build/C/man3/tmpnam.3:56
10929 msgid ""
10930 "The B<tmpnam>()  function returns a pointer to a string that is a valid "
10931 "filename, and such that a file with this name did not exist at some point in "
10932 "time, so that naive programmers may think it a suitable name for a temporary "
10933 "file.  If the argument I<s> is NULL this name is generated in an internal "
10934 "static buffer and may be overwritten by the next call to B<tmpnam>().  If "
10935 "I<s> is not NULL, the name is copied to the character array (of length at "
10936 "least I<L_tmpnam>)  pointed to by I<s> and the value I<s> is returned in "
10937 "case of success."
10938 msgstr ""
10939
10940 #. type: Plain text
10941 #: build/C/man3/tmpnam.3:68
10942 msgid ""
10943 "The pathname that is created, has a directory prefix I<P_tmpdir>.  (Both "
10944 "I<L_tmpnam> and I<P_tmpdir> are defined in I<E<lt>stdio.hE<gt>>, just like "
10945 "the B<TMP_MAX> mentioned below.)"
10946 msgstr ""
10947
10948 #. type: Plain text
10949 #: build/C/man3/tmpnam.3:73
10950 msgid ""
10951 "The B<tmpnam>()  function returns a pointer to a unique temporary filename, "
10952 "or NULL if a unique name cannot be generated."
10953 msgstr ""
10954
10955 #. type: Plain text
10956 #: build/C/man3/tmpnam.3:75
10957 msgid "No errors are defined."
10958 msgstr ""
10959
10960 #. type: Plain text
10961 #: build/C/man3/tmpnam.3:80
10962 msgid ""
10963 "SVr4, 4.3BSD, C89, C99, POSIX.1-2001.  POSIX.1-2008 marks B<tmpnam>()  as "
10964 "obsolete."
10965 msgstr ""
10966
10967 #. type: Plain text
10968 #: build/C/man3/tmpnam.3:91
10969 msgid ""
10970 "The B<tmpnam>()  function generates a different string each time it is "
10971 "called, up to B<TMP_MAX> times.  If it is called more than B<TMP_MAX> times, "
10972 "the behavior is implementation defined."
10973 msgstr ""
10974
10975 #. type: Plain text
10976 #: build/C/man3/tmpnam.3:110
10977 msgid ""
10978 "Although B<tmpnam>()  generates names that are difficult to guess, it is "
10979 "nevertheless possible that between the time that B<tmpnam>()  returns a "
10980 "pathname, and the time that the program opens it, another program might "
10981 "create that pathname using B<open>(2), or create it as a symbolic link.  "
10982 "This can lead to security holes.  To avoid such possibilities, use the "
10983 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
10984 "B<mkstemp>(3)  or B<tmpfile>(3)."
10985 msgstr ""
10986
10987 #. type: Plain text
10988 #: build/C/man3/tmpnam.3:118
10989 msgid ""
10990 "Portable applications that use threads cannot call B<tmpnam>()  with a NULL "
10991 "argument if either B<_POSIX_THREADS> or B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
10992 "defined."
10993 msgstr ""
10994
10995 #. type: Plain text
10996 #: build/C/man3/tmpnam.3:122
10997 msgid "A POSIX draft proposed to use a function B<tmpnam_r>()  defined by"
10998 msgstr ""
10999
11000 #. type: Plain text
11001 #: build/C/man3/tmpnam.3:130
11002 #, no-wrap
11003 msgid ""
11004 "char *\n"
11005 "tmpnam_r(char *s)\n"
11006 "{\n"
11007 "    return s ? tmpnam(s) : NULL;\n"
11008 "}\n"
11009 msgstr ""
11010
11011 #. type: Plain text
11012 #: build/C/man3/tmpnam.3:144
11013 msgid ""
11014 "apparently as a warning not to use NULL.  A few systems implement it.  To "
11015 "get a glibc prototype for this function from I<E<lt>stdio.hE<gt>>, define "
11016 "B<_SVID_SOURCE> or B<_BSD_SOURCE> (before including I<any> header file)."
11017 msgstr ""
11018
11019 #. type: Plain text
11020 #: build/C/man3/tmpnam.3:156
11021 msgid "B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpfile>(3)"
11022 msgstr ""
11023
11024 #. type: TH
11025 #: build/C/man2/unlink.2:32
11026 #, no-wrap
11027 msgid "UNLINK"
11028 msgstr ""
11029
11030 #. type: TH
11031 #: build/C/man2/unlink.2:32
11032 #, no-wrap
11033 msgid "2011-09-15"
11034 msgstr ""
11035
11036 #. type: Plain text
11037 #: build/C/man2/unlink.2:35
11038 msgid "unlink - delete a name and possibly the file it refers to"
11039 msgstr ""
11040
11041 #. type: Plain text
11042 #: build/C/man2/unlink.2:39
11043 msgid "B<int unlink(const char *>I<pathname>B<);>"
11044 msgstr ""
11045
11046 #. type: Plain text
11047 #: build/C/man2/unlink.2:45
11048 msgid ""
11049 "B<unlink>()  deletes a name from the file system.  If that name was the last "
11050 "link to a file and no processes have the file open the file is deleted and "
11051 "the space it was using is made available for reuse."
11052 msgstr ""
11053
11054 #. type: Plain text
11055 #: build/C/man2/unlink.2:49
11056 msgid ""
11057 "If the name was the last link to a file but any processes still have the "
11058 "file open the file will remain in existence until the last file descriptor "
11059 "referring to it is closed."
11060 msgstr ""
11061
11062 #. type: Plain text
11063 #: build/C/man2/unlink.2:51
11064 msgid "If the name referred to a symbolic link the link is removed."
11065 msgstr ""
11066
11067 #. type: Plain text
11068 #: build/C/man2/unlink.2:55
11069 msgid ""
11070 "If the name referred to a socket, fifo or device the name for it is removed "
11071 "but processes which have the object open may continue to use it."
11072 msgstr ""
11073
11074 #. type: Plain text
11075 #: build/C/man2/unlink.2:71
11076 msgid ""
11077 "Write access to the directory containing I<pathname> is not allowed for the "
11078 "process's effective UID, or one of the directories in I<pathname> did not "
11079 "allow search permission.  (See also B<path_resolution>(7).)"
11080 msgstr ""
11081
11082 #. type: Plain text
11083 #: build/C/man2/unlink.2:80
11084 msgid ""
11085 "The file I<pathname> cannot be unlinked because it is being used by the "
11086 "system or another process; for example, it is a mount point or the NFS "
11087 "client software created it to represent an active but otherwise nameless "
11088 "inode (\"NFS silly renamed\")."
11089 msgstr ""
11090
11091 #. type: Plain text
11092 #: build/C/man2/unlink.2:92
11093 msgid ""
11094 "I<pathname> refers to a directory.  (This is the non-POSIX value returned by "
11095 "Linux since 2.1.132.)"
11096 msgstr ""
11097
11098 #. type: Plain text
11099 #: build/C/man2/unlink.2:96
11100 msgid "Too many symbolic links were encountered in translating I<pathname>."
11101 msgstr ""
11102
11103 #. type: Plain text
11104 #: build/C/man2/unlink.2:106
11105 msgid ""
11106 "A component in I<pathname> does not exist or is a dangling symbolic link, or "
11107 "I<pathname> is empty."
11108 msgstr ""
11109
11110 #. type: Plain text
11111 #: build/C/man2/unlink.2:114
11112 msgid "A component used as a directory in I<pathname> is not, in fact, a directory."
11113 msgstr ""
11114
11115 #. type: Plain text
11116 #: build/C/man2/unlink.2:123
11117 msgid ""
11118 "The system does not allow unlinking of directories, or unlinking of "
11119 "directories requires privileges that the calling process doesn't have.  "
11120 "(This is the POSIX prescribed error return; as noted above, Linux returns "
11121 "B<EISDIR> for this case.)"
11122 msgstr ""
11123
11124 #. type: TP
11125 #: build/C/man2/unlink.2:123
11126 #, no-wrap
11127 msgid "B<EPERM> (Linux only)"
11128 msgstr ""
11129
11130 #. type: Plain text
11131 #: build/C/man2/unlink.2:126
11132 msgid "The file system does not allow unlinking of files."
11133 msgstr ""
11134
11135 #. type: Plain text
11136 #: build/C/man2/unlink.2:137
11137 msgid ""
11138 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
11139 "and the process's effective UID is neither the UID of the file to be deleted "
11140 "nor that of the directory containing it, and the process is not privileged "
11141 "(Linux: does not have the B<CAP_FOWNER> capability)."
11142 msgstr ""
11143
11144 #. type: Plain text
11145 #: build/C/man2/unlink.2:141
11146 msgid "I<pathname> refers to a file on a read-only file system."
11147 msgstr ""
11148
11149 #. type: Plain text
11150 #: build/C/man2/unlink.2:161
11151 msgid ""
11152 "B<rm>(1), B<chmod>(2), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
11153 "B<rmdir>(2), B<unlinkat>(2), B<mkfifo>(3), B<remove>(3), "
11154 "B<path_resolution>(7), B<symlink>(7)"
11155 msgstr ""
11156
11157 #. type: TH
11158 #: build/C/man3/unlocked_stdio.3:23
11159 #, no-wrap
11160 msgid "UNLOCKED_STDIO"
11161 msgstr ""
11162
11163 #. type: Plain text
11164 #: build/C/man3/unlocked_stdio.3:27
11165 msgid ""
11166 "getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - "
11167 "nonlocking stdio functions"
11168 msgstr ""
11169
11170 #. type: Plain text
11171 #: build/C/man3/unlocked_stdio.3:35
11172 #, no-wrap
11173 msgid ""
11174 "B<int getc_unlocked(FILE *>I<stream>B<);>\n"
11175 "B<int getchar_unlocked(void);>\n"
11176 "B<int putc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11177 "B<int putchar_unlocked(int >I<c>B<);>\n"
11178 msgstr ""
11179
11180 #. type: Plain text
11181 #: build/C/man3/unlocked_stdio.3:47
11182 #, no-wrap
11183 msgid ""
11184 "B<void clearerr_unlocked(FILE *>I<stream>B<);>\n"
11185 "B<int feof_unlocked(FILE *>I<stream>B<);>\n"
11186 "B<int ferror_unlocked(FILE *>I<stream>B<);>\n"
11187 "B<int fileno_unlocked(FILE *>I<stream>B<);>\n"
11188 "B<int fflush_unlocked(FILE *>I<stream>B<);>\n"
11189 "B<int fgetc_unlocked(FILE *>I<stream>B<);>\n"
11190 "B<int fputc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11191 "B<size_t fread_unlocked(void *>I<ptr>B<, size_t >I<size>B<, size_t "
11192 ">I<n>B<,>\n"
11193 "B<                      FILE *>I<stream>B<);>\n"
11194 "B<size_t fwrite_unlocked(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
11195 ">I<n>B<,>\n"
11196 "B<                      FILE *>I<stream>B<);>\n"
11197 msgstr ""
11198
11199 #. type: Plain text
11200 #: build/C/man3/unlocked_stdio.3:50
11201 #, no-wrap
11202 msgid ""
11203 "B<char *fgets_unlocked(char *>I<s>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
11204 "B<int fputs_unlocked(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
11205 msgstr ""
11206
11207 #. type: Plain text
11208 #: build/C/man3/unlocked_stdio.3:61
11209 #, no-wrap
11210 msgid ""
11211 "B<wint_t getwc_unlocked(FILE *>I<stream>B<);>\n"
11212 "B<wint_t getwchar_unlocked(void);>\n"
11213 "B<wint_t fgetwc_unlocked(FILE *>I<stream>B<);>\n"
11214 "B<wint_t fputwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11215 "B<wint_t putwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11216 "B<wint_t putwchar_unlocked(wchar_t >I<wc>B<);>\n"
11217 "B<wchar_t *fgetws_unlocked(wchar_t *>I<ws>B<, int >I<n>B<, FILE "
11218 "*>I<stream>B<);>\n"
11219 "B<int fputws_unlocked(const wchar_t *>I<ws>B<, FILE *>I<stream>B<);>\n"
11220 msgstr ""
11221
11222 #. type: Plain text
11223 #: build/C/man3/unlocked_stdio.3:73
11224 msgid ""
11225 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
11226 "B<putchar_unlocked>():"
11227 msgstr ""
11228
11229 #. type: Plain text
11230 #: build/C/man3/unlocked_stdio.3:76
11231 msgid ""
11232 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || "
11233 "_BSD_SOURCE || _SVID_SOURCE"
11234 msgstr ""
11235
11236 #. type: Plain text
11237 #: build/C/man3/unlocked_stdio.3:87
11238 msgid ""
11239 "B<clearerr_unlocked>(), B<feof_unlocked>(), B<ferror_unlocked>(), "
11240 "B<fileno_unlocked>(), B<fflush_unlocked>(), B<fgetc_unlocked>(), "
11241 "B<fputc_unlocked>(), B<fread_unlocked>(), B<fwrite_unlocked>():"
11242 msgstr ""
11243
11244 #. type: Plain text
11245 #: build/C/man3/unlocked_stdio.3:89
11246 msgid "_BSD_SOURCE || _SVID_SOURCE"
11247 msgstr ""
11248
11249 #. type: Plain text
11250 #: build/C/man3/unlocked_stdio.3:100
11251 msgid ""
11252 "B<fgets_unlocked>(), B<fputs_unlocked>(), B<getwc_unlocked>(), "
11253 "B<getwchar_unlocked>(), B<fgetwc_unlocked>(), B<fputwc_unlocked>(), "
11254 "B<putwchar_unlocked>(), B<fgetws_unlocked>(), B<fputws_unlocked>():"
11255 msgstr ""
11256
11257 #. type: Plain text
11258 #: build/C/man3/unlocked_stdio.3:111
11259 msgid ""
11260 "Each of these functions has the same behavior as its counterpart without the "
11261 "\"_unlocked\" suffix, except that they do not use locking (they do not set "
11262 "locks themselves, and do not test for the presence of locks set by others) "
11263 "and hence are thread-unsafe.  See B<flockfile>(3)."
11264 msgstr ""
11265
11266 #. type: Plain text
11267 #: build/C/man3/unlocked_stdio.3:118
11268 msgid ""
11269 "The four functions B<getc_unlocked>(), B<getchar_unlocked>(), "
11270 "B<putc_unlocked>(), B<putchar_unlocked>()  are in POSIX.1-2001."
11271 msgstr ""
11272
11273 #.  E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
11274 #.  moved to a compatibility library.
11275 #.  Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
11276 #.  feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
11277 #.  fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
11278 #.  fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
11279 #.  ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
11280 #.  getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
11281 #.  putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
11282 #.  putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
11283 #.  ungetc_unlocked, ungetwc_unlocked.
11284 #. type: Plain text
11285 #: build/C/man3/unlocked_stdio.3:134
11286 msgid ""
11287 "The nonstandard B<*_unlocked>()  variants occur on a few UNIX systems, and "
11288 "are available in recent glibc.  They should probably not be used."
11289 msgstr ""
11290
11291 #. type: Plain text
11292 #: build/C/man3/unlocked_stdio.3:137
11293 msgid "B<flockfile>(3), B<stdio>(3)"
11294 msgstr ""
11295
11296 #. type: TH
11297 #: build/C/man3/wprintf.3:14
11298 #, no-wrap
11299 msgid "WPRINTF"
11300 msgstr ""
11301
11302 #. type: TH
11303 #: build/C/man3/wprintf.3:14
11304 #, no-wrap
11305 msgid "2011-09-17"
11306 msgstr ""
11307
11308 #. type: Plain text
11309 #: build/C/man3/wprintf.3:18
11310 msgid ""
11311 "wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - formatted "
11312 "wide-character output conversion"
11313 msgstr ""
11314
11315 #. type: Plain text
11316 #: build/C/man3/wprintf.3:22
11317 #, no-wrap
11318 msgid ""
11319 "B<#include E<lt>stdio.hE<gt>>\n"
11320 "B<#include E<lt>wchar.hE<gt>>\n"
11321 msgstr ""
11322
11323 #. type: Plain text
11324 #: build/C/man3/wprintf.3:27
11325 #, no-wrap
11326 msgid ""
11327 "B<int wprintf(const wchar_t *>I<format>B<, ...);>\n"
11328 "B<int fwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, ...);>\n"
11329 "B<int swprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11330 "B<             const wchar_t *>I<format>B<, ...);>\n"
11331 msgstr ""
11332
11333 #. type: Plain text
11334 #: build/C/man3/wprintf.3:32
11335 #, no-wrap
11336 msgid ""
11337 "B<int vwprintf(const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11338 "B<int vfwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, va_list "
11339 ">I<args>B<);>\n"
11340 "B<int vswprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11341 "B<              const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11342 msgstr ""
11343
11344 #.  .BR wprintf (),
11345 #.  .BR fwprintf (),
11346 #.  .BR swprintf (),
11347 #.  .BR vwprintf (),
11348 #.  .BR vfwprintf (),
11349 #.  .BR vswprintf ():
11350 #. type: Plain text
11351 #: build/C/man3/wprintf.3:49
11352 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE ||"
11353 msgstr ""
11354
11355 #. type: Plain text
11356 #: build/C/man3/wprintf.3:51
11357 msgid "_ISOC95_SOURCE /* Since glibc 2.12 */ ||"
11358 msgstr ""
11359
11360 #. type: Plain text
11361 #: build/C/man3/wprintf.3:53
11362 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
11363 msgstr ""
11364
11365 #. type: Plain text
11366 #: build/C/man3/wprintf.3:56
11367 msgid "or I<cc\\ -std=c99>"
11368 msgstr ""
11369
11370 #. type: Plain text
11371 #: build/C/man3/wprintf.3:67
11372 msgid ""
11373 "The B<wprintf>()  family of functions is the wide-character equivalent of "
11374 "the B<printf>(3)  family of functions.  It performs formatted output of wide "
11375 "characters."
11376 msgstr ""
11377
11378 #. type: Plain text
11379 #: build/C/man3/wprintf.3:77
11380 msgid ""
11381 "The B<wprintf>()  and B<vwprintf>()  functions perform wide-character output "
11382 "to I<stdout>.  I<stdout> must not be byte oriented; see B<fwide>(3)  for "
11383 "more information."
11384 msgstr ""
11385
11386 #. type: Plain text
11387 #: build/C/man3/wprintf.3:87
11388 msgid ""
11389 "The B<fwprintf>()  and B<vfwprintf>()  functions perform wide-character "
11390 "output to I<stream>.  I<stream> must not be byte oriented; see B<fwide>(3)  "
11391 "for more information."
11392 msgstr ""
11393
11394 #. type: Plain text
11395 #: build/C/man3/wprintf.3:98
11396 msgid ""
11397 "The B<swprintf>()  and B<vswprintf>()  functions perform wide-character "
11398 "output to an array of wide characters.  The programmer must ensure that "
11399 "there is room for at least I<maxlen> wide characters at I<wcs>."
11400 msgstr ""
11401
11402 #. type: Plain text
11403 #: build/C/man3/wprintf.3:109
11404 msgid ""
11405 "These functions are like the B<printf>(3), B<vprintf>(3), B<fprintf>(3), "
11406 "B<vfprintf>(3), B<sprintf>(3), B<vsprintf>(3)  functions except for the "
11407 "following differences:"
11408 msgstr ""
11409
11410 #. type: TP
11411 #: build/C/man3/wprintf.3:109 build/C/man3/wprintf.3:112 build/C/man3/wprintf.3:115
11412 #, no-wrap
11413 msgid "B<\\(bu>"
11414 msgstr ""
11415
11416 #. type: Plain text
11417 #: build/C/man3/wprintf.3:112
11418 msgid "The I<format> string is a wide-character string."
11419 msgstr ""
11420
11421 #. type: Plain text
11422 #: build/C/man3/wprintf.3:115
11423 msgid "The output consists of wide characters, not bytes."
11424 msgstr ""
11425
11426 #. type: Plain text
11427 #: build/C/man3/wprintf.3:130
11428 msgid ""
11429 "B<swprintf>()  and B<vswprintf>()  take a I<maxlen> argument, B<sprintf>(3)  "
11430 "and B<vsprintf>(3)  do not.  (B<snprintf>(3)  and B<vsnprintf>(3)  take a "
11431 "I<maxlen> argument, but these functions do not return -1 upon buffer "
11432 "overflow on Linux.)"
11433 msgstr ""
11434
11435 #. type: Plain text
11436 #: build/C/man3/wprintf.3:132
11437 msgid "The treatment of the conversion characters B<c> and B<s> is different:"
11438 msgstr ""
11439
11440 #. type: Plain text
11441 #: build/C/man3/wprintf.3:146
11442 msgid ""
11443 "If no B<l> modifier is present, the I<int> argument is converted to a wide "
11444 "character by a call to the B<btowc>(3)  function, and the resulting wide "
11445 "character is written.  If an B<l> modifier is present, the I<wint_t> (wide "
11446 "character) argument is written."
11447 msgstr ""
11448
11449 #. type: Plain text
11450 #: build/C/man3/wprintf.3:185
11451 msgid ""
11452 "If no B<l> modifier is present: The I<const\\ char\\ *> argument is expected "
11453 "to be a pointer to an array of character type (pointer to a string) "
11454 "containing a multibyte character sequence beginning in the initial shift "
11455 "state.  Characters from the array are converted to wide characters (each by "
11456 "a call to the B<mbrtowc>(3)  function with a conversion state starting in "
11457 "the initial state before the first byte).  The resulting wide characters are "
11458 "written up to (but not including) the terminating null wide character.  If a "
11459 "precision is specified, no more wide characters than the number specified "
11460 "are written.  Note that the precision determines the number of I<wide "
11461 "characters> written, not the number of I<bytes> or I<screen positions>.  The "
11462 "array must contain a terminating null byte, unless a precision is given and "
11463 "it is so small that the number of converted wide characters reaches it "
11464 "before the end of the array is reached.  If an B<l> modifier is present: The "
11465 "I<const\\ wchar_t\\ *> argument is expected to be a pointer to an array of "
11466 "wide characters.  Wide characters from the array are written up to (but not "
11467 "including) a terminating null wide character.  If a precision is specified, "
11468 "no more than the number specified are written.  The array must contain a "
11469 "terminating null wide character, unless a precision is given and it is "
11470 "smaller than or equal to the number of wide characters in the array."
11471 msgstr ""
11472
11473 #. type: Plain text
11474 #: build/C/man3/wprintf.3:193
11475 msgid ""
11476 "The functions return the number of wide characters written, excluding the "
11477 "terminating null wide character in case of the functions B<swprintf>()  and "
11478 "B<vswprintf>().  They return -1 when an error occurs."
11479 msgstr ""
11480
11481 #. type: Plain text
11482 #: build/C/man3/wprintf.3:195
11483 msgid "C99."
11484 msgstr ""
11485
11486 #. type: Plain text
11487 #: build/C/man3/wprintf.3:203
11488 msgid ""
11489 "The behavior of B<wprintf>()  et al. depends on the B<LC_CTYPE> category of "
11490 "the current locale."
11491 msgstr ""
11492
11493 #. type: Plain text
11494 #: build/C/man3/wprintf.3:229
11495 msgid ""
11496 "If the I<format> string contains non-ASCII wide characters, the program will "
11497 "only work correctly if the B<LC_CTYPE> category of the current locale at run "
11498 "time is the same as the B<LC_CTYPE> category of the current locale at "
11499 "compile time.  This is because the I<wchar_t> representation is platform- "
11500 "and locale-dependent.  (The glibc represents wide characters using their "
11501 "Unicode (ISO-10646) code point, but other platforms don't do this.  Also, "
11502 "the use of C99 universal character names of the form \\eunnnn does not solve "
11503 "this problem.)  Therefore, in internationalized programs, the I<format> "
11504 "string should consist of ASCII wide characters only, or should be "
11505 "constructed at run time in an internationalized way (e.g., using "
11506 "B<gettext>(3)  or B<iconv>(3), followed by B<mbstowcs>(3))."
11507 msgstr ""
11508
11509 #.  .BR wscanf (3)
11510 #. type: Plain text
11511 #: build/C/man3/wprintf.3:236
11512 msgid "B<fprintf>(3), B<fputwc>(3), B<fwide>(3), B<printf>(3), B<snprintf>(3)"
11513 msgstr ""
11514
11515 #. type: TH
11516 #: build/C/man2/write.2:39
11517 #, no-wrap
11518 msgid "WRITE"
11519 msgstr ""
11520
11521 #. type: TH
11522 #: build/C/man2/write.2:39
11523 #, no-wrap
11524 msgid "2010-08-29"
11525 msgstr ""
11526
11527 #. type: Plain text
11528 #: build/C/man2/write.2:42
11529 msgid "write - write to a file descriptor"
11530 msgstr ""
11531
11532 #. type: Plain text
11533 #: build/C/man2/write.2:46
11534 msgid "B<ssize_t write(int >I<fd>B<, const void *>I<buf>B<, size_t >I<count>B<);>"
11535 msgstr ""
11536
11537 #. type: Plain text
11538 #: build/C/man2/write.2:54
11539 msgid ""
11540 "B<write>()  writes up to I<count> bytes from the buffer pointed I<buf> to "
11541 "the file referred to by the file descriptor I<fd>."
11542 msgstr ""
11543
11544 #. type: Plain text
11545 #: build/C/man2/write.2:68
11546 msgid ""
11547 "The number of bytes written may be less than I<count> if, for example, there "
11548 "is insufficient space on the underlying physical medium, or the "
11549 "B<RLIMIT_FSIZE> resource limit is encountered (see B<setrlimit>(2)), or the "
11550 "call was interrupted by a signal handler after having written less than "
11551 "I<count> bytes.  (See also B<pipe>(7).)"
11552 msgstr ""
11553
11554 #. type: Plain text
11555 #: build/C/man2/write.2:82
11556 msgid ""
11557 "For a seekable file (i.e., one to which B<lseek>(2)  may be applied, for "
11558 "example, a regular file)  writing takes place at the current file offset, "
11559 "and the file offset is incremented by the number of bytes actually written.  "
11560 "If the file was B<open>(2)ed with B<O_APPEND>, the file offset is first set "
11561 "to the end of the file before writing.  The adjustment of the file offset "
11562 "and the write operation are performed as an atomic step."
11563 msgstr ""
11564
11565 #. type: Plain text
11566 #: build/C/man2/write.2:89
11567 msgid ""
11568 "POSIX requires that a B<read>(2)  which can be proved to occur after a "
11569 "B<write>()  has returned returns the new data.  Note that not all file "
11570 "systems are POSIX conforming."
11571 msgstr ""
11572
11573 #. type: Plain text
11574 #: build/C/man2/write.2:94
11575 msgid ""
11576 "On success, the number of bytes written is returned (zero indicates nothing "
11577 "was written).  On error, -1 is returned, and I<errno> is set appropriately."
11578 msgstr ""
11579
11580 #. type: Plain text
11581 #: build/C/man2/write.2:107
11582 msgid ""
11583 "If I<count> is zero and I<fd> refers to a regular file, then B<write>()  may "
11584 "return a failure status if one of the errors below is detected.  If no "
11585 "errors are detected, 0 will be returned without causing any other effect.  "
11586 "If I<count> is zero and I<fd> refers to a file other than a regular file, "
11587 "the results are not specified."
11588 msgstr ""
11589
11590 #. type: Plain text
11591 #: build/C/man2/write.2:115
11592 msgid ""
11593 "The file descriptor I<fd> refers to a file other than a socket and has been "
11594 "marked nonblocking (B<O_NONBLOCK>), and the write would block."
11595 msgstr ""
11596
11597 #.  Actually EAGAIN on Linux
11598 #. type: Plain text
11599 #: build/C/man2/write.2:126
11600 msgid ""
11601 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
11602 "(B<O_NONBLOCK>), and the write would block.  POSIX.1-2001 allows either "
11603 "error to be returned for this case, and does not require these constants to "
11604 "have the same value, so a portable application should check for both "
11605 "possibilities."
11606 msgstr ""
11607
11608 #. type: Plain text
11609 #: build/C/man2/write.2:130
11610 msgid "I<fd> is not a valid file descriptor or is not open for writing."
11611 msgstr ""
11612
11613 #. type: TP
11614 #: build/C/man2/write.2:130
11615 #, no-wrap
11616 msgid "B<EDESTADDRREQ>"
11617 msgstr ""
11618
11619 #. type: Plain text
11620 #: build/C/man2/write.2:135
11621 msgid ""
11622 "I<fd> refers to a datagram socket for which a peer address has not been set "
11623 "using B<connect>(2)."
11624 msgstr ""
11625
11626 #. type: Plain text
11627 #: build/C/man2/write.2:144
11628 msgid ""
11629 "An attempt was made to write a file that exceeds the implementation-defined "
11630 "maximum file size or the process's file size limit, or to write at a "
11631 "position past the maximum allowed offset."
11632 msgstr ""
11633
11634 #. type: Plain text
11635 #: build/C/man2/write.2:148
11636 msgid ""
11637 "The call was interrupted by a signal before any data was written; see "
11638 "B<signal>(7)."
11639 msgstr ""
11640
11641 #. type: Plain text
11642 #: build/C/man2/write.2:159
11643 msgid ""
11644 "I<fd> is attached to an object which is unsuitable for writing; or the file "
11645 "was opened with the B<O_DIRECT> flag, and either the address specified in "
11646 "I<buf>, the value specified in I<count>, or the current file offset is not "
11647 "suitably aligned."
11648 msgstr ""
11649
11650 #. type: Plain text
11651 #: build/C/man2/write.2:162
11652 msgid "A low-level I/O error occurred while modifying the inode."
11653 msgstr ""
11654
11655 #. type: Plain text
11656 #: build/C/man2/write.2:167
11657 msgid ""
11658 "The device containing the file referred to by I<fd> has no room for the "
11659 "data."
11660 msgstr ""
11661
11662 #. type: TP
11663 #: build/C/man2/write.2:167
11664 #, no-wrap
11665 msgid "B<EPIPE>"
11666 msgstr ""
11667
11668 #. type: Plain text
11669 #: build/C/man2/write.2:176
11670 msgid ""
11671 "I<fd> is connected to a pipe or socket whose reading end is closed.  When "
11672 "this happens the writing process will also receive a B<SIGPIPE> signal.  "
11673 "(Thus, the write return value is seen only if the program catches, blocks or "
11674 "ignores this signal.)"
11675 msgstr ""
11676
11677 #. type: Plain text
11678 #: build/C/man2/write.2:179
11679 msgid "Other errors may occur, depending on the object connected to I<fd>."
11680 msgstr ""
11681
11682 #. type: Plain text
11683 #: build/C/man2/write.2:188
11684 msgid ""
11685 "Under SVr4 a write may be interrupted and return B<EINTR> at any point, not "
11686 "just before any data is written."
11687 msgstr ""
11688
11689 #. type: Plain text
11690 #: build/C/man2/write.2:197
11691 msgid ""
11692 "A successful return from B<write>()  does not make any guarantee that data "
11693 "has been committed to disk.  In fact, on some buggy implementations, it does "
11694 "not even guarantee that space has successfully been reserved for the data.  "
11695 "The only way to be sure is to call B<fsync>(2)  after you are done writing "
11696 "all your data."
11697 msgstr ""
11698
11699 #. type: Plain text
11700 #: build/C/man2/write.2:205
11701 msgid ""
11702 "If a B<write>()  is interrupted by a signal handler before any bytes are "
11703 "written, then the call fails with the error B<EINTR>; if it is interrupted "
11704 "after at least one byte has been written, the call succeeds, and returns the "
11705 "number of bytes written."
11706 msgstr ""
11707
11708 #. type: Plain text
11709 #: build/C/man2/write.2:217
11710 msgid ""
11711 "B<close>(2), B<fcntl>(2), B<fsync>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), "
11712 "B<pwrite>(2), B<read>(2), B<select>(2), B<writev>(2), B<fwrite>(3)"
11713 msgstr ""