OSDN Git Service

7f782266c4a69268d9ed7600c9bbb94d36e80133
[linuxjm/LDP_man-pages.git] / po4a / stdio / po / stdio.pot
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "POT-Creation-Date: 2012-04-23 07:55+0900\n"
11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
14 "Language: \n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #. type: TH
20 #: build/C/man3/asprintf.3:25
21 #, no-wrap
22 msgid "ASPRINTF"
23 msgstr ""
24
25 #. type: TH
26 #: build/C/man3/asprintf.3:25
27 #, no-wrap
28 msgid "2001-12-18"
29 msgstr ""
30
31 #. type: TH
32 #: build/C/man3/asprintf.3:25 build/C/man3/ctermid.3:24 build/C/man3/dprintf.3:25 build/C/man3/fclose.3:42 build/C/man3/fcloseall.3:24 build/C/man3/fflush.3:43 build/C/man3/fgetwc.3:16 build/C/man3/fmemopen.3:6 build/C/man3/fopen.3:42 build/C/man3/fputwc.3:14 build/C/man3/fread.3:43 build/C/man3/fseek.3:40 build/C/man3/getline.3:24 build/C/man3/gets.3:25 build/C/man3/getw.3:23 build/C/man3/popen.3:38 build/C/man3/printf.3:34 build/C/man3/puts.3:24 build/C/man3/remove.3:31 build/C/man3/scanf.3:50 build/C/man3/wprintf.3:14
33 #, no-wrap
34 msgid "GNU"
35 msgstr ""
36
37 #. type: TH
38 #: build/C/man3/asprintf.3:25 build/C/man3/ctermid.3:24 build/C/man3/dprintf.3:25 build/C/man3/fclose.3:42 build/C/man3/fcloseall.3:24 build/C/man3/ferror.3:42 build/C/man3/fflush.3:43 build/C/man3/fgetwc.3:16 build/C/man3/flockfile.3:23 build/C/man3/fmemopen.3:6 build/C/man3/fmtmsg.3:9 build/C/man3/fopen.3:42 build/C/man3/fopencookie.3:24 build/C/man3/fpurge.3:23 build/C/man3/fputwc.3:14 build/C/man3/fread.3:43 build/C/man3/fseek.3:40 build/C/man3/fseeko.3:23 build/C/man3/getline.3:24 build/C/man3/gets.3:25 build/C/man3/getw.3:23 build/C/man2/link.2:31 build/C/man2/llseek.2:26 build/C/man2/lseek.2:45 build/C/man3/lseek64.3:23 build/C/man2/open.2:52 build/C/man3/perror.3:30 build/C/man2/pipe.2:36 build/C/man3/popen.3:38 build/C/man3/printf.3:34 build/C/man3/puts.3:24 build/C/man2/read.2:35 build/C/man2/readlink.2:41 build/C/man2/readv.2:30 build/C/man3/remove.3:31 build/C/man2/rename.2:32 build/C/man2/rmdir.2:30 build/C/man3/scanf.3:50 build/C/man3/setbuf.3:46 build/C/man3/stdin.3:9 build/C/man3/stdio.3:37 build/C/man3/stdio_ext.3:23 build/C/man2/symlink.2:32 build/C/man7/symlink.7:35 build/C/man3/tempnam.3:23 build/C/man3/tmpfile.3:29 build/C/man3/tmpnam.3:25 build/C/man2/unlink.2:32 build/C/man3/unlocked_stdio.3:23 build/C/man3/wprintf.3:14 build/C/man2/write.2:39
39 #, no-wrap
40 msgid "Linux Programmer's Manual"
41 msgstr ""
42
43 #. type: SH
44 #: build/C/man3/asprintf.3:26 build/C/man3/ctermid.3:25 build/C/man3/dprintf.3:26 build/C/man3/fclose.3:43 build/C/man3/fcloseall.3:25 build/C/man3/ferror.3:43 build/C/man3/fflush.3:44 build/C/man3/fgetwc.3:17 build/C/man3/flockfile.3:24 build/C/man3/fmemopen.3:7 build/C/man3/fmtmsg.3:10 build/C/man3/fopen.3:43 build/C/man3/fopencookie.3:25 build/C/man3/fpurge.3:24 build/C/man3/fputwc.3:15 build/C/man3/fread.3:44 build/C/man3/fseek.3:41 build/C/man3/fseeko.3:24 build/C/man3/getline.3:25 build/C/man3/gets.3:26 build/C/man3/getw.3:24 build/C/man2/link.2:32 build/C/man2/llseek.2:27 build/C/man2/lseek.2:46 build/C/man3/lseek64.3:24 build/C/man2/open.2:53 build/C/man3/perror.3:31 build/C/man2/pipe.2:37 build/C/man3/popen.3:39 build/C/man3/printf.3:35 build/C/man3/puts.3:25 build/C/man2/read.2:36 build/C/man2/readlink.2:42 build/C/man2/readv.2:31 build/C/man3/remove.3:32 build/C/man2/rename.2:33 build/C/man2/rmdir.2:31 build/C/man3/scanf.3:51 build/C/man3/setbuf.3:47 build/C/man3/stdin.3:10 build/C/man3/stdio.3:38 build/C/man3/stdio_ext.3:24 build/C/man2/symlink.2:33 build/C/man7/symlink.7:36 build/C/man3/tempnam.3:24 build/C/man3/tmpfile.3:30 build/C/man3/tmpnam.3:26 build/C/man2/unlink.2:33 build/C/man3/unlocked_stdio.3:24 build/C/man3/wprintf.3:15 build/C/man2/write.2:40
45 #, no-wrap
46 msgid "NAME"
47 msgstr ""
48
49 #. type: Plain text
50 #: build/C/man3/asprintf.3:28
51 msgid "asprintf, vasprintf - print to allocated string"
52 msgstr ""
53
54 #. type: SH
55 #: build/C/man3/asprintf.3:28 build/C/man3/ctermid.3:27 build/C/man3/dprintf.3:28 build/C/man3/fclose.3:45 build/C/man3/fcloseall.3:27 build/C/man3/ferror.3:45 build/C/man3/fflush.3:46 build/C/man3/fgetwc.3:19 build/C/man3/flockfile.3:26 build/C/man3/fmemopen.3:9 build/C/man3/fmtmsg.3:12 build/C/man3/fopen.3:45 build/C/man3/fopencookie.3:27 build/C/man3/fpurge.3:26 build/C/man3/fputwc.3:17 build/C/man3/fread.3:46 build/C/man3/fseek.3:43 build/C/man3/fseeko.3:26 build/C/man3/getline.3:27 build/C/man3/gets.3:28 build/C/man3/getw.3:26 build/C/man2/link.2:34 build/C/man2/llseek.2:29 build/C/man2/lseek.2:48 build/C/man3/lseek64.3:26 build/C/man2/open.2:55 build/C/man3/perror.3:33 build/C/man2/pipe.2:39 build/C/man3/popen.3:41 build/C/man3/printf.3:38 build/C/man3/puts.3:27 build/C/man2/read.2:38 build/C/man2/readlink.2:44 build/C/man2/readv.2:33 build/C/man3/remove.3:34 build/C/man2/rename.2:35 build/C/man2/rmdir.2:33 build/C/man3/scanf.3:53 build/C/man3/setbuf.3:49 build/C/man3/stdin.3:12 build/C/man3/stdio.3:40 build/C/man3/stdio_ext.3:28 build/C/man2/symlink.2:35 build/C/man3/tempnam.3:26 build/C/man3/tmpfile.3:32 build/C/man3/tmpnam.3:28 build/C/man2/unlink.2:35 build/C/man3/unlocked_stdio.3:27 build/C/man3/wprintf.3:18 build/C/man2/write.2:42
56 #, no-wrap
57 msgid "SYNOPSIS"
58 msgstr ""
59
60 #. type: Plain text
61 #: build/C/man3/asprintf.3:30
62 msgid "B<#define _GNU_SOURCE> /* See feature_test_macros(7) */"
63 msgstr ""
64
65 #. type: Plain text
66 #: build/C/man3/asprintf.3:32 build/C/man3/dprintf.3:30 build/C/man3/fclose.3:47 build/C/man3/ferror.3:47 build/C/man3/fflush.3:48 build/C/man3/fseek.3:45 build/C/man3/perror.3:35 build/C/man3/printf.3:40 build/C/man3/remove.3:36 build/C/man2/rename.2:37 build/C/man3/stdio.3:42 build/C/man3/stdio_ext.3:30
67 msgid "B<#include E<lt>stdio.hE<gt>>"
68 msgstr ""
69
70 #. type: Plain text
71 #: build/C/man3/asprintf.3:34
72 msgid "B<int asprintf(char **>I<strp>B<, const char *>I<fmt>B<, ...);>"
73 msgstr ""
74
75 #. type: Plain text
76 #: build/C/man3/asprintf.3:36
77 msgid ""
78 "B<int vasprintf(char **>I<strp>B<, const char *>I<fmt>B<, va_list "
79 ">I<ap>B<);>"
80 msgstr ""
81
82 #. type: SH
83 #: build/C/man3/asprintf.3:36 build/C/man3/ctermid.3:44 build/C/man3/dprintf.3:54 build/C/man3/fclose.3:49 build/C/man3/fcloseall.3:34 build/C/man3/ferror.3:63 build/C/man3/fflush.3:50 build/C/man3/fgetwc.3:28 build/C/man3/flockfile.3:49 build/C/man3/fmemopen.3:42 build/C/man3/fmtmsg.3:22 build/C/man3/fopen.3:63 build/C/man3/fopencookie.3:35 build/C/man3/fpurge.3:40 build/C/man3/fputwc.3:26 build/C/man3/fread.3:56 build/C/man3/fseek.3:55 build/C/man3/fseeko.3:35 build/C/man3/getline.3:56 build/C/man3/gets.3:44 build/C/man3/getw.3:57 build/C/man2/link.2:38 build/C/man2/llseek.2:38 build/C/man2/lseek.2:54 build/C/man3/lseek64.3:34 build/C/man2/open.2:66 build/C/man3/perror.3:54 build/C/man2/pipe.2:51 build/C/man3/popen.3:62 build/C/man3/printf.3:76 build/C/man3/puts.3:41 build/C/man2/read.2:44 build/C/man2/readlink.2:61 build/C/man2/readv.2:56 build/C/man3/remove.3:38 build/C/man2/rename.2:39 build/C/man2/rmdir.2:37 build/C/man3/scanf.3:85 build/C/man3/setbuf.3:71 build/C/man3/stdin.3:20 build/C/man3/stdio.3:48 build/C/man3/stdio_ext.3:52 build/C/man2/symlink.2:52 build/C/man3/tempnam.3:40 build/C/man3/tmpfile.3:38 build/C/man3/tmpnam.3:34 build/C/man2/unlink.2:39 build/C/man3/unlocked_stdio.3:104 build/C/man3/wprintf.3:58 build/C/man2/write.2:46
84 #, no-wrap
85 msgid "DESCRIPTION"
86 msgstr ""
87
88 #. type: Plain text
89 #: build/C/man3/asprintf.3:51
90 msgid ""
91 "The functions B<asprintf>()  and B<vasprintf>()  are analogs of "
92 "B<sprintf>(3)  and B<vsprintf>(3), except that they allocate a string large "
93 "enough to hold the output including the terminating null byte, and return a "
94 "pointer to it via the first argument.  This pointer should be passed to "
95 "B<free>(3)  to release the allocated storage when it is no longer needed."
96 msgstr ""
97
98 #. type: SH
99 #: build/C/man3/asprintf.3:51 build/C/man3/ctermid.3:57 build/C/man3/fclose.3:57 build/C/man3/fcloseall.3:49 build/C/man3/fflush.3:72 build/C/man3/fgetwc.3:53 build/C/man3/flockfile.3:112 build/C/man3/fmemopen.3:172 build/C/man3/fmtmsg.3:148 build/C/man3/fopen.3:189 build/C/man3/fopencookie.3:235 build/C/man3/fpurge.3:56 build/C/man3/fputwc.3:52 build/C/man3/fread.3:81 build/C/man3/fseek.3:117 build/C/man3/fseeko.3:63 build/C/man3/getline.3:108 build/C/man3/gets.3:109 build/C/man3/getw.3:71 build/C/man2/link.2:52 build/C/man2/llseek.2:57 build/C/man2/lseek.2:151 build/C/man2/open.2:464 build/C/man2/pipe.2:92 build/C/man3/popen.3:121 build/C/man3/puts.3:82 build/C/man2/read.2:63 build/C/man2/readlink.2:75 build/C/man2/readv.2:175 build/C/man3/remove.3:60 build/C/man2/rename.2:91 build/C/man2/rmdir.2:40 build/C/man3/scanf.3:528 build/C/man3/setbuf.3:150 build/C/man2/symlink.2:84 build/C/man3/tempnam.3:85 build/C/man3/tmpfile.3:45 build/C/man3/tmpnam.3:68 build/C/man2/unlink.2:55 build/C/man3/wprintf.3:185 build/C/man2/write.2:89
100 #, no-wrap
101 msgid "RETURN VALUE"
102 msgstr ""
103
104 #. type: Plain text
105 #: build/C/man3/asprintf.3:59
106 msgid ""
107 "When successful, these functions return the number of bytes printed, just "
108 "like B<sprintf>(3).  If memory allocation wasn't possible, or some other "
109 "error occurs, these functions will return -1, and the contents of I<strp> is "
110 "undefined."
111 msgstr ""
112
113 #. type: SH
114 #: build/C/man3/asprintf.3:59 build/C/man3/ctermid.3:59 build/C/man3/dprintf.3:68 build/C/man3/fclose.3:88 build/C/man3/fcloseall.3:54 build/C/man3/ferror.3:105 build/C/man3/fflush.3:91 build/C/man3/fgetwc.3:65 build/C/man3/flockfile.3:119 build/C/man3/fmemopen.3:191 build/C/man3/fmtmsg.3:221 build/C/man3/fopen.3:246 build/C/man3/fopencookie.3:242 build/C/man3/fpurge.3:68 build/C/man3/fputwc.3:63 build/C/man3/fread.3: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:610 build/C/man3/perror.3:107 build/C/man2/pipe.2:118 build/C/man3/popen.3:167 build/C/man3/printf.3:807 build/C/man3/puts.3:101 build/C/man2/read.2:155 build/C/man2/readlink.2:123 build/C/man2/readv.2:212 build/C/man3/remove.3:70 build/C/man2/rename.2:229 build/C/man2/rmdir.2:127 build/C/man3/scanf.3:575 build/C/man3/setbuf.3:162 build/C/man3/stdin.3:109 build/C/man3/stdio.3:244 build/C/man2/symlink.2:144 build/C/man3/tempnam.3:94 build/C/man3/tmpfile.3:74 build/C/man3/tmpnam.3:75 build/C/man2/unlink.2:141 build/C/man3/unlocked_stdio.3:111 build/C/man3/wprintf.3:193 build/C/man2/write.2:179
115 #, no-wrap
116 msgid "CONFORMING TO"
117 msgstr ""
118
119 #. type: Plain text
120 #: build/C/man3/asprintf.3:65
121 msgid ""
122 "These functions are GNU extensions, not in C or POSIX.  They are also "
123 "available under *BSD.  The FreeBSD implementation sets I<strp> to NULL on "
124 "error."
125 msgstr ""
126
127 #. type: SH
128 #: build/C/man3/asprintf.3:65 build/C/man3/ctermid.3:69 build/C/man3/dprintf.3:94 build/C/man3/fclose.3:100 build/C/man3/fcloseall.3:56 build/C/man3/ferror.3:112 build/C/man3/fflush.3:106 build/C/man3/fgetwc.3:82 build/C/man3/flockfile.3:127 build/C/man3/fmemopen.3:273 build/C/man3/fmtmsg.3:293 build/C/man3/fopen.3:302 build/C/man3/fopencookie.3:434 build/C/man3/fpurge.3:78 build/C/man3/fputwc.3:80 build/C/man3/fread.3:98 build/C/man3/fseek.3:166 build/C/man3/fseeko.3:81 build/C/man3/getline.3:166 build/C/man3/gets.3:171 build/C/man3/getw.3:84 build/C/man2/link.2:177 build/C/man2/llseek.2:82 build/C/man2/lseek.2:234 build/C/man3/lseek64.3:157 build/C/man2/open.2:849 build/C/man3/perror.3:135 build/C/man2/pipe.2:190 build/C/man3/popen.3:196 build/C/man3/printf.3:1074 build/C/man3/puts.3:110 build/C/man2/read.2:178 build/C/man2/readlink.2:212 build/C/man2/readv.2:282 build/C/man3/remove.3:81 build/C/man2/rename.2:242 build/C/man2/rmdir.2:132 build/C/man3/scanf.3:717 build/C/man3/setbuf.3:198 build/C/man3/stdin.3:150 build/C/man3/stdio.3:248 build/C/man3/stdio_ext.3:130 build/C/man2/symlink.2:159 build/C/man7/symlink.7:470 build/C/man3/tempnam.3:164 build/C/man3/tmpfile.3:86 build/C/man3/tmpnam.3:151 build/C/man2/unlink.2:148 build/C/man3/unlocked_stdio.3:134 build/C/man3/wprintf.3:229 build/C/man2/write.2:205
129 #, no-wrap
130 msgid "SEE ALSO"
131 msgstr ""
132
133 #. type: Plain text
134 #: build/C/man3/asprintf.3: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:308 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:187 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:871 build/C/man3/perror.3:140 build/C/man2/pipe.2:197 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:315 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:194 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:878 build/C/man3/perror.3:147 build/C/man2/pipe.2:204 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.38 of the Linux I<man-pages> project.  A "
148 "description of the project, and information about reporting bugs, can be "
149 "found at http://www.kernel.org/doc/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:150 build/C/man3/getw.3:80 build/C/man2/link.2:171 build/C/man2/open.2:838 build/C/man3/popen.3:173 build/C/man3/printf.3:930 build/C/man3/puts.3:103 build/C/man2/readv.2:256 build/C/man3/remove.3:78 build/C/man2/rename.2:231 build/C/man2/rmdir.2:129 build/C/man3/scanf.3:682 build/C/man3/setbuf.3:168 build/C/man3/tempnam.3:154 build/C/man3/tmpnam.3:144 build/C/man2/unlink.2:145
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:472 build/C/man2/pipe.2:97 build/C/man3/popen.3:141 build/C/man2/read.2:77 build/C/man2/readlink.2:83 build/C/man2/readv.2:186 build/C/man3/remove.3:65 build/C/man2/rename.2:96 build/C/man2/rmdir.2:45 build/C/man3/scanf.3:545 build/C/man2/symlink.2:89 build/C/man3/tempnam.3:90 build/C/man3/tmpfile.3:52 build/C/man3/tmpnam.3:73 build/C/man2/unlink.2:60 build/C/man2/write.2:107
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:636 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:113 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:124 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:102 build/C/man2/read.2:108 build/C/man2/read.2:119 build/C/man2/readlink.2:93 build/C/man2/readlink.2:102 build/C/man2/readv.2:198 build/C/man2/rename.2:136 build/C/man2/rmdir.2:67 build/C/man3/scanf.3:563 build/C/man2/write.2:148
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 C11 specifies this flag
2092 #.  FIXME document /,ccs= charset/
2093 #. type: Plain text
2094 #: build/C/man3/fopen.3:302
2095 msgid ""
2096 "Open the file exclusively (like the B<O_EXCL> flag of B<open>(2)).  If the "
2097 "file already exists, B<fopen>()  fails, and sets I<errno> to B<EEXIST>.  "
2098 "This flag is ignored for B<fdopen>()."
2099 msgstr ""
2100
2101 #. type: Plain text
2102 #: build/C/man3/fopen.3:308
2103 msgid "B<open>(2), B<fclose>(3), B<fileno>(3), B<fmemopen>(3), B<fopencookie>(3)"
2104 msgstr ""
2105
2106 #. type: TH
2107 #: build/C/man3/fopencookie.3:24
2108 #, no-wrap
2109 msgid "FOPENCOOKIE"
2110 msgstr ""
2111
2112 #. type: TH
2113 #: build/C/man3/fopencookie.3:24
2114 #, no-wrap
2115 msgid "2008-12-05"
2116 msgstr ""
2117
2118 #. type: TH
2119 #: 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
2120 #, no-wrap
2121 msgid "Linux"
2122 msgstr ""
2123
2124 #. type: Plain text
2125 #: build/C/man3/fopencookie.3:27
2126 msgid "fopencookie - opening a custom stream"
2127 msgstr ""
2128
2129 #. type: Plain text
2130 #: build/C/man3/fopencookie.3:34
2131 #, no-wrap
2132 msgid ""
2133 "B<FILE *fopencookie(void *>I<cookie>B<, const char *>I<mode>B<,>\n"
2134 "B<                  cookie_io_functions_t >I<io_funcs>B<);>\n"
2135 msgstr ""
2136
2137 #. type: Plain text
2138 #: build/C/man3/fopencookie.3:47
2139 msgid ""
2140 "The B<fopencookie>()  function allows the programmer to create a custom "
2141 "implementation for a standard I/O stream.  This implementation can store the "
2142 "stream's data at a location of its own choosing; for example, "
2143 "B<fopencookie>()  is used to implement B<fmemopen>(3), which provides a "
2144 "stream interface to data that is stored in a buffer in memory."
2145 msgstr ""
2146
2147 #. type: Plain text
2148 #: build/C/man3/fopencookie.3:49
2149 msgid "In order to create a custom stream the programmer must:"
2150 msgstr ""
2151
2152 #. type: IP
2153 #: 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
2154 #, no-wrap
2155 msgid "*"
2156 msgstr ""
2157
2158 #. type: Plain text
2159 #: build/C/man3/fopencookie.3:52
2160 msgid ""
2161 "Implement four \"hook\" functions that are used internally by the standard "
2162 "I/O library when performing I/O on the stream."
2163 msgstr ""
2164
2165 #. type: Plain text
2166 #: build/C/man3/fopencookie.3:63
2167 msgid ""
2168 "Define a \"cookie\" data type, a structure that provides bookkeeping "
2169 "information (e.g., where to store data) used by the aforementioned hook "
2170 "functions.  The standard I/O package knows nothing about the contents of "
2171 "this cookie (thus it is typed as I<void\\ *> when passed to "
2172 "B<fopencookie>()), but automatically supplies the cookie as the first "
2173 "argument when calling the hook functions."
2174 msgstr ""
2175
2176 #. type: Plain text
2177 #: build/C/man3/fopencookie.3:68
2178 msgid ""
2179 "Call B<fopencookie>()  to open a new stream and associate the cookie and "
2180 "hook functions with that stream."
2181 msgstr ""
2182
2183 #. type: Plain text
2184 #: build/C/man3/fopencookie.3:76
2185 msgid ""
2186 "The B<fopencookie>()  function serves a purpose similar to B<fopen>(3): it "
2187 "opens a new stream and returns a pointer to a I<FILE> object that is used to "
2188 "operate on that stream."
2189 msgstr ""
2190
2191 #. type: Plain text
2192 #: build/C/man3/fopencookie.3:83
2193 msgid ""
2194 "The I<cookie> argument is a pointer to the caller's cookie structure that is "
2195 "to be associated with the new stream.  This pointer is supplied as the first "
2196 "argument when the standard I/O library invokes any of the hook functions "
2197 "described below."
2198 msgstr ""
2199
2200 #. type: Plain text
2201 #: build/C/man3/fopencookie.3:99
2202 msgid ""
2203 "The I<mode> argument serves the same purpose as for B<fopen>(3).  The "
2204 "following modes are supported: I<r>, I<w>, I<a>, I<r+>, I<w+>, and I<a+>.  "
2205 "See B<fopen>(3)  for details."
2206 msgstr ""
2207
2208 #. type: Plain text
2209 #: build/C/man3/fopencookie.3:105
2210 msgid ""
2211 "The I<io_funcs> argument is a structure that contains four fields pointing "
2212 "to the programmer-defined hook functions that are used to implement this "
2213 "stream.  The structure is defined as follows"
2214 msgstr ""
2215
2216 #. type: Plain text
2217 #: build/C/man3/fopencookie.3:114
2218 #, no-wrap
2219 msgid ""
2220 "struct cookie_io_functions_t {\n"
2221 "    cookie_read_function_t  *read;\n"
2222 "    cookie_write_function_t *write;\n"
2223 "    cookie_seek_function_t  *seek;\n"
2224 "    cookie_close_function_t *close;\n"
2225 "};\n"
2226 msgstr ""
2227
2228 #. type: Plain text
2229 #: build/C/man3/fopencookie.3:118
2230 msgid "The four fields are as follows:"
2231 msgstr ""
2232
2233 #. type: TP
2234 #: build/C/man3/fopencookie.3:118
2235 #, no-wrap
2236 msgid "I<cookie_read_function_t *read>"
2237 msgstr ""
2238
2239 #. type: Plain text
2240 #: build/C/man3/fopencookie.3:122
2241 msgid ""
2242 "This function implements read operations for the stream.  When called, it "
2243 "receives three arguments:"
2244 msgstr ""
2245
2246 #. type: Plain text
2247 #: build/C/man3/fopencookie.3:124
2248 #, no-wrap
2249 msgid "    ssize_t read(void *cookie, char *buf, size_t size);\n"
2250 msgstr ""
2251
2252 #. type: Plain text
2253 #: build/C/man3/fopencookie.3:139
2254 msgid ""
2255 "The I<buf> and I<size> arguments are, respectively, a buffer into which "
2256 "input data can be placed and the size of that buffer.  As its function "
2257 "result, the I<read> function should return the number of bytes copied into "
2258 "I<buf>, 0 on end of file, or -1 on error.  The I<read> function should "
2259 "update the stream offset appropriately."
2260 msgstr ""
2261
2262 #. type: Plain text
2263 #: build/C/man3/fopencookie.3:144
2264 msgid ""
2265 "If I<*read> is a NULL pointer, then reads from the custom stream always "
2266 "return end of file."
2267 msgstr ""
2268
2269 #. type: TP
2270 #: build/C/man3/fopencookie.3:144
2271 #, no-wrap
2272 msgid "I<cookie_write_function_t *write>"
2273 msgstr ""
2274
2275 #. type: Plain text
2276 #: build/C/man3/fopencookie.3:148
2277 msgid ""
2278 "This function implements write operations for the stream.  When called, it "
2279 "receives three arguments:"
2280 msgstr ""
2281
2282 #. type: Plain text
2283 #: build/C/man3/fopencookie.3:150
2284 #, no-wrap
2285 msgid "    ssize_t write(void *cookie, const char *buf, size_t size);\n"
2286 msgstr ""
2287
2288 #. type: Plain text
2289 #: build/C/man3/fopencookie.3:165
2290 msgid ""
2291 "The I<buf> and I<size> arguments are, respectively, a buffer of data to be "
2292 "output to the stream and the size of that buffer.  As its function result, "
2293 "the I<write> function should return the number of bytes copied from I<buf>, "
2294 "or -1 on error.  The I<write> function should update the stream offset "
2295 "appropriately."
2296 msgstr ""
2297
2298 #. type: Plain text
2299 #: build/C/man3/fopencookie.3:170
2300 msgid "If I<*write> is a NULL pointer, then output to the stream is discarded."
2301 msgstr ""
2302
2303 #. type: TP
2304 #: build/C/man3/fopencookie.3:170
2305 #, no-wrap
2306 msgid "I<cookie_seek_function_t *seek>"
2307 msgstr ""
2308
2309 #. type: Plain text
2310 #: build/C/man3/fopencookie.3:174
2311 msgid ""
2312 "This function implements seek operations on the stream.  When called, it "
2313 "receives three arguments:"
2314 msgstr ""
2315
2316 #. type: Plain text
2317 #: build/C/man3/fopencookie.3:176
2318 #, no-wrap
2319 msgid "    int seek(void *cookie, off64_t *offset, int whence);\n"
2320 msgstr ""
2321
2322 #. type: Plain text
2323 #: build/C/man3/fopencookie.3:182
2324 msgid ""
2325 "The I<*offset> argument specifies the new file offset depending on which of "
2326 "the following three values is supplied in I<whence>:"
2327 msgstr ""
2328
2329 #. type: TP
2330 #: build/C/man3/fopencookie.3:183 build/C/man2/lseek.2:65
2331 #, no-wrap
2332 msgid "B<SEEK_SET>"
2333 msgstr ""
2334
2335 #. type: Plain text
2336 #: build/C/man3/fopencookie.3:188
2337 msgid ""
2338 "The stream offset should be set I<*offset> bytes from the start of the "
2339 "stream."
2340 msgstr ""
2341
2342 #. type: TP
2343 #: build/C/man3/fopencookie.3:188 build/C/man2/lseek.2:70
2344 #, no-wrap
2345 msgid "B<SEEK_CUR>"
2346 msgstr ""
2347
2348 #. type: Plain text
2349 #: build/C/man3/fopencookie.3:192
2350 msgid "I<*offset> should be added to the current stream offset."
2351 msgstr ""
2352
2353 #. type: TP
2354 #: build/C/man3/fopencookie.3:192 build/C/man2/lseek.2:75
2355 #, no-wrap
2356 msgid "B<SEEK_END>"
2357 msgstr ""
2358
2359 #. type: Plain text
2360 #: build/C/man3/fopencookie.3:196
2361 msgid "The stream offset should be set to the size of the stream plus I<*offset>."
2362 msgstr ""
2363
2364 #. type: Plain text
2365 #: build/C/man3/fopencookie.3:203
2366 msgid ""
2367 "Before returning, the I<seek> function should update I<*offset> to indicate "
2368 "the new stream offset."
2369 msgstr ""
2370
2371 #. type: Plain text
2372 #: build/C/man3/fopencookie.3:207
2373 msgid ""
2374 "As its function result, the I<seek> function should return 0 on success, and "
2375 "-1 on error."
2376 msgstr ""
2377
2378 #. type: Plain text
2379 #: build/C/man3/fopencookie.3:212
2380 msgid ""
2381 "If I<*seek> is a NULL pointer, then it is not possible to perform seek "
2382 "operations on the stream."
2383 msgstr ""
2384
2385 #. type: TP
2386 #: build/C/man3/fopencookie.3:212
2387 #, no-wrap
2388 msgid "I<cookie_close_function_t *close>"
2389 msgstr ""
2390
2391 #. type: Plain text
2392 #: build/C/man3/fopencookie.3:218
2393 msgid ""
2394 "This function closes the stream.  The hook function can do things such as "
2395 "freeing buffers allocated for the stream.  When called, it receives one "
2396 "argument:"
2397 msgstr ""
2398
2399 #. type: Plain text
2400 #: build/C/man3/fopencookie.3:220
2401 #, no-wrap
2402 msgid "    int close(void *cookie);\n"
2403 msgstr ""
2404
2405 #. type: Plain text
2406 #: build/C/man3/fopencookie.3:225
2407 msgid ""
2408 "The I<cookie> argument is the cookie that the programmer supplied when "
2409 "calling B<fopencookie>()."
2410 msgstr ""
2411
2412 #. type: Plain text
2413 #: build/C/man3/fopencookie.3:231
2414 msgid ""
2415 "As its function result, the I<close> function should return 0 on success, "
2416 "and B<EOF> on error."
2417 msgstr ""
2418
2419 #. type: Plain text
2420 #: build/C/man3/fopencookie.3:235
2421 msgid ""
2422 "If I<*close> is NULL, then no special action is performed when the stream is "
2423 "closed."
2424 msgstr ""
2425
2426 #.  .SH ERRORS
2427 #.  It's not clear if errno ever gets set...
2428 #. type: Plain text
2429 #: build/C/man3/fopencookie.3:242
2430 msgid ""
2431 "On success B<fopencookie>()  returns a pointer to the new stream.  On error, "
2432 "NULL is returned."
2433 msgstr ""
2434
2435 #. type: Plain text
2436 #: build/C/man3/fopencookie.3:244
2437 msgid "This function is a nonstandard GNU extension."
2438 msgstr ""
2439
2440 #. type: Plain text
2441 #: build/C/man3/fopencookie.3:253
2442 msgid ""
2443 "The program below implements a custom stream whose functionality is similar "
2444 "(but not identical) to that available via B<fmemopen>(3).  It implements a "
2445 "stream whose data is stored in a memory buffer.  The program writes its "
2446 "command-line arguments to the stream, and then seeks through the stream "
2447 "reading two out of every five characters and writing them to standard "
2448 "output.  The following shell session demonstrates the use of the program:"
2449 msgstr ""
2450
2451 #. type: Plain text
2452 #: build/C/man3/fopencookie.3:261
2453 #, no-wrap
2454 msgid ""
2455 "$B< ./a.out \\(aqhello world\\(aq>\n"
2456 "/he/\n"
2457 "/ w/\n"
2458 "/d/\n"
2459 "Reached end of file\n"
2460 msgstr ""
2461
2462 #. type: Plain text
2463 #: build/C/man3/fopencookie.3:268
2464 msgid ""
2465 "Note that a more general version of the program below could be improved to "
2466 "more robustly handle various error situations (e.g., opening a stream with a "
2467 "cookie that already has an open stream; closing a stream that has already "
2468 "been closed)."
2469 msgstr ""
2470
2471 #. type: Plain text
2472 #: build/C/man3/fopencookie.3:277
2473 #, no-wrap
2474 msgid ""
2475 "#define _GNU_SOURCE\n"
2476 "#include E<lt>sys/types.hE<gt>\n"
2477 "#include E<lt>stdio.hE<gt>\n"
2478 "#include E<lt>stdlib.hE<gt>\n"
2479 "#include E<lt>unistd.hE<gt>\n"
2480 "#include E<lt>string.hE<gt>\n"
2481 msgstr ""
2482
2483 #. type: Plain text
2484 #: build/C/man3/fopencookie.3:279
2485 #, no-wrap
2486 msgid "#define INIT_BUF_SIZE 4\n"
2487 msgstr ""
2488
2489 #. type: Plain text
2490 #: build/C/man3/fopencookie.3:286
2491 #, no-wrap
2492 msgid ""
2493 "struct memfile_cookie {\n"
2494 "    char   *buf;        /* Dynamically sized buffer for data */\n"
2495 "    size_t  allocated;  /* Size of buf */\n"
2496 "    size_t  endpos;     /* Number of characters in buf */\n"
2497 "    off_t   offset;     /* Current file offset in buf */\n"
2498 "};\n"
2499 msgstr ""
2500
2501 #. type: Plain text
2502 #: build/C/man3/fopencookie.3:292
2503 #, no-wrap
2504 msgid ""
2505 "ssize_t\n"
2506 "memfile_write(void *c, const char *buf, size_t size)\n"
2507 "{\n"
2508 "    char *new_buff;\n"
2509 "    struct memfile_cookie *cookie = c;\n"
2510 msgstr ""
2511
2512 #. type: Plain text
2513 #: build/C/man3/fopencookie.3:294
2514 #, no-wrap
2515 msgid "    /* Buffer too small? Keep doubling size until big enough */\n"
2516 msgstr ""
2517
2518 #. type: Plain text
2519 #: build/C/man3/fopencookie.3:304
2520 #, no-wrap
2521 msgid ""
2522 "    while (size + cookie-E<gt>offset E<gt> cookie-E<gt>allocated) {\n"
2523 "        new_buff = realloc(cookie-E<gt>buf, cookie-E<gt>allocated * 2);\n"
2524 "        if (new_buff == NULL) {\n"
2525 "            return -1;\n"
2526 "        } else {\n"
2527 "            cookie-E<gt>allocated *= 2;\n"
2528 "            cookie-E<gt>buf = new_buff;\n"
2529 "        }\n"
2530 "    }\n"
2531 msgstr ""
2532
2533 #. type: Plain text
2534 #: build/C/man3/fopencookie.3:306
2535 #, no-wrap
2536 msgid "    memcpy(cookie-E<gt>buf + cookie-E<gt>offset, buf, size);\n"
2537 msgstr ""
2538
2539 #. type: Plain text
2540 #: build/C/man3/fopencookie.3:310
2541 #, no-wrap
2542 msgid ""
2543 "    cookie-E<gt>offset += size;\n"
2544 "    if (cookie-E<gt>offset E<gt> cookie-E<gt>endpos)\n"
2545 "        cookie-E<gt>endpos = cookie-E<gt>offset;\n"
2546 msgstr ""
2547
2548 #. type: Plain text
2549 #: build/C/man3/fopencookie.3:313
2550 #, no-wrap
2551 msgid ""
2552 "    return size;\n"
2553 "}\n"
2554 msgstr ""
2555
2556 #. type: Plain text
2557 #: build/C/man3/fopencookie.3:319
2558 #, no-wrap
2559 msgid ""
2560 "ssize_t\n"
2561 "memfile_read(void *c, char *buf, size_t size)\n"
2562 "{\n"
2563 "    ssize_t xbytes;\n"
2564 "    struct memfile_cookie *cookie = c;\n"
2565 msgstr ""
2566
2567 #. type: Plain text
2568 #: build/C/man3/fopencookie.3:321
2569 #, no-wrap
2570 msgid "    /* Fetch minimum of bytes requested and bytes available */\n"
2571 msgstr ""
2572
2573 #. type: Plain text
2574 #: build/C/man3/fopencookie.3:327
2575 #, no-wrap
2576 msgid ""
2577 "    xbytes = size;\n"
2578 "    if (cookie-E<gt>offset + size E<gt> cookie-E<gt>endpos)\n"
2579 "        xbytes = cookie-E<gt>endpos - cookie-E<gt>offset;\n"
2580 "    if (xbytes E<lt> 0)     /* offset may be past endpos */\n"
2581 "       xbytes = 0;\n"
2582 msgstr ""
2583
2584 #. type: Plain text
2585 #: build/C/man3/fopencookie.3:329
2586 #, no-wrap
2587 msgid "    memcpy(buf, cookie-E<gt>buf + cookie-E<gt>offset, xbytes);\n"
2588 msgstr ""
2589
2590 #. type: Plain text
2591 #: build/C/man3/fopencookie.3:333
2592 #, no-wrap
2593 msgid ""
2594 "    cookie-E<gt>offset += xbytes;\n"
2595 "    return xbytes;\n"
2596 "}\n"
2597 msgstr ""
2598
2599 #. type: Plain text
2600 #: build/C/man3/fopencookie.3:339
2601 #, no-wrap
2602 msgid ""
2603 "int\n"
2604 "memfile_seek(void *c, off64_t *offset, int whence)\n"
2605 "{\n"
2606 "    off64_t new_offset;\n"
2607 "    struct memfile_cookie *cookie = c;\n"
2608 msgstr ""
2609
2610 #. type: Plain text
2611 #: build/C/man3/fopencookie.3:348
2612 #, no-wrap
2613 msgid ""
2614 "    if (whence == SEEK_SET)\n"
2615 "        new_offset = *offset;\n"
2616 "    else if (whence == SEEK_END)\n"
2617 "        new_offset = cookie-E<gt>endpos + *offset;\n"
2618 "    else if (whence == SEEK_CUR)\n"
2619 "        new_offset = cookie-E<gt>offset + *offset;\n"
2620 "    else\n"
2621 "        return -1;\n"
2622 msgstr ""
2623
2624 #. type: Plain text
2625 #: build/C/man3/fopencookie.3:351
2626 #, no-wrap
2627 msgid ""
2628 "    if (new_offset E<lt> 0)\n"
2629 "        return -1;\n"
2630 msgstr ""
2631
2632 #. type: Plain text
2633 #: build/C/man3/fopencookie.3:356
2634 #, no-wrap
2635 msgid ""
2636 "    cookie-E<gt>offset = new_offset;\n"
2637 "    *offset = new_offset;\n"
2638 "    return 0;\n"
2639 "}\n"
2640 msgstr ""
2641
2642 #. type: Plain text
2643 #: build/C/man3/fopencookie.3:361
2644 #, no-wrap
2645 msgid ""
2646 "int\n"
2647 "memfile_close(void *c)\n"
2648 "{\n"
2649 "    struct memfile_cookie *cookie = c;\n"
2650 msgstr ""
2651
2652 #. type: Plain text
2653 #: build/C/man3/fopencookie.3:365
2654 #, no-wrap
2655 msgid ""
2656 "    free(cookie-E<gt>buf);\n"
2657 "    cookie-E<gt>allocated = 0;\n"
2658 "    cookie-E<gt>buf = NULL;\n"
2659 msgstr ""
2660
2661 #. type: Plain text
2662 #: build/C/man3/fopencookie.3:368
2663 #, no-wrap
2664 msgid ""
2665 "    return 0;\n"
2666 "}\n"
2667 msgstr ""
2668
2669 #. type: Plain text
2670 #: build/C/man3/fopencookie.3:384
2671 #, no-wrap
2672 msgid ""
2673 "int\n"
2674 "main(int argc, char *argv[])\n"
2675 "{\n"
2676 "    cookie_io_functions_t  memfile_func = {\n"
2677 "        .read  = memfile_read,\n"
2678 "        .write = memfile_write,\n"
2679 "        .seek  = memfile_seek,\n"
2680 "        .close = memfile_close\n"
2681 "    };\n"
2682 "    FILE *fp;\n"
2683 "    struct memfile_cookie mycookie;\n"
2684 "    ssize_t nread;\n"
2685 "    long p;\n"
2686 "    int j;\n"
2687 "    char buf[1000];\n"
2688 msgstr ""
2689
2690 #. type: Plain text
2691 #: build/C/man3/fopencookie.3:386
2692 #, no-wrap
2693 msgid "    /* Set up the cookie before calling fopencookie() */\n"
2694 msgstr ""
2695
2696 #. type: Plain text
2697 #: build/C/man3/fopencookie.3:392
2698 #, no-wrap
2699 msgid ""
2700 "    mycookie.buf = malloc(INIT_BUF_SIZE);\n"
2701 "    if (mycookie.buf == NULL) {\n"
2702 "        perror(\"malloc\");\n"
2703 "        exit(EXIT_FAILURE);\n"
2704 "    }\n"
2705 msgstr ""
2706
2707 #. type: Plain text
2708 #: build/C/man3/fopencookie.3:396
2709 #, no-wrap
2710 msgid ""
2711 "    mycookie.allocated = INIT_BUF_SIZE;\n"
2712 "    mycookie.offset = 0;\n"
2713 "    mycookie.endpos = 0;\n"
2714 msgstr ""
2715
2716 #. type: Plain text
2717 #: build/C/man3/fopencookie.3:402
2718 #, no-wrap
2719 msgid ""
2720 "    fp = fopencookie(&mycookie,\"w+\", memfile_func);\n"
2721 "    if (fp == NULL) {\n"
2722 "        perror(\"fopencookie\");\n"
2723 "        exit(EXIT_FAILURE);\n"
2724 "    }\n"
2725 msgstr ""
2726
2727 #. type: Plain text
2728 #: build/C/man3/fopencookie.3:404
2729 #, no-wrap
2730 msgid "    /* Write command-line arguments to our file */\n"
2731 msgstr ""
2732
2733 #. type: Plain text
2734 #: build/C/man3/fopencookie.3:410
2735 #, no-wrap
2736 msgid ""
2737 "    for (j = 1; j E<lt> argc; j++)\n"
2738 "        if (fputs(argv[j], fp) == EOF) {\n"
2739 "            perror(\"fputs\");\n"
2740 "            exit(EXIT_FAILURE);\n"
2741 "        }\n"
2742 msgstr ""
2743
2744 #. type: Plain text
2745 #: build/C/man3/fopencookie.3:412
2746 #, no-wrap
2747 msgid "    /* Read two bytes out of every five, until EOF */\n"
2748 msgstr ""
2749
2750 #. type: Plain text
2751 #: build/C/man3/fopencookie.3:427
2752 #, no-wrap
2753 msgid ""
2754 "    for (p = 0; ; p += 5) {\n"
2755 "        if (fseek(fp, p, SEEK_SET) == -1) {\n"
2756 "            perror(\"fseek\");\n"
2757 "            exit(EXIT_FAILURE);\n"
2758 "        }\n"
2759 "        nread = fread(buf, 1, 2, fp);\n"
2760 "        if (nread == -1) {\n"
2761 "            perror(\"fread\");\n"
2762 "            exit(EXIT_FAILURE);\n"
2763 "        }\n"
2764 "        if (nread == 0) {\n"
2765 "            printf(\"Reached end of file\\en\");\n"
2766 "            break;\n"
2767 "        }\n"
2768 msgstr ""
2769
2770 #. type: Plain text
2771 #: build/C/man3/fopencookie.3:430
2772 #, no-wrap
2773 msgid ""
2774 "        printf(\"/%.*s/\\en\", nread, buf);\n"
2775 "    }\n"
2776 msgstr ""
2777
2778 #. type: Plain text
2779 #: build/C/man3/fopencookie.3:433 build/C/man2/readlink.2:211
2780 #, no-wrap
2781 msgid ""
2782 "    exit(EXIT_SUCCESS);\n"
2783 "}\n"
2784 msgstr ""
2785
2786 #. type: Plain text
2787 #: build/C/man3/fopencookie.3:439
2788 msgid "B<fclose>(3), B<fmemopen>(3), B<fopen>(3), B<fseek>(3)"
2789 msgstr ""
2790
2791 #. type: TH
2792 #: build/C/man3/fpurge.3:23
2793 #, no-wrap
2794 msgid "FPURGE"
2795 msgstr ""
2796
2797 #. type: TH
2798 #: build/C/man3/fpurge.3:23
2799 #, no-wrap
2800 msgid "2001-12-15"
2801 msgstr ""
2802
2803 #. type: Plain text
2804 #: build/C/man3/fpurge.3:26
2805 msgid "fpurge, __fpurge - purge a stream"
2806 msgstr ""
2807
2808 #. type: Plain text
2809 #: build/C/man3/fpurge.3:30
2810 #, no-wrap
2811 msgid ""
2812 "/* unsupported */\n"
2813 "B<#include E<lt>stdio.hE<gt>>\n"
2814 msgstr ""
2815
2816 #. type: Plain text
2817 #: build/C/man3/fpurge.3:32
2818 #, no-wrap
2819 msgid "B<int fpurge(FILE *>I<stream>B<);>\n"
2820 msgstr ""
2821
2822 #. type: Plain text
2823 #: build/C/man3/fpurge.3:35
2824 #, no-wrap
2825 msgid ""
2826 "/* supported */\n"
2827 "B<#include E<lt>stdio.hE<gt>>\n"
2828 msgstr ""
2829
2830 #. type: Plain text
2831 #: build/C/man3/fpurge.3:37
2832 #, no-wrap
2833 msgid "B<#include E<lt>stdio_ext.hE<gt>>\n"
2834 msgstr ""
2835
2836 #. type: Plain text
2837 #: build/C/man3/fpurge.3:39
2838 #, no-wrap
2839 msgid "B<void  __fpurge(FILE *>I<stream>B<);>\n"
2840 msgstr ""
2841
2842 #. type: Plain text
2843 #: build/C/man3/fpurge.3:52
2844 msgid ""
2845 "The function B<fpurge>()  clears the buffers of the given stream.  For "
2846 "output streams this discards any unwritten output.  For input streams this "
2847 "discards any input read from the underlying object but not yet obtained via "
2848 "B<getc>(3); this includes any text pushed back via B<ungetc>(3).  See also "
2849 "B<fflush>(3)."
2850 msgstr ""
2851
2852 #. type: Plain text
2853 #: build/C/man3/fpurge.3:56
2854 msgid ""
2855 "The function B<__fpurge>()  does precisely the same, but without returning a "
2856 "value."
2857 msgstr ""
2858
2859 #. type: Plain text
2860 #: build/C/man3/fpurge.3:63
2861 msgid ""
2862 "Upon successful completion B<fpurge>()  returns 0.  On error, it returns -1 "
2863 "and sets I<errno> appropriately."
2864 msgstr ""
2865
2866 #. type: Plain text
2867 #: build/C/man3/fpurge.3:68
2868 msgid "I<stream> is not an open stream."
2869 msgstr ""
2870
2871 #. type: Plain text
2872 #: build/C/man3/fpurge.3:76
2873 msgid ""
2874 "These functions are nonstandard and not portable.  The function B<fpurge>()  "
2875 "was introduced in 4.4BSD and is not available under Linux.  The function "
2876 "B<__fpurge>()  was introduced in Solaris, and is present in glibc 2.1.95 and "
2877 "later."
2878 msgstr ""
2879
2880 #. type: Plain text
2881 #: build/C/man3/fpurge.3:78
2882 msgid "Usually it is a mistake to want to discard input buffers."
2883 msgstr ""
2884
2885 #.  .BR fclean (3),
2886 #. type: Plain text
2887 #: build/C/man3/fpurge.3:83
2888 msgid "B<fflush>(3), B<setbuf>(3), B<stdio_ext>(3)"
2889 msgstr ""
2890
2891 #. type: TH
2892 #: build/C/man3/fputwc.3:14
2893 #, no-wrap
2894 msgid "FPUTWC"
2895 msgstr ""
2896
2897 #. type: Plain text
2898 #: build/C/man3/fputwc.3:17
2899 msgid "fputwc, putwc - write a wide character to a FILE stream"
2900 msgstr ""
2901
2902 #. type: Plain text
2903 #: build/C/man3/fputwc.3:25
2904 #, no-wrap
2905 msgid ""
2906 "B<wint_t fputwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
2907 "B<wint_t putwc(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
2908 msgstr ""
2909
2910 #. type: Plain text
2911 #: build/C/man3/fputwc.3:41
2912 msgid ""
2913 "The B<fputwc>()  function is the wide-character equivalent of the "
2914 "B<fputc>(3)  function.  It writes the wide character I<wc> to I<stream>.  If "
2915 "I<ferror(stream)> becomes true, it returns B<WEOF>.  If a wide-character "
2916 "conversion error occurs, it sets I<errno> to B<EILSEQ> and returns B<WEOF>.  "
2917 "Otherwise it returns I<wc>."
2918 msgstr ""
2919
2920 #. type: Plain text
2921 #: build/C/man3/fputwc.3:49
2922 msgid ""
2923 "The B<putwc>()  function or macro functions identically to B<fputwc>().  It "
2924 "may be implemented as a macro, and may evaluate its argument more than "
2925 "once.  There is no reason ever to use it."
2926 msgstr ""
2927
2928 #. type: Plain text
2929 #: build/C/man3/fputwc.3:58
2930 msgid ""
2931 "The B<fputwc>()  function returns I<wc> if no error occurred, or B<WEOF> to "
2932 "indicate an error."
2933 msgstr ""
2934
2935 #. type: Plain text
2936 #: build/C/man3/fputwc.3:63
2937 msgid "Conversion of I<wc> to the stream's encoding fails."
2938 msgstr ""
2939
2940 #. type: Plain text
2941 #: build/C/man3/fputwc.3:72
2942 msgid ""
2943 "The behavior of B<fputwc>()  depends on the B<LC_CTYPE> category of the "
2944 "current locale."
2945 msgstr ""
2946
2947 #. type: Plain text
2948 #: build/C/man3/fputwc.3:80
2949 msgid ""
2950 "In the absence of additional information passed to the B<fopen>(3)  call, it "
2951 "is reasonable to expect that B<fputwc>()  will actually write the multibyte "
2952 "sequence corresponding to the wide character I<wc>."
2953 msgstr ""
2954
2955 #. type: Plain text
2956 #: build/C/man3/fputwc.3:84
2957 msgid "B<fgetwc>(3), B<fputws>(3), B<unlocked_stdio>(3)"
2958 msgstr ""
2959
2960 #. type: TH
2961 #: build/C/man3/fread.3:43
2962 #, no-wrap
2963 msgid "FREAD"
2964 msgstr ""
2965
2966 #. type: TH
2967 #: build/C/man3/fread.3:43
2968 #, no-wrap
2969 msgid "1996-05-17"
2970 msgstr ""
2971
2972 #. type: Plain text
2973 #: build/C/man3/fread.3:46
2974 msgid "fread, fwrite - binary stream input/output"
2975 msgstr ""
2976
2977 #. type: Plain text
2978 #: build/C/man3/fread.3:52
2979 #, no-wrap
2980 msgid ""
2981 "B<size_t fread(void *>I<ptr>B<, size_t >I<size>B<, size_t >I<nmemb>B<, FILE "
2982 "*>I<stream>B<);>\n"
2983 msgstr ""
2984
2985 #. type: Plain text
2986 #: build/C/man3/fread.3:55
2987 #, no-wrap
2988 msgid ""
2989 "B<size_t fwrite(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
2990 ">I<nmemb>B<,>\n"
2991 "B<              FILE *>I<stream>B<);>\n"
2992 msgstr ""
2993
2994 #. type: Plain text
2995 #: build/C/man3/fread.3:67
2996 msgid ""
2997 "The function B<fread>()  reads I<nmemb> elements of data, each I<size> bytes "
2998 "long, from the stream pointed to by I<stream>, storing them at the location "
2999 "given by I<ptr>."
3000 msgstr ""
3001
3002 #. type: Plain text
3003 #: build/C/man3/fread.3:78
3004 msgid ""
3005 "The function B<fwrite>()  writes I<nmemb> elements of data, each I<size> "
3006 "bytes long, to the stream pointed to by I<stream>, obtaining them from the "
3007 "location given by I<ptr>."
3008 msgstr ""
3009
3010 #. type: Plain text
3011 #: build/C/man3/fread.3:89
3012 msgid ""
3013 "B<fread>()  and B<fwrite>()  return the number of items successfully read or "
3014 "written (i.e., not the number of characters).  If an error occurs, or the "
3015 "end-of-file is reached, the return value is a short item count (or zero)."
3016 msgstr ""
3017
3018 #. type: Plain text
3019 #: build/C/man3/fread.3:96
3020 msgid ""
3021 "B<fread>()  does not distinguish between end-of-file and error, and callers "
3022 "must use B<feof>(3)  and B<ferror>(3)  to determine which occurred."
3023 msgstr ""
3024
3025 #. type: Plain text
3026 #: build/C/man3/fread.3:98
3027 msgid "C89, POSIX.1-2001."
3028 msgstr ""
3029
3030 #. type: Plain text
3031 #: build/C/man3/fread.3:104
3032 msgid "B<read>(2), B<write>(2), B<feof>(3), B<ferror>(3), B<unlocked_stdio>(3)"
3033 msgstr ""
3034
3035 #. type: TH
3036 #: build/C/man3/fseek.3:40
3037 #, no-wrap
3038 msgid "FSEEK"
3039 msgstr ""
3040
3041 #. type: TH
3042 #: build/C/man3/fseek.3:40
3043 #, no-wrap
3044 msgid "1993-11-29"
3045 msgstr ""
3046
3047 #. type: Plain text
3048 #: build/C/man3/fseek.3:43
3049 msgid "fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream"
3050 msgstr ""
3051
3052 #. type: Plain text
3053 #: build/C/man3/fseek.3:47
3054 msgid "B<int fseek(FILE *>I<stream>B<, long >I<offset>B<, int >I<whence>B<);>"
3055 msgstr ""
3056
3057 #. type: Plain text
3058 #: build/C/man3/fseek.3:49
3059 msgid "B<long ftell(FILE *>I<stream>B<);>"
3060 msgstr ""
3061
3062 #. type: Plain text
3063 #: build/C/man3/fseek.3:51
3064 msgid "B<void rewind(FILE *>I<stream>B<);>"
3065 msgstr ""
3066
3067 #. type: Plain text
3068 #: build/C/man3/fseek.3:53
3069 msgid "B<int fgetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3070 msgstr ""
3071
3072 #. type: Plain text
3073 #: build/C/man3/fseek.3:55
3074 msgid "B<int fsetpos(FILE *>I<stream>B<, fpos_t *>I<pos>B<);>"
3075 msgstr ""
3076
3077 #. type: Plain text
3078 #: build/C/man3/fseek.3:79
3079 msgid ""
3080 "The B<fseek>()  function sets the file position indicator for the stream "
3081 "pointed to by I<stream>.  The new position, measured in bytes, is obtained "
3082 "by adding I<offset> bytes to the position specified by I<whence>.  If "
3083 "I<whence> is set to B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, the offset is "
3084 "relative to the start of the file, the current position indicator, or "
3085 "end-of-file, respectively.  A successful call to the B<fseek>()  function "
3086 "clears the end-of-file indicator for the stream and undoes any effects of "
3087 "the B<ungetc>(3)  function on the same stream."
3088 msgstr ""
3089
3090 #. type: Plain text
3091 #: build/C/man3/fseek.3:85
3092 msgid ""
3093 "The B<ftell>()  function obtains the current value of the file position "
3094 "indicator for the stream pointed to by I<stream>."
3095 msgstr ""
3096
3097 #. type: Plain text
3098 #: build/C/man3/fseek.3:92
3099 msgid ""
3100 "The B<rewind>()  function sets the file position indicator for the stream "
3101 "pointed to by I<stream> to the beginning of the file.  It is equivalent to:"
3102 msgstr ""
3103
3104 #. type: Plain text
3105 #: build/C/man3/fseek.3:95
3106 msgid "(void) fseek(stream, 0L, SEEK_SET)"
3107 msgstr ""
3108
3109 #. type: Plain text
3110 #: build/C/man3/fseek.3:99
3111 msgid ""
3112 "except that the error indicator for the stream is also cleared (see "
3113 "B<clearerr>(3))."
3114 msgstr ""
3115
3116 #. type: Plain text
3117 #: build/C/man3/fseek.3:117
3118 msgid ""
3119 "The B<fgetpos>()  and B<fsetpos>()  functions are alternate interfaces "
3120 "equivalent to B<ftell>()  and B<fseek>()  (with whence set to B<SEEK_SET>), "
3121 "setting and storing the current value of the file offset into or from the "
3122 "object referenced by I<pos>.  On some non-UNIX systems an I<fpos_t> object "
3123 "may be a complex object and these routines may be the only way to portably "
3124 "reposition a text stream."
3125 msgstr ""
3126
3127 #. type: Plain text
3128 #: build/C/man3/fseek.3:132
3129 msgid ""
3130 "The B<rewind>()  function returns no value.  Upon successful completion, "
3131 "B<fgetpos>(), B<fseek>(), B<fsetpos>()  return 0, and B<ftell>()  returns "
3132 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3133 "indicate the error."
3134 msgstr ""
3135
3136 #. type: Plain text
3137 #: build/C/man3/fseek.3:138
3138 msgid "The I<stream> specified is not a seekable stream."
3139 msgstr ""
3140
3141 #. type: Plain text
3142 #: build/C/man3/fseek.3:149
3143 msgid ""
3144 "The I<whence> argument to B<fseek>()  was not B<SEEK_SET>, B<SEEK_END>, or "
3145 "B<SEEK_CUR>."
3146 msgstr ""
3147
3148 #. type: Plain text
3149 #: build/C/man3/fseek.3:164
3150 msgid ""
3151 "The functions B<fgetpos>(), B<fseek>(), B<fsetpos>(), and B<ftell>()  may "
3152 "also fail and set I<errno> for any of the errors specified for the routines "
3153 "B<fflush>(3), B<fstat>(2), B<lseek>(2), and B<malloc>(3)."
3154 msgstr ""
3155
3156 #. type: Plain text
3157 #: build/C/man3/fseek.3:169
3158 msgid "B<lseek>(2), B<fseeko>(3)"
3159 msgstr ""
3160
3161 #. type: TH
3162 #: build/C/man3/fseeko.3:23
3163 #, no-wrap
3164 msgid "FSEEKO"
3165 msgstr ""
3166
3167 #. type: TH
3168 #: build/C/man3/fseeko.3:23
3169 #, no-wrap
3170 msgid "2001-11-05"
3171 msgstr ""
3172
3173 #. type: Plain text
3174 #: build/C/man3/fseeko.3:26
3175 msgid "fseeko, ftello - seek to or report file position"
3176 msgstr ""
3177
3178 #. type: Plain text
3179 #: build/C/man3/fseeko.3:31
3180 #, no-wrap
3181 msgid "B<int fseeko(FILE *>I<stream>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
3182 msgstr ""
3183
3184 #. type: Plain text
3185 #: build/C/man3/fseeko.3:34
3186 #, no-wrap
3187 msgid ""
3188 "B<off_t ftello(FILE *>I<stream>B<);>\n"
3189 "\n"
3190 msgstr ""
3191
3192 #. type: Plain text
3193 #: build/C/man3/fseeko.3:52
3194 msgid ""
3195 "The B<fseeko>()  and B<ftello>()  functions are identical to B<fseek>(3)  "
3196 "and B<ftell>(3)  (see B<fseek>(3)), respectively, except that the I<offset> "
3197 "argument of B<fseeko>()  and the return value of B<ftello>()  is of type "
3198 "I<off_t> instead of I<long>."
3199 msgstr ""
3200
3201 #. type: Plain text
3202 #: build/C/man3/fseeko.3:55
3203 msgid ""
3204 "On many architectures both I<off_t> and I<long> are 32-bit types, but "
3205 "compilation with"
3206 msgstr ""
3207
3208 #. type: Plain text
3209 #: build/C/man3/fseeko.3:59 build/C/man3/lseek64.3:79
3210 #, no-wrap
3211 msgid "#define _FILE_OFFSET_BITS 64\n"
3212 msgstr ""
3213
3214 #. type: Plain text
3215 #: build/C/man3/fseeko.3:63
3216 msgid "will turn I<off_t> into a 64-bit type."
3217 msgstr ""
3218
3219 #. type: Plain text
3220 #: build/C/man3/fseeko.3:72
3221 msgid ""
3222 "On successful completion, B<fseeko>()  returns 0, while B<ftello>()  returns "
3223 "the current offset.  Otherwise, -1 is returned and I<errno> is set to "
3224 "indicate the error."
3225 msgstr ""
3226
3227 #. type: Plain text
3228 #: build/C/man3/fseeko.3:75
3229 msgid "See the ERRORS in B<fseek>(3)."
3230 msgstr ""
3231
3232 #. type: Plain text
3233 #: build/C/man3/fseeko.3:77
3234 msgid "SUSv2, POSIX.1-2001."
3235 msgstr ""
3236
3237 #. type: Plain text
3238 #: build/C/man3/fseeko.3:81
3239 msgid ""
3240 "These functions are found on System V-like systems.  They are not present in "
3241 "libc4, libc5, glibc 2.0 but are available since glibc 2.1."
3242 msgstr ""
3243
3244 #. type: Plain text
3245 #: build/C/man3/fseeko.3:83
3246 msgid "B<fseek>(3)"
3247 msgstr ""
3248
3249 #. type: TH
3250 #: build/C/man3/getline.3:24
3251 #, no-wrap
3252 msgid "GETLINE"
3253 msgstr ""
3254
3255 #. type: TH
3256 #: build/C/man3/getline.3:24
3257 #, no-wrap
3258 msgid "2010-06-12"
3259 msgstr ""
3260
3261 #. type: Plain text
3262 #: build/C/man3/getline.3:27
3263 msgid "getline, getdelim - delimited string input"
3264 msgstr ""
3265
3266 #. type: Plain text
3267 #: build/C/man3/getline.3:32
3268 #, no-wrap
3269 msgid ""
3270 "B<ssize_t getline(char **>I<lineptr>B<, size_t *>I<n>B<, FILE "
3271 "*>I<stream>B<);>\n"
3272 msgstr ""
3273
3274 #. type: Plain text
3275 #: build/C/man3/getline.3:35
3276 #, no-wrap
3277 msgid ""
3278 "B<ssize_t getdelim(char **>I<lineptr>B<, size_t *>I<n>B<, int >I<delim>B<, "
3279 "FILE *>I<stream>B<);>\n"
3280 msgstr ""
3281
3282 #. type: Plain text
3283 #: build/C/man3/getline.3:45
3284 msgid "B<getline>(), B<getdelim>():"
3285 msgstr ""
3286
3287 #. type: Plain text
3288 #: build/C/man3/getline.3:50
3289 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200809L || _XOPEN_SOURCE\\ E<gt>=\\ 700"
3290 msgstr ""
3291
3292 #. type: Plain text
3293 #: build/C/man3/getline.3:63
3294 msgid ""
3295 "B<getline>()  reads an entire line from I<stream>, storing the address of "
3296 "the buffer containing the text into I<*lineptr>.  The buffer is "
3297 "null-terminated and includes the newline character, if one was found."
3298 msgstr ""
3299
3300 #. type: Plain text
3301 #: build/C/man3/getline.3:73
3302 msgid ""
3303 "If I<*lineptr> is NULL, then B<getline>()  will allocate a buffer for "
3304 "storing the line, which should be freed by the user program.  (In this case, "
3305 "the value in I<*n> is ignored.)"
3306 msgstr ""
3307
3308 #. type: Plain text
3309 #: build/C/man3/getline.3:91
3310 msgid ""
3311 "Alternatively, before calling B<getline>(), I<*lineptr> can contain a "
3312 "pointer to a B<malloc>(3)-allocated buffer I<*n> bytes in size.  If the "
3313 "buffer is not large enough to hold the line, B<getline>()  resizes it with "
3314 "B<realloc>(3), updating I<*lineptr> and I<*n> as necessary."
3315 msgstr ""
3316
3317 #. type: Plain text
3318 #: build/C/man3/getline.3:97
3319 msgid ""
3320 "In either case, on a successful call, I<*lineptr> and I<*n> will be updated "
3321 "to reflect the buffer address and allocated size respectively."
3322 msgstr ""
3323
3324 #. type: Plain text
3325 #: build/C/man3/getline.3:108
3326 msgid ""
3327 "B<getdelim>()  works like B<getline>(), except that a line delimiter other "
3328 "than newline can be specified as the I<delimiter> argument.  As with "
3329 "B<getline>(), a delimiter character is not added if one was not present in "
3330 "the input before end of file was reached."
3331 msgstr ""
3332
3333 #. type: Plain text
3334 #: build/C/man3/getline.3:117
3335 msgid ""
3336 "On success, B<getline>()  and B<getdelim>()  return the number of characters "
3337 "read, including the delimiter character, but not including the terminating "
3338 "null byte.  This value can be used to handle embedded null bytes in the line "
3339 "read."
3340 msgstr ""
3341
3342 #. type: Plain text
3343 #: build/C/man3/getline.3:120
3344 msgid ""
3345 "Both functions return -1 on failure to read a line (including end-of-file "
3346 "condition)."
3347 msgstr ""
3348
3349 #. type: Plain text
3350 #: build/C/man3/getline.3:130
3351 msgid "Bad arguments (I<n> or I<lineptr> is NULL, or I<stream> is not valid)."
3352 msgstr ""
3353
3354 #. type: Plain text
3355 #: build/C/man3/getline.3:132
3356 msgid "These functions are available since libc 4.6.27."
3357 msgstr ""
3358
3359 #. type: Plain text
3360 #: build/C/man3/getline.3:139
3361 msgid ""
3362 "Both B<getline>()  and B<getdelim>()  were originally GNU extensions.  They "
3363 "were standardized in POSIX.1-2008."
3364 msgstr ""
3365
3366 #. type: Plain text
3367 #: build/C/man3/getline.3:144
3368 #, no-wrap
3369 msgid ""
3370 "#define _GNU_SOURCE\n"
3371 "#include E<lt>stdio.hE<gt>\n"
3372 "#include E<lt>stdlib.hE<gt>\n"
3373 msgstr ""
3374
3375 #. type: Plain text
3376 #: build/C/man3/getline.3:152
3377 #, no-wrap
3378 msgid ""
3379 "int\n"
3380 "main(void)\n"
3381 "{\n"
3382 "    FILE *fp;\n"
3383 "    char *line = NULL;\n"
3384 "    size_t len = 0;\n"
3385 "    ssize_t read;\n"
3386 msgstr ""
3387
3388 #. type: Plain text
3389 #: build/C/man3/getline.3:156
3390 #, no-wrap
3391 msgid ""
3392 "    fp = fopen(\"/etc/motd\", \"r\");\n"
3393 "    if (fp == NULL)\n"
3394 "        exit(EXIT_FAILURE);\n"
3395 msgstr ""
3396
3397 #. type: Plain text
3398 #: build/C/man3/getline.3:161
3399 #, no-wrap
3400 msgid ""
3401 "    while ((read = getline(&line, &len, fp)) != -1) {\n"
3402 "        printf(\"Retrieved line of length %zu :\\en\", read);\n"
3403 "        printf(\"%s\", line);\n"
3404 "    }\n"
3405 msgstr ""
3406
3407 #. type: Plain text
3408 #: build/C/man3/getline.3:165
3409 #, no-wrap
3410 msgid ""
3411 "    free(line);\n"
3412 "    exit(EXIT_SUCCESS);\n"
3413 "}\n"
3414 msgstr ""
3415
3416 #. type: Plain text
3417 #: build/C/man3/getline.3:173
3418 msgid "B<read>(2), B<fgets>(3), B<fopen>(3), B<fread>(3), B<gets>(3), B<scanf>(3)"
3419 msgstr ""
3420
3421 #. type: TH
3422 #: build/C/man3/gets.3:25
3423 #, no-wrap
3424 msgid "GETS"
3425 msgstr ""
3426
3427 #. type: TH
3428 #: build/C/man3/gets.3:25
3429 #, no-wrap
3430 msgid "2012-01-18"
3431 msgstr ""
3432
3433 #. type: Plain text
3434 #: build/C/man3/gets.3:28
3435 msgid "fgetc, fgets, getc, getchar, gets, ungetc - input of characters and strings"
3436 msgstr ""
3437
3438 #. type: Plain text
3439 #: build/C/man3/gets.3:33
3440 #, no-wrap
3441 msgid "B<int fgetc(FILE *>I<stream>B<);>\n"
3442 msgstr ""
3443
3444 #. type: Plain text
3445 #: build/C/man3/gets.3:35
3446 #, no-wrap
3447 msgid "B<char *fgets(char *>I<s>B<, int >I<size>B<, FILE *>I<stream>B<);>\n"
3448 msgstr ""
3449
3450 #. type: Plain text
3451 #: build/C/man3/gets.3:37
3452 #, no-wrap
3453 msgid "B<int getc(FILE *>I<stream>B<);>\n"
3454 msgstr ""
3455
3456 #. type: Plain text
3457 #: build/C/man3/gets.3:39
3458 #, no-wrap
3459 msgid "B<int getchar(void);>\n"
3460 msgstr ""
3461
3462 #. type: Plain text
3463 #: build/C/man3/gets.3:41
3464 #, no-wrap
3465 msgid "B<char *gets(char *>I<s>B<);>\n"
3466 msgstr ""
3467
3468 #. type: Plain text
3469 #: build/C/man3/gets.3:43
3470 #, no-wrap
3471 msgid "B<int ungetc(int >I<c>B<, FILE *>I<stream>B<);>\n"
3472 msgstr ""
3473
3474 #. type: Plain text
3475 #: build/C/man3/gets.3:55
3476 msgid ""
3477 "B<fgetc>()  reads the next character from I<stream> and returns it as an "
3478 "I<unsigned char> cast to an I<int>, or B<EOF> on end of file or error."
3479 msgstr ""
3480
3481 #. type: Plain text
3482 #: build/C/man3/gets.3:62
3483 msgid ""
3484 "B<getc>()  is equivalent to B<fgetc>()  except that it may be implemented as "
3485 "a macro which evaluates I<stream> more than once."
3486 msgstr ""
3487
3488 #. type: Plain text
3489 #: build/C/man3/gets.3:66
3490 msgid "B<getchar>()  is equivalent to B<getc(>I<stdin>B<)>."
3491 msgstr ""
3492
3493 #. type: Plain text
3494 #: build/C/man3/gets.3:76
3495 msgid ""
3496 "B<gets>()  reads a line from I<stdin> into the buffer pointed to by I<s> "
3497 "until either a terminating newline or B<EOF>, which it replaces with a null "
3498 "byte (\\(aq\\e0\\(aq).  No check for buffer overrun is performed (see BUGS "
3499 "below)."
3500 msgstr ""
3501
3502 #. type: Plain text
3503 #: build/C/man3/gets.3:90
3504 msgid ""
3505 "B<fgets>()  reads in at most one less than I<size> characters from I<stream> "
3506 "and stores them into the buffer pointed to by I<s>.  Reading stops after an "
3507 "B<EOF> or a newline.  If a newline is read, it is stored into the buffer.  A "
3508 "terminating null byte (\\(aq\\e0\\(aq)  is stored after the last character "
3509 "in the buffer."
3510 msgstr ""
3511
3512 #. type: Plain text
3513 #: build/C/man3/gets.3:101
3514 msgid ""
3515 "B<ungetc>()  pushes I<c> back to I<stream>, cast to I<unsigned char>, where "
3516 "it is available for subsequent read operations.  Pushed-back characters will "
3517 "be returned in reverse order; only one pushback is guaranteed."
3518 msgstr ""
3519
3520 #. type: Plain text
3521 #: build/C/man3/gets.3:106
3522 msgid ""
3523 "Calls to the functions described here can be mixed with each other and with "
3524 "calls to other input functions from the I<stdio> library for the same input "
3525 "stream."
3526 msgstr ""
3527
3528 #. type: Plain text
3529 #: build/C/man3/gets.3:121
3530 msgid ""
3531 "B<fgetc>(), B<getc>()  and B<getchar>()  return the character read as an "
3532 "I<unsigned char> cast to an I<int> or B<EOF> on end of file or error."
3533 msgstr ""
3534
3535 #. type: Plain text
3536 #: build/C/man3/gets.3:129
3537 msgid ""
3538 "B<gets>()  and B<fgets>()  return I<s> on success, and NULL on error or when "
3539 "end of file occurs while no characters have been read."
3540 msgstr ""
3541
3542 #. type: Plain text
3543 #: build/C/man3/gets.3:136
3544 msgid "B<ungetc>()  returns I<c> on success, or B<EOF> on error."
3545 msgstr ""
3546
3547 #. type: Plain text
3548 #: build/C/man3/gets.3:138
3549 msgid "C89, C99, POSIX.1-2001."
3550 msgstr ""
3551
3552 #. type: Plain text
3553 #: build/C/man3/gets.3:150
3554 msgid ""
3555 "LSB deprecates B<gets>().  POSIX.1-2008 marks B<gets>()  obsolescent.  ISO "
3556 "C11 removes the specification of B<gets>()  from the C language, and since "
3557 "version 2.16, glibc header files don't expose the function declaration if "
3558 "the B<_ISOC11_SOURCE> feature test macro is defined."
3559 msgstr ""
3560
3561 #. type: Plain text
3562 #: build/C/man3/gets.3:164
3563 msgid ""
3564 "Never use B<gets>().  Because it is impossible to tell without knowing the "
3565 "data in advance how many characters B<gets>()  will read, and because "
3566 "B<gets>()  will continue to store characters past the end of the buffer, it "
3567 "is extremely dangerous to use.  It has been used to break computer "
3568 "security.  Use B<fgets>()  instead."
3569 msgstr ""
3570
3571 #. type: Plain text
3572 #: build/C/man3/gets.3:171
3573 msgid ""
3574 "It is not advisable to mix calls to input functions from the I<stdio> "
3575 "library with low-level calls to B<read>(2)  for the file descriptor "
3576 "associated with the input stream; the results will be undefined and very "
3577 "probably not what you want."
3578 msgstr ""
3579
3580 #. type: Plain text
3581 #: build/C/man3/gets.3:187
3582 msgid ""
3583 "B<read>(2), B<write>(2), B<ferror>(3), B<fgetwc>(3), B<fgetws>(3), "
3584 "B<fopen>(3), B<fread>(3), B<fseek>(3), B<getline>(3), B<getwchar>(3), "
3585 "B<puts>(3), B<scanf>(3), B<ungetwc>(3), B<unlocked_stdio>(3), "
3586 "B<feature_test_macros>(7)"
3587 msgstr ""
3588
3589 #. type: TH
3590 #: build/C/man3/getw.3:23
3591 #, no-wrap
3592 msgid "GETW"
3593 msgstr ""
3594
3595 #. type: TH
3596 #: build/C/man3/getw.3:23
3597 #, no-wrap
3598 msgid "2010-09-26"
3599 msgstr ""
3600
3601 #. type: Plain text
3602 #: build/C/man3/getw.3:26
3603 msgid "getw, putw - input and output of words (ints)"
3604 msgstr ""
3605
3606 #. type: Plain text
3607 #: build/C/man3/getw.3:31
3608 #, no-wrap
3609 msgid "B<int getw(FILE *>I<stream>B<);>\n"
3610 msgstr ""
3611
3612 #. type: Plain text
3613 #: build/C/man3/getw.3:33
3614 #, no-wrap
3615 msgid "B<int putw(int >I<w>B<, FILE *>I<stream>B<);>\n"
3616 msgstr ""
3617
3618 #. type: Plain text
3619 #: build/C/man3/getw.3:42
3620 msgid "B<getw>(), B<putw>():"
3621 msgstr ""
3622
3623 #. type: TP
3624 #: build/C/man3/getw.3:45
3625 #, no-wrap
3626 msgid "Since glibc 2.3.3:"
3627 msgstr ""
3628
3629 #. type: Plain text
3630 #: build/C/man3/getw.3:48
3631 msgid "_SVID_SOURCE || _BSD_SOURCE ||"
3632 msgstr ""
3633
3634 #. type: Plain text
3635 #: build/C/man3/getw.3:51
3636 #, no-wrap
3637 msgid ""
3638 "(_XOPEN_SOURCE &&\n"
3639 "    !(_POSIX_C_SOURCE\\ E<gt>=\\ 200112L || _XOPEN_SOURCE\\ E<gt>=\\ 600))\n"
3640 msgstr ""
3641
3642 #. type: TP
3643 #: build/C/man3/getw.3:51
3644 #, no-wrap
3645 msgid "Before glibc 2.3.3:"
3646 msgstr ""
3647
3648 #. type: Plain text
3649 #: build/C/man3/getw.3:54
3650 msgid "_SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE"
3651 msgstr ""
3652
3653 #. type: Plain text
3654 #: build/C/man3/getw.3:64
3655 msgid ""
3656 "B<getw>()  reads a word (that is, an I<int>) from I<stream>.  It's provided "
3657 "for compatibility with SVr4.  We recommend you use B<fread>(3)  instead."
3658 msgstr ""
3659
3660 #. type: Plain text
3661 #: build/C/man3/getw.3:71
3662 msgid ""
3663 "B<putw>()  writes the word I<w> (that is, an I<int>) to I<stream>.  It is "
3664 "provided for compatibility with SVr4, but we recommend you use B<fwrite>(3)  "
3665 "instead."
3666 msgstr ""
3667
3668 #. type: Plain text
3669 #: build/C/man3/getw.3:78
3670 msgid ""
3671 "Normally, B<getw>()  returns the word read, and B<putw>()  returns 0.  On "
3672 "error, they return B<EOF>."
3673 msgstr ""
3674
3675 #. type: Plain text
3676 #: build/C/man3/getw.3:80
3677 msgid "SVr4, SUSv2.  Not present in POSIX.1-2001."
3678 msgstr ""
3679
3680 #. type: Plain text
3681 #: build/C/man3/getw.3:84
3682 msgid ""
3683 "The value returned on error is also a legitimate data value.  B<ferror>(3)  "
3684 "can be used to distinguish between the two cases."
3685 msgstr ""
3686
3687 #. type: Plain text
3688 #: build/C/man3/getw.3:90
3689 msgid "B<ferror>(3), B<fread>(3), B<fwrite>(3), B<getc>(3), B<putc>(3)"
3690 msgstr ""
3691
3692 #. type: TH
3693 #: build/C/man2/link.2:31
3694 #, no-wrap
3695 msgid "LINK"
3696 msgstr ""
3697
3698 #. type: TH
3699 #: build/C/man2/link.2:31
3700 #, no-wrap
3701 msgid "2008-08-21"
3702 msgstr ""
3703
3704 #. type: Plain text
3705 #: build/C/man2/link.2:34
3706 msgid "link - make a new name for a file"
3707 msgstr ""
3708
3709 #. type: Plain text
3710 #: 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
3711 msgid "B<#include E<lt>unistd.hE<gt>>"
3712 msgstr ""
3713
3714 #. type: Plain text
3715 #: build/C/man2/link.2:38
3716 msgid "B<int link(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
3717 msgstr ""
3718
3719 #. type: Plain text
3720 #: build/C/man2/link.2:41
3721 msgid ""
3722 "B<link>()  creates a new link (also known as a hard link) to an existing "
3723 "file."
3724 msgstr ""
3725
3726 #. type: Plain text
3727 #: build/C/man2/link.2:47 build/C/man2/symlink.2:84
3728 msgid "If I<newpath> exists it will I<not> be overwritten."
3729 msgstr ""
3730
3731 #. type: Plain text
3732 #: build/C/man2/link.2:52
3733 msgid ""
3734 "This new name may be used exactly as the old one for any operation; both "
3735 "names refer to the same file (and so have the same permissions and "
3736 "ownership) and it is impossible to tell which name was the \"original\"."
3737 msgstr ""
3738
3739 #. type: Plain text
3740 #: build/C/man2/link.2:57 build/C/man2/pipe.2:97 build/C/man3/remove.3:65 build/C/man2/rename.2:96 build/C/man2/rmdir.2:45 build/C/man2/symlink.2:89 build/C/man2/unlink.2:60
3741 msgid ""
3742 "On success, zero is returned.  On error, -1 is returned, and I<errno> is set "
3743 "appropriately."
3744 msgstr ""
3745
3746 #. type: TP
3747 #: build/C/man2/link.2:58 build/C/man2/open.2:473 build/C/man2/readlink.2:84 build/C/man2/rename.2:97 build/C/man2/rmdir.2:46 build/C/man2/symlink.2:90 build/C/man3/tmpfile.3:53 build/C/man2/unlink.2:61
3748 #, no-wrap
3749 msgid "B<EACCES>"
3750 msgstr ""
3751
3752 #. type: Plain text
3753 #: build/C/man2/link.2:69
3754 msgid ""
3755 "Write access to the directory containing I<newpath> is denied, or search "
3756 "permission is denied for one of the directories in the path prefix of "
3757 "I<oldpath> or I<newpath>.  (See also B<path_resolution>(7).)"
3758 msgstr ""
3759
3760 #. type: TP
3761 #: build/C/man2/link.2:69 build/C/man2/open.2:482 build/C/man2/symlink.2:99 build/C/man3/tmpfile.3:56
3762 #, no-wrap
3763 msgid "B<EEXIST>"
3764 msgstr ""
3765
3766 #. type: Plain text
3767 #: build/C/man2/link.2:73 build/C/man2/symlink.2:103
3768 msgid "I<newpath> already exists."
3769 msgstr ""
3770
3771 #. type: TP
3772 #: build/C/man2/link.2:73 build/C/man2/llseek.2:69 build/C/man2/open.2:488 build/C/man2/pipe.2:98 build/C/man2/read.2:100 build/C/man2/readlink.2:89 build/C/man2/rename.2:133 build/C/man2/rmdir.2:64 build/C/man2/symlink.2:103 build/C/man2/unlink.2:80 build/C/man2/write.2:135
3773 #, no-wrap
3774 msgid "B<EFAULT>"
3775 msgstr ""
3776
3777 #. type: Plain text
3778 #: build/C/man2/link.2:76 build/C/man2/rename.2:136 build/C/man2/symlink.2:106
3779 msgid "I<oldpath> or I<newpath> points outside your accessible address space."
3780 msgstr ""
3781
3782 #. type: TP
3783 #: 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
3784 #, no-wrap
3785 msgid "B<EIO>"
3786 msgstr ""
3787
3788 #. type: Plain text
3789 #: build/C/man2/link.2:79 build/C/man2/symlink.2:109 build/C/man2/unlink.2:87
3790 msgid "An I/O error occurred."
3791 msgstr ""
3792
3793 #. type: TP
3794 #: build/C/man2/link.2:79 build/C/man2/open.2:512 build/C/man2/readlink.2:108 build/C/man2/rename.2:146 build/C/man2/rmdir.2:73 build/C/man2/symlink.2:109 build/C/man2/unlink.2:92
3795 #, no-wrap
3796 msgid "B<ELOOP>"
3797 msgstr ""
3798
3799 #. type: Plain text
3800 #: build/C/man2/link.2:83 build/C/man2/rename.2:150
3801 msgid ""
3802 "Too many symbolic links were encountered in resolving I<oldpath> or "
3803 "I<newpath>."
3804 msgstr ""
3805
3806 #. type: TP
3807 #: build/C/man2/link.2:83 build/C/man2/rename.2:150
3808 #, no-wrap
3809 msgid "B<EMLINK>"
3810 msgstr ""
3811
3812 #. type: Plain text
3813 #: build/C/man2/link.2:88
3814 msgid ""
3815 "The file referred to by I<oldpath> already has the maximum number of links "
3816 "to it."
3817 msgstr ""
3818
3819 #. type: TP
3820 #: build/C/man2/link.2:88 build/C/man2/open.2:522 build/C/man2/readlink.2:111 build/C/man2/rename.2:157 build/C/man2/rmdir.2:77 build/C/man2/symlink.2:113 build/C/man2/unlink.2:96
3821 #, no-wrap
3822 msgid "B<ENAMETOOLONG>"
3823 msgstr ""
3824
3825 #. type: Plain text
3826 #: build/C/man2/link.2:91 build/C/man2/rename.2:160 build/C/man2/symlink.2:116
3827 msgid "I<oldpath> or I<newpath> was too long."
3828 msgstr ""
3829
3830 #. type: TP
3831 #: build/C/man2/link.2:91 build/C/man2/open.2:536 build/C/man2/readlink.2:114 build/C/man2/rename.2:160 build/C/man2/rmdir.2:80 build/C/man2/symlink.2:116 build/C/man2/unlink.2:99
3832 #, no-wrap
3833 msgid "B<ENOENT>"
3834 msgstr ""
3835
3836 #. type: Plain text
3837 #: build/C/man2/link.2:96
3838 msgid ""
3839 "A directory component in I<oldpath> or I<newpath> does not exist or is a "
3840 "dangling symbolic link."
3841 msgstr ""
3842
3843 #. type: TP
3844 #: build/C/man2/link.2:96 build/C/man2/open.2:543 build/C/man2/readlink.2:117 build/C/man2/rename.2:173 build/C/man2/rmdir.2:85 build/C/man3/scanf.3:568 build/C/man2/symlink.2:123 build/C/man3/tempnam.3:91 build/C/man2/unlink.2:106
3845 #, no-wrap
3846 msgid "B<ENOMEM>"
3847 msgstr ""
3848
3849 #. type: Plain text
3850 #: build/C/man2/link.2:99 build/C/man2/open.2:546 build/C/man2/readlink.2:120 build/C/man2/rename.2:176 build/C/man2/rmdir.2:88 build/C/man2/symlink.2:126 build/C/man2/unlink.2:109
3851 msgid "Insufficient kernel memory was available."
3852 msgstr ""
3853
3854 #. type: TP
3855 #: build/C/man2/link.2:99 build/C/man2/open.2:546 build/C/man2/rename.2:176 build/C/man2/symlink.2:126 build/C/man3/tmpfile.3:68 build/C/man2/write.2:162
3856 #, no-wrap
3857 msgid "B<ENOSPC>"
3858 msgstr ""
3859
3860 #. type: Plain text
3861 #: build/C/man2/link.2:103 build/C/man2/rename.2:180 build/C/man2/symlink.2:130
3862 msgid "The device containing the file has no room for the new directory entry."
3863 msgstr ""
3864
3865 #. type: TP
3866 #: build/C/man2/link.2:103 build/C/man2/open.2:552 build/C/man2/readlink.2:120 build/C/man2/rename.2:180 build/C/man2/rmdir.2:88 build/C/man2/symlink.2:130 build/C/man2/unlink.2:109
3867 #, no-wrap
3868 msgid "B<ENOTDIR>"
3869 msgstr ""
3870
3871 #. type: Plain text
3872 #: build/C/man2/link.2:108
3873 msgid ""
3874 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
3875 "a directory."
3876 msgstr ""
3877
3878 #. type: TP
3879 #: build/C/man2/link.2:108 build/C/man2/link.2:112 build/C/man2/open.2:585 build/C/man2/rmdir.2:107 build/C/man2/rmdir.2:118 build/C/man2/symlink.2:135 build/C/man2/unlink.2:114
3880 #, no-wrap
3881 msgid "B<EPERM>"
3882 msgstr ""
3883
3884 #. type: Plain text
3885 #: build/C/man2/link.2:112
3886 msgid "I<oldpath> is a directory."
3887 msgstr ""
3888
3889 #. type: Plain text
3890 #: build/C/man2/link.2:117
3891 msgid ""
3892 "The file system containing I<oldpath> and I<newpath> does not support the "
3893 "creation of hard links."
3894 msgstr ""
3895
3896 #. type: TP
3897 #: build/C/man2/link.2:117 build/C/man2/open.2:593 build/C/man2/rename.2:218 build/C/man2/rmdir.2:123 build/C/man2/symlink.2:140 build/C/man3/tmpfile.3:71 build/C/man2/unlink.2:137
3898 #, no-wrap
3899 msgid "B<EROFS>"
3900 msgstr ""
3901
3902 #. type: Plain text
3903 #: build/C/man2/link.2:120 build/C/man2/rename.2:221
3904 msgid "The file is on a read-only file system."
3905 msgstr ""
3906
3907 #. type: TP
3908 #: build/C/man2/link.2:120 build/C/man2/rename.2:221
3909 #, no-wrap
3910 msgid "B<EXDEV>"
3911 msgstr ""
3912
3913 #. type: Plain text
3914 #: build/C/man2/link.2:128
3915 msgid ""
3916 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
3917 "permits a file system to be mounted at multiple points, but B<link>()  does "
3918 "not work across different mount points, even if the same file system is "
3919 "mounted on both.)"
3920 msgstr ""
3921
3922 #.  SVr4 documents additional ENOLINK and
3923 #.  EMULTIHOP error conditions; POSIX.1 does not document ELOOP.
3924 #.  X/OPEN does not document EFAULT, ENOMEM or EIO.
3925 #. type: Plain text
3926 #: build/C/man2/link.2:133
3927 msgid "SVr4, 4.3BSD, POSIX.1-2001 (but see NOTES)."
3928 msgstr ""
3929
3930 #. type: Plain text
3931 #: build/C/man2/link.2:140
3932 msgid ""
3933 "Hard links, as created by B<link>(), cannot span file systems.  Use "
3934 "B<symlink>(2)  if this is required."
3935 msgstr ""
3936
3937 #.  more precisely: since kernel 1.3.56
3938 #.  For example, the default Solaris compilation environment
3939 #.  behaves like Linux, and contributors to a March 2005
3940 #.  thread in the Austin mailing list reported that some
3941 #.  other (System V) implementations did/do the same -- MTK, Apr 05
3942 #. type: Plain text
3943 #: build/C/man2/link.2:171
3944 msgid ""
3945 "POSIX.1-2001 says that B<link>()  should dereference I<oldpath> if it is a "
3946 "symbolic link.  However, since kernel 2.0, Linux does not do so: if "
3947 "I<oldpath> is a symbolic link, then I<newpath> is created as a (hard) link "
3948 "to the same symbolic link file (i.e., I<newpath> becomes a symbolic link to "
3949 "the same file that I<oldpath> refers to).  Some other implementations behave "
3950 "in the same manner as Linux.  POSIX.1-2008 changes the specification of "
3951 "B<link>(), making it implementation-dependent whether or not I<oldpath> is "
3952 "dereferenced if it is a symbolic link.  For precise control over the "
3953 "treatment of symbolic links when creating a link, see B<linkat>(2)."
3954 msgstr ""
3955
3956 #. type: Plain text
3957 #: build/C/man2/link.2:177
3958 msgid ""
3959 "On NFS file systems, the return code may be wrong in case the NFS server "
3960 "performs the link creation and dies before it can say so.  Use B<stat>(2)  "
3961 "to find out if the link got created."
3962 msgstr ""
3963
3964 #. type: Plain text
3965 #: build/C/man2/link.2:187
3966 msgid ""
3967 "B<ln>(1), B<linkat>(2), B<open>(2), B<rename>(2), B<stat>(2), B<symlink>(2), "
3968 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
3969 msgstr ""
3970
3971 #. type: TH
3972 #: build/C/man2/llseek.2:26
3973 #, no-wrap
3974 msgid "LLSEEK"
3975 msgstr ""
3976
3977 #. type: TH
3978 #: build/C/man2/llseek.2:26
3979 #, no-wrap
3980 msgid "2007-06-01"
3981 msgstr ""
3982
3983 #. type: Plain text
3984 #: build/C/man2/llseek.2:29
3985 msgid "_llseek - reposition read/write file offset"
3986 msgstr ""
3987
3988 #. type: Plain text
3989 #: build/C/man2/llseek.2:33
3990 #, no-wrap
3991 msgid ""
3992 "B<#include E<lt>sys/types.hE<gt>>\n"
3993 "B<#include E<lt>unistd.hE<gt>>\n"
3994 msgstr ""
3995
3996 #. type: Plain text
3997 #: build/C/man2/llseek.2:37
3998 #, no-wrap
3999 msgid ""
4000 "B<int _llseek(unsigned int >I<fd>B<, unsigned long >I<offset_high>B<,>\n"
4001 "B<            unsigned long >I<offset_low>B<, loff_t *>I<result>B<,>\n"
4002 "B<            unsigned int >I<whence>B<);>\n"
4003 msgstr ""
4004
4005 #. type: Plain text
4006 #: build/C/man2/llseek.2:57
4007 msgid ""
4008 "The B<_llseek>()  function repositions the offset of the open file "
4009 "associated with the file descriptor I<fd> to I<(offset_highE<lt>E<lt>32) | "
4010 "offset_low> bytes relative to the beginning of the file, the current "
4011 "position in the file, or the end of the file, depending on whether I<whence> "
4012 "is B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively.  It returns the "
4013 "resulting file position in the argument I<result>."
4014 msgstr ""
4015
4016 #. type: Plain text
4017 #: build/C/man2/llseek.2:64
4018 msgid ""
4019 "Upon successful completion, B<_llseek>()  returns 0.  Otherwise, a value of "
4020 "-1 is returned and I<errno> is set to indicate the error."
4021 msgstr ""
4022
4023 #. type: Plain text
4024 #: build/C/man2/llseek.2:69 build/C/man2/lseek.2:164
4025 msgid "I<fd> is not an open file descriptor."
4026 msgstr ""
4027
4028 #. type: Plain text
4029 #: build/C/man2/llseek.2:72
4030 msgid "Problem with copying results to user space."
4031 msgstr ""
4032
4033 #. type: Plain text
4034 #: build/C/man2/llseek.2:76
4035 msgid "I<whence> is invalid."
4036 msgstr ""
4037
4038 #. type: Plain text
4039 #: build/C/man2/llseek.2:79
4040 msgid ""
4041 "This function is Linux-specific, and should not be used in programs intended "
4042 "to be portable."
4043 msgstr ""
4044
4045 #. type: Plain text
4046 #: build/C/man2/llseek.2:82
4047 msgid ""
4048 "Glibc does not provide a wrapper for this system call; call it using "
4049 "B<syscall>(2)."
4050 msgstr ""
4051
4052 #. type: Plain text
4053 #: build/C/man2/llseek.2:85
4054 msgid "B<lseek>(2), B<lseek64>(3)"
4055 msgstr ""
4056
4057 #. type: TH
4058 #: build/C/man2/lseek.2:45
4059 #, no-wrap
4060 msgid "LSEEK"
4061 msgstr ""
4062
4063 #. type: TH
4064 #: build/C/man2/lseek.2:45
4065 #, no-wrap
4066 msgid "2011-09-25"
4067 msgstr ""
4068
4069 #. type: Plain text
4070 #: build/C/man2/lseek.2:48
4071 msgid "lseek - reposition read/write file offset"
4072 msgstr ""
4073
4074 #. type: Plain text
4075 #: build/C/man2/lseek.2:50 build/C/man3/lseek64.3:30
4076 msgid "B<#include E<lt>sys/types.hE<gt>>"
4077 msgstr ""
4078
4079 #. type: Plain text
4080 #: build/C/man2/lseek.2:54
4081 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>"
4082 msgstr ""
4083
4084 #. type: Plain text
4085 #: build/C/man2/lseek.2:65
4086 msgid ""
4087 "The B<lseek>()  function repositions the offset of the open file associated "
4088 "with the file descriptor I<fd> to the argument I<offset> according to the "
4089 "directive I<whence> as follows:"
4090 msgstr ""
4091
4092 #. type: Plain text
4093 #: build/C/man2/lseek.2:70
4094 msgid "The offset is set to I<offset> bytes."
4095 msgstr ""
4096
4097 #. type: Plain text
4098 #: build/C/man2/lseek.2:75
4099 msgid "The offset is set to its current location plus I<offset> bytes."
4100 msgstr ""
4101
4102 #. type: Plain text
4103 #: build/C/man2/lseek.2:80
4104 msgid "The offset is set to the size of the file plus I<offset> bytes."
4105 msgstr ""
4106
4107 #. type: Plain text
4108 #: build/C/man2/lseek.2:88
4109 msgid ""
4110 "The B<lseek>()  function allows the file offset to be set beyond the end of "
4111 "the file (but this does not change the size of the file).  If data is later "
4112 "written at this point, subsequent reads of the data in the gap (a \"hole\") "
4113 "return null bytes (\\(aq\\e0\\(aq) until data is actually written into the "
4114 "gap."
4115 msgstr ""
4116
4117 #. type: SS
4118 #: build/C/man2/lseek.2:88
4119 #, no-wrap
4120 msgid "Seeking file data and holes"
4121 msgstr ""
4122
4123 #. type: Plain text
4124 #: build/C/man2/lseek.2:91
4125 msgid ""
4126 "Since version 3.1, Linux supports the following additional values for "
4127 "I<whence>:"
4128 msgstr ""
4129
4130 #. type: TP
4131 #: build/C/man2/lseek.2:91
4132 #, no-wrap
4133 msgid "B<SEEK_DATA>"
4134 msgstr ""
4135
4136 #. type: Plain text
4137 #: build/C/man2/lseek.2:102
4138 msgid ""
4139 "Adjust the file offset to the next location in the file greater than or "
4140 "equal to I<offset> containing data.  If I<offset> points to data, then the "
4141 "file offset is set to I<offset>."
4142 msgstr ""
4143
4144 #. type: TP
4145 #: build/C/man2/lseek.2:102
4146 #, no-wrap
4147 msgid "B<SEEK_HOLE>"
4148 msgstr ""
4149
4150 #. type: Plain text
4151 #: build/C/man2/lseek.2:116
4152 msgid ""
4153 "Adjust the file offset to the next hole in the file greater than or equal to "
4154 "I<offset>.  If I<offset> points into the middle of a hole, then the file "
4155 "offset is set to I<offset>.  If there is no hole past I<offset>, then the "
4156 "file offset is adjusted to the end of the file (i.e., there is an implicit "
4157 "hole at the end of any file)."
4158 msgstr ""
4159
4160 #. type: Plain text
4161 #: build/C/man2/lseek.2:122
4162 msgid ""
4163 "In both of the above cases, B<lseek>()  fails if I<offset> points past the "
4164 "end of the file."
4165 msgstr ""
4166
4167 #. type: Plain text
4168 #: build/C/man2/lseek.2:128
4169 msgid ""
4170 "These operations allow applications to map holes in a sparsely allocated "
4171 "file.  This can be useful for applications such as file backup tools, which "
4172 "can save space when creating backups and preserve holes, if they have a "
4173 "mechanism for discovering holes."
4174 msgstr ""
4175
4176 #.  https://lkml.org/lkml/2011/4/22/79
4177 #.  http://lwn.net/Articles/440255/
4178 #.  http://blogs.oracle.com/bonwick/entry/seek_hole_and_seek_data
4179 #. type: Plain text
4180 #: build/C/man2/lseek.2:151
4181 msgid ""
4182 "For the purposes of these operations, a hole is a sequence of zeros that "
4183 "(normally) has not been allocated in the underlying file storage.  However, "
4184 "a file system is not obliged to report holes, so these operations are not a "
4185 "guaranteed mechanism for mapping the storage space actually allocated to a "
4186 "file.  (Furthermore, a sequence of zeros that actually has been written to "
4187 "the underlying storage may not be reported as a hole.)  In the simplest "
4188 "implementation, a file system can support the operations by making "
4189 "B<SEEK_HOLE> always return the offset of the end of the file, and making "
4190 "B<SEEK_DATA> always return I<offset> (i.e., even if the location referred to "
4191 "by I<offset> is a hole, it can be considered to consist of data that is a "
4192 "sequence of zeros)."
4193 msgstr ""
4194
4195 #. type: Plain text
4196 #: build/C/man2/lseek.2:159
4197 msgid ""
4198 "Upon successful completion, B<lseek>()  returns the resulting offset "
4199 "location as measured in bytes from the beginning of the file.  On error, the "
4200 "value I<(off_t)\\ -1> is returned and I<errno> is set to indicate the error."
4201 msgstr ""
4202
4203 #.  Some systems may allow negative offsets for character devices
4204 #.  and/or for remote file systems.
4205 #. type: Plain text
4206 #: build/C/man2/lseek.2:172
4207 msgid ""
4208 "I<whence> is not valid.  Or: the resulting file offset would be negative, or "
4209 "beyond the end of a seekable device."
4210 msgstr ""
4211
4212 #. type: TP
4213 #: build/C/man2/lseek.2:172 build/C/man2/open.2:565
4214 #, no-wrap
4215 msgid "B<EOVERFLOW>"
4216 msgstr ""
4217
4218 #.  HP-UX 11 says EINVAL for this case (but POSIX.1 says EOVERFLOW)
4219 #. type: Plain text
4220 #: build/C/man2/lseek.2:177
4221 msgid "The resulting file offset cannot be represented in an I<off_t>."
4222 msgstr ""
4223
4224 #. type: TP
4225 #: build/C/man2/lseek.2:177
4226 #, no-wrap
4227 msgid "B<ESPIPE>"
4228 msgstr ""
4229
4230 #. type: Plain text
4231 #: build/C/man2/lseek.2:181
4232 msgid "I<fd> is associated with a pipe, socket, or FIFO."
4233 msgstr ""
4234
4235 #. type: TP
4236 #: build/C/man2/lseek.2:181 build/C/man2/open.2:559
4237 #, no-wrap
4238 msgid "B<ENXIO>"
4239 msgstr ""
4240
4241 #. type: Plain text
4242 #: build/C/man2/lseek.2:189
4243 msgid ""
4244 "I<whence> is B<SEEK_DATA> or B<SEEK_HOLE>, and the current file offset is "
4245 "beyond the end of the file."
4246 msgstr ""
4247
4248 #.  SVr4 documents additional error
4249 #.  conditions EDEADLK, ENOLCK, ENOLNK, ENOSR, ENXIO, or ERANGE.
4250 #. type: Plain text
4251 #: 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
4252 msgid "SVr4, 4.3BSD, POSIX.1-2001."
4253 msgstr ""
4254
4255 #.  FIXME . Review http://austingroupbugs.net/view.php?id=415 in the future
4256 #. type: Plain text
4257 #: build/C/man2/lseek.2:199
4258 msgid ""
4259 "B<SEEK_DATA> and B<SEEK_HOLE> are nonstandard extensions also present in "
4260 "Solaris, FreeBSD, and DragonFly BSD; they are proposed for inclusion in the "
4261 "next POSIX revision (Issue 8)."
4262 msgstr ""
4263
4264 #. type: Plain text
4265 #: build/C/man2/lseek.2:203
4266 msgid ""
4267 "Some devices are incapable of seeking and POSIX does not specify which "
4268 "devices must support B<lseek>()."
4269 msgstr ""
4270
4271 #.  Other systems return the number of written characters,
4272 #.  using SEEK_SET to set the counter. (Of written characters.)
4273 #. type: Plain text
4274 #: build/C/man2/lseek.2:210
4275 msgid "On Linux, using B<lseek>()  on a tty device returns B<ESPIPE>."
4276 msgstr ""
4277
4278 #. type: Plain text
4279 #: build/C/man2/lseek.2:213
4280 msgid ""
4281 "When converting old code, substitute values for I<whence> with the following "
4282 "macros:"
4283 msgstr ""
4284
4285 #. type: tbl table
4286 #: build/C/man2/lseek.2:216
4287 #, no-wrap
4288 msgid "old\tnew\n"
4289 msgstr ""
4290
4291 #. type: tbl table
4292 #: build/C/man2/lseek.2:217
4293 #, no-wrap
4294 msgid "0\tSEEK_SET\n"
4295 msgstr ""
4296
4297 #. type: tbl table
4298 #: build/C/man2/lseek.2:218
4299 #, no-wrap
4300 msgid "1\tSEEK_CUR\n"
4301 msgstr ""
4302
4303 #. type: tbl table
4304 #: build/C/man2/lseek.2:219
4305 #, no-wrap
4306 msgid "2\tSEEK_END\n"
4307 msgstr ""
4308
4309 #. type: tbl table
4310 #: build/C/man2/lseek.2:220
4311 #, no-wrap
4312 msgid "L_SET\tSEEK_SET\n"
4313 msgstr ""
4314
4315 #. type: tbl table
4316 #: build/C/man2/lseek.2:221
4317 #, no-wrap
4318 msgid "L_INCR\tSEEK_CUR\n"
4319 msgstr ""
4320
4321 #. type: tbl table
4322 #: build/C/man2/lseek.2:222
4323 #, no-wrap
4324 msgid "L_XTND\tSEEK_END\n"
4325 msgstr ""
4326
4327 #. type: Plain text
4328 #: build/C/man2/lseek.2:234
4329 msgid ""
4330 "Note that file descriptors created by B<dup>(2)  or B<fork>(2)  share the "
4331 "current file position pointer, so seeking on such files may be subject to "
4332 "race conditions."
4333 msgstr ""
4334
4335 #. type: Plain text
4336 #: build/C/man2/lseek.2:241
4337 msgid ""
4338 "B<dup>(2), B<fork>(2), B<open>(2), B<fseek>(3), B<lseek64>(3), "
4339 "B<posix_fallocate>(3)"
4340 msgstr ""
4341
4342 #. type: TH
4343 #: build/C/man3/lseek64.3:23
4344 #, no-wrap
4345 msgid "LSEEK64"
4346 msgstr ""
4347
4348 #. type: TH
4349 #: build/C/man3/lseek64.3:23
4350 #, no-wrap
4351 msgid "2004-12-11"
4352 msgstr ""
4353
4354 #. type: Plain text
4355 #: build/C/man3/lseek64.3:26
4356 msgid "lseek64 - reposition 64-bit read/write file offset"
4357 msgstr ""
4358
4359 #. type: Plain text
4360 #: build/C/man3/lseek64.3:28
4361 msgid "B<#define _LARGEFILE64_SOURCE> /* See feature_test_macros(7) */"
4362 msgstr ""
4363
4364 #. type: Plain text
4365 #: build/C/man3/lseek64.3:34
4366 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>"
4367 msgstr ""
4368
4369 #. type: Plain text
4370 #: build/C/man3/lseek64.3:51
4371 msgid ""
4372 "The B<lseek>(2)  family of functions reposition the offset of the open file "
4373 "associated with the file descriptor I<fd> to I<offset> bytes relative to the "
4374 "start, current position, or end of the file, when I<whence> has the value "
4375 "B<SEEK_SET>, B<SEEK_CUR>, or B<SEEK_END>, respectively."
4376 msgstr ""
4377
4378 #. type: Plain text
4379 #: build/C/man3/lseek64.3:54
4380 msgid "For more details, return value, and errors, see B<lseek>(2)."
4381 msgstr ""
4382
4383 #. type: Plain text
4384 #: build/C/man3/lseek64.3:61
4385 msgid ""
4386 "Four interfaces are available: B<lseek>(2), B<lseek64>(), B<llseek>(2), and "
4387 "the raw system call B<_llseek>(2)."
4388 msgstr ""
4389
4390 #. type: SS
4391 #: build/C/man3/lseek64.3:61
4392 #, no-wrap
4393 msgid "lseek"
4394 msgstr ""
4395
4396 #. type: Plain text
4397 #: build/C/man3/lseek64.3:63 build/C/man3/lseek64.3:85 build/C/man3/lseek64.3:114
4398 msgid "Prototype:"
4399 msgstr ""
4400
4401 #. type: Plain text
4402 #: build/C/man3/lseek64.3:67
4403 #, no-wrap
4404 msgid "B<off_t lseek(int >I<fd>B<, off_t >I<offset>B<, int >I<whence>B<);>\n"
4405 msgstr ""
4406
4407 #. type: Plain text
4408 #: build/C/man3/lseek64.3:75
4409 msgid ""
4410 "B<lseek>(2)  uses the type I<off_t>.  This is a 32-bit signed type on 32-bit "
4411 "architectures, unless one compiles with"
4412 msgstr ""
4413
4414 #. type: Plain text
4415 #: build/C/man3/lseek64.3:83
4416 msgid "in which case it is a 64-bit signed type."
4417 msgstr ""
4418
4419 #. type: SS
4420 #: build/C/man3/lseek64.3:83
4421 #, no-wrap
4422 msgid "lseek64"
4423 msgstr ""
4424
4425 #. type: Plain text
4426 #: build/C/man3/lseek64.3:89
4427 #, no-wrap
4428 msgid "B<off64_t lseek64(int >I<fd>B<, off64_t >I<offset>B<, int >I<whence>B<);>\n"
4429 msgstr ""
4430
4431 #. type: Plain text
4432 #: build/C/man3/lseek64.3:100
4433 msgid ""
4434 "The library routine B<lseek64>()  uses a 64-bit type even when I<off_t> is a "
4435 "32-bit type.  Its prototype (and the type I<off64_t>)  is available only "
4436 "when one compiles with"
4437 msgstr ""
4438
4439 #. type: Plain text
4440 #: build/C/man3/lseek64.3:104
4441 #, no-wrap
4442 msgid "#define _LARGEFILE64_SOURCE\n"
4443 msgstr ""
4444
4445 #.  in glibc 2.0.94, not in 2.0.6
4446 #. type: Plain text
4447 #: build/C/man3/lseek64.3:112
4448 msgid ""
4449 "The function B<lseek64>()  is available since glibc 2.1, and is defined to "
4450 "be an alias for B<llseek>()."
4451 msgstr ""
4452
4453 #. type: SS
4454 #: build/C/man3/lseek64.3:112
4455 #, no-wrap
4456 msgid "llseek"
4457 msgstr ""
4458
4459 #. type: Plain text
4460 #: build/C/man3/lseek64.3:118
4461 #, no-wrap
4462 msgid "B<loff_t llseek(int >I<fd>B<, loff_t >I<offset>B<, int >I<whence>B<);>\n"
4463 msgstr ""
4464
4465 #.  in libc 5.0.9, not in 4.7.6
4466 #. type: Plain text
4467 #: build/C/man3/lseek64.3:137
4468 msgid ""
4469 "The type I<loff_t> is a 64-bit signed type.  The library routine B<llseek>()  "
4470 "is available in libc5 and glibc and works without special defines.  Its "
4471 "prototype was given in I<E<lt>unistd.hE<gt>> with libc5, but glibc does not "
4472 "provide a prototype.  This is bad, since a prototype is needed.  Users "
4473 "should add the above prototype, or something equivalent, to their own "
4474 "source.  When users complained about data loss caused by a miscompilation of "
4475 "B<e2fsck>(8), glibc 2.1.3 added the link-time warning"
4476 msgstr ""
4477
4478 #. type: Plain text
4479 #: build/C/man3/lseek64.3:140
4480 msgid "the \\`llseek\\' function may be dangerous; use \\`lseek64\\' instead."
4481 msgstr ""
4482
4483 #. type: Plain text
4484 #: build/C/man3/lseek64.3:144
4485 msgid "This makes this function unusable if one desires a warning-free compilation."
4486 msgstr ""
4487
4488 #. type: SS
4489 #: build/C/man3/lseek64.3:144
4490 #, no-wrap
4491 msgid "_llseek"
4492 msgstr ""
4493
4494 #. type: Plain text
4495 #: build/C/man3/lseek64.3:147
4496 msgid ""
4497 "All the above functions are implemented in terms of this system call.  The "
4498 "prototype is:"
4499 msgstr ""
4500
4501 #. type: Plain text
4502 #: build/C/man3/lseek64.3:152
4503 #, no-wrap
4504 msgid ""
4505 "B<int _llseek(int >I<fd>B<, off_t >I<offset_hi>B<, off_t >I<offset_lo>B<,>\n"
4506 "B<            loff_t *>I<result>B<, int >I<whence>B<);>\n"
4507 msgstr ""
4508
4509 #. type: Plain text
4510 #: build/C/man3/lseek64.3:157
4511 msgid "For more details, see B<llseek>(2)."
4512 msgstr ""
4513
4514 #. type: Plain text
4515 #: build/C/man3/lseek64.3:160
4516 msgid "B<llseek>(2), B<lseek>(2)"
4517 msgstr ""
4518
4519 #. type: TH
4520 #: build/C/man2/open.2:52
4521 #, no-wrap
4522 msgid "OPEN"
4523 msgstr ""
4524
4525 #. type: TH
4526 #: build/C/man2/open.2:52
4527 #, no-wrap
4528 msgid "2012-02-27"
4529 msgstr ""
4530
4531 #. type: Plain text
4532 #: build/C/man2/open.2:55
4533 msgid "open, creat - open and possibly create a file or device"
4534 msgstr ""
4535
4536 #. type: Plain text
4537 #: build/C/man2/open.2:60
4538 #, no-wrap
4539 msgid ""
4540 "B<#include E<lt>sys/types.hE<gt>>\n"
4541 "B<#include E<lt>sys/stat.hE<gt>>\n"
4542 "B<#include E<lt>fcntl.hE<gt>>\n"
4543 msgstr ""
4544
4545 #. type: Plain text
4546 #: build/C/man2/open.2:63
4547 #, no-wrap
4548 msgid ""
4549 "B<int open(const char *>I<pathname>B<, int >I<flags>B<);>\n"
4550 "B<int open(const char *>I<pathname>B<, int >I<flags>B<, mode_t "
4551 ">I<mode>B<);>\n"
4552 msgstr ""
4553
4554 #. type: Plain text
4555 #: build/C/man2/open.2:65
4556 #, no-wrap
4557 msgid "B<int creat(const char *>I<pathname>B<, mode_t >I<mode>B<);>\n"
4558 msgstr ""
4559
4560 #. type: Plain text
4561 #: build/C/man2/open.2:76
4562 msgid ""
4563 "Given a I<pathname> for a file, B<open>()  returns a file descriptor, a "
4564 "small, nonnegative integer for use in subsequent system calls (B<read>(2), "
4565 "B<write>(2), B<lseek>(2), B<fcntl>(2), etc.).  The file descriptor returned "
4566 "by a successful call will be the lowest-numbered file descriptor not "
4567 "currently open for the process."
4568 msgstr ""
4569
4570 #. type: Plain text
4571 #: build/C/man2/open.2:88
4572 msgid ""
4573 "By default, the new file descriptor is set to remain open across an "
4574 "B<execve>(2)  (i.e., the B<FD_CLOEXEC> file descriptor flag described in "
4575 "B<fcntl>(2)  is initially disabled; the B<O_CLOEXEC> flag, described below, "
4576 "can be used to change this default).  The file offset is set to the "
4577 "beginning of the file (see B<lseek>(2))."
4578 msgstr ""
4579
4580 #. type: Plain text
4581 #: build/C/man2/open.2:107
4582 msgid ""
4583 "A call to B<open>()  creates a new I<open file description>, an entry in the "
4584 "system-wide table of open files.  This entry records the file offset and the "
4585 "file status flags (modifiable via the B<fcntl>(2)  B<F_SETFL> operation).  A "
4586 "file descriptor is a reference to one of these entries; this reference is "
4587 "unaffected if I<pathname> is subsequently removed or modified to refer to a "
4588 "different file.  The new open file description is initially not shared with "
4589 "any other process, but sharing may arise via B<fork>(2)."
4590 msgstr ""
4591
4592 #. type: Plain text
4593 #: build/C/man2/open.2:115
4594 msgid ""
4595 "The argument I<flags> must include one of the following I<access modes>: "
4596 "B<O_RDONLY>, B<O_WRONLY>, or B<O_RDWR>.  These request opening the file "
4597 "read-only, write-only, or read/write, respectively."
4598 msgstr ""
4599
4600 #.  FIXME . Actually is it true that the "file status flags" are all of the
4601 #.  remaining flags listed below?  SUSv4 divides the flags into:
4602 #.  * Access mode
4603 #.  * File creation
4604 #.  * File status
4605 #.  * Other (O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW)
4606 #.  though it's not clear what the difference between "other" and
4607 #.  "File creation" flags is.  (I've raised an Aardvark to see if this
4608 #.  can be clarified in SUSv4; 10 Oct 2008.)
4609 #. type: Plain text
4610 #: build/C/man2/open.2:142
4611 msgid ""
4612 "In addition, zero or more file creation flags and file status flags can be "
4613 "bitwise-I<or>'d in I<flags>.  The I<file creation flags> are B<O_CREAT>, "
4614 "B<O_EXCL>, B<O_NOCTTY>, and B<O_TRUNC>.  The I<file status flags> are all of "
4615 "the remaining flags listed below.  The distinction between these two groups "
4616 "of flags is that the file status flags can be retrieved and (in some cases)  "
4617 "modified using B<fcntl>(2).  The full list of file creation flags and file "
4618 "status flags is as follows:"
4619 msgstr ""
4620
4621 #. type: TP
4622 #: build/C/man2/open.2:142
4623 #, no-wrap
4624 msgid "B<O_APPEND>"
4625 msgstr ""
4626
4627 #.  For more background, see
4628 #.  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453946
4629 #.  http://nfs.sourceforge.net/
4630 #. type: Plain text
4631 #: build/C/man2/open.2:159
4632 msgid ""
4633 "The file is opened in append mode.  Before each B<write>(2), the file offset "
4634 "is positioned at the end of the file, as if with B<lseek>(2).  B<O_APPEND> "
4635 "may lead to corrupted files on NFS file systems if more than one process "
4636 "appends data to a file at once.  This is because NFS does not support "
4637 "appending to a file, so the client kernel has to simulate it, which can't be "
4638 "done without a race condition."
4639 msgstr ""
4640
4641 #. type: TP
4642 #: build/C/man2/open.2:159
4643 #, no-wrap
4644 msgid "B<O_ASYNC>"
4645 msgstr ""
4646
4647 #. type: Plain text
4648 #: build/C/man2/open.2:172
4649 msgid ""
4650 "Enable signal-driven I/O: generate a signal (B<SIGIO> by default, but this "
4651 "can be changed via B<fcntl>(2))  when input or output becomes possible on "
4652 "this file descriptor.  This feature is only available for terminals, "
4653 "pseudoterminals, sockets, and (since Linux 2.6) pipes and FIFOs.  See "
4654 "B<fcntl>(2)  for further details."
4655 msgstr ""
4656
4657 #. type: TP
4658 #: build/C/man2/open.2:172
4659 #, no-wrap
4660 msgid "B<O_CLOEXEC> (Since Linux 2.6.23)"
4661 msgstr ""
4662
4663 #.  This flag fixes only one form of the race condition;
4664 #.  The race can also occur with, for example, descriptors
4665 #.  returned by accept(), pipe(), etc.
4666 #. type: Plain text
4667 #: build/C/man2/open.2:197
4668 msgid ""
4669 "Enable the close-on-exec flag for the new file descriptor.  Specifying this "
4670 "flag permits a program to avoid additional B<fcntl>(2)  B<F_SETFD> "
4671 "operations to set the B<FD_CLOEXEC> flag.  Additionally, use of this flag is "
4672 "essential in some multithreaded programs since using a separate B<fcntl>(2)  "
4673 "B<F_SETFD> operation to set the B<FD_CLOEXEC> flag does not suffice to avoid "
4674 "race conditions where one thread opens a file descriptor at the same time as "
4675 "another thread does a B<fork>(2)  plus B<execve>(2)."
4676 msgstr ""
4677
4678 #. type: TP
4679 #: build/C/man2/open.2:197
4680 #, no-wrap
4681 msgid "B<O_CREAT>"
4682 msgstr ""
4683
4684 #.  As at 2.6.25, bsdgroups is supported by ext2, ext3, ext4, and
4685 #.  XFS (since 2.6.14).
4686 #. type: Plain text
4687 #: build/C/man2/open.2:213
4688 msgid ""
4689 "If the file does not exist it will be created.  The owner (user ID) of the "
4690 "file is set to the effective user ID of the process.  The group ownership "
4691 "(group ID) is set either to the effective group ID of the process or to the "
4692 "group ID of the parent directory (depending on file system type and mount "
4693 "options, and the mode of the parent directory, see the mount options "
4694 "I<bsdgroups> and I<sysvgroups> described in B<mount>(8))."
4695 msgstr ""
4696
4697 #. type: Plain text
4698 #: build/C/man2/open.2:236
4699 msgid ""
4700 "I<mode> specifies the permissions to use in case a new file is created.  "
4701 "This argument must be supplied when B<O_CREAT> is specified in I<flags>; if "
4702 "B<O_CREAT> is not specified, then I<mode> is ignored.  The effective "
4703 "permissions are modified by the process's I<umask> in the usual way: The "
4704 "permissions of the created file are I<(mode\\ &\\ ~umask)>.  Note that this "
4705 "mode only applies to future accesses of the newly created file; the "
4706 "B<open>()  call that creates a read-only file may well return a read/write "
4707 "file descriptor."
4708 msgstr ""
4709
4710 #. type: Plain text
4711 #: build/C/man2/open.2:239
4712 msgid "The following symbolic constants are provided for I<mode>:"
4713 msgstr ""
4714
4715 #. type: TP
4716 #: build/C/man2/open.2:239
4717 #, no-wrap
4718 msgid "B<S_IRWXU>"
4719 msgstr ""
4720
4721 #. type: Plain text
4722 #: build/C/man2/open.2:242
4723 msgid "00700 user (file owner) has read, write and execute permission"
4724 msgstr ""
4725
4726 #. type: TP
4727 #: build/C/man2/open.2:242
4728 #, no-wrap
4729 msgid "B<S_IRUSR>"
4730 msgstr ""
4731
4732 #. type: Plain text
4733 #: build/C/man2/open.2:245
4734 msgid "00400 user has read permission"
4735 msgstr ""
4736
4737 #. type: TP
4738 #: build/C/man2/open.2:245
4739 #, no-wrap
4740 msgid "B<S_IWUSR>"
4741 msgstr ""
4742
4743 #. type: Plain text
4744 #: build/C/man2/open.2:248
4745 msgid "00200 user has write permission"
4746 msgstr ""
4747
4748 #. type: TP
4749 #: build/C/man2/open.2:248
4750 #, no-wrap
4751 msgid "B<S_IXUSR>"
4752 msgstr ""
4753
4754 #. type: Plain text
4755 #: build/C/man2/open.2:251
4756 msgid "00100 user has execute permission"
4757 msgstr ""
4758
4759 #. type: TP
4760 #: build/C/man2/open.2:251
4761 #, no-wrap
4762 msgid "B<S_IRWXG>"
4763 msgstr ""
4764
4765 #. type: Plain text
4766 #: build/C/man2/open.2:254
4767 msgid "00070 group has read, write and execute permission"
4768 msgstr ""
4769
4770 #. type: TP
4771 #: build/C/man2/open.2:254
4772 #, no-wrap
4773 msgid "B<S_IRGRP>"
4774 msgstr ""
4775
4776 #. type: Plain text
4777 #: build/C/man2/open.2:257
4778 msgid "00040 group has read permission"
4779 msgstr ""
4780
4781 #. type: TP
4782 #: build/C/man2/open.2:257
4783 #, no-wrap
4784 msgid "B<S_IWGRP>"
4785 msgstr ""
4786
4787 #. type: Plain text
4788 #: build/C/man2/open.2:260
4789 msgid "00020 group has write permission"
4790 msgstr ""
4791
4792 #. type: TP
4793 #: build/C/man2/open.2:260
4794 #, no-wrap
4795 msgid "B<S_IXGRP>"
4796 msgstr ""
4797
4798 #. type: Plain text
4799 #: build/C/man2/open.2:263
4800 msgid "00010 group has execute permission"
4801 msgstr ""
4802
4803 #. type: TP
4804 #: build/C/man2/open.2:263
4805 #, no-wrap
4806 msgid "B<S_IRWXO>"
4807 msgstr ""
4808
4809 #. type: Plain text
4810 #: build/C/man2/open.2:266
4811 msgid "00007 others have read, write and execute permission"
4812 msgstr ""
4813
4814 #. type: TP
4815 #: build/C/man2/open.2:266
4816 #, no-wrap
4817 msgid "B<S_IROTH>"
4818 msgstr ""
4819
4820 #. type: Plain text
4821 #: build/C/man2/open.2:269
4822 msgid "00004 others have read permission"
4823 msgstr ""
4824
4825 #. type: TP
4826 #: build/C/man2/open.2:269
4827 #, no-wrap
4828 msgid "B<S_IWOTH>"
4829 msgstr ""
4830
4831 #. type: Plain text
4832 #: build/C/man2/open.2:272
4833 msgid "00002 others have write permission"
4834 msgstr ""
4835
4836 #. type: TP
4837 #: build/C/man2/open.2:272
4838 #, no-wrap
4839 msgid "B<S_IXOTH>"
4840 msgstr ""
4841
4842 #. type: Plain text
4843 #: build/C/man2/open.2:275
4844 msgid "00001 others have execute permission"
4845 msgstr ""
4846
4847 #. type: TP
4848 #: build/C/man2/open.2:276
4849 #, no-wrap
4850 msgid "B<O_DIRECT> (Since Linux 2.4.10)"
4851 msgstr ""
4852
4853 #. type: Plain text
4854 #: build/C/man2/open.2:293
4855 msgid ""
4856 "Try to minimize cache effects of the I/O to and from this file.  In general "
4857 "this will degrade performance, but it is useful in special situations, such "
4858 "as when applications do their own caching.  File I/O is done directly "
4859 "to/from user space buffers.  The B<O_DIRECT> flag on its own makes an effort "
4860 "to transfer data synchronously, but does not give the guarantees of the "
4861 "B<O_SYNC> flag that data and necessary metadata are transferred.  To "
4862 "guarantee synchronous I/O, B<O_SYNC> must be used in addition to "
4863 "B<O_DIRECT>.  See NOTES below for further discussion."
4864 msgstr ""
4865
4866 #. type: Plain text
4867 #: build/C/man2/open.2:297
4868 msgid ""
4869 "A semantically similar (but deprecated) interface for block devices is "
4870 "described in B<raw>(8)."
4871 msgstr ""
4872
4873 #. type: TP
4874 #: build/C/man2/open.2:297
4875 #, no-wrap
4876 msgid "B<O_DIRECTORY>"
4877 msgstr ""
4878
4879 #.  But see the following and its replies:
4880 #.  http://marc.theaimsgroup.com/?t=112748702800001&r=1&w=2
4881 #.  [PATCH] open: O_DIRECTORY and O_CREAT together should fail
4882 #.  O_DIRECTORY | O_CREAT causes O_DIRECTORY to be ignored.
4883 #. type: Plain text
4884 #: build/C/man2/open.2:311
4885 msgid ""
4886 "If I<pathname> is not a directory, cause the open to fail.  This flag is "
4887 "Linux-specific, and was added in kernel version 2.1.126, to avoid "
4888 "denial-of-service problems if B<opendir>(3)  is called on a FIFO or tape "
4889 "device, but should not be used outside of the implementation of "
4890 "B<opendir>(3)."
4891 msgstr ""
4892
4893 #. type: TP
4894 #: build/C/man2/open.2:311
4895 #, no-wrap
4896 msgid "B<O_EXCL>"
4897 msgstr ""
4898
4899 #. type: Plain text
4900 #: build/C/man2/open.2:321
4901 msgid ""
4902 "Ensure that this call creates the file: if this flag is specified in "
4903 "conjunction with B<O_CREAT>, and I<pathname> already exists, then B<open>()  "
4904 "will fail."
4905 msgstr ""
4906
4907 #.  POSIX.1-2001 explicitly requires this behavior.
4908 #. type: Plain text
4909 #: build/C/man2/open.2:329
4910 msgid ""
4911 "When these two flags are specified, symbolic links are not followed: if "
4912 "I<pathname> is a symbolic link, then B<open>()  fails regardless of where "
4913 "the symbolic link points to."
4914 msgstr ""
4915
4916 #. type: Plain text
4917 #: build/C/man2/open.2:345
4918 msgid ""
4919 "In general, the behavior of B<O_EXCL> is undefined if it is used without "
4920 "B<O_CREAT>.  There is one exception: on Linux 2.6 and later, B<O_EXCL> can "
4921 "be used without B<O_CREAT> if I<pathname> refers to a block device.  If the "
4922 "block device is in use by the system (e.g., mounted), B<open>()  fails with "
4923 "the error B<EBUSY>."
4924 msgstr ""
4925
4926 #. type: Plain text
4927 #: build/C/man2/open.2:367
4928 msgid ""
4929 "On NFS, B<O_EXCL> is only supported when using NFSv3 or later on kernel 2.6 "
4930 "or later.  In NFS environments where B<O_EXCL> support is not provided, "
4931 "programs that rely on it for performing locking tasks will contain a race "
4932 "condition.  Portable programs that want to perform atomic file locking using "
4933 "a lockfile, and need to avoid reliance on NFS support for B<O_EXCL>, can "
4934 "create a unique file on the same file system (e.g., incorporating hostname "
4935 "and PID), and use B<link>(2)  to make a link to the lockfile.  If B<link>(2)  "
4936 "returns 0, the lock is successful.  Otherwise, use B<stat>(2)  on the unique "
4937 "file to check if its link count has increased to 2, in which case the lock "
4938 "is also successful."
4939 msgstr ""
4940
4941 #. type: TP
4942 #: build/C/man2/open.2:367
4943 #, no-wrap
4944 msgid "B<O_LARGEFILE>"
4945 msgstr ""
4946
4947 #. type: Plain text
4948 #: build/C/man2/open.2:389
4949 msgid ""
4950 "(LFS)  Allow files whose sizes cannot be represented in an I<off_t> (but can "
4951 "be represented in an I<off64_t>)  to be opened.  The B<_LARGEFILE64_SOURCE> "
4952 "macro must be defined (before including I<any> header files)  in order to "
4953 "obtain this definition.  Setting the B<_FILE_OFFSET_BITS> feature test macro "
4954 "to 64 (rather than using B<O_LARGEFILE>)  is the preferred method of "
4955 "accessing large files on 32-bit systems (see B<feature_test_macros>(7))."
4956 msgstr ""
4957
4958 #. type: TP
4959 #: build/C/man2/open.2:389
4960 #, no-wrap
4961 msgid "B<O_NOATIME> (Since Linux 2.6.8)"
4962 msgstr ""
4963
4964 #.  The O_NOATIME flag also affects the treatment of st_atime
4965 #.  by mmap() and readdir(2), MTK, Dec 04.
4966 #. type: Plain text
4967 #: build/C/man2/open.2:400
4968 msgid ""
4969 "Do not update the file last access time (st_atime in the inode)  when the "
4970 "file is B<read>(2).  This flag is intended for use by indexing or backup "
4971 "programs, where its use can significantly reduce the amount of disk "
4972 "activity.  This flag may not be effective on all file systems.  One example "
4973 "is NFS, where the server maintains the access time."
4974 msgstr ""
4975
4976 #. type: TP
4977 #: build/C/man2/open.2:400
4978 #, no-wrap
4979 msgid "B<O_NOCTTY>"
4980 msgstr ""
4981
4982 #. type: Plain text
4983 #: build/C/man2/open.2:408
4984 msgid ""
4985 "If I<pathname> refers to a terminal device\\(emsee B<tty>(4)\\(em it will "
4986 "not become the process's controlling terminal even if the process does not "
4987 "have one."
4988 msgstr ""
4989
4990 #. type: TP
4991 #: build/C/man2/open.2:408
4992 #, no-wrap
4993 msgid "B<O_NOFOLLOW>"
4994 msgstr ""
4995
4996 #.  The headers from glibc 2.0.100 and later include a
4997 #.  definition of this flag; \fIkernels before 2.1.126 will ignore it if
4998 #.  used\fP.
4999 #. type: Plain text
5000 #: build/C/man2/open.2:417
5001 msgid ""
5002 "If I<pathname> is a symbolic link, then the open fails.  This is a FreeBSD "
5003 "extension, which was added to Linux in version 2.1.126.  Symbolic links in "
5004 "earlier components of the pathname will still be followed."
5005 msgstr ""
5006
5007 #. type: TP
5008 #: build/C/man2/open.2:417
5009 #, no-wrap
5010 msgid "B<O_NONBLOCK> or B<O_NDELAY>"
5011 msgstr ""
5012
5013 #. type: Plain text
5014 #: build/C/man2/open.2:430
5015 msgid ""
5016 "When possible, the file is opened in nonblocking mode.  Neither the "
5017 "B<open>()  nor any subsequent operations on the file descriptor which is "
5018 "returned will cause the calling process to wait.  For the handling of FIFOs "
5019 "(named pipes), see also B<fifo>(7).  For a discussion of the effect of "
5020 "B<O_NONBLOCK> in conjunction with mandatory file locks and with file leases, "
5021 "see B<fcntl>(2)."
5022 msgstr ""
5023
5024 #. type: TP
5025 #: build/C/man2/open.2:430
5026 #, no-wrap
5027 msgid "B<O_SYNC>"
5028 msgstr ""
5029
5030 #. type: Plain text
5031 #: build/C/man2/open.2:438
5032 msgid ""
5033 "The file is opened for synchronous I/O.  Any B<write>(2)s on the resulting "
5034 "file descriptor will block the calling process until the data has been "
5035 "physically written to the underlying hardware.  I<But see NOTES below>."
5036 msgstr ""
5037
5038 #. type: TP
5039 #: build/C/man2/open.2:438
5040 #, no-wrap
5041 msgid "B<O_TRUNC>"
5042 msgstr ""
5043
5044 #. type: Plain text
5045 #: build/C/man2/open.2:452
5046 msgid ""
5047 "If the file already exists and is a regular file and the open mode allows "
5048 "writing (i.e., is B<O_RDWR> or B<O_WRONLY>)  it will be truncated to length "
5049 "0.  If the file is a FIFO or terminal device file, the B<O_TRUNC> flag is "
5050 "ignored.  Otherwise the effect of B<O_TRUNC> is unspecified."
5051 msgstr ""
5052
5053 #. type: Plain text
5054 #: build/C/man2/open.2:456
5055 msgid ""
5056 "Some of these optional flags can be altered using B<fcntl>(2)  after the "
5057 "file has been opened."
5058 msgstr ""
5059
5060 #. type: Plain text
5061 #: build/C/man2/open.2:464
5062 msgid ""
5063 "B<creat>()  is equivalent to B<open>()  with I<flags> equal to "
5064 "B<O_CREAT|O_WRONLY|O_TRUNC>."
5065 msgstr ""
5066
5067 #. type: Plain text
5068 #: build/C/man2/open.2:472
5069 msgid ""
5070 "B<open>()  and B<creat>()  return the new file descriptor, or -1 if an error "
5071 "occurred (in which case, I<errno> is set appropriately)."
5072 msgstr ""
5073
5074 #. type: Plain text
5075 #: build/C/man2/open.2:482
5076 msgid ""
5077 "The requested access to the file is not allowed, or search permission is "
5078 "denied for one of the directories in the path prefix of I<pathname>, or the "
5079 "file did not exist yet and write access to the parent directory is not "
5080 "allowed.  (See also B<path_resolution>(7).)"
5081 msgstr ""
5082
5083 #. type: Plain text
5084 #: build/C/man2/open.2:488
5085 msgid "I<pathname> already exists and B<O_CREAT> and B<O_EXCL> were used."
5086 msgstr ""
5087
5088 #. type: Plain text
5089 #: build/C/man2/open.2:492 build/C/man2/rmdir.2:67 build/C/man2/unlink.2:84
5090 msgid "I<pathname> points outside your accessible address space."
5091 msgstr ""
5092
5093 #. type: TP
5094 #: build/C/man2/open.2:492 build/C/man2/write.2:139
5095 #, no-wrap
5096 msgid "B<EFBIG>"
5097 msgstr ""
5098
5099 #. type: Plain text
5100 #: build/C/man2/open.2:496
5101 msgid "See B<EOVERFLOW>."
5102 msgstr ""
5103
5104 #. type: TP
5105 #: build/C/man2/open.2:496 build/C/man2/read.2:104 build/C/man3/scanf.3:559 build/C/man3/tmpfile.3:59 build/C/man2/write.2:144
5106 #, no-wrap
5107 msgid "B<EINTR>"
5108 msgstr ""
5109
5110 #. type: Plain text
5111 #: build/C/man2/open.2:503
5112 msgid ""
5113 "While blocked waiting to complete an open of a slow device (e.g., a FIFO; "
5114 "see B<fifo>(7)), the call was interrupted by a signal handler; see "
5115 "B<signal>(7)."
5116 msgstr ""
5117
5118 #. type: TP
5119 #: build/C/man2/open.2:503 build/C/man2/read.2:140 build/C/man2/rename.2:140 build/C/man2/unlink.2:87
5120 #, no-wrap
5121 msgid "B<EISDIR>"
5122 msgstr ""
5123
5124 #. type: Plain text
5125 #: build/C/man2/open.2:512
5126 msgid ""
5127 "I<pathname> refers to a directory and the access requested involved writing "
5128 "(that is, B<O_WRONLY> or B<O_RDWR> is set)."
5129 msgstr ""
5130
5131 #. type: Plain text
5132 #: build/C/man2/open.2:519
5133 msgid ""
5134 "Too many symbolic links were encountered in resolving I<pathname>, or "
5135 "B<O_NOFOLLOW> was specified but I<pathname> was a symbolic link."
5136 msgstr ""
5137
5138 #. type: TP
5139 #: build/C/man2/open.2:519 build/C/man2/pipe.2:107 build/C/man3/tmpfile.3:62
5140 #, no-wrap
5141 msgid "B<EMFILE>"
5142 msgstr ""
5143
5144 #. type: Plain text
5145 #: build/C/man2/open.2:522
5146 msgid "The process already has the maximum number of files open."
5147 msgstr ""
5148
5149 #. type: Plain text
5150 #: build/C/man2/open.2:526 build/C/man2/rmdir.2:80 build/C/man2/unlink.2:99
5151 msgid "I<pathname> was too long."
5152 msgstr ""
5153
5154 #. type: TP
5155 #: build/C/man2/open.2:526 build/C/man2/pipe.2:110 build/C/man3/tmpfile.3:65
5156 #, no-wrap
5157 msgid "B<ENFILE>"
5158 msgstr ""
5159
5160 #. type: Plain text
5161 #: build/C/man2/open.2:529 build/C/man2/pipe.2:113
5162 msgid "The system limit on the total number of open files has been reached."
5163 msgstr ""
5164
5165 #. type: TP
5166 #: build/C/man2/open.2:529
5167 #, no-wrap
5168 msgid "B<ENODEV>"
5169 msgstr ""
5170
5171 #. type: Plain text
5172 #: build/C/man2/open.2:536
5173 msgid ""
5174 "I<pathname> refers to a device special file and no corresponding device "
5175 "exists.  (This is a Linux kernel bug; in this situation B<ENXIO> must be "
5176 "returned.)"
5177 msgstr ""
5178
5179 #. type: Plain text
5180 #: build/C/man2/open.2:543
5181 msgid ""
5182 "B<O_CREAT> is not set and the named file does not exist.  Or, a directory "
5183 "component in I<pathname> does not exist or is a dangling symbolic link."
5184 msgstr ""
5185
5186 #. type: Plain text
5187 #: build/C/man2/open.2:552
5188 msgid ""
5189 "I<pathname> was to be created but the device containing I<pathname> has no "
5190 "room for the new file."
5191 msgstr ""
5192
5193 #. type: Plain text
5194 #: build/C/man2/open.2:559
5195 msgid ""
5196 "A component used as a directory in I<pathname> is not, in fact, a directory, "
5197 "or B<O_DIRECTORY> was specified and I<pathname> was not a directory."
5198 msgstr ""
5199
5200 #. type: Plain text
5201 #: build/C/man2/open.2:565
5202 msgid ""
5203 "B<O_NONBLOCK> | B<O_WRONLY> is set, the named file is a FIFO and no process "
5204 "has the file open for reading.  Or, the file is a device special file and no "
5205 "corresponding device exists."
5206 msgstr ""
5207
5208 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=7253
5209 #.  "Open of a large file on 32-bit fails with EFBIG, should be EOVERFLOW"
5210 #.  Reported 2006-10-03
5211 #. type: Plain text
5212 #: build/C/man2/open.2:585
5213 msgid ""
5214 "I<pathname> refers to a regular file that is too large to be opened.  The "
5215 "usual scenario here is that an application compiled on a 32-bit platform "
5216 "without I<-D_FILE_OFFSET_BITS=64> tried to open a file whose size exceeds "
5217 "I<(2E<lt>E<lt>31)-1> bits; see also B<O_LARGEFILE> above.  This is the error "
5218 "specified by POSIX.1-2001; in kernels before 2.6.24, Linux gave the error "
5219 "B<EFBIG> for this case."
5220 msgstr ""
5221
5222 #.  Strictly speaking, it's the file system UID... (MTK)
5223 #. type: Plain text
5224 #: build/C/man2/open.2:593
5225 msgid ""
5226 "The B<O_NOATIME> flag was specified, but the effective user ID of the caller "
5227 "did not match the owner of the file and the caller was not privileged "
5228 "(B<CAP_FOWNER>)."
5229 msgstr ""
5230
5231 #. type: Plain text
5232 #: build/C/man2/open.2:598
5233 msgid ""
5234 "I<pathname> refers to a file on a read-only file system and write access was "
5235 "requested."
5236 msgstr ""
5237
5238 #. type: TP
5239 #: build/C/man2/open.2:598
5240 #, no-wrap
5241 msgid "B<ETXTBSY>"
5242 msgstr ""
5243
5244 #. type: Plain text
5245 #: build/C/man2/open.2:603
5246 msgid ""
5247 "I<pathname> refers to an executable image which is currently being executed "
5248 "and write access was requested."
5249 msgstr ""
5250
5251 #. type: TP
5252 #: build/C/man2/open.2:603
5253 #, no-wrap
5254 msgid "B<EWOULDBLOCK>"
5255 msgstr ""
5256
5257 #. type: Plain text
5258 #: build/C/man2/open.2:610
5259 msgid ""
5260 "The B<O_NONBLOCK> flag was specified, and an incompatible lease was held on "
5261 "the file (see B<fcntl>(2))."
5262 msgstr ""
5263
5264 #. type: Plain text
5265 #: build/C/man2/open.2:623
5266 msgid ""
5267 "SVr4, 4.3BSD, POSIX.1-2001.  The B<O_DIRECTORY>, B<O_NOATIME>, and "
5268 "B<O_NOFOLLOW> flags are Linux-specific, and one may need to define "
5269 "B<_GNU_SOURCE> (before including I<any> header files)  to obtain their "
5270 "definitions."
5271 msgstr ""
5272
5273 #. type: Plain text
5274 #: build/C/man2/open.2:628
5275 msgid ""
5276 "The B<O_CLOEXEC> flag is not specified in POSIX.1-2001, but is specified in "
5277 "POSIX.1-2008."
5278 msgstr ""
5279
5280 #. type: Plain text
5281 #: build/C/man2/open.2:636
5282 msgid ""
5283 "B<O_DIRECT> is not specified in POSIX; one has to define B<_GNU_SOURCE> "
5284 "(before including I<any> header files)  to get its definition."
5285 msgstr ""
5286
5287 #. type: Plain text
5288 #: build/C/man2/open.2:644
5289 msgid ""
5290 "Under Linux, the B<O_NONBLOCK> flag indicates that one wants to open but "
5291 "does not necessarily have the intention to read or write.  This is typically "
5292 "used to open devices in order to get a file descriptor for use with "
5293 "B<ioctl>(2)."
5294 msgstr ""
5295
5296 #.  See for example util-linux's disk-utils/setfdprm.c
5297 #.  For some background on access mode 3, see
5298 #.  http://thread.gmane.org/gmane.linux.kernel/653123
5299 #.  "[RFC] correct flags to f_mode conversion in __dentry_open"
5300 #.  LKML, 12 Mar 2008
5301 #. type: Plain text
5302 #: build/C/man2/open.2:673
5303 msgid ""
5304 "Unlike the other values that can be specified in I<flags>, the I<access "
5305 "mode> values B<O_RDONLY>, B<O_WRONLY>, and B<O_RDWR>, do not specify "
5306 "individual bits.  Rather, they define the low order two bits of I<flags>, "
5307 "and are defined respectively as 0, 1, and 2.  In other words, the "
5308 "combination B<O_RDONLY | O_WRONLY> is a logical error, and certainly does "
5309 "not have the same meaning as B<O_RDWR>.  Linux reserves the special, "
5310 "nonstandard access mode 3 (binary 11) in I<flags> to mean: check for read "
5311 "and write permission on the file and return a descriptor that can't be used "
5312 "for reading or writing.  This nonstandard access mode is used by some Linux "
5313 "drivers to return a descriptor that is only to be used for device-specific "
5314 "B<ioctl>(2)  operations."
5315 msgstr ""
5316
5317 #.  Linux 2.0, 2.5: truncate
5318 #.  Solaris 5.7, 5.8: truncate
5319 #.  Irix 6.5: truncate
5320 #.  Tru64 5.1B: truncate
5321 #.  HP-UX 11.22: truncate
5322 #.  FreeBSD 4.7: truncate
5323 #. type: Plain text
5324 #: build/C/man2/open.2:684
5325 msgid ""
5326 "The (undefined) effect of B<O_RDONLY | O_TRUNC> varies among "
5327 "implementations.  On many systems the file is actually truncated."
5328 msgstr ""
5329
5330 #. type: Plain text
5331 #: build/C/man2/open.2:688
5332 msgid ""
5333 "There are many infelicities in the protocol underlying NFS, affecting "
5334 "amongst others B<O_SYNC> and B<O_NDELAY>."
5335 msgstr ""
5336
5337 #. type: Plain text
5338 #: build/C/man2/open.2:710
5339 msgid ""
5340 "POSIX provides for three different variants of synchronized I/O, "
5341 "corresponding to the flags B<O_SYNC>, B<O_DSYNC>, and B<O_RSYNC>.  Currently "
5342 "(2.6.31), Linux only implements B<O_SYNC>, but glibc maps B<O_DSYNC> and "
5343 "B<O_RSYNC> to the same numerical value as B<O_SYNC>.  Most Linux file "
5344 "systems don't actually implement the POSIX B<O_SYNC> semantics, which "
5345 "require all metadata updates of a write to be on disk on returning to "
5346 "userspace, but only the B<O_DSYNC> semantics, which require only actual file "
5347 "data and metadata necessary to retrieve it to be on disk by the time the "
5348 "system call returns."
5349 msgstr ""
5350
5351 #. type: Plain text
5352 #: build/C/man2/open.2:718
5353 msgid ""
5354 "Note that B<open>()  can open device special files, but B<creat>()  cannot "
5355 "create them; use B<mknod>(2)  instead."
5356 msgstr ""
5357
5358 #. type: Plain text
5359 #: build/C/man2/open.2:731
5360 msgid ""
5361 "On NFS file systems with UID mapping enabled, B<open>()  may return a file "
5362 "descriptor but, for example, B<read>(2)  requests are denied with "
5363 "B<EACCES>.  This is because the client performs B<open>()  by checking the "
5364 "permissions, but UID mapping is performed by the server upon read and write "
5365 "requests."
5366 msgstr ""
5367
5368 #. type: Plain text
5369 #: build/C/man2/open.2:750
5370 msgid ""
5371 "If the file is newly created, its I<st_atime>, I<st_ctime>, I<st_mtime> "
5372 "fields (respectively, time of last access, time of last status change, and "
5373 "time of last modification; see B<stat>(2))  are set to the current time, and "
5374 "so are the I<st_ctime> and I<st_mtime> fields of the parent directory.  "
5375 "Otherwise, if the file is modified because of the B<O_TRUNC> flag, its "
5376 "st_ctime and st_mtime fields are set to the current time."
5377 msgstr ""
5378
5379 #. type: SS
5380 #: build/C/man2/open.2:750
5381 #, no-wrap
5382 msgid "O_DIRECT"
5383 msgstr ""
5384
5385 #. type: Plain text
5386 #: build/C/man2/open.2:767
5387 msgid ""
5388 "The B<O_DIRECT> flag may impose alignment restrictions on the length and "
5389 "address of userspace buffers and the file offset of I/Os.  In Linux "
5390 "alignment restrictions vary by file system and kernel version and might be "
5391 "absent entirely.  However there is currently no file system-independent "
5392 "interface for an application to discover these restrictions for a given file "
5393 "or file system.  Some file systems provide their own interfaces for doing "
5394 "so, for example the B<XFS_IOC_DIOINFO> operation in B<xfsctl>(3)."
5395 msgstr ""
5396
5397 #. type: Plain text
5398 #: build/C/man2/open.2:773
5399 msgid ""
5400 "Under Linux 2.4, transfer sizes, and the alignment of the user buffer and "
5401 "the file offset must all be multiples of the logical block size of the file "
5402 "system.  Under Linux 2.6, alignment to 512-byte boundaries suffices."
5403 msgstr ""
5404
5405 #. type: Plain text
5406 #: build/C/man2/open.2:783
5407 msgid ""
5408 "The B<O_DIRECT> flag was introduced in SGI IRIX, where it has alignment "
5409 "restrictions similar to those of Linux 2.4.  IRIX has also a B<fcntl>(2)  "
5410 "call to query appropriate alignments, and sizes.  FreeBSD 4.x introduced a "
5411 "flag of the same name, but without alignment restrictions."
5412 msgstr ""
5413
5414 #. type: Plain text
5415 #: build/C/man2/open.2:792
5416 msgid ""
5417 "B<O_DIRECT> support was added under Linux in kernel version 2.4.10.  Older "
5418 "Linux kernels simply ignore this flag.  Some file systems may not implement "
5419 "the flag and B<open>()  will fail with B<EINVAL> if it is used."
5420 msgstr ""
5421
5422 #. type: Plain text
5423 #: build/C/man2/open.2:803
5424 msgid ""
5425 "Applications should avoid mixing B<O_DIRECT> and normal I/O to the same "
5426 "file, and especially to overlapping byte regions in the same file.  Even "
5427 "when the file system correctly handles the coherency issues in this "
5428 "situation, overall I/O throughput is likely to be slower than using either "
5429 "mode alone.  Likewise, applications should avoid mixing B<mmap>(2)  of files "
5430 "with direct I/O to the same files."
5431 msgstr ""
5432
5433 #. type: Plain text
5434 #: build/C/man2/open.2:825
5435 msgid ""
5436 "The behaviour of B<O_DIRECT> with NFS will differ from local file systems.  "
5437 "Older kernels, or kernels configured in certain ways, may not support this "
5438 "combination.  The NFS protocol does not support passing the flag to the "
5439 "server, so B<O_DIRECT> I/O will only bypass the page cache on the client; "
5440 "the server may still cache the I/O.  The client asks the server to make the "
5441 "I/O synchronous to preserve the synchronous semantics of B<O_DIRECT>.  Some "
5442 "servers will perform poorly under these circumstances, especially if the I/O "
5443 "size is small.  Some servers may also be configured to lie to clients about "
5444 "the I/O having reached stable storage; this will avoid the performance "
5445 "penalty at some risk to data integrity in the event of server power "
5446 "failure.  The Linux NFS client places no alignment restrictions on "
5447 "B<O_DIRECT> I/O."
5448 msgstr ""
5449
5450 #. type: Plain text
5451 #: build/C/man2/open.2:832
5452 msgid ""
5453 "In summary, B<O_DIRECT> is a potentially powerful tool that should be used "
5454 "with caution.  It is recommended that applications treat use of B<O_DIRECT> "
5455 "as a performance option which is disabled by default."
5456 msgstr ""
5457
5458 #. type: Plain text
5459 #: build/C/man2/open.2:837
5460 msgid ""
5461 "\"The thing that has always disturbed me about O_DIRECT is that the whole "
5462 "interface is just stupid, and was probably designed by a deranged monkey on "
5463 "some serious mind-controlling substances.\"\\(emLinus"
5464 msgstr ""
5465
5466 #.  FIXME . Check bugzilla report on open(O_ASYNC)
5467 #.  See http://bugzilla.kernel.org/show_bug.cgi?id=5993
5468 #. type: Plain text
5469 #: build/C/man2/open.2:849
5470 msgid ""
5471 "Currently, it is not possible to enable signal-driven I/O by specifying "
5472 "B<O_ASYNC> when calling B<open>(); use B<fcntl>(2)  to enable this flag."
5473 msgstr ""
5474
5475 #. type: Plain text
5476 #: build/C/man2/open.2:871
5477 msgid ""
5478 "B<chmod>(2), B<chown>(2), B<close>(2), B<dup>(2), B<fcntl>(2), B<link>(2), "
5479 "B<lseek>(2), B<mknod>(2), B<mmap>(2), B<mount>(2), B<openat>(2), B<read>(2), "
5480 "B<socket>(2), B<stat>(2), B<umask>(2), B<unlink>(2), B<write>(2), "
5481 "B<fopen>(3), B<fifo>(7), B<path_resolution>(7), B<symlink>(7)"
5482 msgstr ""
5483
5484 #. type: TH
5485 #: build/C/man3/perror.3:30
5486 #, no-wrap
5487 msgid "PERROR"
5488 msgstr ""
5489
5490 #. type: Plain text
5491 #: build/C/man3/perror.3:33
5492 msgid "perror - print a system error message"
5493 msgstr ""
5494
5495 #. type: Plain text
5496 #: build/C/man3/perror.3:37
5497 msgid "B<void perror(const char *>I<s>B<);>"
5498 msgstr ""
5499
5500 #. type: Plain text
5501 #: build/C/man3/perror.3:39
5502 msgid "B<#include E<lt>errno.hE<gt>>"
5503 msgstr ""
5504
5505 #. type: Plain text
5506 #: build/C/man3/perror.3:41
5507 msgid "B<const char *>I<sys_errlist>B<[];>"
5508 msgstr ""
5509
5510 #. type: Plain text
5511 #: build/C/man3/perror.3:43
5512 msgid "B<int >I<sys_nerr>B<;>"
5513 msgstr ""
5514
5515 #. type: Plain text
5516 #: build/C/man3/perror.3:45
5517 msgid "B<int >I<errno>B<;>"
5518 msgstr ""
5519
5520 #. type: Plain text
5521 #: build/C/man3/perror.3:54
5522 msgid "I<sys_errlist>, I<sys_nerr>: _BSD_SOURCE"
5523 msgstr ""
5524
5525 #. type: Plain text
5526 #: build/C/man3/perror.3:67
5527 msgid ""
5528 "The routine B<perror>()  produces a message on the standard error output, "
5529 "describing the last error encountered during a call to a system or library "
5530 "function.  First (if I<s> is not NULL and I<*s> is not a null byte "
5531 "(\\(aq\\e0\\(aq)) the argument string I<s> is printed, followed by a colon "
5532 "and a blank.  Then the message and a new-line."
5533 msgstr ""
5534
5535 #. type: Plain text
5536 #: build/C/man3/perror.3:75
5537 msgid ""
5538 "To be of most use, the argument string should include the name of the "
5539 "function that incurred the error.  The error number is taken from the "
5540 "external variable I<errno>, which is set when errors occur but not cleared "
5541 "when successful calls are made."
5542 msgstr ""
5543
5544 #. type: Plain text
5545 #: build/C/man3/perror.3:86
5546 msgid ""
5547 "The global error list I<sys_errlist>[] indexed by I<errno> can be used to "
5548 "obtain the error message without the newline.  The largest message number "
5549 "provided in the table is I<sys_nerr> -1.  Be careful when directly accessing "
5550 "this list because new error values may not have been added to "
5551 "I<sys_errlist>[]."
5552 msgstr ""
5553
5554 #. type: Plain text
5555 #: build/C/man3/perror.3:107
5556 msgid ""
5557 "When a system call fails, it usually returns -1 and sets the variable "
5558 "I<errno> to a value describing what went wrong.  (These values can be found "
5559 "in I<E<lt>errno.hE<gt>>.)  Many library functions do likewise.  The function "
5560 "B<perror>()  serves to translate this error code into human-readable form.  "
5561 "Note that I<errno> is undefined after a successful library call: this call "
5562 "may well change this variable, even though it succeeds, for example because "
5563 "it internally used some other library function that failed.  Thus, if a "
5564 "failing call is not immediately followed by a call to B<perror>(), the value "
5565 "of I<errno> should be saved."
5566 msgstr ""
5567
5568 #. type: Plain text
5569 #: build/C/man3/perror.3:120
5570 msgid ""
5571 "The function B<perror>()  and the external I<errno> (see B<errno>(3))  "
5572 "conform to C89, C99, 4.3BSD, POSIX.1-2001.  The externals I<sys_nerr> and "
5573 "I<sys_errlist> conform to BSD."
5574 msgstr ""
5575
5576 #.  and only when _BSD_SOURCE is defined.
5577 #.  When
5578 #.  .B _GNU_SOURCE
5579 #.  is defined, the symbols
5580 #.  .I _sys_nerr
5581 #.  and
5582 #.  .I _sys_errlist
5583 #.  are provided.
5584 #. type: Plain text
5585 #: build/C/man3/perror.3:135
5586 msgid ""
5587 "The externals I<sys_nerr> and I<sys_errlist> are defined by glibc, but in "
5588 "I<E<lt>stdio.hE<gt>>."
5589 msgstr ""
5590
5591 #. type: Plain text
5592 #: build/C/man3/perror.3:140
5593 msgid "B<err>(3), B<errno>(3), B<error>(3), B<strerror>(3)"
5594 msgstr ""
5595
5596 #. type: TH
5597 #: build/C/man2/pipe.2:36
5598 #, no-wrap
5599 msgid "PIPE"
5600 msgstr ""
5601
5602 #. type: TH
5603 #: build/C/man2/pipe.2:36
5604 #, no-wrap
5605 msgid "2012-02-14"
5606 msgstr ""
5607
5608 #. type: Plain text
5609 #: build/C/man2/pipe.2:39
5610 msgid "pipe, pipe2 - create pipe"
5611 msgstr ""
5612
5613 #. type: Plain text
5614 #: build/C/man2/pipe.2:42 build/C/man2/read.2:41
5615 #, no-wrap
5616 msgid "B<#include E<lt>unistd.hE<gt>>\n"
5617 msgstr ""
5618
5619 #. type: Plain text
5620 #: build/C/man2/pipe.2:44
5621 #, no-wrap
5622 msgid "B<int pipe(int >I<pipefd>B<[2]);>\n"
5623 msgstr ""
5624
5625 #. type: Plain text
5626 #: build/C/man2/pipe.2:48
5627 #, no-wrap
5628 msgid ""
5629 "B<#define _GNU_SOURCE>             /* See feature_test_macros(7) */\n"
5630 "B<#include E<lt>fcntl.hE<gt>>              /* Obtain O_* constant "
5631 "definitions */\n"
5632 "B<#include E<lt>unistd.hE<gt>>\n"
5633 msgstr ""
5634
5635 #. type: Plain text
5636 #: build/C/man2/pipe.2:50
5637 #, no-wrap
5638 msgid "B<int pipe2(int >I<pipefd>B<[2], int >I<flags>B<);>\n"
5639 msgstr ""
5640
5641 #. type: Plain text
5642 #: build/C/man2/pipe.2:66
5643 msgid ""
5644 "B<pipe>()  creates a pipe, a unidirectional data channel that can be used "
5645 "for interprocess communication.  The array I<pipefd> is used to return two "
5646 "file descriptors referring to the ends of the pipe.  I<pipefd[0]> refers to "
5647 "the read end of the pipe.  I<pipefd[1]> refers to the write end of the "
5648 "pipe.  Data written to the write end of the pipe is buffered by the kernel "
5649 "until it is read from the read end of the pipe.  For further details, see "
5650 "B<pipe>(7)."
5651 msgstr ""
5652
5653 #. type: Plain text
5654 #: build/C/man2/pipe.2:76
5655 msgid ""
5656 "If I<flags> is 0, then B<pipe2>()  is the same as B<pipe>().  The following "
5657 "values can be bitwise ORed in I<flags> to obtain different behavior:"
5658 msgstr ""
5659
5660 #. type: TP
5661 #: build/C/man2/pipe.2:76
5662 #, no-wrap
5663 msgid "B<O_NONBLOCK>"
5664 msgstr ""
5665
5666 #. type: Plain text
5667 #: build/C/man2/pipe.2:84
5668 msgid ""
5669 "Set the B<O_NONBLOCK> file status flag on the two new open file "
5670 "descriptions.  Using this flag saves extra calls to B<fcntl>(2)  to achieve "
5671 "the same result."
5672 msgstr ""
5673
5674 #. type: TP
5675 #: build/C/man2/pipe.2:84
5676 #, no-wrap
5677 msgid "B<O_CLOEXEC>"
5678 msgstr ""
5679
5680 #. type: Plain text
5681 #: build/C/man2/pipe.2:92
5682 msgid ""
5683 "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the two new file "
5684 "descriptors.  See the description of the same flag in B<open>(2)  for "
5685 "reasons why this may be useful."
5686 msgstr ""
5687
5688 #. type: Plain text
5689 #: build/C/man2/pipe.2:102
5690 msgid "I<pipefd> is not valid."
5691 msgstr ""
5692
5693 #. type: Plain text
5694 #: build/C/man2/pipe.2:107
5695 msgid "(B<pipe2>())  Invalid value in I<flags>."
5696 msgstr ""
5697
5698 #. type: Plain text
5699 #: build/C/man2/pipe.2:110
5700 msgid "Too many file descriptors are in use by the process."
5701 msgstr ""
5702
5703 #. type: Plain text
5704 #: build/C/man2/pipe.2:118
5705 msgid ""
5706 "B<pipe2>()  was added to Linux in version 2.6.27; glibc support is available "
5707 "starting with version 2.9."
5708 msgstr ""
5709
5710 #. type: Plain text
5711 #: build/C/man2/pipe.2:121
5712 msgid "B<pipe>(): POSIX.1-2001."
5713 msgstr ""
5714
5715 #. type: Plain text
5716 #: build/C/man2/pipe.2:124
5717 msgid "B<pipe2>()  is Linux-specific."
5718 msgstr ""
5719
5720 #.  fork.2 refers to this example program.
5721 #. type: Plain text
5722 #: build/C/man2/pipe.2:140
5723 msgid ""
5724 "The following program creates a pipe, and then B<fork>(2)s to create a child "
5725 "process; the child inherits a duplicate set of file descriptors that refer "
5726 "to the same pipe.  After the B<fork>(2), each process closes the descriptors "
5727 "that it doesn't need for the pipe (see B<pipe>(7)).  The parent then writes "
5728 "the string contained in the program's command-line argument to the pipe, and "
5729 "the child reads this string a byte at a time from the pipe and echoes it on "
5730 "standard output."
5731 msgstr ""
5732
5733 #. type: Plain text
5734 #: build/C/man2/pipe.2:147
5735 #, no-wrap
5736 msgid ""
5737 "#include E<lt>sys/wait.hE<gt>\n"
5738 "#include E<lt>stdio.hE<gt>\n"
5739 "#include E<lt>stdlib.hE<gt>\n"
5740 "#include E<lt>unistd.hE<gt>\n"
5741 "#include E<lt>string.hE<gt>\n"
5742 msgstr ""
5743
5744 #. type: Plain text
5745 #: build/C/man2/pipe.2:154
5746 #, no-wrap
5747 msgid ""
5748 "int\n"
5749 "main(int argc, char *argv[])\n"
5750 "{\n"
5751 "    int pipefd[2];\n"
5752 "    pid_t cpid;\n"
5753 "    char buf;\n"
5754 msgstr ""
5755
5756 #. type: Plain text
5757 #: build/C/man2/pipe.2:159
5758 #, no-wrap
5759 msgid ""
5760 "    if (argc != 2) {\n"
5761 "\tfprintf(stderr, \"Usage: %s E<lt>stringE<gt>\\en\", argv[0]);\n"
5762 "\texit(EXIT_FAILURE);\n"
5763 "    }\n"
5764 msgstr ""
5765
5766 #. type: Plain text
5767 #: build/C/man2/pipe.2:164
5768 #, no-wrap
5769 msgid ""
5770 "    if (pipe(pipefd) == -1) {\n"
5771 "        perror(\"pipe\");\n"
5772 "        exit(EXIT_FAILURE);\n"
5773 "    }\n"
5774 msgstr ""
5775
5776 #. type: Plain text
5777 #: build/C/man2/pipe.2:170
5778 #, no-wrap
5779 msgid ""
5780 "    cpid = fork();\n"
5781 "    if (cpid == -1) {\n"
5782 "        perror(\"fork\");\n"
5783 "        exit(EXIT_FAILURE);\n"
5784 "    }\n"
5785 msgstr ""
5786
5787 #. type: Plain text
5788 #: build/C/man2/pipe.2:173
5789 #, no-wrap
5790 msgid ""
5791 "    if (cpid == 0) {    /* Child reads from pipe */\n"
5792 "        close(pipefd[1]);          /* Close unused write end */\n"
5793 msgstr ""
5794
5795 #. type: Plain text
5796 #: build/C/man2/pipe.2:176
5797 #, no-wrap
5798 msgid ""
5799 "        while (read(pipefd[0], &buf, 1) E<gt> 0)\n"
5800 "            write(STDOUT_FILENO, &buf, 1);\n"
5801 msgstr ""
5802
5803 #. type: Plain text
5804 #: build/C/man2/pipe.2:180
5805 #, no-wrap
5806 msgid ""
5807 "        write(STDOUT_FILENO, \"\\en\", 1);\n"
5808 "        close(pipefd[0]);\n"
5809 "        _exit(EXIT_SUCCESS);\n"
5810 msgstr ""
5811
5812 #. type: Plain text
5813 #: build/C/man2/pipe.2:189
5814 #, no-wrap
5815 msgid ""
5816 "    } else {            /* Parent writes argv[1] to pipe */\n"
5817 "        close(pipefd[0]);          /* Close unused read end */\n"
5818 "        write(pipefd[1], argv[1], strlen(argv[1]));\n"
5819 "        close(pipefd[1]);          /* Reader will see EOF */\n"
5820 "        wait(NULL);                /* Wait for child */\n"
5821 "        exit(EXIT_SUCCESS);\n"
5822 "    }\n"
5823 "}\n"
5824 msgstr ""
5825
5826 #. type: Plain text
5827 #: build/C/man2/pipe.2:197
5828 msgid ""
5829 "B<fork>(2), B<read>(2), B<socketpair>(2), B<write>(2), B<popen>(3), "
5830 "B<pipe>(7)"
5831 msgstr ""
5832
5833 #. type: TH
5834 #: build/C/man3/popen.3:38
5835 #, no-wrap
5836 msgid "POPEN"
5837 msgstr ""
5838
5839 #. type: TH
5840 #: build/C/man3/popen.3:38
5841 #, no-wrap
5842 msgid "2010-02-03"
5843 msgstr ""
5844
5845 #. type: Plain text
5846 #: build/C/man3/popen.3:41
5847 msgid "popen, pclose - pipe stream to or from a process"
5848 msgstr ""
5849
5850 #. type: Plain text
5851 #: build/C/man3/popen.3:46
5852 #, no-wrap
5853 msgid "B<FILE *popen(const char *>I<command>B<, const char *>I<type>B<);>\n"
5854 msgstr ""
5855
5856 #. type: Plain text
5857 #: build/C/man3/popen.3:48
5858 #, no-wrap
5859 msgid "B<int pclose(FILE *>I<stream>B<);>\n"
5860 msgstr ""
5861
5862 #. type: Plain text
5863 #: build/C/man3/popen.3:58
5864 msgid "B<popen>(), B<pclose>():"
5865 msgstr ""
5866
5867 #. type: Plain text
5868 #: build/C/man3/popen.3:60
5869 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 2 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE"
5870 msgstr ""
5871
5872 #. type: Plain text
5873 #: build/C/man3/popen.3:71
5874 msgid ""
5875 "The B<popen>()  function opens a process by creating a pipe, forking, and "
5876 "invoking the shell.  Since a pipe is by definition unidirectional, the "
5877 "I<type> argument may specify only reading or writing, not both; the "
5878 "resulting stream is correspondingly read-only or write-only."
5879 msgstr ""
5880
5881 #. type: Plain text
5882 #: build/C/man3/popen.3:95
5883 msgid ""
5884 "The I<command> argument is a pointer to a null-terminated string containing "
5885 "a shell command line.  This command is passed to I</bin/sh> using the B<-c> "
5886 "flag; interpretation, if any, is performed by the shell.  The I<type> "
5887 "argument is a pointer to a null-terminated string which must contain either "
5888 "the letter \\(aqr\\(aq for reading or the letter \\(aqw\\(aq for writing.  "
5889 "Since glibc 2.9, this argument can additionally include the letter "
5890 "\\(aqe\\(aq, which causes the close-on-exec flag (B<FD_CLOEXEC>)  to be set "
5891 "on the underlying file descriptor; see the description of the B<O_CLOEXEC> "
5892 "flag in B<open>(2)  for reasons why this may be useful."
5893 msgstr ""
5894
5895 #. type: Plain text
5896 #: build/C/man3/popen.3:111
5897 msgid ""
5898 "The return value from B<popen>()  is a normal standard I/O stream in all "
5899 "respects save that it must be closed with B<pclose>()  rather than "
5900 "B<fclose>(3).  Writing to such a stream writes to the standard input of the "
5901 "command; the command's standard output is the same as that of the process "
5902 "that called B<popen>(), unless this is altered by the command itself.  "
5903 "Conversely, reading from a \"popened\" stream reads the command's standard "
5904 "output, and the command's standard input is the same as that of the process "
5905 "that called B<popen>()."
5906 msgstr ""
5907
5908 #. type: Plain text
5909 #: build/C/man3/popen.3:115
5910 msgid "Note that output B<popen>()  streams are fully buffered by default."
5911 msgstr ""
5912
5913 #. type: Plain text
5914 #: build/C/man3/popen.3:121
5915 msgid ""
5916 "The B<pclose>()  function waits for the associated process to terminate and "
5917 "returns the exit status of the command as returned by B<wait4>(2)."
5918 msgstr ""
5919
5920 #. type: Plain text
5921 #: build/C/man3/popen.3:129
5922 msgid ""
5923 "The B<popen>()  function returns NULL if the B<fork>(2)  or B<pipe>(2)  "
5924 "calls fail, or if it cannot allocate memory."
5925 msgstr ""
5926
5927 #.  These conditions actually give undefined results, so I commented
5928 #.  them out.
5929 #.  .I stream
5930 #.  is not associated with a "popen()ed" command, if
5931 #. .I stream
5932 #.  already "pclose()d", or if
5933 #. type: Plain text
5934 #: build/C/man3/popen.3:141
5935 msgid ""
5936 "The B<pclose>()  function returns -1 if B<wait4>(2)  returns an error, or "
5937 "some other error is detected."
5938 msgstr ""
5939
5940 #. type: Plain text
5941 #: build/C/man3/popen.3:160
5942 msgid ""
5943 "The B<popen>()  function does not set I<errno> if memory allocation fails.  "
5944 "If the underlying B<fork>(2)  or B<pipe>(2)  fails, I<errno> is set "
5945 "appropriately.  If the I<type> argument is invalid, and this condition is "
5946 "detected, I<errno> is set to B<EINVAL>."
5947 msgstr ""
5948
5949 #. type: Plain text
5950 #: build/C/man3/popen.3:167
5951 msgid ""
5952 "If B<pclose>()  cannot obtain the child status, I<errno> is set to "
5953 "B<ECHILD>."
5954 msgstr ""
5955
5956 #. type: Plain text
5957 #: build/C/man3/popen.3:173
5958 msgid "The \\(aqe\\(aq value for I<type> is a Linux extension."
5959 msgstr ""
5960
5961 #. type: Plain text
5962 #: build/C/man3/popen.3:186
5963 msgid ""
5964 "Since the standard input of a command opened for reading shares its seek "
5965 "offset with the process that called B<popen>(), if the original process has "
5966 "done a buffered read, the command's input position may not be as expected.  "
5967 "Similarly, the output from a command opened for writing may become "
5968 "intermingled with that of the original process.  The latter can be avoided "
5969 "by calling B<fflush>(3)  before B<popen>()."
5970 msgstr ""
5971
5972 #.  .SH HISTORY
5973 #.  A
5974 #.  .BR popen ()
5975 #.  and a
5976 #.  .BR pclose ()
5977 #.  function appeared in Version 7 AT&T UNIX.
5978 #. type: Plain text
5979 #: build/C/man3/popen.3:196
5980 msgid ""
5981 "Failure to execute the shell is indistinguishable from the shell's failure "
5982 "to execute command, or an immediate exit of the command.  The only hint is "
5983 "an exit status of 127."
5984 msgstr ""
5985
5986 #. type: Plain text
5987 #: build/C/man3/popen.3:206
5988 msgid ""
5989 "B<sh>(1), B<fork>(2), B<pipe>(2), B<wait4>(2), B<fclose>(3), B<fflush>(3), "
5990 "B<fopen>(3), B<stdio>(3), B<system>(3)"
5991 msgstr ""
5992
5993 #. type: TH
5994 #: build/C/man3/printf.3:34
5995 #, no-wrap
5996 msgid "PRINTF"
5997 msgstr ""
5998
5999 #. type: TH
6000 #: build/C/man3/printf.3:34 build/C/man3/puts.3:24 build/C/man3/scanf.3:50
6001 #, no-wrap
6002 msgid "2011-09-28"
6003 msgstr ""
6004
6005 #. type: Plain text
6006 #: build/C/man3/printf.3:38
6007 msgid ""
6008 "printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf - "
6009 "formatted output conversion"
6010 msgstr ""
6011
6012 #. type: Plain text
6013 #: build/C/man3/printf.3:42
6014 msgid "B<int printf(const char *>I<format>B<, ...);>"
6015 msgstr ""
6016
6017 #. type: Plain text
6018 #: build/C/man3/printf.3:44
6019 msgid "B<int fprintf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>"
6020 msgstr ""
6021
6022 #. type: Plain text
6023 #: build/C/man3/printf.3:46
6024 msgid "B<int sprintf(char *>I<str>B<, const char *>I<format>B<, ...);>"
6025 msgstr ""
6026
6027 #. type: Plain text
6028 #: build/C/man3/printf.3:48
6029 msgid ""
6030 "B<int snprintf(char *>I<str>B<, size_t >I<size>B<, const char *>I<format>B<, "
6031 "...);>"
6032 msgstr ""
6033
6034 #. type: Plain text
6035 #: build/C/man3/printf.3:50
6036 msgid "B<#include E<lt>stdarg.hE<gt>>"
6037 msgstr ""
6038
6039 #. type: Plain text
6040 #: build/C/man3/printf.3:52
6041 msgid "B<int vprintf(const char *>I<format>B<, va_list >I<ap>B<);>"
6042 msgstr ""
6043
6044 #. type: Plain text
6045 #: build/C/man3/printf.3:54
6046 msgid ""
6047 "B<int vfprintf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
6048 ">I<ap>B<);>"
6049 msgstr ""
6050
6051 #. type: Plain text
6052 #: build/C/man3/printf.3:56
6053 msgid ""
6054 "B<int vsprintf(char *>I<str>B<, const char *>I<format>B<, va_list "
6055 ">I<ap>B<);>"
6056 msgstr ""
6057
6058 #. type: Plain text
6059 #: build/C/man3/printf.3:59
6060 msgid ""
6061 "B<int vsnprintf(char *>I<str>B<, size_t >I<size>B<, const char "
6062 "*>I<format>B<, va_list >I<ap>B<);>"
6063 msgstr ""
6064
6065 #. type: Plain text
6066 #: build/C/man3/printf.3:68
6067 msgid "B<snprintf>(), B<vsnprintf>():"
6068 msgstr ""
6069
6070 #. type: Plain text
6071 #: build/C/man3/printf.3:71
6072 msgid ""
6073 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE || "
6074 "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
6075 msgstr ""
6076
6077 #. type: Plain text
6078 #: build/C/man3/printf.3:74 build/C/man3/scanf.3:83
6079 msgid "or I<cc -std=c99>"
6080 msgstr ""
6081
6082 #. type: Plain text
6083 #: build/C/man3/printf.3:101
6084 msgid ""
6085 "The functions in the B<printf>()  family produce output according to a "
6086 "I<format> as described below.  The functions B<printf>()  and B<vprintf>()  "
6087 "write output to I<stdout>, the standard output stream; B<fprintf>()  and "
6088 "B<vfprintf>()  write output to the given output I<stream>; B<sprintf>(), "
6089 "B<snprintf>(), B<vsprintf>()  and B<vsnprintf>()  write to the character "
6090 "string I<str>."
6091 msgstr ""
6092
6093 #. type: Plain text
6094 #: build/C/man3/printf.3:110
6095 msgid ""
6096 "The functions B<snprintf>()  and B<vsnprintf>()  write at most I<size> bytes "
6097 "(including the terminating null byte (\\(aq\\e0\\(aq)) to I<str>."
6098 msgstr ""
6099
6100 #. type: Plain text
6101 #: build/C/man3/printf.3:134
6102 msgid ""
6103 "The functions B<vprintf>(), B<vfprintf>(), B<vsprintf>(), B<vsnprintf>()  "
6104 "are equivalent to the functions B<printf>(), B<fprintf>(), B<sprintf>(), "
6105 "B<snprintf>(), respectively, except that they are called with a I<va_list> "
6106 "instead of a variable number of arguments.  These functions do not call the "
6107 "I<va_end> macro.  Because they invoke the I<va_arg> macro, the value of "
6108 "I<ap> is undefined after the call.  See B<stdarg>(3)."
6109 msgstr ""
6110
6111 #. type: Plain text
6112 #: build/C/man3/printf.3:141
6113 msgid ""
6114 "These eight functions write the output under the control of a I<format> "
6115 "string that specifies how subsequent arguments (or arguments accessed via "
6116 "the variable-length argument facilities of B<stdarg>(3))  are converted for "
6117 "output."
6118 msgstr ""
6119
6120 #. type: Plain text
6121 #: build/C/man3/printf.3:152
6122 msgid ""
6123 "C99 and POSIX.1-2001 specify that the results are undefined if a call to "
6124 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), or B<vsnprintf>()  would cause "
6125 "copying to take place between objects that overlap (e.g., if the target "
6126 "string array and one of the supplied input arguments refer to the same "
6127 "buffer).  See NOTES."
6128 msgstr ""
6129
6130 #. type: SS
6131 #: build/C/man3/printf.3:152
6132 #, no-wrap
6133 msgid "Return value"
6134 msgstr ""
6135
6136 #. type: Plain text
6137 #: build/C/man3/printf.3:155
6138 msgid ""
6139 "Upon successful return, these functions return the number of characters "
6140 "printed (excluding the null byte used to end output to strings)."
6141 msgstr ""
6142
6143 #. type: Plain text
6144 #: build/C/man3/printf.3:171
6145 msgid ""
6146 "The functions B<snprintf>()  and B<vsnprintf>()  do not write more than "
6147 "I<size> bytes (including the terminating null byte (\\(aq\\e0\\(aq)).  If "
6148 "the output was truncated due to this limit then the return value is the "
6149 "number of characters (excluding the terminating null byte)  which would have "
6150 "been written to the final string if enough space had been available.  Thus, "
6151 "a return value of I<size> or more means that the output was truncated.  (See "
6152 "also below under NOTES.)"
6153 msgstr ""
6154
6155 #. type: Plain text
6156 #: build/C/man3/printf.3:173
6157 msgid "If an output error is encountered, a negative value is returned."
6158 msgstr ""
6159
6160 #. type: SS
6161 #: build/C/man3/printf.3:173
6162 #, no-wrap
6163 msgid "Format of the format string"
6164 msgstr ""
6165
6166 #. type: Plain text
6167 #: build/C/man3/printf.3:195
6168 msgid ""
6169 "The format string is a character string, beginning and ending in its initial "
6170 "shift state, if any.  The format string is composed of zero or more "
6171 "directives: ordinary characters (not B<%>), which are copied unchanged to "
6172 "the output stream; and conversion specifications, each of which results in "
6173 "fetching zero or more subsequent arguments.  Each conversion specification "
6174 "is introduced by the character B<%>, and ends with a I<conversion "
6175 "specifier>.  In between there may be (in this order) zero or more I<flags>, "
6176 "an optional minimum I<field width>, an optional I<precision> and an optional "
6177 "I<length modifier>."
6178 msgstr ""
6179
6180 #. type: Plain text
6181 #: build/C/man3/printf.3:208
6182 msgid ""
6183 "The arguments must correspond properly (after type promotion) with the "
6184 "conversion specifier.  By default, the arguments are used in the order "
6185 "given, where each \\(aq*\\(aq and each conversion specifier asks for the "
6186 "next argument (and it is an error if insufficiently many arguments are "
6187 "given).  One can also specify explicitly which argument is taken, at each "
6188 "place where an argument is required, by writing \"%m$\" instead of "
6189 "\\(aq%\\(aq and \"*m$\" instead of \\(aq*\\(aq, where the decimal integer m "
6190 "denotes the position in the argument list of the desired argument, indexed "
6191 "starting from 1.  Thus,"
6192 msgstr ""
6193
6194 #. type: Plain text
6195 #: build/C/man3/printf.3:212
6196 #, no-wrap
6197 msgid "printf(\"%*d\", width, num);\n"
6198 msgstr ""
6199
6200 #. type: Plain text
6201 #: build/C/man3/printf.3:216
6202 msgid "and"
6203 msgstr ""
6204
6205 #. type: Plain text
6206 #: build/C/man3/printf.3:220
6207 #, no-wrap
6208 msgid "printf(\"%2$*1$d\", width, num);\n"
6209 msgstr ""
6210
6211 #. type: Plain text
6212 #: build/C/man3/printf.3:236
6213 msgid ""
6214 "are equivalent.  The second style allows repeated references to the same "
6215 "argument.  The C99 standard does not include the style using \\(aq$\\(aq, "
6216 "which comes from the Single UNIX Specification.  If the style using "
6217 "\\(aq$\\(aq is used, it must be used throughout for all conversions taking "
6218 "an argument and all width and precision arguments, but it may be mixed with "
6219 "\"%%\" formats which do not consume an argument.  There may be no gaps in "
6220 "the numbers of arguments specified using \\(aq$\\(aq; for example, if "
6221 "arguments 1 and 3 are specified, argument 2 must also be specified somewhere "
6222 "in the format string."
6223 msgstr ""
6224
6225 #. type: Plain text
6226 #: build/C/man3/printf.3:246
6227 msgid ""
6228 "For some numeric conversions a radix character (\"decimal point\") or "
6229 "thousands' grouping character is used.  The actual character used depends on "
6230 "the B<LC_NUMERIC> part of the locale.  The POSIX locale uses \\(aq.\\(aq as "
6231 "radix character, and does not have a grouping character.  Thus,"
6232 msgstr ""
6233
6234 #. type: Plain text
6235 #: build/C/man3/printf.3:250
6236 #, no-wrap
6237 msgid "    printf(\"%\\(aq.2f\", 1234567.89);\n"
6238 msgstr ""
6239
6240 #. type: Plain text
6241 #: build/C/man3/printf.3:255
6242 msgid ""
6243 "results in \"1234567.89\" in the POSIX locale, in \"1234567,89\" in the "
6244 "nl_NL locale, and in \"1.234.567,89\" in the da_DK locale."
6245 msgstr ""
6246
6247 #. type: SS
6248 #: build/C/man3/printf.3:255
6249 #, no-wrap
6250 msgid "The flag characters"
6251 msgstr ""
6252
6253 #. type: Plain text
6254 #: build/C/man3/printf.3:257
6255 msgid "The character % is followed by zero or more of the following flags:"
6256 msgstr ""
6257
6258 #. type: TP
6259 #: build/C/man3/printf.3:257
6260 #, no-wrap
6261 msgid "B<#>"
6262 msgstr ""
6263
6264 #. type: Plain text
6265 #: build/C/man3/printf.3:291
6266 msgid ""
6267 "The value should be converted to an \"alternate form\".  For B<o> "
6268 "conversions, the first character of the output string is made zero (by "
6269 "prefixing a 0 if it was not zero already).  For B<x> and B<X> conversions, a "
6270 "nonzero result has the string \"0x\" (or \"0X\" for B<X> conversions) "
6271 "prepended to it.  For B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> "
6272 "conversions, the result will always contain a decimal point, even if no "
6273 "digits follow it (normally, a decimal point appears in the results of those "
6274 "conversions only if a digit follows).  For B<g> and B<G> conversions, "
6275 "trailing zeros are not removed from the result as they would otherwise be.  "
6276 "For other conversions, the result is undefined."
6277 msgstr ""
6278
6279 #. type: TP
6280 #: build/C/man3/printf.3:291
6281 #, no-wrap
6282 msgid "B<\\&0>"
6283 msgstr ""
6284
6285 #. type: Plain text
6286 #: build/C/man3/printf.3:331
6287 msgid ""
6288 "The value should be zero padded.  For B<d>, B<i>, B<o>, B<u>, B<x>, B<X>, "
6289 "B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, and B<G> conversions, the "
6290 "converted value is padded on the left with zeros rather than blanks.  If the "
6291 "B<\\&0> and B<-> flags both appear, the B<\\&0> flag is ignored.  If a "
6292 "precision is given with a numeric conversion (B<d>, B<i>, B<o>, B<u>, B<x>, "
6293 "and B<X>), the B<\\&0> flag is ignored.  For other conversions, the behavior "
6294 "is undefined."
6295 msgstr ""
6296
6297 #. type: TP
6298 #: build/C/man3/printf.3:331
6299 #, no-wrap
6300 msgid "B<->"
6301 msgstr ""
6302
6303 #. type: Plain text
6304 #: build/C/man3/printf.3:344
6305 msgid ""
6306 "The converted value is to be left adjusted on the field boundary.  (The "
6307 "default is right justification.)  Except for B<n> conversions, the converted "
6308 "value is padded on the right with blanks, rather than on the left with "
6309 "blanks or zeros.  A B<-> overrides a B<\\&0> if both are given."
6310 msgstr ""
6311
6312 #. type: TP
6313 #: build/C/man3/printf.3:344
6314 #, no-wrap
6315 msgid "B<\\(aq \\(aq>"
6316 msgstr ""
6317
6318 #. type: Plain text
6319 #: build/C/man3/printf.3:348
6320 msgid ""
6321 "(a space) A blank should be left before a positive number (or empty string) "
6322 "produced by a signed conversion."
6323 msgstr ""
6324
6325 #. type: TP
6326 #: build/C/man3/printf.3:348
6327 #, no-wrap
6328 msgid "B<+>"
6329 msgstr ""
6330
6331 #. type: Plain text
6332 #: build/C/man3/printf.3:356
6333 msgid ""
6334 "A sign (+ or -) should always be placed before a number produced by a signed "
6335 "conversion.  By default a sign is used only for negative numbers.  A B<+> "
6336 "overrides a space if both are used."
6337 msgstr ""
6338
6339 #. type: Plain text
6340 #: build/C/man3/printf.3:359
6341 msgid ""
6342 "The five flag characters above are defined in the C standard.  The SUSv2 "
6343 "specifies one further flag character."
6344 msgstr ""
6345
6346 #. type: TP
6347 #: build/C/man3/printf.3:359
6348 #, no-wrap
6349 msgid "B<\\(aq>"
6350 msgstr ""
6351
6352 #. type: Plain text
6353 #: build/C/man3/printf.3:376
6354 msgid ""
6355 "For decimal conversion (B<i>, B<d>, B<u>, B<f>, B<F>, B<g>, B<G>)  the "
6356 "output is to be grouped with thousands' grouping characters if the locale "
6357 "information indicates any.  Note that many versions of B<gcc>(1)  cannot "
6358 "parse this option and will issue a warning.  SUSv2 does not include "
6359 "I<%\\(aqF>."
6360 msgstr ""
6361
6362 #. type: Plain text
6363 #: build/C/man3/printf.3:378
6364 msgid "glibc 2.2 adds one further flag character."
6365 msgstr ""
6366
6367 #. type: TP
6368 #: build/C/man3/printf.3:378
6369 #, no-wrap
6370 msgid "B<I>"
6371 msgstr ""
6372
6373 #.  outdigits keyword in locale file
6374 #. type: Plain text
6375 #: build/C/man3/printf.3:388
6376 msgid ""
6377 "For decimal integer conversion (B<i>, B<d>, B<u>)  the output uses the "
6378 "locale's alternative output digits, if any.  For example, since glibc 2.2.3 "
6379 "this will give Arabic-Indic digits in the Persian (\"fa_IR\") locale."
6380 msgstr ""
6381
6382 #. type: SS
6383 #: build/C/man3/printf.3:388
6384 #, no-wrap
6385 msgid "The field width"
6386 msgstr ""
6387
6388 #. type: Plain text
6389 #: build/C/man3/printf.3:404
6390 msgid ""
6391 "An optional decimal digit string (with nonzero first digit) specifying a "
6392 "minimum field width.  If the converted value has fewer characters than the "
6393 "field width, it will be padded with spaces on the left (or right, if the "
6394 "left-adjustment flag has been given).  Instead of a decimal digit string one "
6395 "may write \"*\" or \"*m$\" (for some decimal integer I<m>) to specify that "
6396 "the field width is given in the next argument, or in the I<m>-th argument, "
6397 "respectively, which must be of type I<int>.  A negative field width is taken "
6398 "as a \\(aq-\\(aq flag followed by a positive field width.  In no case does a "
6399 "nonexistent or small field width cause truncation of a field; if the result "
6400 "of a conversion is wider than the field width, the field is expanded to "
6401 "contain the conversion result."
6402 msgstr ""
6403
6404 #. type: SS
6405 #: build/C/man3/printf.3:404
6406 #, no-wrap
6407 msgid "The precision"
6408 msgstr ""
6409
6410 #. type: Plain text
6411 #: build/C/man3/printf.3:440
6412 msgid ""
6413 "An optional precision, in the form of a period (\\(aq.\\(aq)  followed by an "
6414 "optional decimal digit string.  Instead of a decimal digit string one may "
6415 "write \"*\" or \"*m$\" (for some decimal integer m) to specify that the "
6416 "precision is given in the next argument, or in the m-th argument, "
6417 "respectively, which must be of type I<int>.  If the precision is given as "
6418 "just \\(aq.\\(aq, or the precision is negative, the precision is taken to be "
6419 "zero.  This gives the minimum number of digits to appear for B<d>, B<i>, "
6420 "B<o>, B<u>, B<x>, and B<X> conversions, the number of digits to appear after "
6421 "the radix character for B<a>, B<A>, B<e>, B<E>, B<f>, and B<F> conversions, "
6422 "the maximum number of significant digits for B<g> and B<G> conversions, or "
6423 "the maximum number of characters to be printed from a string for B<s> and "
6424 "B<S> conversions."
6425 msgstr ""
6426
6427 #. type: SS
6428 #: build/C/man3/printf.3:440
6429 #, no-wrap
6430 msgid "The length modifier"
6431 msgstr ""
6432
6433 #. type: Plain text
6434 #: build/C/man3/printf.3:450
6435 msgid ""
6436 "Here, \"integer conversion\" stands for B<d>, B<i>, B<o>, B<u>, B<x>, or "
6437 "B<X> conversion."
6438 msgstr ""
6439
6440 #. type: TP
6441 #: build/C/man3/printf.3:450 build/C/man3/scanf.3:291
6442 #, no-wrap
6443 msgid "B<hh>"
6444 msgstr ""
6445
6446 #. type: Plain text
6447 #: build/C/man3/printf.3:461
6448 msgid ""
6449 "A following integer conversion corresponds to a I<signed char> or I<unsigned "
6450 "char> argument, or a following B<n> conversion corresponds to a pointer to a "
6451 "I<signed char> argument."
6452 msgstr ""
6453
6454 #. type: TP
6455 #: build/C/man3/printf.3:461 build/C/man3/scanf.3:281
6456 #, no-wrap
6457 msgid "B<h>"
6458 msgstr ""
6459
6460 #. type: Plain text
6461 #: build/C/man3/printf.3:472
6462 msgid ""
6463 "A following integer conversion corresponds to a I<short int> or I<unsigned "
6464 "short int> argument, or a following B<n> conversion corresponds to a pointer "
6465 "to a I<short int> argument."
6466 msgstr ""
6467
6468 #. type: TP
6469 #: build/C/man3/printf.3:472 build/C/man3/scanf.3:308
6470 #, no-wrap
6471 msgid "B<l>"
6472 msgstr ""
6473
6474 #. type: Plain text
6475 #: build/C/man3/printf.3:491
6476 msgid ""
6477 "(ell) A following integer conversion corresponds to a I<long int> or "
6478 "I<unsigned long int> argument, or a following B<n> conversion corresponds to "
6479 "a pointer to a I<long int> argument, or a following B<c> conversion "
6480 "corresponds to a I<wint_t> argument, or a following B<s> conversion "
6481 "corresponds to a pointer to I<wchar_t> argument."
6482 msgstr ""
6483
6484 #. type: TP
6485 #: build/C/man3/printf.3:491
6486 #, no-wrap
6487 msgid "B<ll>"
6488 msgstr ""
6489
6490 #. type: Plain text
6491 #: build/C/man3/printf.3:503
6492 msgid ""
6493 "(ell-ell).  A following integer conversion corresponds to a I<long long int> "
6494 "or I<unsigned long long int> argument, or a following B<n> conversion "
6495 "corresponds to a pointer to a I<long long int> argument."
6496 msgstr ""
6497
6498 #. type: TP
6499 #: build/C/man3/printf.3:503 build/C/man3/scanf.3:335
6500 #, no-wrap
6501 msgid "B<L>"
6502 msgstr ""
6503
6504 #. type: Plain text
6505 #: build/C/man3/printf.3:519
6506 msgid ""
6507 "A following B<a>, B<A>, B<e>, B<E>, B<f>, B<F>, B<g>, or B<G> conversion "
6508 "corresponds to a I<long double> argument.  (C99 allows %LF, but SUSv2 does "
6509 "not.)"
6510 msgstr ""
6511
6512 #. type: TP
6513 #: build/C/man3/printf.3:519 build/C/man3/scanf.3:351
6514 #, no-wrap
6515 msgid "B<q>"
6516 msgstr ""
6517
6518 #. type: Plain text
6519 #: build/C/man3/printf.3:525
6520 msgid ""
6521 "(\"quad\". 4.4BSD and Linux libc5 only.  Don't use.)  This is a synonym for "
6522 "B<ll>."
6523 msgstr ""
6524
6525 #. type: TP
6526 #: build/C/man3/printf.3:525 build/C/man3/scanf.3:299
6527 #, no-wrap
6528 msgid "B<j>"
6529 msgstr ""
6530
6531 #. type: Plain text
6532 #: build/C/man3/printf.3:532
6533 msgid ""
6534 "A following integer conversion corresponds to an I<intmax_t> or I<uintmax_t> "
6535 "argument."
6536 msgstr ""
6537
6538 #. type: TP
6539 #: build/C/man3/printf.3:532 build/C/man3/scanf.3:363
6540 #, no-wrap
6541 msgid "B<z>"
6542 msgstr ""
6543
6544 #. type: Plain text
6545 #: build/C/man3/printf.3:543
6546 msgid ""
6547 "A following integer conversion corresponds to a I<size_t> or I<ssize_t> "
6548 "argument.  (Linux libc5 has B<Z> with this meaning.  Don't use it.)"
6549 msgstr ""
6550
6551 #. type: TP
6552 #: build/C/man3/printf.3:543 build/C/man3/scanf.3:356
6553 #, no-wrap
6554 msgid "B<t>"
6555 msgstr ""
6556
6557 #. type: Plain text
6558 #: build/C/man3/printf.3:548
6559 msgid "A following integer conversion corresponds to a I<ptrdiff_t> argument."
6560 msgstr ""
6561
6562 #. type: Plain text
6563 #: build/C/man3/printf.3:577
6564 msgid ""
6565 "The SUSv2 only knows about the length modifiers B<h> (in B<hd>, B<hi>, "
6566 "B<ho>, B<hx>, B<hX>, B<hn>)  and B<l> (in B<ld>, B<li>, B<lo>, B<lx>, B<lX>, "
6567 "B<ln>, B<lc>, B<ls>)  and B<L> (in B<Le>, B<LE>, B<Lf>, B<Lg>, B<LG>)."
6568 msgstr ""
6569
6570 #. type: SS
6571 #: build/C/man3/printf.3:577
6572 #, no-wrap
6573 msgid "The conversion specifier"
6574 msgstr ""
6575
6576 #. type: Plain text
6577 #: build/C/man3/printf.3:580
6578 msgid ""
6579 "A character that specifies the type of conversion to be applied.  The "
6580 "conversion specifiers and their meanings are:"
6581 msgstr ""
6582
6583 #. type: TP
6584 #: build/C/man3/printf.3:580
6585 #, no-wrap
6586 msgid "B<d>, B<i>"
6587 msgstr ""
6588
6589 #. type: Plain text
6590 #: build/C/man3/printf.3:590
6591 msgid ""
6592 "The I<int> argument is converted to signed decimal notation.  The precision, "
6593 "if any, gives the minimum number of digits that must appear; if the "
6594 "converted value requires fewer digits, it is padded on the left with zeros.  "
6595 "The default precision is 1.  When 0 is printed with an explicit precision 0, "
6596 "the output is empty."
6597 msgstr ""
6598
6599 #. type: TP
6600 #: build/C/man3/printf.3:590
6601 #, no-wrap
6602 msgid "B<o>, B<u>, B<x>, B<X>"
6603 msgstr ""
6604
6605 #. type: Plain text
6606 #: build/C/man3/printf.3:617
6607 msgid ""
6608 "The I<unsigned int> argument is converted to unsigned octal (B<o>), unsigned "
6609 "decimal (B<u>), or unsigned hexadecimal (B<x> and B<X>)  notation.  The "
6610 "letters B<abcdef> are used for B<x> conversions; the letters B<ABCDEF> are "
6611 "used for B<X> conversions.  The precision, if any, gives the minimum number "
6612 "of digits that must appear; if the converted value requires fewer digits, it "
6613 "is padded on the left with zeros.  The default precision is 1.  When 0 is "
6614 "printed with an explicit precision 0, the output is empty."
6615 msgstr ""
6616
6617 #. type: TP
6618 #: build/C/man3/printf.3:617
6619 #, no-wrap
6620 msgid "B<e>, B<E>"
6621 msgstr ""
6622
6623 #. type: Plain text
6624 #: build/C/man3/printf.3:622
6625 msgid "The I<double> argument is rounded and converted in the style"
6626 msgstr ""
6627
6628 #. type: Plain text
6629 #: build/C/man3/printf.3:637
6630 msgid ""
6631 "[-]dB<\\&.>dddB<e>\\*(Pmdd where there is one digit before the decimal-point "
6632 "character and the number of digits after it is equal to the precision; if "
6633 "the precision is missing, it is taken as 6; if the precision is zero, no "
6634 "decimal-point character appears.  An B<E> conversion uses the letter B<E> "
6635 "(rather than B<e>)  to introduce the exponent.  The exponent always contains "
6636 "at least two digits; if the value is zero, the exponent is 00."
6637 msgstr ""
6638
6639 #. type: TP
6640 #: build/C/man3/printf.3:637
6641 #, no-wrap
6642 msgid "B<f>, B<F>"
6643 msgstr ""
6644
6645 #. type: Plain text
6646 #: build/C/man3/printf.3:648
6647 msgid ""
6648 "The I<double> argument is rounded and converted to decimal notation in the "
6649 "style [-]dddB<\\&.>ddd, where the number of digits after the decimal-point "
6650 "character is equal to the precision specification.  If the precision is "
6651 "missing, it is taken as 6; if the precision is explicitly zero, no "
6652 "decimal-point character appears.  If a decimal point appears, at least one "
6653 "digit appears before it."
6654 msgstr ""
6655
6656 #. type: Plain text
6657 #: build/C/man3/printf.3:659
6658 msgid ""
6659 "(The SUSv2 does not know about B<F> and says that character string "
6660 "representations for infinity and NaN may be made available.  The C99 "
6661 "standard specifies \"[-]inf\" or \"[-]infinity\" for infinity, and a string "
6662 "starting with \"nan\" for NaN, in the case of B<f> conversion, and "
6663 "\"[-]INF\" or \"[-]INFINITY\" or \"NAN*\" in the case of B<F> conversion.)"
6664 msgstr ""
6665
6666 #. type: TP
6667 #: build/C/man3/printf.3:659
6668 #, no-wrap
6669 msgid "B<g>, B<G>"
6670 msgstr ""
6671
6672 #. type: Plain text
6673 #: build/C/man3/printf.3:684
6674 msgid ""
6675 "The I<double> argument is converted in style B<f> or B<e> (or B<F> or B<E> "
6676 "for B<G> conversions).  The precision specifies the number of significant "
6677 "digits.  If the precision is missing, 6 digits are given; if the precision "
6678 "is zero, it is treated as 1.  Style B<e> is used if the exponent from its "
6679 "conversion is less than -4 or greater than or equal to the precision.  "
6680 "Trailing zeros are removed from the fractional part of the result; a decimal "
6681 "point appears only if it is followed by at least one digit."
6682 msgstr ""
6683
6684 #. type: TP
6685 #: build/C/man3/printf.3:684
6686 #, no-wrap
6687 msgid "B<a>, B<A>"
6688 msgstr ""
6689
6690 #. type: Plain text
6691 #: build/C/man3/printf.3:708
6692 msgid ""
6693 "(C99; not in SUSv2) For B<a> conversion, the I<double> argument is converted "
6694 "to hexadecimal notation (using the letters abcdef)  in the style "
6695 "[-]B<0x>hB<\\&.>hhhhB<p>\\*(Pmd; for B<A> conversion the prefix B<0X>, the "
6696 "letters ABCDEF, and the exponent separator B<P> is used.  There is one "
6697 "hexadecimal digit before the decimal point, and the number of digits after "
6698 "it is equal to the precision.  The default precision suffices for an exact "
6699 "representation of the value if an exact representation in base 2 exists and "
6700 "otherwise is sufficiently large to distinguish values of type I<double>.  "
6701 "The digit before the decimal point is unspecified for nonnormalized numbers, "
6702 "and nonzero but otherwise unspecified for normalized numbers."
6703 msgstr ""
6704
6705 #. type: TP
6706 #: build/C/man3/printf.3:708 build/C/man3/scanf.3:456 build/C/man3/wprintf.3:132
6707 #, no-wrap
6708 msgid "B<c>"
6709 msgstr ""
6710
6711 #. type: Plain text
6712 #: build/C/man3/printf.3:726
6713 msgid ""
6714 "If no B<l> modifier is present, the I<int> argument is converted to an "
6715 "I<unsigned char>, and the resulting character is written.  If an B<l> "
6716 "modifier is present, the I<wint_t> (wide character) argument is converted to "
6717 "a multibyte sequence by a call to the B<wcrtomb>(3)  function, with a "
6718 "conversion state starting in the initial state, and the resulting multibyte "
6719 "string is written."
6720 msgstr ""
6721
6722 #. type: TP
6723 #: build/C/man3/printf.3:726 build/C/man3/scanf.3:448 build/C/man3/wprintf.3:146
6724 #, no-wrap
6725 msgid "B<s>"
6726 msgstr ""
6727
6728 #. type: Plain text
6729 #: build/C/man3/printf.3:741
6730 msgid ""
6731 "If no B<l> modifier is present: The I<const char *> argument is expected to "
6732 "be a pointer to an array of character type (pointer to a string).  "
6733 "Characters from the array are written up to (but not including) a "
6734 "terminating null byte (\\(aq\\e0\\(aq); if a precision is specified, no more "
6735 "than the number specified are written.  If a precision is given, no null "
6736 "byte need be present; if the precision is not specified, or is greater than "
6737 "the size of the array, the array must contain a terminating null byte."
6738 msgstr ""
6739
6740 #. type: Plain text
6741 #: build/C/man3/printf.3:768
6742 msgid ""
6743 "If an B<l> modifier is present: The I<const wchar_t *> argument is expected "
6744 "to be a pointer to an array of wide characters.  Wide characters from the "
6745 "array are converted to multibyte characters (each by a call to the "
6746 "B<wcrtomb>(3)  function, with a conversion state starting in the initial "
6747 "state before the first wide character), up to and including a terminating "
6748 "null wide character.  The resulting multibyte characters are written up to "
6749 "(but not including) the terminating null byte.  If a precision is specified, "
6750 "no more bytes than the number specified are written, but no partial "
6751 "multibyte characters are written.  Note that the precision determines the "
6752 "number of I<bytes> written, not the number of I<wide characters> or I<screen "
6753 "positions>.  The array must contain a terminating null wide character, "
6754 "unless a precision is given and it is so small that the number of bytes "
6755 "written exceeds it before the end of the array is reached."
6756 msgstr ""
6757
6758 #. type: TP
6759 #: build/C/man3/printf.3:768
6760 #, no-wrap
6761 msgid "B<C>"
6762 msgstr ""
6763
6764 #. type: Plain text
6765 #: build/C/man3/printf.3:774
6766 msgid "(Not in C99, but in SUSv2.)  Synonym for B<lc>.  Don't use."
6767 msgstr ""
6768
6769 #. type: TP
6770 #: build/C/man3/printf.3:774
6771 #, no-wrap
6772 msgid "B<S>"
6773 msgstr ""
6774
6775 #. type: Plain text
6776 #: build/C/man3/printf.3:780
6777 msgid "(Not in C99, but in SUSv2.)  Synonym for B<ls>.  Don't use."
6778 msgstr ""
6779
6780 #. type: TP
6781 #: build/C/man3/printf.3:780 build/C/man3/scanf.3:500
6782 #, no-wrap
6783 msgid "B<p>"
6784 msgstr ""
6785
6786 #. type: Plain text
6787 #: build/C/man3/printf.3:788
6788 msgid ""
6789 "The I<void *> pointer argument is printed in hexadecimal (as if by B<%#x> or "
6790 "B<%#lx>)."
6791 msgstr ""
6792
6793 #. type: TP
6794 #: build/C/man3/printf.3:788 build/C/man3/scanf.3:508
6795 #, no-wrap
6796 msgid "B<n>"
6797 msgstr ""
6798
6799 #. type: Plain text
6800 #: build/C/man3/printf.3:795
6801 msgid ""
6802 "The number of characters written so far is stored into the integer indicated "
6803 "by the I<int *> (or variant) pointer argument.  No argument is converted."
6804 msgstr ""
6805
6806 #. type: TP
6807 #: build/C/man3/printf.3:795
6808 #, no-wrap
6809 msgid "B<m>"
6810 msgstr ""
6811
6812 #. type: Plain text
6813 #: build/C/man3/printf.3:801
6814 msgid ""
6815 "(Glibc extension.)  Print output of I<strerror(errno)>.  No argument is "
6816 "required."
6817 msgstr ""
6818
6819 #. type: TP
6820 #: build/C/man3/printf.3:801 build/C/man3/scanf.3:374
6821 #, no-wrap
6822 msgid "B<%>"
6823 msgstr ""
6824
6825 #. type: Plain text
6826 #: build/C/man3/printf.3:807
6827 msgid ""
6828 "A \\(aq%\\(aq is written.  No argument is converted.  The complete "
6829 "conversion specification is \\(aq%%\\(aq."
6830 msgstr ""
6831
6832 #. type: Plain text
6833 #: build/C/man3/printf.3:822
6834 msgid ""
6835 "The B<fprintf>(), B<printf>(), B<sprintf>(), B<vprintf>(), B<vfprintf>(), "
6836 "and B<vsprintf>()  functions conform to C89 and C99.  The B<snprintf>()  and "
6837 "B<vsnprintf>()  functions conform to C99."
6838 msgstr ""
6839
6840 #. type: Plain text
6841 #: build/C/man3/printf.3:835
6842 msgid ""
6843 "Concerning the return value of B<snprintf>(), SUSv2 and C99 contradict each "
6844 "other: when B<snprintf>()  is called with I<size>=0 then SUSv2 stipulates an "
6845 "unspecified return value less than 1, while C99 allows I<str> to be NULL in "
6846 "this case, and gives the return value (as always)  as the number of "
6847 "characters that would have been written in case the output string has been "
6848 "large enough."
6849 msgstr ""
6850
6851 #. type: Plain text
6852 #: build/C/man3/printf.3:849
6853 msgid ""
6854 "Linux libc4 knows about the five C standard flags.  It knows about the "
6855 "length modifiers B<h>, B<l>, B<L>, and the conversions B<c>, B<d>, B<e>, "
6856 "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 "
6857 "B<X>, where B<F> is a synonym for B<f>.  Additionally, it accepts B<D>, "
6858 "B<O>, and B<U> as synonyms for B<ld>, B<lo>, and B<lu>.  (This is bad, and "
6859 "caused serious bugs later, when support for B<%D> disappeared.)  No "
6860 "locale-dependent radix character, no thousands' separator, no NaN or "
6861 "infinity, no \"%m$\" and \"*m$\"."
6862 msgstr ""
6863
6864 #. type: Plain text
6865 #: build/C/man3/printf.3:860
6866 msgid ""
6867 "Linux libc5 knows about the five C standard flags and the \\(aq flag, "
6868 "locale, \"%m$\" and \"*m$\".  It knows about the length modifiers B<h>, "
6869 "B<l>, B<L>, B<Z>, and B<q>, but accepts B<L> and B<q> both for I<long "
6870 "double> and for I<long long int> (this is a bug).  It no longer recognizes "
6871 "B<F>, B<D>, B<O>, and B<U>, but adds the conversion character B<m>, which "
6872 "outputs I<strerror(errno)>."
6873 msgstr ""
6874
6875 #. type: Plain text
6876 #: build/C/man3/printf.3:862
6877 msgid "glibc 2.0 adds conversion characters B<C> and B<S>."
6878 msgstr ""
6879
6880 #. type: Plain text
6881 #: build/C/man3/printf.3:865
6882 msgid ""
6883 "glibc 2.1 adds length modifiers B<hh>, B<j>, B<t>, and B<z> and conversion "
6884 "characters B<a> and B<A>."
6885 msgstr ""
6886
6887 #. type: Plain text
6888 #: build/C/man3/printf.3:868
6889 msgid ""
6890 "glibc 2.2 adds the conversion character B<F> with C99 semantics, and the "
6891 "flag character B<I>."
6892 msgstr ""
6893
6894 #. type: Plain text
6895 #: build/C/man3/printf.3:870
6896 msgid "Some programs imprudently rely on code such as the following"
6897 msgstr ""
6898
6899 #. type: Plain text
6900 #: build/C/man3/printf.3:872
6901 #, no-wrap
6902 msgid "    sprintf(buf, \"%s some further text\", buf);\n"
6903 msgstr ""
6904
6905 #.  http://sourceware.org/bugzilla/show_bug.cgi?id=7075
6906 #. type: Plain text
6907 #: build/C/man3/printf.3:888
6908 msgid ""
6909 "to append text to I<buf>.  However, the standards explicitly note that the "
6910 "results are undefined if source and destination buffers overlap when calling "
6911 "B<sprintf>(), B<snprintf>(), B<vsprintf>(), and B<vsnprintf>().  Depending "
6912 "on the version of B<gcc>(1)  used, and the compiler options employed, calls "
6913 "such as the above will B<not> produce the expected results."
6914 msgstr ""
6915
6916 #.  .SH HISTORY
6917 #.  UNIX V7 defines the three routines
6918 #.  .BR printf (),
6919 #.  .BR fprintf (),
6920 #.  .BR sprintf (),
6921 #.  and has the flag \-, the width or precision *, the length modifier l,
6922 #.  and the conversions doxfegcsu, and also D,O,U,X as synonyms for ld,lo,lu,lx.
6923 #.  This is still true for 2.9.1BSD, but 2.10BSD has the flags
6924 #.  #, + and <space> and no longer mentions D,O,U,X.
6925 #.  2.11BSD has
6926 #.  .BR vprintf (),
6927 #.  .BR vfprintf (),
6928 #.  .BR vsprintf (),
6929 #.  and warns not to use D,O,U,X.
6930 #.  4.3BSD Reno has the flag 0, the length modifiers h and L,
6931 #.  and the conversions n, p, E, G, X (with current meaning)
6932 #.  and deprecates D,O,U.
6933 #.  4.4BSD introduces the functions
6934 #.  .BR snprintf ()
6935 #.  and
6936 #.  .BR vsnprintf (),
6937 #.  and the length modifier q.
6938 #.  FreeBSD also has functions
6939 #.  .BR asprintf ()
6940 #.  and
6941 #.  .BR vasprintf (),
6942 #.  that allocate a buffer large enough for
6943 #.  .BR sprintf ().
6944 #.  In glibc there are functions
6945 #.  .BR dprintf ()
6946 #.  and
6947 #.  .BR vdprintf ()
6948 #.  that print to a file descriptor instead of a stream.
6949 #. type: Plain text
6950 #: build/C/man3/printf.3:930
6951 msgid ""
6952 "The glibc implementation of the functions B<snprintf>()  and B<vsnprintf>()  "
6953 "conforms to the C99 standard, that is, behaves as described above, since "
6954 "glibc version 2.1.  Until glibc 2.0.6 they would return -1 when the output "
6955 "was truncated."
6956 msgstr ""
6957
6958 #. type: Plain text
6959 #: build/C/man3/printf.3:947
6960 msgid ""
6961 "Because B<sprintf>()  and B<vsprintf>()  assume an arbitrarily long string, "
6962 "callers must be careful not to overflow the actual space; this is often "
6963 "impossible to assure.  Note that the length of the strings produced is "
6964 "locale-dependent and difficult to predict.  Use B<snprintf>()  and "
6965 "B<vsnprintf>()  instead (or B<asprintf>(3)  and B<vasprintf>(3))."
6966 msgstr ""
6967
6968 #. type: Plain text
6969 #: build/C/man3/printf.3:960
6970 msgid ""
6971 "Linux libc4.[45] does not have a B<snprintf>(), but provides a libbsd that "
6972 "contains an B<snprintf>()  equivalent to B<sprintf>(), that is, one that "
6973 "ignores the I<size> argument.  Thus, the use of B<snprintf>()  with early "
6974 "libc4 leads to serious security problems."
6975 msgstr ""
6976
6977 #.  .PP
6978 #.  Some floating-point conversions under early libc4
6979 #.  caused memory leaks.
6980 #. type: Plain text
6981 #: build/C/man3/printf.3:974
6982 msgid ""
6983 "Code such as B<printf(>I<foo>B<);> often indicates a bug, since I<foo> may "
6984 "contain a % character.  If I<foo> comes from untrusted user input, it may "
6985 "contain B<%n>, causing the B<printf>()  call to write to memory and creating "
6986 "a security hole."
6987 msgstr ""
6988
6989 #. type: Plain text
6990 #: build/C/man3/printf.3:977
6991 msgid "To print \\*(Pi to five decimal places:"
6992 msgstr ""
6993
6994 #. type: Plain text
6995 #: build/C/man3/printf.3:983
6996 #, no-wrap
6997 msgid ""
6998 "#include E<lt>math.hE<gt>\n"
6999 "#include E<lt>stdio.hE<gt>\n"
7000 "fprintf(stdout, \"pi = %.5f\\en\", 4 * atan(1.0));\n"
7001 msgstr ""
7002
7003 #. type: Plain text
7004 #: build/C/man3/printf.3:992
7005 msgid ""
7006 "To print a date and time in the form \"Sunday, July 3, 10:02\", where "
7007 "I<weekday> and I<month> are pointers to strings:"
7008 msgstr ""
7009
7010 #. type: Plain text
7011 #: build/C/man3/printf.3:998
7012 #, no-wrap
7013 msgid ""
7014 "#include E<lt>stdio.hE<gt>\n"
7015 "fprintf(stdout, \"%s, %s %d, %.2d:%.2d\\en\",\n"
7016 "        weekday, month, day, hour, min);\n"
7017 msgstr ""
7018
7019 #. type: Plain text
7020 #: build/C/man3/printf.3:1004
7021 msgid ""
7022 "Many countries use the day-month-year order.  Hence, an internationalized "
7023 "version must be able to print the arguments in an order specified by the "
7024 "format:"
7025 msgstr ""
7026
7027 #. type: Plain text
7028 #: build/C/man3/printf.3:1010
7029 #, no-wrap
7030 msgid ""
7031 "#include E<lt>stdio.hE<gt>\n"
7032 "fprintf(stdout, format,\n"
7033 "        weekday, month, day, hour, min);\n"
7034 msgstr ""
7035
7036 #. type: Plain text
7037 #: build/C/man3/printf.3:1017
7038 msgid ""
7039 "where I<format> depends on locale, and may permute the arguments.  With the "
7040 "value:"
7041 msgstr ""
7042
7043 #. type: Plain text
7044 #: build/C/man3/printf.3:1021
7045 #, no-wrap
7046 msgid "\"%1$s, %3$d. %2$s, %4$d:%5$.2d\\en\"\n"
7047 msgstr ""
7048
7049 #. type: Plain text
7050 #: build/C/man3/printf.3:1025
7051 msgid "one might obtain \"Sonntag, 3. Juli, 10:02\"."
7052 msgstr ""
7053
7054 #. type: Plain text
7055 #: build/C/man3/printf.3:1028
7056 msgid ""
7057 "To allocate a sufficiently large string and print into it (code correct for "
7058 "both glibc 2.0 and glibc 2.1):"
7059 msgstr ""
7060
7061 #. type: Plain text
7062 #: build/C/man3/printf.3:1033
7063 #, no-wrap
7064 msgid ""
7065 "#include E<lt>stdio.hE<gt>\n"
7066 "#include E<lt>stdlib.hE<gt>\n"
7067 "#include E<lt>stdarg.hE<gt>\n"
7068 msgstr ""
7069
7070 #. type: Plain text
7071 #: build/C/man3/printf.3:1041
7072 #, no-wrap
7073 msgid ""
7074 "char *\n"
7075 "make_message(const char *fmt, ...)\n"
7076 "{\n"
7077 "    int n;\n"
7078 "    int size = 100;     /* Guess we need no more than 100 bytes. */\n"
7079 "    char *p, *np;\n"
7080 "    va_list ap;\n"
7081 msgstr ""
7082
7083 #. type: Plain text
7084 #: build/C/man3/printf.3:1044
7085 #, no-wrap
7086 msgid ""
7087 "    if ((p = malloc(size)) == NULL)\n"
7088 "        return NULL;\n"
7089 msgstr ""
7090
7091 #. type: Plain text
7092 #: build/C/man3/printf.3:1046
7093 #, no-wrap
7094 msgid "    while (1) {\n"
7095 msgstr ""
7096
7097 #. type: Plain text
7098 #: build/C/man3/printf.3:1048
7099 #, no-wrap
7100 msgid "        /* Try to print in the allocated space. */\n"
7101 msgstr ""
7102
7103 #. type: Plain text
7104 #: build/C/man3/printf.3:1052
7105 #, no-wrap
7106 msgid ""
7107 "        va_start(ap, fmt);\n"
7108 "        n = vsnprintf(p, size, fmt, ap);\n"
7109 "        va_end(ap);\n"
7110 msgstr ""
7111
7112 #. type: Plain text
7113 #: build/C/man3/printf.3:1054
7114 #, no-wrap
7115 msgid "        /* If that worked, return the string. */\n"
7116 msgstr ""
7117
7118 #. type: Plain text
7119 #: build/C/man3/printf.3:1057
7120 #, no-wrap
7121 msgid ""
7122 "        if (n E<gt> -1 && n E<lt> size)\n"
7123 "            return p;\n"
7124 msgstr ""
7125
7126 #. type: Plain text
7127 #: build/C/man3/printf.3:1059
7128 #, no-wrap
7129 msgid "        /* Else try again with more space. */\n"
7130 msgstr ""
7131
7132 #. type: Plain text
7133 #: build/C/man3/printf.3:1064
7134 #, no-wrap
7135 msgid ""
7136 "        if (n E<gt> -1)    /* glibc 2.1 */\n"
7137 "            size = n+1; /* precisely what is needed */\n"
7138 "        else           /* glibc 2.0 */\n"
7139 "            size *= 2;  /* twice the old size */\n"
7140 msgstr ""
7141
7142 #. type: Plain text
7143 #: build/C/man3/printf.3:1073
7144 #, no-wrap
7145 msgid ""
7146 "        if ((np = realloc (p, size)) == NULL) {\n"
7147 "            free(p);\n"
7148 "            return NULL;\n"
7149 "        } else {\n"
7150 "            p = np;\n"
7151 "        }\n"
7152 "    }\n"
7153 "}\n"
7154 msgstr ""
7155
7156 #. type: Plain text
7157 #: build/C/man3/printf.3:1083
7158 msgid ""
7159 "B<printf>(1), B<asprintf>(3), B<dprintf>(3), B<scanf>(3), B<setlocale>(3), "
7160 "B<wcrtomb>(3), B<wprintf>(3), B<locale>(5)"
7161 msgstr ""
7162
7163 #. type: TH
7164 #: build/C/man3/puts.3:24
7165 #, no-wrap
7166 msgid "PUTS"
7167 msgstr ""
7168
7169 #. type: Plain text
7170 #: build/C/man3/puts.3:27
7171 msgid "fputc, fputs, putc, putchar, puts - output of characters and strings"
7172 msgstr ""
7173
7174 #. type: Plain text
7175 #: build/C/man3/puts.3:32
7176 #, no-wrap
7177 msgid "B<int fputc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7178 msgstr ""
7179
7180 #. type: Plain text
7181 #: build/C/man3/puts.3:34
7182 #, no-wrap
7183 msgid "B<int fputs(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
7184 msgstr ""
7185
7186 #. type: Plain text
7187 #: build/C/man3/puts.3:36
7188 #, no-wrap
7189 msgid "B<int putc(int >I<c>B<, FILE *>I<stream>B<);>\n"
7190 msgstr ""
7191
7192 #. type: Plain text
7193 #: build/C/man3/puts.3:38
7194 #, no-wrap
7195 msgid "B<int putchar(int >I<c>B<);>\n"
7196 msgstr ""
7197
7198 #. type: Plain text
7199 #: build/C/man3/puts.3:40
7200 #, no-wrap
7201 msgid "B<int puts(const char *>I<s>B<);>\n"
7202 msgstr ""
7203
7204 #. type: Plain text
7205 #: build/C/man3/puts.3:49
7206 msgid ""
7207 "B<fputc>()  writes the character I<c>, cast to an I<unsigned char>, to "
7208 "I<stream>."
7209 msgstr ""
7210
7211 #. type: Plain text
7212 #: build/C/man3/puts.3:56
7213 msgid ""
7214 "B<fputs>()  writes the string I<s> to I<stream>, without its terminating "
7215 "null byte (\\(aq\\e0\\(aq)."
7216 msgstr ""
7217
7218 #. type: Plain text
7219 #: build/C/man3/puts.3:63
7220 msgid ""
7221 "B<putc>()  is equivalent to B<fputc>()  except that it may be implemented as "
7222 "a macro which evaluates I<stream> more than once."
7223 msgstr ""
7224
7225 #. type: Plain text
7226 #: build/C/man3/puts.3:67
7227 msgid "B<putchar(>I<c>B<);> is equivalent to B<putc(>I<c>B<,>I<stdout>B<).>"
7228 msgstr ""
7229
7230 #. type: Plain text
7231 #: build/C/man3/puts.3:74
7232 msgid "B<puts>()  writes the string I<s> and a trailing newline to I<stdout>."
7233 msgstr ""
7234
7235 #. type: Plain text
7236 #: build/C/man3/puts.3:79
7237 msgid ""
7238 "Calls to the functions described here can be mixed with each other and with "
7239 "calls to other output functions from the I<stdio> library for the same "
7240 "output stream."
7241 msgstr ""
7242
7243 #. type: Plain text
7244 #: build/C/man3/puts.3:94
7245 msgid ""
7246 "B<fputc>(), B<putc>()  and B<putchar>()  return the character written as an "
7247 "I<unsigned char> cast to an I<int> or B<EOF> on error."
7248 msgstr ""
7249
7250 #. type: Plain text
7251 #: build/C/man3/puts.3:101
7252 msgid ""
7253 "B<puts>()  and B<fputs>()  return a nonnegative number on success, or B<EOF> "
7254 "on error."
7255 msgstr ""
7256
7257 #. type: Plain text
7258 #: build/C/man3/puts.3:110
7259 msgid ""
7260 "It is not advisable to mix calls to output functions from the I<stdio> "
7261 "library with low-level calls to B<write>(2)  for the file descriptor "
7262 "associated with the same output stream; the results will be undefined and "
7263 "very probably not what you want."
7264 msgstr ""
7265
7266 #. type: Plain text
7267 #: build/C/man3/puts.3:122
7268 msgid ""
7269 "B<write>(2), B<ferror>(3), B<fopen>(3), B<fputwc>(3), B<fputws>(3), "
7270 "B<fseek>(3), B<fwrite>(3), B<gets>(3), B<putwchar>(3), B<scanf>(3), "
7271 "B<unlocked_stdio>(3)"
7272 msgstr ""
7273
7274 #. type: TH
7275 #: build/C/man2/read.2:35
7276 #, no-wrap
7277 msgid "READ"
7278 msgstr ""
7279
7280 #. type: Plain text
7281 #: build/C/man2/read.2:38
7282 msgid "read - read from a file descriptor"
7283 msgstr ""
7284
7285 #. type: Plain text
7286 #: build/C/man2/read.2:43
7287 #, no-wrap
7288 msgid "B<ssize_t read(int >I<fd>B<, void *>I<buf>B<, size_t >I<count>B<);>\n"
7289 msgstr ""
7290
7291 #. type: Plain text
7292 #: build/C/man2/read.2:52
7293 msgid ""
7294 "B<read>()  attempts to read up to I<count> bytes from file descriptor I<fd> "
7295 "into the buffer starting at I<buf>."
7296 msgstr ""
7297
7298 #. type: Plain text
7299 #: build/C/man2/read.2:63
7300 msgid ""
7301 "If I<count> is zero, B<read>()  returns zero and has no other results.  If "
7302 "I<count> is greater than B<SSIZE_MAX>, the result is unspecified."
7303 msgstr ""
7304
7305 #. type: Plain text
7306 #: build/C/man2/read.2:77
7307 msgid ""
7308 "On success, the number of bytes read is returned (zero indicates end of "
7309 "file), and the file position is advanced by this number.  It is not an error "
7310 "if this number is smaller than the number of bytes requested; this may "
7311 "happen for example because fewer bytes are actually available right now "
7312 "(maybe because we were close to end-of-file, or because we are reading from "
7313 "a pipe, or from a terminal), or because B<read>()  was interrupted by a "
7314 "signal.  On error, -1 is returned, and I<errno> is set appropriately.  In "
7315 "this case it is left unspecified whether the file position (if any) changes."
7316 msgstr ""
7317
7318 #. type: TP
7319 #: build/C/man2/read.2:78 build/C/man3/scanf.3:546 build/C/man2/write.2:108
7320 #, no-wrap
7321 msgid "B<EAGAIN>"
7322 msgstr ""
7323
7324 #. type: Plain text
7325 #: build/C/man2/read.2:85
7326 msgid ""
7327 "The file descriptor I<fd> refers to a file other than a socket and has been "
7328 "marked nonblocking (B<O_NONBLOCK>), and the read would block."
7329 msgstr ""
7330
7331 #. type: TP
7332 #: build/C/man2/read.2:85 build/C/man2/write.2:115
7333 #, no-wrap
7334 msgid "B<EAGAIN> or B<EWOULDBLOCK>"
7335 msgstr ""
7336
7337 #.  Actually EAGAIN on Linux
7338 #. type: Plain text
7339 #: build/C/man2/read.2:96
7340 msgid ""
7341 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
7342 "(B<O_NONBLOCK>), and the read would block.  POSIX.1-2001 allows either error "
7343 "to be returned for this case, and does not require these constants to have "
7344 "the same value, so a portable application should check for both "
7345 "possibilities."
7346 msgstr ""
7347
7348 #. type: Plain text
7349 #: build/C/man2/read.2:100
7350 msgid "I<fd> is not a valid file descriptor or is not open for reading."
7351 msgstr ""
7352
7353 #. type: Plain text
7354 #: build/C/man2/read.2:104 build/C/man2/write.2:139
7355 msgid "I<buf> is outside your accessible address space."
7356 msgstr ""
7357
7358 #. type: Plain text
7359 #: build/C/man2/read.2:108
7360 msgid ""
7361 "The call was interrupted by a signal before any data was read; see "
7362 "B<signal>(7)."
7363 msgstr ""
7364
7365 #. type: Plain text
7366 #: build/C/man2/read.2:119
7367 msgid ""
7368 "I<fd> is attached to an object which is unsuitable for reading; or the file "
7369 "was opened with the B<O_DIRECT> flag, and either the address specified in "
7370 "I<buf>, the value specified in I<count>, or the current file offset is not "
7371 "suitably aligned."
7372 msgstr ""
7373
7374 #. type: Plain text
7375 #: build/C/man2/read.2:129
7376 msgid ""
7377 "I<fd> was created via a call to B<timerfd_create>(2)  and the wrong size "
7378 "buffer was given to B<read>(); see B<timerfd_create>(2)  for further "
7379 "information."
7380 msgstr ""
7381
7382 #. type: Plain text
7383 #: build/C/man2/read.2:140
7384 msgid ""
7385 "I/O error.  This will happen for example when the process is in a background "
7386 "process group, tries to read from its controlling tty, and either it is "
7387 "ignoring or blocking B<SIGTTIN> or its process group is orphaned.  It may "
7388 "also occur when there is a low-level I/O error while reading from a disk or "
7389 "tape."
7390 msgstr ""
7391
7392 #. type: Plain text
7393 #: build/C/man2/read.2:144
7394 msgid "I<fd> refers to a directory."
7395 msgstr ""
7396
7397 #. type: Plain text
7398 #: build/C/man2/read.2:155
7399 msgid ""
7400 "Other errors may occur, depending on the object connected to I<fd>.  POSIX "
7401 "allows a B<read>()  that is interrupted after reading some data to return -1 "
7402 "(with I<errno> set to B<EINTR>)  or to return the number of bytes already "
7403 "read."
7404 msgstr ""
7405
7406 #. type: Plain text
7407 #: build/C/man2/read.2:169
7408 msgid ""
7409 "On NFS file systems, reading small amounts of data will only update the "
7410 "timestamp the first time, subsequent calls may not do so.  This is caused by "
7411 "client side attribute caching, because most if not all NFS clients leave "
7412 "st_atime (last file access time)  updates to the server and client side "
7413 "reads satisfied from the client's cache will not cause st_atime updates on "
7414 "the server as there are no server side reads.  UNIX semantics can be "
7415 "obtained by disabling client side attribute caching, but in most situations "
7416 "this will substantially increase server load and decrease performance."
7417 msgstr ""
7418
7419 #. type: Plain text
7420 #: build/C/man2/read.2:178
7421 msgid ""
7422 "Many file systems and disks were considered to be fast enough that the "
7423 "implementation of B<O_NONBLOCK> was deemed unnecessary.  So, B<O_NONBLOCK> "
7424 "may not be available on files and/or disks."
7425 msgstr ""
7426
7427 #. type: Plain text
7428 #: build/C/man2/read.2:191
7429 msgid ""
7430 "B<close>(2), B<fcntl>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), B<pread>(2), "
7431 "B<readdir>(2), B<readlink>(2), B<readv>(2), B<select>(2), B<write>(2), "
7432 "B<fread>(3)"
7433 msgstr ""
7434
7435 #. type: TH
7436 #: build/C/man2/readlink.2:41
7437 #, no-wrap
7438 msgid "READLINK"
7439 msgstr ""
7440
7441 #. type: TH
7442 #: build/C/man2/readlink.2:41
7443 #, no-wrap
7444 msgid "2011-09-20"
7445 msgstr ""
7446
7447 #. type: Plain text
7448 #: build/C/man2/readlink.2:44
7449 msgid "readlink - read value of a symbolic link"
7450 msgstr ""
7451
7452 #. type: Plain text
7453 #: build/C/man2/readlink.2:48
7454 msgid ""
7455 "B<ssize_t readlink(const char *>I<path>B<, char *>I<buf>B<, size_t "
7456 ">I<bufsiz>B<);>"
7457 msgstr ""
7458
7459 #. type: Plain text
7460 #: build/C/man2/readlink.2:56
7461 msgid "B<readlink>():"
7462 msgstr ""
7463
7464 #. type: Plain text
7465 #: build/C/man2/readlink.2:59 build/C/man2/symlink.2:50
7466 msgid ""
7467 "_BSD_SOURCE || _XOPEN_SOURCE\\ E<gt>=\\ 500 || _XOPEN_SOURCE\\ &&\\ "
7468 "_XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\\ E<gt>=\\ 200112L"
7469 msgstr ""
7470
7471 #. type: Plain text
7472 #: build/C/man2/readlink.2:75
7473 msgid ""
7474 "B<readlink>()  places the contents of the symbolic link I<path> in the "
7475 "buffer I<buf>, which has size I<bufsiz>.  B<readlink>()  does not append a "
7476 "null byte to I<buf>.  It will truncate the contents (to a length of "
7477 "I<bufsiz> characters), in case the buffer is too small to hold all of the "
7478 "contents."
7479 msgstr ""
7480
7481 #. type: Plain text
7482 #: build/C/man2/readlink.2:83
7483 msgid ""
7484 "On success, B<readlink>()  returns the number of bytes placed in I<buf>.  On "
7485 "error, -1 is returned and I<errno> is set to indicate the error."
7486 msgstr ""
7487
7488 #. type: Plain text
7489 #: build/C/man2/readlink.2:89
7490 msgid ""
7491 "Search permission is denied for a component of the path prefix.  (See also "
7492 "B<path_resolution>(7).)"
7493 msgstr ""
7494
7495 #. type: Plain text
7496 #: build/C/man2/readlink.2:93
7497 msgid "I<buf> extends outside the process's allocated address space."
7498 msgstr ""
7499
7500 #.  At the glibc level, bufsiz is unsigned, so this error can only occur
7501 #.  if bufsiz==0.  However, the in the kernel syscall, bufsiz is signed,
7502 #.  and this error can also occur if bufsiz < 0.
7503 #.  See: http://thread.gmane.org/gmane.linux.man/380
7504 #.  Subject: [patch 0/3] [RFC] kernel/glibc mismatch of "readlink" syscall?
7505 #. type: Plain text
7506 #: build/C/man2/readlink.2:102
7507 msgid "I<bufsiz> is not positive."
7508 msgstr ""
7509
7510 #. type: Plain text
7511 #: build/C/man2/readlink.2:105
7512 msgid "The named file is not a symbolic link."
7513 msgstr ""
7514
7515 #. type: Plain text
7516 #: build/C/man2/readlink.2:108
7517 msgid "An I/O error occurred while reading from the file system."
7518 msgstr ""
7519
7520 #. type: Plain text
7521 #: build/C/man2/readlink.2:111
7522 msgid "Too many symbolic links were encountered in translating the pathname."
7523 msgstr ""
7524
7525 #. type: Plain text
7526 #: build/C/man2/readlink.2:114
7527 msgid "A pathname, or a component of a pathname, was too long."
7528 msgstr ""
7529
7530 #. type: Plain text
7531 #: build/C/man2/readlink.2:117
7532 msgid "The named file does not exist."
7533 msgstr ""
7534
7535 #. type: Plain text
7536 #: build/C/man2/readlink.2:123
7537 msgid "A component of the path prefix is not a directory."
7538 msgstr ""
7539
7540 #. type: Plain text
7541 #: build/C/man2/readlink.2:128
7542 msgid "4.4BSD (B<readlink>()  first appeared in 4.2BSD), POSIX.1-2001."
7543 msgstr ""
7544
7545 #. type: Plain text
7546 #: build/C/man2/readlink.2:136
7547 msgid ""
7548 "In versions of glibc up to and including glibc 2.4, the return type of "
7549 "B<readlink>()  was declared as I<int>.  Nowadays, the return type is "
7550 "declared as I<ssize_t>, as (newly) required in POSIX.1-2001."
7551 msgstr ""
7552
7553 #. type: Plain text
7554 #: build/C/man2/readlink.2:155
7555 msgid ""
7556 "Using a statically sized buffer might not provide enough room for the "
7557 "symbolic link contents.  The required size for the buffer can be obtained "
7558 "from the I<stat.st_size> value returned by a call to B<lstat>(2)  on the "
7559 "link.  However, the number of bytes written by B<readlink>()  should be "
7560 "checked to make sure that the size of the symbolic link did not increase "
7561 "between the calls.  Dynamically allocating the buffer for B<readlink>()  "
7562 "also addresses a common portability problem when using I<PATH_MAX> for the "
7563 "buffer size, as this constant is not guaranteed to be defined per POSIX if "
7564 "the system does not have such limit."
7565 msgstr ""
7566
7567 #. type: Plain text
7568 #: build/C/man2/readlink.2:161
7569 msgid ""
7570 "The following program allocates the buffer needed by B<readlink>()  "
7571 "dynamically from the information provided by B<lstat>(), making sure there's "
7572 "no race condition between the calls."
7573 msgstr ""
7574
7575 #. type: Plain text
7576 #: build/C/man2/readlink.2:168
7577 #, no-wrap
7578 msgid ""
7579 "#include E<lt>sys/types.hE<gt>\n"
7580 "#include E<lt>sys/stat.hE<gt>\n"
7581 "#include E<lt>stdio.hE<gt>\n"
7582 "#include E<lt>stdlib.hE<gt>\n"
7583 "#include E<lt>unistd.hE<gt>\n"
7584 msgstr ""
7585
7586 #. type: Plain text
7587 #: build/C/man2/readlink.2:175
7588 #, no-wrap
7589 msgid ""
7590 "int\n"
7591 "main(int argc, char *argv[])\n"
7592 "{\n"
7593 "    struct stat sb;\n"
7594 "    char *linkname;\n"
7595 "    ssize_t r;\n"
7596 msgstr ""
7597
7598 #. type: Plain text
7599 #: build/C/man2/readlink.2:180
7600 #, no-wrap
7601 msgid ""
7602 "    if (argc != 2) {\n"
7603 "        fprintf(stderr, \"Usage: %s E<lt>pathnameE<gt>\\en\", argv[0]);\n"
7604 "        exit(EXIT_FAILURE);\n"
7605 "    }\n"
7606 msgstr ""
7607
7608 #. type: Plain text
7609 #: build/C/man2/readlink.2:185
7610 #, no-wrap
7611 msgid ""
7612 "    if (lstat(argv[1], &sb) == -1) {\n"
7613 "        perror(\"lstat\");\n"
7614 "        exit(EXIT_FAILURE);\n"
7615 "    }\n"
7616 msgstr ""
7617
7618 #. type: Plain text
7619 #: build/C/man2/readlink.2:191
7620 #, no-wrap
7621 msgid ""
7622 "    linkname = malloc(sb.st_size + 1);\n"
7623 "    if (linkname == NULL) {\n"
7624 "        fprintf(stderr, \"insufficient memory\\en\");\n"
7625 "        exit(EXIT_FAILURE);\n"
7626 "    }\n"
7627 msgstr ""
7628
7629 #. type: Plain text
7630 #: build/C/man2/readlink.2:193
7631 #, no-wrap
7632 msgid "    r = readlink(argv[1], linkname, sb.st_size + 1);\n"
7633 msgstr ""
7634
7635 #. type: Plain text
7636 #: build/C/man2/readlink.2:198
7637 #, no-wrap
7638 msgid ""
7639 "    if (r E<lt> 0) {\n"
7640 "        perror(\"lstat\");\n"
7641 "        exit(EXIT_FAILURE);\n"
7642 "    }\n"
7643 msgstr ""
7644
7645 #. type: Plain text
7646 #: build/C/man2/readlink.2:204
7647 #, no-wrap
7648 msgid ""
7649 "    if (r E<gt> sb.st_size) {\n"
7650 "        fprintf(stderr, \"symlink increased in size \"\n"
7651 "                        \"between lstat() and readlink()\\en\");\n"
7652 "        exit(EXIT_FAILURE);\n"
7653 "    }\n"
7654 msgstr ""
7655
7656 #. type: Plain text
7657 #: build/C/man2/readlink.2:206
7658 #, no-wrap
7659 msgid "    linkname[sb.st_size] = \\(aq\\e0\\(aq;\n"
7660 msgstr ""
7661
7662 #. type: Plain text
7663 #: build/C/man2/readlink.2:208
7664 #, no-wrap
7665 msgid ""
7666 "    printf(\"\\(aq%s\\(aq points to \\(aq%s\\(aq\\en\", argv[1], "
7667 "linkname);\n"
7668 msgstr ""
7669
7670 #. type: Plain text
7671 #: build/C/man2/readlink.2:220
7672 msgid ""
7673 "B<readlink>(1), B<lstat>(2), B<readlinkat>(2), B<stat>(2), B<symlink>(2), "
7674 "B<path_resolution>(7), B<symlink>(7)"
7675 msgstr ""
7676
7677 #. type: TH
7678 #: build/C/man2/readv.2:30
7679 #, no-wrap
7680 msgid "READV"
7681 msgstr ""
7682
7683 #. type: TH
7684 #: build/C/man2/readv.2:30
7685 #, no-wrap
7686 msgid "2010-11-17"
7687 msgstr ""
7688
7689 #. type: Plain text
7690 #: build/C/man2/readv.2:33
7691 msgid "readv, writev, preadv, pwritev - read or write data into multiple buffers"
7692 msgstr ""
7693
7694 #. type: Plain text
7695 #: build/C/man2/readv.2:36
7696 #, no-wrap
7697 msgid "B<#include E<lt>sys/uio.hE<gt>>\n"
7698 msgstr ""
7699
7700 #. type: Plain text
7701 #: build/C/man2/readv.2:38
7702 #, no-wrap
7703 msgid ""
7704 "B<ssize_t readv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7705 ">I<iovcnt>B<);>\n"
7706 msgstr ""
7707
7708 #. type: Plain text
7709 #: build/C/man2/readv.2:40
7710 #, no-wrap
7711 msgid ""
7712 "B<ssize_t writev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7713 ">I<iovcnt>B<);>\n"
7714 msgstr ""
7715
7716 #. type: Plain text
7717 #: build/C/man2/readv.2:43
7718 #, no-wrap
7719 msgid ""
7720 "B<ssize_t preadv(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7721 ">I<iovcnt>B<,>\n"
7722 "B<               off_t >I<offset>B<);>\n"
7723 msgstr ""
7724
7725 #. type: Plain text
7726 #: build/C/man2/readv.2:46
7727 #, no-wrap
7728 msgid ""
7729 "B<ssize_t pwritev(int >I<fd>B<, const struct iovec *>I<iov>B<, int "
7730 ">I<iovcnt>B<,>\n"
7731 "B<                off_t >I<offset>B<);>\n"
7732 msgstr ""
7733
7734 #. type: Plain text
7735 #: build/C/man2/readv.2:56
7736 msgid "B<preadv>(), B<pwritev>(): _BSD_SOURCE"
7737 msgstr ""
7738
7739 #. type: Plain text
7740 #: build/C/man2/readv.2:66
7741 msgid ""
7742 "The B<readv>()  system call reads I<iovcnt> buffers from the file associated "
7743 "with the file descriptor I<fd> into the buffers described by I<iov> "
7744 "(\"scatter input\")."
7745 msgstr ""
7746
7747 #. type: Plain text
7748 #: build/C/man2/readv.2:76
7749 msgid ""
7750 "The B<writev>()  system call writes I<iovcnt> buffers of data described by "
7751 "I<iov> to the file associated with the file descriptor I<fd> (\"gather "
7752 "output\")."
7753 msgstr ""
7754
7755 #. type: Plain text
7756 #: build/C/man2/readv.2:85
7757 msgid ""
7758 "The pointer I<iov> points to an array of I<iovec> structures, defined in "
7759 "I<E<lt>sys/uio.hE<gt>> as:"
7760 msgstr ""
7761
7762 #. type: Plain text
7763 #: build/C/man2/readv.2:93
7764 #, no-wrap
7765 msgid ""
7766 "struct iovec {\n"
7767 "    void  *iov_base;    /* Starting address */\n"
7768 "    size_t iov_len;     /* Number of bytes to transfer */\n"
7769 "};\n"
7770 msgstr ""
7771
7772 #. type: Plain text
7773 #: build/C/man2/readv.2:101
7774 msgid ""
7775 "The B<readv>()  system call works just like B<read>(2)  except that multiple "
7776 "buffers are filled."
7777 msgstr ""
7778
7779 #. type: Plain text
7780 #: build/C/man2/readv.2:107
7781 msgid ""
7782 "The B<writev>()  system call works just like B<write>(2)  except that "
7783 "multiple buffers are written out."
7784 msgstr ""
7785
7786 #. type: Plain text
7787 #: build/C/man2/readv.2:126
7788 msgid ""
7789 "Buffers are processed in array order.  This means that B<readv>()  "
7790 "completely fills I<iov>[0] before proceeding to I<iov>[1], and so on.  (If "
7791 "there is insufficient data, then not all buffers pointed to by I<iov> may be "
7792 "filled.)  Similarly, B<writev>()  writes out the entire contents of "
7793 "I<iov>[0] before proceeding to I<iov>[1], and so on."
7794 msgstr ""
7795
7796 #. type: Plain text
7797 #: build/C/man2/readv.2:144
7798 msgid ""
7799 "The data transfers performed by B<readv>()  and B<writev>()  are atomic: the "
7800 "data written by B<writev>()  is written as a single block that is not "
7801 "intermingled with output from writes in other processes (but see B<pipe>(7)  "
7802 "for an exception); analogously, B<readv>()  is guaranteed to read a "
7803 "contiguous block of data from the file, regardless of read operations "
7804 "performed in other threads or processes that have file descriptors referring "
7805 "to the same open file description (see B<open>(2))."
7806 msgstr ""
7807
7808 #. type: SS
7809 #: build/C/man2/readv.2:144
7810 #, no-wrap
7811 msgid "preadv() and pwritev()"
7812 msgstr ""
7813
7814 #. type: Plain text
7815 #: build/C/man2/readv.2:157
7816 msgid ""
7817 "The B<preadv>()  system call combines the functionality of B<readv>()  and "
7818 "B<pread>(2).  It performs the same task as B<readv>(), but adds a fourth "
7819 "argument, I<offset>, which specifies the file offset at which the input "
7820 "operation is to be performed."
7821 msgstr ""
7822
7823 #. type: Plain text
7824 #: build/C/man2/readv.2:170
7825 msgid ""
7826 "The B<pwritev>()  system call combines the functionality of B<writev>()  and "
7827 "B<pwrite>(2).  It performs the same task as B<writev>(), but adds a fourth "
7828 "argument, I<offset>, which specifies the file offset at which the output "
7829 "operation is to be performed."
7830 msgstr ""
7831
7832 #. type: Plain text
7833 #: build/C/man2/readv.2:175
7834 msgid ""
7835 "The file offset is not changed by these system calls.  The file referred to "
7836 "by I<fd> must be capable of seeking."
7837 msgstr ""
7838
7839 #. type: Plain text
7840 #: build/C/man2/readv.2:186
7841 msgid ""
7842 "On success, B<readv>()  and B<preadv>()  return the number of bytes read; "
7843 "B<writev>()  and B<pwritev>()  return the number of bytes written.  On "
7844 "error, -1 is returned, and I<errno> is set appropriately."
7845 msgstr ""
7846
7847 #. type: Plain text
7848 #: build/C/man2/readv.2:198
7849 msgid ""
7850 "The errors are as given for B<read>(2)  and B<write>(2).  Furthermore, "
7851 "B<preadv>()  and B<pwritev>()  can also fail for the same reasons as "
7852 "B<lseek>(2).  Additionally, the following error is defined:"
7853 msgstr ""
7854
7855 #. type: Plain text
7856 #: build/C/man2/readv.2:207
7857 msgid ""
7858 "The sum of the I<iov_len> values overflows an I<ssize_t> value.  Or, the "
7859 "vector count I<iovcnt> is less than zero or greater than the permitted "
7860 "maximum."
7861 msgstr ""
7862
7863 #. type: Plain text
7864 #: build/C/man2/readv.2:212
7865 msgid ""
7866 "B<preadv>()  and B<pwritev>()  first appeared in Linux 2.6.30; library "
7867 "support was added in glibc 2.10."
7868 msgstr ""
7869
7870 #.  The readv/writev system calls were buggy before Linux 1.3.40.
7871 #.  (Says release.libc.)
7872 #. type: Plain text
7873 #: build/C/man2/readv.2:220
7874 msgid ""
7875 "B<readv>(), B<writev>(): 4.4BSD (these system calls first appeared in "
7876 "4.2BSD), POSIX.1-2001.  Linux libc5 used I<size_t> as the type of the "
7877 "I<iovcnt> argument, and I<int> as the return type."
7878 msgstr ""
7879
7880 #. type: Plain text
7881 #: build/C/man2/readv.2:224
7882 msgid "B<preadv>(), B<pwritev>(): nonstandard, but present also on the modern BSDs."
7883 msgstr ""
7884
7885 #. type: SS
7886 #: build/C/man2/readv.2:225
7887 #, no-wrap
7888 msgid "Linux Notes"
7889 msgstr ""
7890
7891 #. type: Plain text
7892 #: build/C/man2/readv.2:256
7893 msgid ""
7894 "POSIX.1-2001 allows an implementation to place a limit on the number of "
7895 "items that can be passed in I<iov>.  An implementation can advertise its "
7896 "limit by defining B<IOV_MAX> in I<E<lt>limits.hE<gt>> or at run time via the "
7897 "return value from I<sysconf(_SC_IOV_MAX)>.  On Linux, the limit advertised "
7898 "by these mechanisms is 1024, which is the true kernel limit.  However, the "
7899 "glibc wrapper functions do some extra work if they detect that the "
7900 "underlying kernel system call failed because this limit was exceeded.  In "
7901 "the case of B<readv>()  the wrapper function allocates a temporary buffer "
7902 "large enough for all of the items specified by I<iov>, passes that buffer in "
7903 "a call to B<read>(2), copies data from the buffer to the locations specified "
7904 "by the I<iov_base> fields of the elements of I<iov>, and then frees the "
7905 "buffer.  The wrapper function for B<writev>()  performs the analogous task "
7906 "using a temporary buffer and a call to B<write>(2)."
7907 msgstr ""
7908
7909 #. type: Plain text
7910 #: build/C/man2/readv.2:263
7911 msgid ""
7912 "It is not advisable to mix calls to B<readv>()  or B<writev>(), which "
7913 "operate on file descriptors, with the functions from the stdio library; the "
7914 "results will be undefined and probably not what you want."
7915 msgstr ""
7916
7917 #. type: Plain text
7918 #: build/C/man2/readv.2:266
7919 msgid "The following code sample demonstrates the use of B<writev>():"
7920 msgstr ""
7921
7922 #. type: Plain text
7923 #: build/C/man2/readv.2:273
7924 #, no-wrap
7925 msgid ""
7926 "char *str0 = \"hello \";\n"
7927 "char *str1 = \"world\\en\";\n"
7928 "struct iovec iov[2];\n"
7929 "ssize_t nwritten;\n"
7930 msgstr ""
7931
7932 #. type: Plain text
7933 #: build/C/man2/readv.2:278
7934 #, no-wrap
7935 msgid ""
7936 "iov[0].iov_base = str0;\n"
7937 "iov[0].iov_len = strlen(str0);\n"
7938 "iov[1].iov_base = str1;\n"
7939 "iov[1].iov_len = strlen(str1);\n"
7940 msgstr ""
7941
7942 #. type: Plain text
7943 #: build/C/man2/readv.2:280
7944 #, no-wrap
7945 msgid "nwritten = writev(STDOUT_FILENO, iov, 2);\n"
7946 msgstr ""
7947
7948 #. type: Plain text
7949 #: build/C/man2/readv.2:286
7950 msgid "B<pread>(2), B<read>(2), B<write>(2)"
7951 msgstr ""
7952
7953 #. type: TH
7954 #: build/C/man3/remove.3:31
7955 #, no-wrap
7956 msgid "REMOVE"
7957 msgstr ""
7958
7959 #. type: TH
7960 #: build/C/man3/remove.3:31
7961 #, no-wrap
7962 msgid "2008-12-03"
7963 msgstr ""
7964
7965 #. type: Plain text
7966 #: build/C/man3/remove.3:34
7967 msgid "remove - remove a file or directory"
7968 msgstr ""
7969
7970 #. type: Plain text
7971 #: build/C/man3/remove.3:38
7972 msgid "B<int remove(const char *>I<pathname>B<);>"
7973 msgstr ""
7974
7975 #. type: Plain text
7976 #: build/C/man3/remove.3:46
7977 msgid ""
7978 "B<remove>()  deletes a name from the file system.  It calls B<unlink>(2)  "
7979 "for files, and B<rmdir>(2)  for directories."
7980 msgstr ""
7981
7982 #. type: Plain text
7983 #: build/C/man3/remove.3:50
7984 msgid ""
7985 "If the removed name was the last link to a file and no processes have the "
7986 "file open, the file is deleted and the space it was using is made available "
7987 "for reuse."
7988 msgstr ""
7989
7990 #. type: Plain text
7991 #: build/C/man3/remove.3:55
7992 msgid ""
7993 "If the name was the last link to a file, but any processes still have the "
7994 "file open, the file will remain in existence until the last file descriptor "
7995 "referring to it is closed."
7996 msgstr ""
7997
7998 #. type: Plain text
7999 #: build/C/man3/remove.3:57
8000 msgid "If the name referred to a symbolic link, the link is removed."
8001 msgstr ""
8002
8003 #. type: Plain text
8004 #: build/C/man3/remove.3:60
8005 msgid ""
8006 "If the name referred to a socket, FIFO, or device, the name is removed, but "
8007 "processes which have the object open may continue to use it."
8008 msgstr ""
8009
8010 #. type: Plain text
8011 #: build/C/man3/remove.3:70
8012 msgid "The errors that occur are those for B<unlink>(2)  and B<rmdir>(2)."
8013 msgstr ""
8014
8015 #. type: Plain text
8016 #: build/C/man3/remove.3:72
8017 msgid "C89, C99, 4.3BSD, POSIX.1-2001."
8018 msgstr ""
8019
8020 #. type: Plain text
8021 #: build/C/man3/remove.3:78
8022 msgid ""
8023 "Under libc4 and libc5, B<remove>()  was an alias for B<unlink>(2)  (and "
8024 "hence would not remove directories)."
8025 msgstr ""
8026
8027 #. type: Plain text
8028 #: build/C/man3/remove.3:81 build/C/man2/unlink.2:148
8029 msgid ""
8030 "Infelicities in the protocol underlying NFS can cause the unexpected "
8031 "disappearance of files which are still being used."
8032 msgstr ""
8033
8034 #. type: Plain text
8035 #: build/C/man3/remove.3:92
8036 msgid ""
8037 "B<rm>(1), B<unlink>(1), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
8038 "B<rmdir>(2), B<unlink>(2), B<mkfifo>(3), B<symlink>(7)"
8039 msgstr ""
8040
8041 #. type: TH
8042 #: build/C/man2/rename.2:32
8043 #, no-wrap
8044 msgid "RENAME"
8045 msgstr ""
8046
8047 #. type: TH
8048 #: build/C/man2/rename.2:32
8049 #, no-wrap
8050 msgid "2009-03-30"
8051 msgstr ""
8052
8053 #. type: Plain text
8054 #: build/C/man2/rename.2:35
8055 msgid "rename - change the name or location of a file"
8056 msgstr ""
8057
8058 #. type: Plain text
8059 #: build/C/man2/rename.2:39
8060 msgid "B<int rename(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
8061 msgstr ""
8062
8063 #. type: Plain text
8064 #: build/C/man2/rename.2:48
8065 msgid ""
8066 "B<rename>()  renames a file, moving it between directories if required.  Any "
8067 "other hard links to the file (as created using B<link>(2))  are unaffected.  "
8068 "Open file descriptors for I<oldpath> are also unaffected."
8069 msgstr ""
8070
8071 #. type: Plain text
8072 #: build/C/man2/rename.2:56
8073 msgid ""
8074 "If I<newpath> already exists it will be atomically replaced (subject to a "
8075 "few conditions; see ERRORS below), so that there is no point at which "
8076 "another process attempting to access I<newpath> will find it missing."
8077 msgstr ""
8078
8079 #. type: Plain text
8080 #: build/C/man2/rename.2:64
8081 msgid ""
8082 "If I<oldpath> and I<newpath> are existing hard links referring to the same "
8083 "file, then B<rename>()  does nothing, and returns a success status."
8084 msgstr ""
8085
8086 #. type: Plain text
8087 #: build/C/man2/rename.2:72
8088 msgid ""
8089 "If I<newpath> exists but the operation fails for some reason B<rename>()  "
8090 "guarantees to leave an instance of I<newpath> in place."
8091 msgstr ""
8092
8093 #. type: Plain text
8094 #: build/C/man2/rename.2:78
8095 msgid ""
8096 "I<oldpath> can specify a directory.  In this case, I<newpath> must either "
8097 "not exist, or it must specify an empty directory."
8098 msgstr ""
8099
8100 #. type: Plain text
8101 #: build/C/man2/rename.2:85
8102 msgid ""
8103 "However, when overwriting there will probably be a window in which both "
8104 "I<oldpath> and I<newpath> refer to the file being renamed."
8105 msgstr ""
8106
8107 #. type: Plain text
8108 #: build/C/man2/rename.2:91
8109 msgid ""
8110 "If I<oldpath> refers to a symbolic link the link is renamed; if I<newpath> "
8111 "refers to a symbolic link the link will be overwritten."
8112 msgstr ""
8113
8114 #. type: Plain text
8115 #: build/C/man2/rename.2:116
8116 msgid ""
8117 "Write permission is denied for the directory containing I<oldpath> or "
8118 "I<newpath>, or, search permission is denied for one of the directories in "
8119 "the path prefix of I<oldpath> or I<newpath>, or I<oldpath> is a directory "
8120 "and does not allow write permission (needed to update the I<..> entry).  "
8121 "(See also B<path_resolution>(7).)"
8122 msgstr ""
8123
8124 #. type: TP
8125 #: build/C/man2/rename.2:116 build/C/man2/rmdir.2:55 build/C/man2/unlink.2:71
8126 #, no-wrap
8127 msgid "B<EBUSY>"
8128 msgstr ""
8129
8130 #. type: Plain text
8131 #: build/C/man2/rename.2:133
8132 msgid ""
8133 "The rename fails because I<oldpath> or I<newpath> is a directory that is in "
8134 "use by some process (perhaps as current working directory, or as root "
8135 "directory, or because it was open for reading) or is in use by the system "
8136 "(for example as mount point), while the system considers this an error.  "
8137 "(Note that there is no requirement to return B<EBUSY> in such "
8138 "cases\\(emthere is nothing wrong with doing the rename anyway\\(embut it is "
8139 "allowed to return B<EBUSY> if the system cannot otherwise handle such "
8140 "situations.)"
8141 msgstr ""
8142
8143 #. type: Plain text
8144 #: build/C/man2/rename.2:140
8145 msgid ""
8146 "The new pathname contained a path prefix of the old, or, more generally, an "
8147 "attempt was made to make a directory a subdirectory of itself."
8148 msgstr ""
8149
8150 #. type: Plain text
8151 #: build/C/man2/rename.2:146
8152 msgid "I<newpath> is an existing directory, but I<oldpath> is not a directory."
8153 msgstr ""
8154
8155 #. type: Plain text
8156 #: build/C/man2/rename.2:157
8157 msgid ""
8158 "I<oldpath> already has the maximum number of links to it, or it was a "
8159 "directory and the directory containing I<newpath> has the maximum number of "
8160 "links."
8161 msgstr ""
8162
8163 #. type: Plain text
8164 #: build/C/man2/rename.2:173
8165 msgid ""
8166 "The link named by I<oldpath> does not exist; or, a directory component in "
8167 "I<newpath> does not exist; or, I<oldpath> or I<newpath> is an empty string."
8168 msgstr ""
8169
8170 #. type: Plain text
8171 #: build/C/man2/rename.2:190
8172 msgid ""
8173 "A component used as a directory in I<oldpath> or I<newpath> is not, in fact, "
8174 "a directory.  Or, I<oldpath> is a directory, and I<newpath> exists but is "
8175 "not a directory."
8176 msgstr ""
8177
8178 #. type: TP
8179 #: build/C/man2/rename.2:190
8180 #, no-wrap
8181 msgid "B<ENOTEMPTY> or B<EEXIST>"
8182 msgstr ""
8183
8184 #. type: Plain text
8185 #: build/C/man2/rename.2:194
8186 msgid ""
8187 "I<newpath> is a nonempty directory, that is, contains entries other than "
8188 "\".\" and \"..\"."
8189 msgstr ""
8190
8191 #. type: TP
8192 #: build/C/man2/rename.2:194 build/C/man2/unlink.2:126
8193 #, no-wrap
8194 msgid "B<EPERM> or B<EACCES>"
8195 msgstr ""
8196
8197 #. type: Plain text
8198 #: build/C/man2/rename.2:218
8199 msgid ""
8200 "The directory containing I<oldpath> has the sticky bit (B<S_ISVTX>)  set and "
8201 "the process's effective user ID is neither the user ID of the file to be "
8202 "deleted nor that of the directory containing it, and the process is not "
8203 "privileged (Linux: does not have the B<CAP_FOWNER> capability); or "
8204 "I<newpath> is an existing file and the directory containing it has the "
8205 "sticky bit set and the process's effective user ID is neither the user ID of "
8206 "the file to be replaced nor that of the directory containing it, and the "
8207 "process is not privileged (Linux: does not have the B<CAP_FOWNER> "
8208 "capability); or the file system containing I<pathname> does not support "
8209 "renaming of the type requested."
8210 msgstr ""
8211
8212 #. type: Plain text
8213 #: build/C/man2/rename.2:229
8214 msgid ""
8215 "I<oldpath> and I<newpath> are not on the same mounted file system.  (Linux "
8216 "permits a file system to be mounted at multiple points, but B<rename>()  "
8217 "does not work across different mount points, even if the same file system is "
8218 "mounted on both.)"
8219 msgstr ""
8220
8221 #. type: Plain text
8222 #: build/C/man2/rename.2:231
8223 msgid "4.3BSD, C89, C99, POSIX.1-2001."
8224 msgstr ""
8225
8226 #. type: Plain text
8227 #: build/C/man2/rename.2:242
8228 msgid ""
8229 "On NFS file systems, you can not assume that if the operation failed the "
8230 "file was not renamed.  If the server does the rename operation and then "
8231 "crashes, the retransmitted RPC which will be processed when the server is up "
8232 "again causes a failure.  The application is expected to deal with this.  See "
8233 "B<link>(2)  for a similar problem."
8234 msgstr ""
8235
8236 #. type: Plain text
8237 #: build/C/man2/rename.2:251
8238 msgid ""
8239 "B<mv>(1), B<chmod>(2), B<link>(2), B<renameat>(2), B<symlink>(2), "
8240 "B<unlink>(2), B<path_resolution>(7), B<symlink>(7)"
8241 msgstr ""
8242
8243 #. type: TH
8244 #: build/C/man2/rmdir.2:30
8245 #, no-wrap
8246 msgid "RMDIR"
8247 msgstr ""
8248
8249 #. type: TH
8250 #: build/C/man2/rmdir.2:30
8251 #, no-wrap
8252 msgid "2008-05-08"
8253 msgstr ""
8254
8255 #. type: Plain text
8256 #: build/C/man2/rmdir.2:33
8257 msgid "rmdir - delete a directory"
8258 msgstr ""
8259
8260 #. type: Plain text
8261 #: build/C/man2/rmdir.2:37
8262 msgid "B<int rmdir(const char *>I<pathname>B<);>"
8263 msgstr ""
8264
8265 #. type: Plain text
8266 #: build/C/man2/rmdir.2:40
8267 msgid "B<rmdir>()  deletes a directory, which must be empty."
8268 msgstr ""
8269
8270 #. type: Plain text
8271 #: build/C/man2/rmdir.2:55
8272 msgid ""
8273 "Write access to the directory containing I<pathname> was not allowed, or one "
8274 "of the directories in the path prefix of I<pathname> did not allow search "
8275 "permission.  (See also B<path_resolution>(7)."
8276 msgstr ""
8277
8278 #. type: Plain text
8279 #: build/C/man2/rmdir.2:64
8280 msgid ""
8281 "I<pathname> is currently in use by the system or some process that prevents "
8282 "its removal.  On Linux this means I<pathname> is currently used as a mount "
8283 "point or is the root directory of the calling process."
8284 msgstr ""
8285
8286 #. type: Plain text
8287 #: build/C/man2/rmdir.2:73
8288 msgid "I<pathname> has I<.> as last component."
8289 msgstr ""
8290
8291 #. type: Plain text
8292 #: build/C/man2/rmdir.2:77
8293 msgid "Too many symbolic links were encountered in resolving I<pathname>."
8294 msgstr ""
8295
8296 #. type: Plain text
8297 #: build/C/man2/rmdir.2:85
8298 msgid ""
8299 "A directory component in I<pathname> does not exist or is a dangling "
8300 "symbolic link."
8301 msgstr ""
8302
8303 #. type: Plain text
8304 #: build/C/man2/rmdir.2:94
8305 msgid ""
8306 "I<pathname>, or a component used as a directory in I<pathname>, is not, in "
8307 "fact, a directory."
8308 msgstr ""
8309
8310 #. type: TP
8311 #: build/C/man2/rmdir.2:94
8312 #, no-wrap
8313 msgid "B<ENOTEMPTY>"
8314 msgstr ""
8315
8316 #. type: Plain text
8317 #: build/C/man2/rmdir.2:107
8318 msgid ""
8319 "I<pathname> contains entries other than I<.> and I<..> ; or, I<pathname> has "
8320 "I<..> as its final component.  POSIX.1-2001 also allows B<EEXIST> for this "
8321 "condition."
8322 msgstr ""
8323
8324 #. type: Plain text
8325 #: build/C/man2/rmdir.2:118
8326 msgid ""
8327 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
8328 "and the process's effective user ID is neither the user ID of the file to be "
8329 "deleted nor that of the directory containing it, and the process is not "
8330 "privileged (Linux: does not have the B<CAP_FOWNER> capability)."
8331 msgstr ""
8332
8333 #. type: Plain text
8334 #: build/C/man2/rmdir.2:123
8335 msgid ""
8336 "The file system containing I<pathname> does not support the removal of "
8337 "directories."
8338 msgstr ""
8339
8340 #. type: Plain text
8341 #: build/C/man2/rmdir.2:127
8342 msgid "I<pathname> refers to a directory on a read-only file system."
8343 msgstr ""
8344
8345 #. type: Plain text
8346 #: build/C/man2/rmdir.2:132
8347 msgid ""
8348 "Infelicities in the protocol underlying NFS can cause the unexpected "
8349 "disappearance of directories which are still being used."
8350 msgstr ""
8351
8352 #. type: Plain text
8353 #: build/C/man2/rmdir.2:141
8354 msgid ""
8355 "B<rm>(1), B<rmdir>(1), B<chdir>(2), B<chmod>(2), B<mkdir>(2), B<rename>(2), "
8356 "B<unlink>(2), B<unlinkat>(2)"
8357 msgstr ""
8358
8359 #. type: TH
8360 #: build/C/man3/scanf.3:50
8361 #, no-wrap
8362 msgid "SCANF"
8363 msgstr ""
8364
8365 #. type: Plain text
8366 #: build/C/man3/scanf.3:53
8367 msgid "scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion"
8368 msgstr ""
8369
8370 #. type: Plain text
8371 #: build/C/man3/scanf.3:60
8372 #, no-wrap
8373 msgid ""
8374 "B<int scanf(const char *>I<format>B<, ...);>\n"
8375 "B<int fscanf(FILE *>I<stream>B<, const char *>I<format>B<, ...);>\n"
8376 "B<int sscanf(const char *>I<str>B<, const char *>I<format>B<, ...);>\n"
8377 msgstr ""
8378
8379 #. type: Plain text
8380 #: build/C/man3/scanf.3:62
8381 #, no-wrap
8382 msgid "B<#include E<lt>stdarg.hE<gt>>\n"
8383 msgstr ""
8384
8385 #. type: Plain text
8386 #: build/C/man3/scanf.3:66
8387 #, no-wrap
8388 msgid ""
8389 "B<int vscanf(const char *>I<format>B<, va_list >I<ap>B<);>\n"
8390 "B<int vsscanf(const char *>I<str>B<, const char *>I<format>B<, va_list "
8391 ">I<ap>B<);>\n"
8392 "B<int vfscanf(FILE *>I<stream>B<, const char *>I<format>B<, va_list "
8393 ">I<ap>B<);>\n"
8394 msgstr ""
8395
8396 #. type: Plain text
8397 #: build/C/man3/scanf.3:77
8398 msgid "B<vscanf>(), B<vsscanf>(), B<vfscanf>():"
8399 msgstr ""
8400
8401 #. type: Plain text
8402 #: build/C/man3/scanf.3:80
8403 msgid ""
8404 "_XOPEN_SOURCE\\ E<gt>=\\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\\ E<gt>=\\ "
8405 "200112L;"
8406 msgstr ""
8407
8408 #. type: Plain text
8409 #: build/C/man3/scanf.3:102
8410 msgid ""
8411 "The B<scanf>()  family of functions scans input according to I<format> as "
8412 "described below.  This format may contain I<conversion specifications>; the "
8413 "results from such conversions, if any, are stored in the locations pointed "
8414 "to by the I<pointer> arguments that follow I<format>.  Each I<pointer> "
8415 "argument must be of a type that is appropriate for the value returned by the "
8416 "corresponding conversion specification."
8417 msgstr ""
8418
8419 #. type: Plain text
8420 #: build/C/man3/scanf.3:113
8421 msgid ""
8422 "If the number of conversion specifications in I<format> exceeds the number "
8423 "of I<pointer> arguments, the results are undefined.  If the number of "
8424 "I<pointer> arguments exceeds the number of conversion specifications, then "
8425 "the excess I<pointer> arguments are evaluated, but are otherwise ignored."
8426 msgstr ""
8427
8428 #. type: Plain text
8429 #: build/C/man3/scanf.3:125
8430 msgid ""
8431 "The B<scanf>()  function reads input from the standard input stream "
8432 "I<stdin>, B<fscanf>()  reads input from the stream pointer I<stream>, and "
8433 "B<sscanf>()  reads its input from the character string pointed to by I<str>."
8434 msgstr ""
8435
8436 #. type: Plain text
8437 #: build/C/man3/scanf.3:143
8438 msgid ""
8439 "The B<vfscanf>()  function is analogous to B<vfprintf>(3)  and reads input "
8440 "from the stream pointer I<stream> using a variable argument list of pointers "
8441 "(see B<stdarg>(3).  The B<vscanf>()  function scans a variable argument list "
8442 "from the standard input and the B<vsscanf>()  function scans it from a "
8443 "string; these are analogous to the B<vprintf>(3)  and B<vsprintf>(3)  "
8444 "functions respectively."
8445 msgstr ""
8446
8447 #. type: Plain text
8448 #: build/C/man3/scanf.3:157
8449 msgid ""
8450 "The I<format> string consists of a sequence of I<directives> which describe "
8451 "how to process the sequence of input characters.  If processing of a "
8452 "directive fails, no further input is read, and B<scanf>()  returns.  A "
8453 "\"failure\" can be either of the following: I<input failure>, meaning that "
8454 "input characters were unavailable, or I<matching failure>, meaning that the "
8455 "input was inappropriate (see below)."
8456 msgstr ""
8457
8458 #. type: Plain text
8459 #: build/C/man3/scanf.3:159
8460 msgid "A directive is one of the following:"
8461 msgstr ""
8462
8463 #. type: TP
8464 #: 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
8465 #, no-wrap
8466 msgid "\\(bu"
8467 msgstr ""
8468
8469 #. type: Plain text
8470 #: build/C/man3/scanf.3:165
8471 msgid ""
8472 "A sequence of white-space characters (space, tab, newline, etc.; see "
8473 "B<isspace>(3)).  This directive matches any amount of white space, including "
8474 "none, in the input."
8475 msgstr ""
8476
8477 #. type: Plain text
8478 #: build/C/man3/scanf.3:169
8479 msgid ""
8480 "An ordinary character (i.e., one other than white space or \\(aq%\\(aq).  "
8481 "This character must exactly match the next character of input."
8482 msgstr ""
8483
8484 #. type: Plain text
8485 #: build/C/man3/scanf.3:180
8486 msgid ""
8487 "A conversion specification, which commences with a \\(aq%\\(aq (percent) "
8488 "character.  A sequence of characters from the input is converted according "
8489 "to this specification, and the result is placed in the corresponding "
8490 "I<pointer> argument.  If the next item of input does not match the "
8491 "conversion specification, the conversion fails\\(emthis is a I<matching "
8492 "failure>."
8493 msgstr ""
8494
8495 #. type: Plain text
8496 #: build/C/man3/scanf.3:188
8497 msgid ""
8498 "Each I<conversion specification> in I<format> begins with either the "
8499 "character \\(aq%\\(aq or the character sequence \"B<%>I<n>B<$>\" (see below "
8500 "for the distinction) followed by:"
8501 msgstr ""
8502
8503 #. type: Plain text
8504 #: build/C/man3/scanf.3:199
8505 msgid ""
8506 "An optional \\(aq*\\(aq assignment-suppression character: B<scanf>()  reads "
8507 "input as directed by the conversion specification, but discards the input.  "
8508 "No corresponding I<pointer> argument is required, and this specification is "
8509 "not included in the count of successful assignments returned by B<scanf>()."
8510 msgstr ""
8511
8512 #. type: Plain text
8513 #: build/C/man3/scanf.3:217
8514 msgid ""
8515 "An optional \\(aqa\\(aq character.  This is used with string conversions, "
8516 "and relieves the caller of the need to allocate a corresponding buffer to "
8517 "hold the input: instead, B<scanf>()  allocates a buffer of sufficient size, "
8518 "and assigns the address of this buffer to the corresponding I<pointer> "
8519 "argument, which should be a pointer to a I<char *> variable (this variable "
8520 "does not need to be initialized before the call).  The caller should "
8521 "subsequently B<free>(3)  this buffer when it is no longer required.  This is "
8522 "a GNU extension; C99 employs the \\(aqa\\(aq character as a conversion "
8523 "specifier (and it can also be used as such in the GNU implementation)."
8524 msgstr ""
8525
8526 #. type: Plain text
8527 #: build/C/man3/scanf.3:229
8528 msgid ""
8529 "An optional decimal integer which specifies the I<maximum field width>.  "
8530 "Reading of characters stops either when this maximum is reached or when a "
8531 "nonmatching character is found, whichever happens first.  Most conversions "
8532 "discard initial white space characters (the exceptions are noted below), and "
8533 "these discarded characters don't count toward the maximum field width.  "
8534 "String input conversions store a terminating null byte (\\(aq\\e0\\(aq)  to "
8535 "mark the end of the input; the maximum field width does not include this "
8536 "terminator."
8537 msgstr ""
8538
8539 #. type: Plain text
8540 #: build/C/man3/scanf.3:243
8541 msgid ""
8542 "An optional I<type modifier character>.  For example, the B<l> type modifier "
8543 "is used with integer conversions such as B<%d> to specify that the "
8544 "corresponding I<pointer> argument refers to a I<long int> rather than a "
8545 "pointer to an I<int>."
8546 msgstr ""
8547
8548 #. type: Plain text
8549 #: build/C/man3/scanf.3:248
8550 msgid ""
8551 "A I<conversion specifier> that specifies the type of input conversion to be "
8552 "performed."
8553 msgstr ""
8554
8555 #. type: Plain text
8556 #: build/C/man3/scanf.3:277
8557 msgid ""
8558 "The conversion specifications in I<format> are of two forms, either "
8559 "beginning with \\(aq%\\(aq or beginning with \"B<%>I<n>B<$>\".  The two "
8560 "forms should not be mixed in the same I<format> string, except that a string "
8561 "containing \"B<%>I<n>B<$>\" specifications can include B<%%> and B<%*>.  If "
8562 "I<format> contains \\(aq%\\(aq specifications then these correspond in order "
8563 "with successive I<pointer> arguments.  In the \"B<%>I<n>B<$>\" form (which "
8564 "is specified in POSIX.1-2001, but not C99), I<n> is a decimal integer that "
8565 "specifies that the converted input should be placed in the location referred "
8566 "to by the I<n>-th I<pointer> argument following I<format>."
8567 msgstr ""
8568
8569 #. type: SS
8570 #: build/C/man3/scanf.3:277
8571 #, no-wrap
8572 msgid "Conversions"
8573 msgstr ""
8574
8575 #. type: Plain text
8576 #: build/C/man3/scanf.3:281
8577 msgid ""
8578 "The following I<type modifier characters> can appear in a conversion "
8579 "specification:"
8580 msgstr ""
8581
8582 #. type: Plain text
8583 #: build/C/man3/scanf.3:291
8584 msgid ""
8585 "Indicates that the conversion will be one of B<d>, B<i>, B<o>, B<u>, B<x>, "
8586 "B<X>, or B<n> and the next pointer is a pointer to a I<short int> or "
8587 "I<unsigned short int> (rather than I<int>)."
8588 msgstr ""
8589
8590 #. type: Plain text
8591 #: build/C/man3/scanf.3:299
8592 msgid ""
8593 "As for B<h>, but the next pointer is a pointer to a I<signed char> or "
8594 "I<unsigned char>."
8595 msgstr ""
8596
8597 #. type: Plain text
8598 #: build/C/man3/scanf.3:308
8599 msgid ""
8600 "As for B<h>, but the next pointer is a pointer to an I<intmax_t> or a "
8601 "I<uintmax_t>.  This modifier was introduced in C99."
8602 msgstr ""
8603
8604 #.  This use of l was introduced in Amendment 1 to ISO C90.
8605 #. type: Plain text
8606 #: build/C/man3/scanf.3:335
8607 msgid ""
8608 "Indicates either that the conversion will be one of B<d>, B<i>, B<o>, B<u>, "
8609 "B<x>, B<X>, or B<n> and the next pointer is a pointer to a I<long int> or "
8610 "I<unsigned long int> (rather than I<int>), or that the conversion will be "
8611 "one of B<e>, B<f>, or B<g> and the next pointer is a pointer to I<double> "
8612 "(rather than I<float>).  Specifying two B<l> characters is equivalent to "
8613 "B<L>.  If used with B<%c> or B<%s> the corresponding parameter is considered "
8614 "as a pointer to a wide character or wide-character string respectively."
8615 msgstr ""
8616
8617 #.  MTK, Jul 05: The following is no longer true for modern
8618 #.  ANSI C (i.e., C99):
8619 #.  (Note that long long is not an
8620 #.  ANSI C
8621 #.  type. Any program using this will not be portable to all
8622 #.  architectures).
8623 #. type: Plain text
8624 #: build/C/man3/scanf.3:351
8625 msgid ""
8626 "Indicates that the conversion will be either B<e>, B<f>, or B<g> and the "
8627 "next pointer is a pointer to I<long double> or the conversion will be B<d>, "
8628 "B<i>, B<o>, B<u>, or B<x> and the next pointer is a pointer to I<long long>."
8629 msgstr ""
8630
8631 #. type: Plain text
8632 #: build/C/man3/scanf.3:356
8633 msgid "equivalent to B<L>.  This specifier does not exist in ANSI C."
8634 msgstr ""
8635
8636 #. type: Plain text
8637 #: build/C/man3/scanf.3:363
8638 msgid ""
8639 "As for B<h>, but the next pointer is a pointer to a I<ptrdiff_t>.  This "
8640 "modifier was introduced in C99."
8641 msgstr ""
8642
8643 #. type: Plain text
8644 #: build/C/man3/scanf.3:370
8645 msgid ""
8646 "As for B<h>, but the next pointer is a pointer to a I<size_t>.  This "
8647 "modifier was introduced in C99."
8648 msgstr ""
8649
8650 #. type: Plain text
8651 #: build/C/man3/scanf.3:374
8652 msgid "The following I<conversion specifiers> are available:"
8653 msgstr ""
8654
8655 #. type: Plain text
8656 #: build/C/man3/scanf.3:383
8657 msgid ""
8658 "Matches a literal \\(aq%\\(aq.  That is, B<%\\&%> in the format string "
8659 "matches a single input \\(aq%\\(aq character.  No conversion is done (but "
8660 "initial white space characters are discarded), and assignment does not "
8661 "occur."
8662 msgstr ""
8663
8664 #. type: TP
8665 #: build/C/man3/scanf.3:383
8666 #, no-wrap
8667 msgid "B<d>"
8668 msgstr ""
8669
8670 #. type: Plain text
8671 #: build/C/man3/scanf.3:388
8672 msgid ""
8673 "Matches an optionally signed decimal integer; the next pointer must be a "
8674 "pointer to I<int>."
8675 msgstr ""
8676
8677 #. type: TP
8678 #: build/C/man3/scanf.3:388
8679 #, no-wrap
8680 msgid "B<D>"
8681 msgstr ""
8682
8683 #. type: Plain text
8684 #: build/C/man3/scanf.3:397
8685 msgid ""
8686 "Equivalent to I<ld>; this exists only for backward compatibility.  (Note: "
8687 "thus only in libc4.  In libc5 and glibc the B<%D> is silently ignored, "
8688 "causing old programs to fail mysteriously.)"
8689 msgstr ""
8690
8691 #. type: TP
8692 #: build/C/man3/scanf.3:397
8693 #, no-wrap
8694 msgid "B<i>"
8695 msgstr ""
8696
8697 #. type: Plain text
8698 #: build/C/man3/scanf.3:409
8699 msgid ""
8700 "Matches an optionally signed integer; the next pointer must be a pointer to "
8701 "I<int>.  The integer is read in base 16 if it begins with I<0x> or I<0X>, in "
8702 "base 8 if it begins with I<0>, and in base 10 otherwise.  Only characters "
8703 "that correspond to the base are used."
8704 msgstr ""
8705
8706 #. type: TP
8707 #: build/C/man3/scanf.3:409
8708 #, no-wrap
8709 msgid "B<o>"
8710 msgstr ""
8711
8712 #. type: Plain text
8713 #: build/C/man3/scanf.3:413
8714 msgid ""
8715 "Matches an unsigned octal integer; the next pointer must be a pointer to "
8716 "I<unsigned int>."
8717 msgstr ""
8718
8719 #. type: TP
8720 #: build/C/man3/scanf.3:413
8721 #, no-wrap
8722 msgid "B<u>"
8723 msgstr ""
8724
8725 #. type: Plain text
8726 #: build/C/man3/scanf.3:418
8727 msgid ""
8728 "Matches an unsigned decimal integer; the next pointer must be a pointer to "
8729 "I<unsigned int>."
8730 msgstr ""
8731
8732 #. type: Plain text
8733 #: build/C/man3/scanf.3:423
8734 msgid ""
8735 "Matches an unsigned hexadecimal integer; the next pointer must be a pointer "
8736 "to I<unsigned int>."
8737 msgstr ""
8738
8739 #. type: TP
8740 #: build/C/man3/scanf.3:423
8741 #, no-wrap
8742 msgid "B<X>"
8743 msgstr ""
8744
8745 #. type: Plain text
8746 #: build/C/man3/scanf.3:427
8747 msgid "Equivalent to B<x>."
8748 msgstr ""
8749
8750 #. type: TP
8751 #: build/C/man3/scanf.3:427
8752 #, no-wrap
8753 msgid "B<f>"
8754 msgstr ""
8755
8756 #. type: Plain text
8757 #: build/C/man3/scanf.3:432
8758 msgid ""
8759 "Matches an optionally signed floating-point number; the next pointer must be "
8760 "a pointer to I<float>."
8761 msgstr ""
8762
8763 #. type: TP
8764 #: build/C/man3/scanf.3:432
8765 #, no-wrap
8766 msgid "B<e>"
8767 msgstr ""
8768
8769 #. type: Plain text
8770 #: build/C/man3/scanf.3:436 build/C/man3/scanf.3:440 build/C/man3/scanf.3:444
8771 msgid "Equivalent to B<f>."
8772 msgstr ""
8773
8774 #. type: TP
8775 #: build/C/man3/scanf.3:436
8776 #, no-wrap
8777 msgid "B<g>"
8778 msgstr ""
8779
8780 #. type: TP
8781 #: build/C/man3/scanf.3:440
8782 #, no-wrap
8783 msgid "B<E>"
8784 msgstr ""
8785
8786 #. type: Plain text
8787 #: build/C/man3/scanf.3:448
8788 msgid "(C99) Equivalent to B<f>."
8789 msgstr ""
8790
8791 #. type: Plain text
8792 #: build/C/man3/scanf.3:456
8793 msgid ""
8794 "Matches a sequence of non-white-space characters; the next pointer must be a "
8795 "pointer to character array that is long enough to hold the input sequence "
8796 "and the terminating null byte (\\(aq\\e0\\(aq), which is added "
8797 "automatically.  The input string stops at white space or at the maximum "
8798 "field width, whichever occurs first."
8799 msgstr ""
8800
8801 #. type: Plain text
8802 #: build/C/man3/scanf.3:467
8803 msgid ""
8804 "Matches a sequence of characters whose length is specified by the I<maximum "
8805 "field width> (default 1); the next pointer must be a pointer to I<char>, and "
8806 "there must be enough room for all the characters (no terminating null byte "
8807 "is added).  The usual skip of leading white space is suppressed.  To skip "
8808 "white space first, use an explicit space in the format."
8809 msgstr ""
8810
8811 #. type: TP
8812 #: build/C/man3/scanf.3:467
8813 #, no-wrap
8814 msgid "B<\\&[>"
8815 msgstr ""
8816
8817 #. type: Plain text
8818 #: build/C/man3/scanf.3:500
8819 msgid ""
8820 "Matches a nonempty sequence of characters from the specified set of accepted "
8821 "characters; the next pointer must be a pointer to I<char>, and there must be "
8822 "enough room for all the characters in the string, plus a terminating null "
8823 "byte.  The usual skip of leading white space is suppressed.  The string is "
8824 "to be made up of characters in (or not in) a particular set; the set is "
8825 "defined by the characters between the open bracket B<[> character and a "
8826 "close bracket B<]> character.  The set I<excludes> those characters if the "
8827 "first character after the open bracket is a circumflex (B<^>).  To include a "
8828 "close bracket in the set, make it the first character after the open bracket "
8829 "or the circumflex; any other position will end the set.  The hyphen "
8830 "character B<-> is also special; when placed between two other characters, it "
8831 "adds all intervening characters to the set.  To include a hyphen, make it "
8832 "the last character before the final close bracket.  For instance, "
8833 "B<[^]0-9-]> means the set \"everything except close bracket, zero through "
8834 "nine, and hyphen\".  The string ends with the appearance of a character not "
8835 "in the (or, with a circumflex, in) set or when the field width runs out."
8836 msgstr ""
8837
8838 #. type: Plain text
8839 #: build/C/man3/scanf.3:508
8840 msgid ""
8841 "Matches a pointer value (as printed by B<%p> in B<printf>(3); the next "
8842 "pointer must be a pointer to a pointer to I<void>."
8843 msgstr ""
8844
8845 #. type: Plain text
8846 #: build/C/man3/scanf.3:528
8847 msgid ""
8848 "Nothing is expected; instead, the number of characters consumed thus far "
8849 "from the input is stored through the next pointer, which must be a pointer "
8850 "to I<int>.  This is I<not> a conversion, although it can be suppressed with "
8851 "the B<*> assignment-suppression character.  The C standard says: \"Execution "
8852 "of a B<%n> directive does not increment the assignment count returned at the "
8853 "completion of execution\" but the Corrigendum seems to contradict this.  "
8854 "Probably it is wise not to make any assumptions on the effect of B<%n> "
8855 "conversions on the return value."
8856 msgstr ""
8857
8858 #. type: Plain text
8859 #: build/C/man3/scanf.3:533
8860 msgid ""
8861 "These functions return the number of input items successfully matched and "
8862 "assigned, which can be fewer than provided for, or even zero in the event of "
8863 "an early matching failure."
8864 msgstr ""
8865
8866 #. type: Plain text
8867 #: build/C/man3/scanf.3:545
8868 msgid ""
8869 "The value B<EOF> is returned if the end of input is reached before either "
8870 "the first successful conversion or a matching failure occurs.  B<EOF> is "
8871 "also returned if a read error occurs, in which case the error indicator for "
8872 "the stream (see B<ferror>(3))  is set, and I<errno> is set indicate the "
8873 "error."
8874 msgstr ""
8875
8876 #. type: Plain text
8877 #: build/C/man3/scanf.3:551
8878 msgid ""
8879 "The file descriptor underlying I<stream> is marked nonblocking, and the read "
8880 "operation would block."
8881 msgstr ""
8882
8883 #. type: Plain text
8884 #: build/C/man3/scanf.3:556
8885 msgid ""
8886 "The file descriptor underlying I<stream> is invalid, or not open for "
8887 "reading."
8888 msgstr ""
8889
8890 #. type: Plain text
8891 #: build/C/man3/scanf.3:559
8892 msgid "Input byte sequence does not form a valid character."
8893 msgstr ""
8894
8895 #. type: Plain text
8896 #: build/C/man3/scanf.3:563
8897 msgid "The read operation was interrupted by a signal; see B<signal>(7)."
8898 msgstr ""
8899
8900 #. type: Plain text
8901 #: build/C/man3/scanf.3:568
8902 msgid "Not enough arguments; or I<format> is NULL."
8903 msgstr ""
8904
8905 #. type: Plain text
8906 #: build/C/man3/scanf.3:571
8907 msgid "Out of memory."
8908 msgstr ""
8909
8910 #. type: TP
8911 #: build/C/man3/scanf.3:571
8912 #, no-wrap
8913 msgid "B<ERANGE>"
8914 msgstr ""
8915
8916 #. type: Plain text
8917 #: build/C/man3/scanf.3:575
8918 msgid ""
8919 "The result of an integer conversion would exceed the size that can be stored "
8920 "in the corresponding integer type."
8921 msgstr ""
8922
8923 #. type: Plain text
8924 #: build/C/man3/scanf.3:585
8925 msgid ""
8926 "The functions B<fscanf>(), B<scanf>(), and B<sscanf>()  conform to C89 and "
8927 "C99 and POSIX.1-2001.  These standards do not specify the B<ERANGE> error."
8928 msgstr ""
8929
8930 #. type: Plain text
8931 #: build/C/man3/scanf.3:595
8932 msgid ""
8933 "The B<q> specifier is the 4.4BSD notation for I<long long>, while B<ll> or "
8934 "the usage of B<L> in integer conversions is the GNU notation."
8935 msgstr ""
8936
8937 #. type: Plain text
8938 #: build/C/man3/scanf.3:606
8939 msgid ""
8940 "The Linux version of these functions is based on the I<GNU> I<libio> "
8941 "library.  Take a look at the I<info> documentation of I<GNU> I<libc "
8942 "(glibc-1.08)> for a more concise description."
8943 msgstr ""
8944
8945 #.  This feature seems to be present at least as far back as glibc 2.0.
8946 #. type: Plain text
8947 #: build/C/man3/scanf.3:624
8948 msgid ""
8949 "The GNU C library supports a nonstandard extension that causes the library "
8950 "to dynamically allocate a string of sufficient size for input strings for "
8951 "the B<%s> and B<%a[>I<range>B<]> conversion specifiers.  To make use of this "
8952 "feature, specify B<a> as a length modifier (thus B<%as> or "
8953 "B<%a[>I<range>B<]>).  The caller must B<free>(3)  the returned string, as in "
8954 "the following example:"
8955 msgstr ""
8956
8957 #. type: Plain text
8958 #: build/C/man3/scanf.3:629
8959 #, no-wrap
8960 msgid ""
8961 "char *p;\n"
8962 "int n;\n"
8963 msgstr ""
8964
8965 #. type: Plain text
8966 #: build/C/man3/scanf.3:640
8967 #, no-wrap
8968 msgid ""
8969 "errno = 0;\n"
8970 "n = scanf(\"%a[a-z]\", &p);\n"
8971 "if (n == 1) {\n"
8972 "    printf(\"read: %s\\en\", p);\n"
8973 "    free(p);\n"
8974 "} else if (errno != 0) {\n"
8975 "    perror(\"scanf\");\n"
8976 "} else {\n"
8977 "    fprintf(stderr, \"No matching characters\\en\");\n"
8978 "}\n"
8979 msgstr ""
8980
8981 #. type: Plain text
8982 #: build/C/man3/scanf.3:648
8983 msgid ""
8984 "As shown in the above example, it is only necessary to call B<free>(3)  if "
8985 "the B<scanf>()  call successfully read a string."
8986 msgstr ""
8987
8988 #. type: Plain text
8989 #: build/C/man3/scanf.3:660
8990 msgid ""
8991 "The B<a> modifier is not available if the program is compiled with I<gcc "
8992 "-std=c99> or I<gcc -D_ISOC99_SOURCE> (unless B<_GNU_SOURCE> is also "
8993 "specified), in which case the B<a> is interpreted as a specifier for "
8994 "floating-point numbers (see above)."
8995 msgstr ""
8996
8997 #. type: Plain text
8998 #: build/C/man3/scanf.3:669
8999 msgid ""
9000 "Since version 2.7, glibc also provides the B<m> modifier for the same "
9001 "purpose as the B<a> modifier.  The B<m> modifier has the following "
9002 "advantages:"
9003 msgstr ""
9004
9005 #. type: Plain text
9006 #: build/C/man3/scanf.3:674
9007 msgid "It may also be applied to B<%c> conversion specifiers (e.g., B<%3mc>)."
9008 msgstr ""
9009
9010 #. type: Plain text
9011 #: build/C/man3/scanf.3:680
9012 msgid ""
9013 "It avoids ambiguity with respect to the B<%a> floating-point conversion "
9014 "specifier (and is unaffected by I<gcc -std=c99> etc.)"
9015 msgstr ""
9016
9017 #. type: Plain text
9018 #: build/C/man3/scanf.3:682
9019 msgid "It is specified in the upcoming revision of the POSIX.1 standard."
9020 msgstr ""
9021
9022 #. type: Plain text
9023 #: build/C/man3/scanf.3:695
9024 msgid ""
9025 "All functions are fully C89 conformant, but provide the additional "
9026 "specifiers B<q> and B<a> as well as an additional behavior of the B<L> and "
9027 "B<l> specifiers.  The latter may be considered to be a bug, as it changes "
9028 "the behavior of specifiers defined in C89."
9029 msgstr ""
9030
9031 #. type: Plain text
9032 #: build/C/man3/scanf.3:711
9033 msgid ""
9034 "Some combinations of the type modifiers and conversion specifiers defined by "
9035 "ANSI C do not make sense (e.g.  B<%Ld>).  While they may have a well-defined "
9036 "behavior on Linux, this need not to be so on other architectures.  Therefore "
9037 "it usually is better to use modifiers that are not defined by ANSI C at all, "
9038 "that is, use B<q> instead of B<L> in combination with B<d>, B<i>, B<o>, "
9039 "B<u>, B<x>, and B<X> conversions or B<ll>."
9040 msgstr ""
9041
9042 #. type: Plain text
9043 #: build/C/man3/scanf.3:717
9044 msgid ""
9045 "The usage of B<q> is not the same as on 4.4BSD, as it may be used in float "
9046 "conversions equivalently to B<L>."
9047 msgstr ""
9048
9049 #. type: Plain text
9050 #: build/C/man3/scanf.3:724
9051 msgid ""
9052 "B<getc>(3), B<printf>(3), B<setlocale>(3), B<strtod>(3), B<strtol>(3), "
9053 "B<strtoul>(3)"
9054 msgstr ""
9055
9056 #. type: TH
9057 #: build/C/man3/setbuf.3:46
9058 #, no-wrap
9059 msgid "SETBUF"
9060 msgstr ""
9061
9062 #. type: TH
9063 #: build/C/man3/setbuf.3:46
9064 #, no-wrap
9065 msgid "2008-06-26"
9066 msgstr ""
9067
9068 #. type: Plain text
9069 #: build/C/man3/setbuf.3:49
9070 msgid "setbuf, setbuffer, setlinebuf, setvbuf - stream buffering operations"
9071 msgstr ""
9072
9073 #. type: Plain text
9074 #: build/C/man3/setbuf.3:54
9075 #, no-wrap
9076 msgid "B<void setbuf(FILE *>I<stream>B<, char *>I<buf>B<);>\n"
9077 msgstr ""
9078
9079 #. type: Plain text
9080 #: build/C/man3/setbuf.3:56
9081 #, no-wrap
9082 msgid "B<void setbuffer(FILE *>I<stream>B<, char *>I<buf>B<, size_t >I<size>B<);>\n"
9083 msgstr ""
9084
9085 #. type: Plain text
9086 #: build/C/man3/setbuf.3:58
9087 #, no-wrap
9088 msgid "B<void setlinebuf(FILE *>I<stream>B<);>\n"
9089 msgstr ""
9090
9091 #. type: Plain text
9092 #: build/C/man3/setbuf.3:61
9093 #, no-wrap
9094 msgid ""
9095 "B<int setvbuf(FILE *>I<stream>B<, char *>I<buf>B<, int >I<mode>B<, size_t "
9096 ">I<size>B<);>\n"
9097 msgstr ""
9098
9099 #. type: Plain text
9100 #: build/C/man3/setbuf.3:71
9101 msgid "B<setbuffer>(), B<setlinebuf>(): _BSD_SOURCE"
9102 msgstr ""
9103
9104 #. type: Plain text
9105 #: build/C/man3/setbuf.3:94
9106 msgid ""
9107 "The three types of buffering available are unbuffered, block buffered, and "
9108 "line buffered.  When an output stream is unbuffered, information appears on "
9109 "the destination file or terminal as soon as written; when it is block "
9110 "buffered many characters are saved up and written as a block; when it is "
9111 "line buffered characters are saved up until a newline is output or input is "
9112 "read from any stream attached to a terminal device (typically I<stdin>).  "
9113 "The function B<fflush>(3)  may be used to force the block out early.  (See "
9114 "B<fclose>(3).)  Normally all files are block buffered.  When the first I/O "
9115 "operation occurs on a file, B<malloc>(3)  is called, and a buffer is "
9116 "obtained.  If a stream refers to a terminal (as I<stdout> normally does) it "
9117 "is line buffered.  The standard error stream I<stderr> is always unbuffered "
9118 "by default."
9119 msgstr ""
9120
9121 #. type: Plain text
9122 #: build/C/man3/setbuf.3:101
9123 msgid ""
9124 "The B<setvbuf>()  function may be used on any open stream to change its "
9125 "buffer.  The I<mode> argument must be one of the following three macros:"
9126 msgstr ""
9127
9128 #. type: TP
9129 #: build/C/man3/setbuf.3:102
9130 #, no-wrap
9131 msgid "B<_IONBF>"
9132 msgstr ""
9133
9134 #. type: Plain text
9135 #: build/C/man3/setbuf.3:105
9136 msgid "unbuffered"
9137 msgstr ""
9138
9139 #. type: TP
9140 #: build/C/man3/setbuf.3:105
9141 #, no-wrap
9142 msgid "B<_IOLBF>"
9143 msgstr ""
9144
9145 #. type: Plain text
9146 #: build/C/man3/setbuf.3:108
9147 msgid "line buffered"
9148 msgstr ""
9149
9150 #. type: TP
9151 #: build/C/man3/setbuf.3:108
9152 #, no-wrap
9153 msgid "B<_IOFBF>"
9154 msgstr ""
9155
9156 #. type: Plain text
9157 #: build/C/man3/setbuf.3:111
9158 msgid "fully buffered"
9159 msgstr ""
9160
9161 #. type: Plain text
9162 #: build/C/man3/setbuf.3:127
9163 msgid ""
9164 "Except for unbuffered files, the I<buf> argument should point to a buffer at "
9165 "least I<size> bytes long; this buffer will be used instead of the current "
9166 "buffer.  If the argument I<buf> is NULL, only the mode is affected; a new "
9167 "buffer will be allocated on the next read or write operation.  The "
9168 "B<setvbuf>()  function may only be used after opening a stream and before "
9169 "any other operations have been performed on it."
9170 msgstr ""
9171
9172 #. type: Plain text
9173 #: build/C/man3/setbuf.3:133
9174 msgid ""
9175 "The other three calls are, in effect, simply aliases for calls to "
9176 "B<setvbuf>().  The B<setbuf>()  function is exactly equivalent to the call"
9177 msgstr ""
9178
9179 #. type: Plain text
9180 #: build/C/man3/setbuf.3:136
9181 msgid "setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);"
9182 msgstr ""
9183
9184 #. type: Plain text
9185 #: build/C/man3/setbuf.3:146
9186 msgid ""
9187 "The B<setbuffer>()  function is the same, except that the size of the buffer "
9188 "is up to the caller, rather than being determined by the default B<BUFSIZ>.  "
9189 "The B<setlinebuf>()  function is exactly equivalent to the call:"
9190 msgstr ""
9191
9192 #. type: Plain text
9193 #: build/C/man3/setbuf.3:149
9194 msgid "setvbuf(stream, (char *) NULL, _IOLBF, 0);"
9195 msgstr ""
9196
9197 #. type: Plain text
9198 #: build/C/man3/setbuf.3:160
9199 msgid ""
9200 "The function B<setvbuf>()  returns 0 on success.  It returns nonzero on "
9201 "failure (I<mode> is invalid or the request cannot be honored).  It may set "
9202 "I<errno> on failure."
9203 msgstr ""
9204
9205 #. type: Plain text
9206 #: build/C/man3/setbuf.3:162
9207 msgid "The other functions do not return a value."
9208 msgstr ""
9209
9210 #. type: Plain text
9211 #: build/C/man3/setbuf.3:168
9212 msgid "The B<setbuf>()  and B<setvbuf>()  functions conform to C89 and C99."
9213 msgstr ""
9214
9215 #. type: Plain text
9216 #: build/C/man3/setbuf.3:178
9217 msgid ""
9218 "The B<setbuffer>()  and B<setlinebuf>()  functions are not portable to "
9219 "versions of BSD before 4.2BSD, and are available under Linux since libc "
9220 "4.5.21.  On 4.2BSD and 4.3BSD systems, B<setbuf>()  always uses a suboptimal "
9221 "buffer size and should be avoided."
9222 msgstr ""
9223
9224 #. type: Plain text
9225 #: build/C/man3/setbuf.3:185
9226 msgid ""
9227 "You must make sure that the space that I<buf> points to still exists by the "
9228 "time I<stream> is closed, which also happens at program termination.  For "
9229 "example, the following is invalid:"
9230 msgstr ""
9231
9232 #. type: Plain text
9233 #: build/C/man3/setbuf.3:188
9234 #, no-wrap
9235 msgid "#include E<lt>stdio.hE<gt>\n"
9236 msgstr ""
9237
9238 #. type: Plain text
9239 #: build/C/man3/setbuf.3:197
9240 #, no-wrap
9241 msgid ""
9242 "int\n"
9243 "main(void)\n"
9244 "{\n"
9245 "    char buf[BUFSIZ];\n"
9246 "    setbuf(stdin, buf);\n"
9247 "    printf(\"Hello, world!\\en\");\n"
9248 "    return 0;\n"
9249 "}\n"
9250 msgstr ""
9251
9252 #. type: Plain text
9253 #: build/C/man3/setbuf.3:206
9254 msgid ""
9255 "B<fclose>(3), B<fflush>(3), B<fopen>(3), B<fread>(3), B<malloc>(3), "
9256 "B<printf>(3), B<puts>(3)"
9257 msgstr ""
9258
9259 #. type: TH
9260 #: build/C/man3/stdin.3:9
9261 #, no-wrap
9262 msgid "STDIN"
9263 msgstr ""
9264
9265 #. type: TH
9266 #: build/C/man3/stdin.3:9 build/C/man3/tmpfile.3:29
9267 #, no-wrap
9268 msgid "2008-07-14"
9269 msgstr ""
9270
9271 #. type: Plain text
9272 #: build/C/man3/stdin.3:12
9273 msgid "stdin, stdout, stderr - standard I/O streams"
9274 msgstr ""
9275
9276 #. type: Plain text
9277 #: build/C/man3/stdin.3:19
9278 #, no-wrap
9279 msgid ""
9280 "B<extern FILE *>I<stdin>B<;>\n"
9281 "B<extern FILE *>I<stdout>B<;>\n"
9282 "B<extern FILE *>I<stderr>B<;>\n"
9283 msgstr ""
9284
9285 #. type: Plain text
9286 #: build/C/man3/stdin.3:31
9287 msgid ""
9288 "Under normal circumstances every UNIX program has three streams opened for "
9289 "it when it starts up, one for input, one for output, and one for printing "
9290 "diagnostic or error messages.  These are typically attached to the user's "
9291 "terminal (see B<tty>(4)  but might instead refer to files or other devices, "
9292 "depending on what the parent process chose to set up.  (See also the "
9293 "\"Redirection\" section of B<sh>(1).)"
9294 msgstr ""
9295
9296 #. type: Plain text
9297 #: build/C/man3/stdin.3:41
9298 msgid ""
9299 "The input stream is referred to as \"standard input\"; the output stream is "
9300 "referred to as \"standard output\"; and the error stream is referred to as "
9301 "\"standard error\".  These terms are abbreviated to form the symbols used to "
9302 "refer to these files, namely I<stdin>, I<stdout>, and I<stderr>."
9303 msgstr ""
9304
9305 #. type: Plain text
9306 #: build/C/man3/stdin.3:50
9307 msgid ""
9308 "Each of these symbols is a B<stdio>(3)  macro of type pointer to I<FILE>, "
9309 "and can be used with functions like B<fprintf>(3)  or B<fread>(3)."
9310 msgstr ""
9311
9312 #. type: Plain text
9313 #: build/C/man3/stdin.3:59
9314 msgid ""
9315 "Since I<FILE>s are a buffering wrapper around UNIX file descriptors, the "
9316 "same underlying files may also be accessed using the raw UNIX file "
9317 "interface, that is, the functions like B<read>(2)  and B<lseek>(2)."
9318 msgstr ""
9319
9320 #. type: Plain text
9321 #: build/C/man3/stdin.3:78
9322 msgid ""
9323 "On program startup, the integer file descriptors associated with the streams "
9324 "I<stdin>, I<stdout>, and I<stderr> are 0, 1, and 2, respectively.  The "
9325 "preprocessor symbols B<STDIN_FILENO>, B<STDOUT_FILENO>, and B<STDERR_FILENO> "
9326 "are defined with these values in I<E<lt>unistd.hE<gt>>.  (Applying "
9327 "B<freopen>(3)  to one of these streams can change the file descriptor number "
9328 "associated with the stream.)"
9329 msgstr ""
9330
9331 #. type: Plain text
9332 #: build/C/man3/stdin.3:91
9333 msgid ""
9334 "Note that mixing use of I<FILE>s and raw file descriptors can produce "
9335 "unexpected results and should generally be avoided.  (For the masochistic "
9336 "among you: POSIX.1, section 8.2.3, describes in detail how this interaction "
9337 "is supposed to work.)  A general rule is that file descriptors are handled "
9338 "in the kernel, while stdio is just a library.  This means for example, that "
9339 "after an B<exec>(3), the child inherits all open file descriptors, but all "
9340 "old streams have become inaccessible."
9341 msgstr ""
9342
9343 #. type: Plain text
9344 #: build/C/man3/stdin.3:109
9345 msgid ""
9346 "Since the symbols I<stdin>, I<stdout>, and I<stderr> are specified to be "
9347 "macros, assigning to them is nonportable.  The standard streams can be made "
9348 "to refer to different files with help of the library function B<freopen>(3), "
9349 "specially introduced to make it possible to reassign I<stdin>, I<stdout>, "
9350 "and I<stderr>.  The standard streams are closed by a call to B<exit>(3)  and "
9351 "by normal program termination."
9352 msgstr ""
9353
9354 #. type: Plain text
9355 #: build/C/man3/stdin.3:118
9356 msgid ""
9357 "The I<stdin>, I<stdout>, and I<stderr> macros conform to C89 and this "
9358 "standard also stipulates that these three streams shall be open at program "
9359 "startup."
9360 msgstr ""
9361
9362 #. type: Plain text
9363 #: build/C/man3/stdin.3:150
9364 msgid ""
9365 "The stream I<stderr> is unbuffered.  The stream I<stdout> is line-buffered "
9366 "when it points to a terminal.  Partial lines will not appear until "
9367 "B<fflush>(3)  or B<exit>(3)  is called, or a newline is printed.  This can "
9368 "produce unexpected results, especially with debugging output.  The buffering "
9369 "mode of the standard streams (or any other stream)  can be changed using the "
9370 "B<setbuf>(3)  or B<setvbuf>(3)  call.  Note that in case I<stdin> is "
9371 "associated with a terminal, there may also be input buffering in the "
9372 "terminal driver, entirely unrelated to stdio buffering.  (Indeed, normally "
9373 "terminal input is line buffered in the kernel.)  This kernel input handling "
9374 "can be modified using calls like B<tcsetattr>(3); see also B<stty>(1), and "
9375 "B<termios>(3)."
9376 msgstr ""
9377
9378 #. type: Plain text
9379 #: build/C/man3/stdin.3:156
9380 msgid "B<csh>(1), B<sh>(1), B<open>(2), B<fopen>(3), B<stdio>(3)"
9381 msgstr ""
9382
9383 #. type: TH
9384 #: build/C/man3/stdio.3:37
9385 #, no-wrap
9386 msgid "STDIO"
9387 msgstr ""
9388
9389 #. type: TH
9390 #: build/C/man3/stdio.3:37
9391 #, no-wrap
9392 msgid "2001-12-26"
9393 msgstr ""
9394
9395 #. type: Plain text
9396 #: build/C/man3/stdio.3:40
9397 msgid "stdio - standard input/output library functions"
9398 msgstr ""
9399
9400 #. type: Plain text
9401 #: build/C/man3/stdio.3:44
9402 msgid "B<FILE *>I<stdin>B<;>"
9403 msgstr ""
9404
9405 #. type: Plain text
9406 #: build/C/man3/stdio.3:46
9407 msgid "B<FILE *>I<stdout>B<;>"
9408 msgstr ""
9409
9410 #. type: Plain text
9411 #: build/C/man3/stdio.3:48
9412 msgid "B<FILE *>I<stderr>B<;>"
9413 msgstr ""
9414
9415 #. type: Plain text
9416 #: build/C/man3/stdio.3:55
9417 msgid ""
9418 "The standard I/O library provides a simple and efficient buffered stream I/O "
9419 "interface.  Input and output is mapped into logical data streams and the "
9420 "physical I/O characteristics are concealed.  The functions and macros are "
9421 "listed below; more information is available from the individual man pages."
9422 msgstr ""
9423
9424 #. type: Plain text
9425 #: build/C/man3/stdio.3:78
9426 msgid ""
9427 "A stream is associated with an external file (which may be a physical "
9428 "device) by I<opening> a file, which may involve creating a new file.  "
9429 "Creating an existing file causes its former contents to be discarded.  If a "
9430 "file can support positioning requests (such as a disk file, as opposed to a "
9431 "terminal) then a I<file position indicator> associated with the stream is "
9432 "positioned at the start of the file (byte zero), unless the file is opened "
9433 "with append mode.  If append mode is used, it is unspecified whether the "
9434 "position indicator will be placed at the start or the end of the file.  The "
9435 "position indicator is maintained by subsequent reads, writes and positioning "
9436 "requests.  All input occurs as if the characters were read by successive "
9437 "calls to the B<fgetc>(3)  function; all output takes place as if all "
9438 "characters were written by successive calls to the B<fputc>(3)  function."
9439 msgstr ""
9440
9441 #. type: Plain text
9442 #: build/C/man3/stdio.3:88
9443 msgid ""
9444 "A file is disassociated from a stream by I<closing> the file.  Output "
9445 "streams are flushed (any unwritten buffer contents are transferred to the "
9446 "host environment) before the stream is disassociated from the file.  The "
9447 "value of a pointer to a I<FILE> object is indeterminate after a file is "
9448 "closed (garbage)."
9449 msgstr ""
9450
9451 #. type: Plain text
9452 #: build/C/man3/stdio.3:101
9453 msgid ""
9454 "A file may be subsequently reopened, by the same or another program "
9455 "execution, and its contents reclaimed or modified (if it can be repositioned "
9456 "at the start).  If the main function returns to its original caller, or the "
9457 "B<exit>(3)  function is called, all open files are closed (hence all output "
9458 "streams are flushed) before program termination.  Other methods of program "
9459 "termination, such as B<abort>(3)  do not bother about closing files "
9460 "properly."
9461 msgstr ""
9462
9463 #. type: Plain text
9464 #: build/C/man3/stdio.3:117
9465 msgid ""
9466 "At program startup, three text streams are predefined and need not be opened "
9467 "explicitly: I<standard input> (for reading conventional input), I<standard "
9468 "output> (for writing conventional input), and I<standard error> (for writing "
9469 "diagnostic output).  These streams are abbreviated I<stdin>,I<stdout> and "
9470 "I<stderr>.  When opened, the standard error stream is not fully buffered; "
9471 "the standard input and output streams are fully buffered if and only if the "
9472 "streams do not to refer to an interactive device."
9473 msgstr ""
9474
9475 #. type: Plain text
9476 #: build/C/man3/stdio.3:127
9477 msgid ""
9478 "Output streams that refer to terminal devices are always line buffered by "
9479 "default; pending output to such streams is written automatically whenever an "
9480 "input stream that refers to a terminal device is read.  In cases where a "
9481 "large amount of computation is done after printing part of a line on an "
9482 "output terminal, it is necessary to B<fflush>(3)  the standard output before "
9483 "going off and computing so that the output will appear."
9484 msgstr ""
9485
9486 #. type: Plain text
9487 #: build/C/man3/stdio.3:141
9488 msgid ""
9489 "The I<stdio> library is a part of the library B<libc> and routines are "
9490 "automatically loaded as needed by the compilers B<cc>(1)  and B<pc>(1).  The "
9491 "SYNOPSIS sections of the following manual pages indicate which include files "
9492 "are to be used, what the compiler declaration for the function looks like "
9493 "and which external variables are of interest."
9494 msgstr ""
9495
9496 #.  Not on Linux: .BR fropen ,
9497 #.  Not on Linux: .BR fwopen ,
9498 #. type: Plain text
9499 #: build/C/man3/stdio.3:181
9500 msgid ""
9501 "The following are defined as macros; these names may not be reused without "
9502 "first removing their current definitions with B<#undef>: B<BUFSIZ>, B<EOF>, "
9503 "B<FILENAME_MAX>, B<FOPEN_MAX>, B<L_cuserid>, B<L_ctermid>, B<L_tmpnam>, "
9504 "B<NULL>, B<SEEK_END>, B<SEEK_SET>, B<SEEK_CUR>, B<TMP_MAX>, B<clearerr>, "
9505 "B<feof>, B<ferror>, B<fileno>, B<getc>, B<getchar>, B<putc>, B<putchar>, "
9506 "B<stderr>, B<stdin>, B<stdout>.  Function versions of the macro functions "
9507 "B<feof>, B<ferror>, B<clearerr>, B<fileno>, B<getc>, B<getchar>, B<putc>, "
9508 "and B<putchar> exist and will be used if the macros definitions are "
9509 "explicitly removed."
9510 msgstr ""
9511
9512 #. type: SS
9513 #: build/C/man3/stdio.3:181
9514 #, no-wrap
9515 msgid "List of Functions"
9516 msgstr ""
9517
9518 #. type: tbl table
9519 #: build/C/man3/stdio.3:186
9520 #, no-wrap
9521 msgid "Function\tDescription\n"
9522 msgstr ""
9523
9524 #. type: tbl table
9525 #: build/C/man3/stdio.3:187
9526 #, no-wrap
9527 msgid "_\n"
9528 msgstr ""
9529
9530 #. type: tbl table
9531 #: build/C/man3/stdio.3:188
9532 #, no-wrap
9533 msgid "clearerr\tcheck and reset stream status\n"
9534 msgstr ""
9535
9536 #. type: tbl table
9537 #: build/C/man3/stdio.3:189
9538 #, no-wrap
9539 msgid "fclose\tclose a stream\n"
9540 msgstr ""
9541
9542 #. type: tbl table
9543 #: build/C/man3/stdio.3:190
9544 #, no-wrap
9545 msgid "fdopen\tstream open functions\n"
9546 msgstr ""
9547
9548 #. type: tbl table
9549 #: build/C/man3/stdio.3:191
9550 #, no-wrap
9551 msgid "feof\tcheck and reset stream status\n"
9552 msgstr ""
9553
9554 #. type: tbl table
9555 #: build/C/man3/stdio.3:192
9556 #, no-wrap
9557 msgid "ferror\tcheck and reset stream status\n"
9558 msgstr ""
9559
9560 #. type: tbl table
9561 #: build/C/man3/stdio.3:193
9562 #, no-wrap
9563 msgid "fflush\tflush a stream\n"
9564 msgstr ""
9565
9566 #. type: tbl table
9567 #: build/C/man3/stdio.3:194
9568 #, no-wrap
9569 msgid "fgetc\tget next character or word from input stream\n"
9570 msgstr ""
9571
9572 #. type: tbl table
9573 #: build/C/man3/stdio.3:195
9574 #, no-wrap
9575 msgid "fgetpos\treposition a stream\n"
9576 msgstr ""
9577
9578 #. type: tbl table
9579 #: build/C/man3/stdio.3:196
9580 #, no-wrap
9581 msgid "fgets\tget a line from a stream\n"
9582 msgstr ""
9583
9584 #. type: tbl table
9585 #: build/C/man3/stdio.3:197
9586 #, no-wrap
9587 msgid "fileno\treturn the integer descriptor of the argument stream\n"
9588 msgstr ""
9589
9590 #. type: tbl table
9591 #: build/C/man3/stdio.3:198
9592 #, no-wrap
9593 msgid "fopen\tstream open functions\n"
9594 msgstr ""
9595
9596 #. type: tbl table
9597 #: build/C/man3/stdio.3:199
9598 #, no-wrap
9599 msgid "fprintf\tformatted output conversion\n"
9600 msgstr ""
9601
9602 #. type: tbl table
9603 #: build/C/man3/stdio.3:200
9604 #, no-wrap
9605 msgid "fpurge\tflush a stream\n"
9606 msgstr ""
9607
9608 #. type: tbl table
9609 #: build/C/man3/stdio.3:201
9610 #, no-wrap
9611 msgid "fputc\toutput a character or word to a stream\n"
9612 msgstr ""
9613
9614 #. type: tbl table
9615 #: build/C/man3/stdio.3:202
9616 #, no-wrap
9617 msgid "fputs\toutput a line to a stream\n"
9618 msgstr ""
9619
9620 #. type: tbl table
9621 #: build/C/man3/stdio.3:203
9622 #, no-wrap
9623 msgid "fread\tbinary stream input/output\n"
9624 msgstr ""
9625
9626 #. type: tbl table
9627 #: build/C/man3/stdio.3:204
9628 #, no-wrap
9629 msgid "freopen\tstream open functions\n"
9630 msgstr ""
9631
9632 #. type: tbl table
9633 #: build/C/man3/stdio.3:205
9634 #, no-wrap
9635 msgid "fscanf\tinput format conversion\n"
9636 msgstr ""
9637
9638 #. type: tbl table
9639 #: build/C/man3/stdio.3:206
9640 #, no-wrap
9641 msgid "fseek\treposition a stream\n"
9642 msgstr ""
9643
9644 #. type: tbl table
9645 #: build/C/man3/stdio.3:207
9646 #, no-wrap
9647 msgid "fsetpos\treposition a stream\n"
9648 msgstr ""
9649
9650 #. type: tbl table
9651 #: build/C/man3/stdio.3:208
9652 #, no-wrap
9653 msgid "ftell\treposition a stream\n"
9654 msgstr ""
9655
9656 #. type: tbl table
9657 #: build/C/man3/stdio.3:209
9658 #, no-wrap
9659 msgid "fwrite\tbinary stream input/output\n"
9660 msgstr ""
9661
9662 #. type: tbl table
9663 #: build/C/man3/stdio.3:210
9664 #, no-wrap
9665 msgid "getc\tget next character or word from input stream\n"
9666 msgstr ""
9667
9668 #. type: tbl table
9669 #: build/C/man3/stdio.3:211
9670 #, no-wrap
9671 msgid "getchar\tget next character or word from input stream\n"
9672 msgstr ""
9673
9674 #. type: tbl table
9675 #: build/C/man3/stdio.3:212
9676 #, no-wrap
9677 msgid "gets\tget a line from a stream\n"
9678 msgstr ""
9679
9680 #. type: tbl table
9681 #: build/C/man3/stdio.3:213
9682 #, no-wrap
9683 msgid "getw\tget next character or word from input stream\n"
9684 msgstr ""
9685
9686 #. type: tbl table
9687 #: build/C/man3/stdio.3:214
9688 #, no-wrap
9689 msgid "mktemp\tmake temporary filename (unique)\n"
9690 msgstr ""
9691
9692 #. type: tbl table
9693 #: build/C/man3/stdio.3:215
9694 #, no-wrap
9695 msgid "perror\tsystem error messages\n"
9696 msgstr ""
9697
9698 #. type: tbl table
9699 #: build/C/man3/stdio.3:216
9700 #, no-wrap
9701 msgid "printf\tformatted output conversion\n"
9702 msgstr ""
9703
9704 #. type: tbl table
9705 #: build/C/man3/stdio.3:217
9706 #, no-wrap
9707 msgid "putc\toutput a character or word to a stream\n"
9708 msgstr ""
9709
9710 #. type: tbl table
9711 #: build/C/man3/stdio.3:218
9712 #, no-wrap
9713 msgid "putchar\toutput a character or word to a stream\n"
9714 msgstr ""
9715
9716 #. type: tbl table
9717 #: build/C/man3/stdio.3:219
9718 #, no-wrap
9719 msgid "puts\toutput a line to a stream\n"
9720 msgstr ""
9721
9722 #. type: tbl table
9723 #: build/C/man3/stdio.3:220
9724 #, no-wrap
9725 msgid "putw\toutput a character or word to a stream\n"
9726 msgstr ""
9727
9728 #. type: tbl table
9729 #: build/C/man3/stdio.3:221
9730 #, no-wrap
9731 msgid "remove\tremove directory entry\n"
9732 msgstr ""
9733
9734 #. type: tbl table
9735 #: build/C/man3/stdio.3:222
9736 #, no-wrap
9737 msgid "rewind\treposition a stream\n"
9738 msgstr ""
9739
9740 #. type: tbl table
9741 #: build/C/man3/stdio.3:223
9742 #, no-wrap
9743 msgid "scanf\tinput format conversion\n"
9744 msgstr ""
9745
9746 #. type: tbl table
9747 #: build/C/man3/stdio.3:224
9748 #, no-wrap
9749 msgid "setbuf\tstream buffering operations\n"
9750 msgstr ""
9751
9752 #. type: tbl table
9753 #: build/C/man3/stdio.3:225
9754 #, no-wrap
9755 msgid "setbuffer\tstream buffering operations\n"
9756 msgstr ""
9757
9758 #. type: tbl table
9759 #: build/C/man3/stdio.3:226
9760 #, no-wrap
9761 msgid "setlinebuf\tstream buffering operations\n"
9762 msgstr ""
9763
9764 #. type: tbl table
9765 #: build/C/man3/stdio.3:227
9766 #, no-wrap
9767 msgid "setvbuf\tstream buffering operations\n"
9768 msgstr ""
9769
9770 #. type: tbl table
9771 #: build/C/man3/stdio.3:228
9772 #, no-wrap
9773 msgid "sprintf\tformatted output conversion\n"
9774 msgstr ""
9775
9776 #. type: tbl table
9777 #: build/C/man3/stdio.3:229
9778 #, no-wrap
9779 msgid "sscanf\tinput format conversion\n"
9780 msgstr ""
9781
9782 #. type: tbl table
9783 #: build/C/man3/stdio.3:230
9784 #, no-wrap
9785 msgid "strerror\tsystem error messages\n"
9786 msgstr ""
9787
9788 #. type: tbl table
9789 #: build/C/man3/stdio.3:231
9790 #, no-wrap
9791 msgid "sys_errlist\tsystem error messages\n"
9792 msgstr ""
9793
9794 #. type: tbl table
9795 #: build/C/man3/stdio.3:232
9796 #, no-wrap
9797 msgid "sys_nerr\tsystem error messages\n"
9798 msgstr ""
9799
9800 #. type: tbl table
9801 #: build/C/man3/stdio.3:233
9802 #, no-wrap
9803 msgid "tempnam\ttemporary file routines\n"
9804 msgstr ""
9805
9806 #. type: tbl table
9807 #: build/C/man3/stdio.3:234
9808 #, no-wrap
9809 msgid "tmpfile\ttemporary file routines\n"
9810 msgstr ""
9811
9812 #. type: tbl table
9813 #: build/C/man3/stdio.3:235
9814 #, no-wrap
9815 msgid "tmpnam\ttemporary file routines\n"
9816 msgstr ""
9817
9818 #. type: tbl table
9819 #: build/C/man3/stdio.3:236
9820 #, no-wrap
9821 msgid "ungetc\tun-get character from input stream\n"
9822 msgstr ""
9823
9824 #. type: tbl table
9825 #: build/C/man3/stdio.3:237
9826 #, no-wrap
9827 msgid "vfprintf\tformatted output conversion\n"
9828 msgstr ""
9829
9830 #. type: tbl table
9831 #: build/C/man3/stdio.3:238
9832 #, no-wrap
9833 msgid "vfscanf\tinput format conversion\n"
9834 msgstr ""
9835
9836 #. type: tbl table
9837 #: build/C/man3/stdio.3:239
9838 #, no-wrap
9839 msgid "vprintf\tformatted output conversion\n"
9840 msgstr ""
9841
9842 #. type: tbl table
9843 #: build/C/man3/stdio.3:240
9844 #, no-wrap
9845 msgid "vscanf\tinput format conversion\n"
9846 msgstr ""
9847
9848 #. type: tbl table
9849 #: build/C/man3/stdio.3:241
9850 #, no-wrap
9851 msgid "vsprintf\tformatted output conversion\n"
9852 msgstr ""
9853
9854 #. type: tbl table
9855 #: build/C/man3/stdio.3:242
9856 #, no-wrap
9857 msgid "vsscanf\tinput format conversion\n"
9858 msgstr ""
9859
9860 #. type: Plain text
9861 #: build/C/man3/stdio.3:248
9862 msgid "The I<stdio> library conforms to C89."
9863 msgstr ""
9864
9865 #. type: Plain text
9866 #: build/C/man3/stdio.3:255
9867 msgid ""
9868 "B<close>(2), B<open>(2), B<read>(2), B<write>(2), B<stdout>(3), "
9869 "B<unlocked_stdio>(3)"
9870 msgstr ""
9871
9872 #. type: TH
9873 #: build/C/man3/stdio_ext.3:23
9874 #, no-wrap
9875 msgid "STDIO_EXT"
9876 msgstr ""
9877
9878 #. type: TH
9879 #: build/C/man3/stdio_ext.3:23
9880 #, no-wrap
9881 msgid "2001-12-16"
9882 msgstr ""
9883
9884 #. type: Plain text
9885 #: build/C/man3/stdio_ext.3:28
9886 msgid ""
9887 "__fbufsize, __flbf, __fpending, __fpurge, __freadable, __freading, "
9888 "__fsetlocking, __fwritable, __fwriting, _flushlbf - interfaces to stdio FILE "
9889 "structure"
9890 msgstr ""
9891
9892 #. type: Plain text
9893 #: build/C/man3/stdio_ext.3:32
9894 msgid "B<#include E<lt>stdio_ext.hE<gt>>"
9895 msgstr ""
9896
9897 #. type: Plain text
9898 #: build/C/man3/stdio_ext.3:34
9899 msgid "B<size_t __fbufsize(FILE *>I<stream>B<);>"
9900 msgstr ""
9901
9902 #. type: Plain text
9903 #: build/C/man3/stdio_ext.3:36
9904 msgid "B<size_t __fpending(FILE *>I<stream>B<);>"
9905 msgstr ""
9906
9907 #. type: Plain text
9908 #: build/C/man3/stdio_ext.3:38
9909 msgid "B<int __flbf(FILE *>I<stream>B<);>"
9910 msgstr ""
9911
9912 #. type: Plain text
9913 #: build/C/man3/stdio_ext.3:40
9914 msgid "B<int __freadable(FILE *>I<stream>B<);>"
9915 msgstr ""
9916
9917 #. type: Plain text
9918 #: build/C/man3/stdio_ext.3:42
9919 msgid "B<int __fwritable(FILE *>I<stream>B<);>"
9920 msgstr ""
9921
9922 #. type: Plain text
9923 #: build/C/man3/stdio_ext.3:44
9924 msgid "B<int __freading(FILE *>I<stream>B<);>"
9925 msgstr ""
9926
9927 #. type: Plain text
9928 #: build/C/man3/stdio_ext.3:46
9929 msgid "B<int __fwriting(FILE *>I<stream>B<);>"
9930 msgstr ""
9931
9932 #. type: Plain text
9933 #: build/C/man3/stdio_ext.3:48
9934 msgid "B<int __fsetlocking(FILE *>I<stream>B<, int >I<type>B<);>"
9935 msgstr ""
9936
9937 #. type: Plain text
9938 #: build/C/man3/stdio_ext.3:50
9939 msgid "B<void _flushlbf(void);>"
9940 msgstr ""
9941
9942 #. type: Plain text
9943 #: build/C/man3/stdio_ext.3:52
9944 msgid "B<void __fpurge(FILE *>I<stream>B<);>"
9945 msgstr ""
9946
9947 #. type: Plain text
9948 #: build/C/man3/stdio_ext.3:57
9949 msgid ""
9950 "Solaris introduced routines to allow portable access to the internals of the "
9951 "I<FILE> structure, and glibc also implemented these."
9952 msgstr ""
9953
9954 #. type: Plain text
9955 #: build/C/man3/stdio_ext.3:62
9956 msgid ""
9957 "The B<__fbufsize>()  function returns the size of the buffer currently used "
9958 "by the given stream."
9959 msgstr ""
9960
9961 #. type: Plain text
9962 #: build/C/man3/stdio_ext.3:69
9963 msgid ""
9964 "The B<__fpending>()  function returns the number of bytes in the output "
9965 "buffer.  For wide-oriented streams the unit is wide characters.  This "
9966 "function is undefined on buffers in reading mode, or opened read-only."
9967 msgstr ""
9968
9969 #. type: Plain text
9970 #: build/C/man3/stdio_ext.3:74
9971 msgid ""
9972 "The B<__flbf>()  function returns a nonzero value if the stream is "
9973 "line-buffered, and zero otherwise."
9974 msgstr ""
9975
9976 #. type: Plain text
9977 #: build/C/man3/stdio_ext.3:79
9978 msgid ""
9979 "The B<__freadable>()  function returns a nonzero value if the stream allows "
9980 "reading, and zero otherwise."
9981 msgstr ""
9982
9983 #. type: Plain text
9984 #: build/C/man3/stdio_ext.3:84
9985 msgid ""
9986 "The B<__fwritable>()  function returns a nonzero value if the stream allows "
9987 "writing, and zero otherwise."
9988 msgstr ""
9989
9990 #. type: Plain text
9991 #: build/C/man3/stdio_ext.3:90
9992 msgid ""
9993 "The B<__freading>()  function returns a nonzero value if the stream is "
9994 "read-only, or if the last operation on the stream was a read operation, and "
9995 "zero otherwise."
9996 msgstr ""
9997
9998 #. type: Plain text
9999 #: build/C/man3/stdio_ext.3:96
10000 msgid ""
10001 "The B<__fwriting>()  function returns a nonzero value if the stream is "
10002 "write-only (or append-only), or if the last operation on the stream was a "
10003 "write operation, and zero otherwise."
10004 msgstr ""
10005
10006 #. type: Plain text
10007 #: build/C/man3/stdio_ext.3:104
10008 msgid ""
10009 "The B<__fsetlocking>()  function can be used to select the desired type of "
10010 "locking on the stream.  It returns the current type.  The I<type> argument "
10011 "can take the following three values:"
10012 msgstr ""
10013
10014 #. type: TP
10015 #: build/C/man3/stdio_ext.3:104
10016 #, no-wrap
10017 msgid "B<FSETLOCKING_INTERNAL>"
10018 msgstr ""
10019
10020 #. type: Plain text
10021 #: build/C/man3/stdio_ext.3:109
10022 msgid ""
10023 "Perform implicit locking around every operation on the given stream (except "
10024 "for the *_unlocked ones).  This is the default."
10025 msgstr ""
10026
10027 #. type: TP
10028 #: build/C/man3/stdio_ext.3:109
10029 #, no-wrap
10030 msgid "B<FSETLOCKING_BYCALLER>"
10031 msgstr ""
10032
10033 #. type: Plain text
10034 #: build/C/man3/stdio_ext.3:116
10035 msgid ""
10036 "The caller will take care of the locking (possibly using B<flockfile>(3)  in "
10037 "case there is more than one thread), and the stdio routines will not do "
10038 "locking until the state is reset to B<FSETLOCKING_INTERNAL>."
10039 msgstr ""
10040
10041 #. type: TP
10042 #: build/C/man3/stdio_ext.3:116
10043 #, no-wrap
10044 msgid "B<FSETLOCKING_QUERY>"
10045 msgstr ""
10046
10047 #. type: Plain text
10048 #: build/C/man3/stdio_ext.3:120
10049 msgid "Don't change the type of locking.  (Only return it.)"
10050 msgstr ""
10051
10052 #. type: Plain text
10053 #: build/C/man3/stdio_ext.3:126
10054 msgid ""
10055 "The B<_flushlbf>()  function flushes all line-buffered streams.  (Presumably "
10056 "so that output to a terminal is forced out, say before reading keyboard "
10057 "input.)"
10058 msgstr ""
10059
10060 #. type: Plain text
10061 #: build/C/man3/stdio_ext.3:130
10062 msgid "The B<__fpurge>()  function discards the contents of the stream's buffer."
10063 msgstr ""
10064
10065 #. type: Plain text
10066 #: build/C/man3/stdio_ext.3:133
10067 msgid "B<flockfile>(3), B<fpurge>(3)"
10068 msgstr ""
10069
10070 #. type: TH
10071 #: build/C/man2/symlink.2:32 build/C/man7/symlink.7:35
10072 #, no-wrap
10073 msgid "SYMLINK"
10074 msgstr ""
10075
10076 #. type: TH
10077 #: build/C/man2/symlink.2:32
10078 #, no-wrap
10079 msgid "2010-09-20"
10080 msgstr ""
10081
10082 #. type: Plain text
10083 #: build/C/man2/symlink.2:35
10084 msgid "symlink - make a new name for a file"
10085 msgstr ""
10086
10087 #. type: Plain text
10088 #: build/C/man2/symlink.2:39
10089 msgid "B<int symlink(const char *>I<oldpath>B<, const char *>I<newpath>B<);>"
10090 msgstr ""
10091
10092 #. type: Plain text
10093 #: build/C/man2/symlink.2:47
10094 msgid "B<symlink>():"
10095 msgstr ""
10096
10097 #. type: Plain text
10098 #: build/C/man2/symlink.2:58
10099 msgid ""
10100 "B<symlink>()  creates a symbolic link named I<newpath> which contains the "
10101 "string I<oldpath>."
10102 msgstr ""
10103
10104 #. type: Plain text
10105 #: build/C/man2/symlink.2:62
10106 msgid ""
10107 "Symbolic links are interpreted at run time as if the contents of the link "
10108 "had been substituted into the path being followed to find a file or "
10109 "directory."
10110 msgstr ""
10111
10112 #. type: Plain text
10113 #: build/C/man2/symlink.2:67
10114 msgid ""
10115 "Symbolic links may contain I<..> path components, which (if used at the "
10116 "start of the link) refer to the parent directories of that in which the link "
10117 "resides."
10118 msgstr ""
10119
10120 #. type: Plain text
10121 #: build/C/man2/symlink.2:71
10122 msgid ""
10123 "A symbolic link (also known as a soft link) may point to an existing file or "
10124 "to a nonexistent one; the latter case is known as a dangling link."
10125 msgstr ""
10126
10127 #. type: Plain text
10128 #: build/C/man2/symlink.2:78
10129 msgid ""
10130 "The permissions of a symbolic link are irrelevant; the ownership is ignored "
10131 "when following the link, but is checked when removal or renaming of the link "
10132 "is requested and the link is in a directory with the sticky bit (B<S_ISVTX>)  "
10133 "set."
10134 msgstr ""
10135
10136 #. type: Plain text
10137 #: build/C/man2/symlink.2:99
10138 msgid ""
10139 "Write access to the directory containing I<newpath> is denied, or one of the "
10140 "directories in the path prefix of I<newpath> did not allow search "
10141 "permission.  (See also B<path_resolution>(7).)"
10142 msgstr ""
10143
10144 #. type: Plain text
10145 #: build/C/man2/symlink.2:113
10146 msgid "Too many symbolic links were encountered in resolving I<newpath>."
10147 msgstr ""
10148
10149 #. type: Plain text
10150 #: build/C/man2/symlink.2:123
10151 msgid ""
10152 "A directory component in I<newpath> does not exist or is a dangling symbolic "
10153 "link, or I<oldpath> is the empty string."
10154 msgstr ""
10155
10156 #. type: Plain text
10157 #: build/C/man2/symlink.2:135
10158 msgid "A component used as a directory in I<newpath> is not, in fact, a directory."
10159 msgstr ""
10160
10161 #. type: Plain text
10162 #: build/C/man2/symlink.2:140
10163 msgid ""
10164 "The file system containing I<newpath> does not support the creation of "
10165 "symbolic links."
10166 msgstr ""
10167
10168 #. type: Plain text
10169 #: build/C/man2/symlink.2:144
10170 msgid "I<newpath> is on a read-only file system."
10171 msgstr ""
10172
10173 #. type: Plain text
10174 #: build/C/man2/symlink.2:154
10175 msgid "No checking of I<oldpath> is done."
10176 msgstr ""
10177
10178 #. type: Plain text
10179 #: build/C/man2/symlink.2:159
10180 msgid ""
10181 "Deleting the name referred to by a symlink will actually delete the file "
10182 "(unless it also has other hard links).  If this behavior is not desired, use "
10183 "B<link>(2)."
10184 msgstr ""
10185
10186 #. type: Plain text
10187 #: build/C/man2/symlink.2:171
10188 msgid ""
10189 "B<ln>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<open>(2), B<readlink>(2), "
10190 "B<rename>(2), B<symlinkat>(2), B<unlink>(2), B<path_resolution>(7), "
10191 "B<symlink>(7)"
10192 msgstr ""
10193
10194 #. type: TH
10195 #: build/C/man7/symlink.7:35
10196 #, no-wrap
10197 msgid "2008-06-18"
10198 msgstr ""
10199
10200 #. type: Plain text
10201 #: build/C/man7/symlink.7:38
10202 msgid "symlink - symbolic link handling"
10203 msgstr ""
10204
10205 #. type: SH
10206 #: build/C/man7/symlink.7:38
10207 #, no-wrap
10208 msgid "SYMBOLIC LINK HANDLING"
10209 msgstr ""
10210
10211 #. type: Plain text
10212 #: build/C/man7/symlink.7:42
10213 msgid ""
10214 "Symbolic links are files that act as pointers to other files.  To understand "
10215 "their behavior, you must first understand how hard links work."
10216 msgstr ""
10217
10218 #. type: Plain text
10219 #: build/C/man7/symlink.7:58
10220 msgid ""
10221 "A hard link to a file is indistinguishable from the original file because it "
10222 "is a reference to the object underlying the original filename.  (To be "
10223 "precise: each of the hard links to a file is a reference to the same "
10224 "I<i-node number>, where an i-node number is an index into the i-node table, "
10225 "which contains metadata about all files on a file system.  See B<stat>(2).)  "
10226 "Changes to a file are independent of the name used to reference the file.  "
10227 "Hard links may not refer to directories (to prevent the possibility of loops "
10228 "within the file system tree, which would confuse many programs)  and may not "
10229 "refer to files on different file systems (because i-node numbers are not "
10230 "unique across file systems)."
10231 msgstr ""
10232
10233 #. type: Plain text
10234 #: build/C/man7/symlink.7:65
10235 msgid ""
10236 "A symbolic link is a special type of file whose contents are a string that "
10237 "is the pathname another file, the file to which the link refers.  In other "
10238 "words, a symbolic link is a pointer to another name, and not to an "
10239 "underlying object.  For this reason, symbolic links may refer to directories "
10240 "and may cross file system boundaries."
10241 msgstr ""
10242
10243 #. type: Plain text
10244 #: build/C/man7/symlink.7:71
10245 msgid ""
10246 "There is no requirement that the pathname referred to by a symbolic link "
10247 "should exist.  A symbolic link that refers to a pathname that does not exist "
10248 "is said to be a I<dangling link>."
10249 msgstr ""
10250
10251 #. type: Plain text
10252 #: build/C/man7/symlink.7:83
10253 msgid ""
10254 "Because a symbolic link and its referenced object coexist in the file system "
10255 "name space, confusion can arise in distinguishing between the link itself "
10256 "and the referenced object.  On historical systems, commands and system calls "
10257 "adopted their own link-following conventions in a somewhat ad-hoc fashion.  "
10258 "Rules for a more uniform approach, as they are implemented on Linux and "
10259 "other systems, are outlined here.  It is important that site-local "
10260 "applications also conform to these rules, so that the user interface can be "
10261 "as consistent as possible."
10262 msgstr ""
10263
10264 #. type: SS
10265 #: build/C/man7/symlink.7:83
10266 #, no-wrap
10267 msgid "Symbolic link ownership, permissions, and timestamps"
10268 msgstr ""
10269
10270 #. type: Plain text
10271 #: build/C/man7/symlink.7:91
10272 msgid ""
10273 "The owner and group of an existing symbolic link can be changed using "
10274 "B<lchown>(2).  The only time that the ownership of a symbolic link matters "
10275 "is when the link is being removed or renamed in a directory that has the "
10276 "sticky bit set (see B<stat>(2))."
10277 msgstr ""
10278
10279 #. type: Plain text
10280 #: build/C/man7/symlink.7:97
10281 msgid ""
10282 "The last access and last modification timestamps of a symbolic link can be "
10283 "changed using B<utimensat>(2)  or B<lutimes>(3)."
10284 msgstr ""
10285
10286 #.  Linux does not currently implement an lchmod(2).
10287 #
10288 #.  The
10289 #.  4.4BSD
10290 #.  system differs from historical
10291 #.  4BSD
10292 #.  systems in that the system call
10293 #.  .BR chown (2)
10294 #.  has been changed to follow symbolic links.
10295 #.  The
10296 #.  .BR lchown (2)
10297 #.  system call was added later when the limitations of the new
10298 #.  .BR chown (2)
10299 #.  became apparent.
10300 #. type: Plain text
10301 #: build/C/man7/symlink.7:116
10302 msgid ""
10303 "On Linux, the permissions of a symbolic link are not used in any operations; "
10304 "the permissions are always 0777 (read, write, and execute for all user "
10305 "categories), and can't be changed."
10306 msgstr ""
10307
10308 #. type: SS
10309 #: build/C/man7/symlink.7:116
10310 #, no-wrap
10311 msgid "Handling of symbolic links by system calls and commands"
10312 msgstr ""
10313
10314 #. type: Plain text
10315 #: build/C/man7/symlink.7:131
10316 msgid ""
10317 "Symbolic links are handled either by operating on the link itself, or by "
10318 "operating on the object referred to by the link.  In the latter case, an "
10319 "application or system call is said to I<follow> the link.  Symbolic links "
10320 "may refer to other symbolic links, in which case the links are dereferenced "
10321 "until an object that is not a symbolic link is found, a symbolic link that "
10322 "refers to a file which does not exist is found, or a loop is detected.  "
10323 "(Loop detection is done by placing an upper limit on the number of links "
10324 "that may be followed, and an error results if this limit is exceeded.)"
10325 msgstr ""
10326
10327 #. type: Plain text
10328 #: build/C/man7/symlink.7:134
10329 msgid ""
10330 "There are three separate areas that need to be discussed.  They are as "
10331 "follows:"
10332 msgstr ""
10333
10334 #. type: IP
10335 #: build/C/man7/symlink.7:134
10336 #, no-wrap
10337 msgid "1."
10338 msgstr ""
10339
10340 #. type: Plain text
10341 #: build/C/man7/symlink.7:136
10342 msgid "Symbolic links used as filename arguments for system calls."
10343 msgstr ""
10344
10345 #. type: IP
10346 #: build/C/man7/symlink.7:136
10347 #, no-wrap
10348 msgid "2."
10349 msgstr ""
10350
10351 #. type: Plain text
10352 #: build/C/man7/symlink.7:139
10353 msgid ""
10354 "Symbolic links specified as command-line arguments to utilities that are not "
10355 "traversing a file tree."
10356 msgstr ""
10357
10358 #. type: IP
10359 #: build/C/man7/symlink.7:139
10360 #, no-wrap
10361 msgid "3."
10362 msgstr ""
10363
10364 #. type: Plain text
10365 #: build/C/man7/symlink.7:143
10366 msgid ""
10367 "Symbolic links encountered by utilities that are traversing a file tree "
10368 "(either specified on the command line or encountered as part of the file "
10369 "hierarchy walk)."
10370 msgstr ""
10371
10372 #. type: SS
10373 #: build/C/man7/symlink.7:143
10374 #, no-wrap
10375 msgid "System calls"
10376 msgstr ""
10377
10378 #. type: Plain text
10379 #: build/C/man7/symlink.7:146
10380 msgid ""
10381 "The first area is symbolic links used as filename arguments for system "
10382 "calls."
10383 msgstr ""
10384
10385 #. type: Plain text
10386 #: build/C/man7/symlink.7:156
10387 msgid ""
10388 "Except as noted below, all system calls follow symbolic links.  For example, "
10389 "if there were a symbolic link I<slink> which pointed to a file named "
10390 "I<afile>, the system call I<open(\"slink\" ...\\&)> would return a file "
10391 "descriptor referring to the file I<afile>."
10392 msgstr ""
10393
10394 #.  Maybe one day: .BR fchownat (2)
10395 #. type: Plain text
10396 #: build/C/man7/symlink.7:206
10397 msgid ""
10398 "Various system calls do not follow links, and operate on the symbolic link "
10399 "itself.  They are: B<lchown>(2), B<lgetxattr>(2), B<llistxattr>(2), "
10400 "B<lremovexattr>(2), B<lsetxattr>(2), B<lstat>(2), B<readlink>(2), "
10401 "B<rename>(2), B<rmdir>(2), and B<unlink>(2).  Certain other system calls "
10402 "optionally follow symbolic links.  They are: B<faccessat>(2), "
10403 "B<fchownat>(2), B<fstatat>(2), B<linkat>(2), B<open>(2), B<openat>(2), and "
10404 "B<utimensat>(2); see their manual pages for details.  Because B<remove>(3)  "
10405 "is an alias for B<unlink>(2), that library function also does not follow "
10406 "symbolic links.  When B<rmdir>(2)  is applied to a symbolic link, it fails "
10407 "with the error B<ENOTDIR>.  The B<link>(2)  warrants special discussion.  "
10408 "POSIX.1-2001 specifies that B<link>(2)  should dereference I<oldpath> if it "
10409 "is a symbolic link.  However, Linux does not do this.  (By default Solaris "
10410 "is the same, but the POSIX.1-2001 specified behavior can be obtained with "
10411 "suitable compiler options.)  The upcoming POSIX.1 revision changes the "
10412 "specification to allow either behavior in an implementation."
10413 msgstr ""
10414
10415 #. type: SS
10416 #: build/C/man7/symlink.7:206
10417 #, no-wrap
10418 msgid "Commands not traversing a file tree"
10419 msgstr ""
10420
10421 #. type: Plain text
10422 #: build/C/man7/symlink.7:209
10423 msgid ""
10424 "The second area is symbolic links, specified as command-line filename "
10425 "arguments, to commands which are not traversing a file tree."
10426 msgstr ""
10427
10428 #. type: Plain text
10429 #: build/C/man7/symlink.7:220
10430 msgid ""
10431 "Except as noted below, commands follow symbolic links named as command-line "
10432 "arguments.  For example, if there were a symbolic link I<slink> which "
10433 "pointed to a file named I<afile>, the command I<cat slink> would display the "
10434 "contents of the file I<afile>."
10435 msgstr ""
10436
10437 #. type: Plain text
10438 #: build/C/man7/symlink.7:228
10439 msgid ""
10440 "It is important to realize that this rule includes commands which may "
10441 "optionally traverse file trees, e.g., the command I<chown file> is included "
10442 "in this rule, while the command I<chown\\ -R file>, which performs a tree "
10443 "traversal, is not.  (The latter is described in the third area, below.)"
10444 msgstr ""
10445
10446 #. type: Plain text
10447 #: build/C/man7/symlink.7:246
10448 msgid ""
10449 "If it is explicitly intended that the command operate on the symbolic link "
10450 "instead of following the symbolic link, e.g., it is desired that I<chown "
10451 "slink> change the ownership of the file that I<slink> is, whether it is a "
10452 "symbolic link or not, the I<-h> option should be used.  In the above "
10453 "example, I<chown root slink> would change the ownership of the file referred "
10454 "to by I<slink>, while I<chown\\ -h root slink> would change the ownership of "
10455 "I<slink> itself."
10456 msgstr ""
10457
10458 #. type: Plain text
10459 #: build/C/man7/symlink.7:248
10460 msgid "There are some exceptions to this rule:"
10461 msgstr ""
10462
10463 #. type: Plain text
10464 #: build/C/man7/symlink.7:258
10465 msgid ""
10466 "The B<mv>(1)  and B<rm>(1)  commands do not follow symbolic links named as "
10467 "arguments, but respectively attempt to rename and delete them.  (Note, if "
10468 "the symbolic link references a file via a relative path, moving it to "
10469 "another directory may very well cause it to stop working, since the path may "
10470 "no longer be correct.)"
10471 msgstr ""
10472
10473 #. type: Plain text
10474 #: build/C/man7/symlink.7:288
10475 msgid ""
10476 "The B<ls>(1)  command is also an exception to this rule.  For compatibility "
10477 "with historic systems (when B<ls>(1)  is not doing a tree walk, i.e., the "
10478 "I<-R> option is not specified), the B<ls>(1)  command follows symbolic links "
10479 "named as arguments if the I<-H> or I<-L> option is specified, or if the "
10480 "I<-F>, I<-d>, or I<-l> options are not specified.  (The B<ls>(1)  command is "
10481 "the only command where the I<-H> and I<-L> options affect its behavior even "
10482 "though it is not doing a walk of a file tree.)"
10483 msgstr ""
10484
10485 #
10486 #. The 4.4BSD system differs from historical 4BSD systems in that the
10487 #. .BR chown (1)
10488 #. and
10489 #. .BR chgrp (1)
10490 #. commands follow symbolic links specified on the command line.
10491 #. type: Plain text
10492 #: build/C/man7/symlink.7:306
10493 msgid ""
10494 "The B<file>(1)  command is also an exception to this rule.  The B<file>(1)  "
10495 "command does not follow symbolic links named as argument by default.  The "
10496 "B<file>(1)  command does follow symbolic links named as argument if the "
10497 "I<-L> option is specified."
10498 msgstr ""
10499
10500 #. type: SS
10501 #: build/C/man7/symlink.7:306
10502 #, no-wrap
10503 msgid "Commands traversing a file tree"
10504 msgstr ""
10505
10506 #. type: Plain text
10507 #: build/C/man7/symlink.7:319
10508 msgid ""
10509 "The following commands either optionally or always traverse file trees: "
10510 "B<chgrp>(1), B<chmod>(1), B<chown>(1), B<cp>(1), B<du>(1), B<find>(1), "
10511 "B<ls>(1), B<pax>(1), B<rm>(1), and B<tar>(1)."
10512 msgstr ""
10513
10514 #. type: Plain text
10515 #: build/C/man7/symlink.7:323
10516 msgid ""
10517 "It is important to realize that the following rules apply equally to "
10518 "symbolic links encountered during the file tree traversal and symbolic links "
10519 "listed as command-line arguments."
10520 msgstr ""
10521
10522 #. type: Plain text
10523 #: build/C/man7/symlink.7:328
10524 msgid ""
10525 "The I<first rule> applies to symbolic links that reference files other than "
10526 "directories.  Operations that apply to symbolic links are performed on the "
10527 "links themselves, but otherwise the links are ignored."
10528 msgstr ""
10529
10530 #. type: Plain text
10531 #: build/C/man7/symlink.7:340
10532 msgid ""
10533 "The command I<rm\\ -r slink directory> will remove I<slink>, as well as any "
10534 "symbolic links encountered in the tree traversal of I<directory>, because "
10535 "symbolic links may be removed.  In no case will B<rm>(1)  affect the file "
10536 "referred to by I<slink>."
10537 msgstr ""
10538
10539 #. type: Plain text
10540 #: build/C/man7/symlink.7:345
10541 msgid ""
10542 "The I<second rule> applies to symbolic links that refer to directories.  "
10543 "Symbolic links that refer to directories are never followed by default.  "
10544 "This is often referred to as a \"physical\" walk, as opposed to a "
10545 "\"logical\" walk (where symbolic links the refer to directories are "
10546 "followed)."
10547 msgstr ""
10548
10549 #. type: Plain text
10550 #: build/C/man7/symlink.7:348
10551 msgid ""
10552 "Certain conventions are (should be) followed as consistently as possible by "
10553 "commands that perform file tree walks:"
10554 msgstr ""
10555
10556 #. type: Plain text
10557 #: build/C/man7/symlink.7:361
10558 msgid ""
10559 "A command can be made to follow any symbolic links named on the command "
10560 "line, regardless of the type of file they reference, by specifying the I<-H> "
10561 "(for \"half-logical\") flag.  This flag is intended to make the command-line "
10562 "name space look like the logical name space.  (Note, for commands that do "
10563 "not always do file tree traversals, the I<-H> flag will be ignored if the "
10564 "I<-R> flag is not also specified.)"
10565 msgstr ""
10566
10567 #. type: Plain text
10568 #: build/C/man7/symlink.7:377
10569 msgid ""
10570 "For example, the command I<chown\\ -HR user slink> will traverse the file "
10571 "hierarchy rooted in the file pointed to by I<slink>.  Note, the I<-H> is not "
10572 "the same as the previously discussed I<-h> flag.  The I<-H> flag causes "
10573 "symbolic links specified on the command line to be dereferenced for the "
10574 "purposes of both the action to be performed and the tree walk, and it is as "
10575 "if the user had specified the name of the file to which the symbolic link "
10576 "pointed."
10577 msgstr ""
10578
10579 #. type: Plain text
10580 #: build/C/man7/symlink.7:391
10581 msgid ""
10582 "A command can be made to follow any symbolic links named on the command "
10583 "line, as well as any symbolic links encountered during the traversal, "
10584 "regardless of the type of file they reference, by specifying the I<-L> (for "
10585 "\"logical\") flag.  This flag is intended to make the entire name space look "
10586 "like the logical name space.  (Note, for commands that do not always do file "
10587 "tree traversals, the I<-L> flag will be ignored if the I<-R> flag is not "
10588 "also specified.)"
10589 msgstr ""
10590
10591 #. type: Plain text
10592 #: build/C/man7/symlink.7:406
10593 msgid ""
10594 "For example, the command I<chown\\ -LR user slink> will change the owner of "
10595 "the file referred to by I<slink>.  If I<slink> refers to a directory, "
10596 "B<chown> will traverse the file hierarchy rooted in the directory that it "
10597 "references.  In addition, if any symbolic links are encountered in any file "
10598 "tree that B<chown> traverses, they will be treated in the same fashion as "
10599 "I<slink>."
10600 msgstr ""
10601
10602 #. type: Plain text
10603 #: build/C/man7/symlink.7:413
10604 msgid ""
10605 "A command can be made to provide the default behavior by specifying the "
10606 "I<-P> (for \"physical\") flag.  This flag is intended to make the entire "
10607 "name space look like the physical name space."
10608 msgstr ""
10609
10610 #. type: Plain text
10611 #: build/C/man7/symlink.7:431
10612 msgid ""
10613 "For commands that do not by default do file tree traversals, the I<-H>, "
10614 "I<-L>, and I<-P> flags are ignored if the I<-R> flag is not also specified.  "
10615 "In addition, you may specify the I<-H>, I<-L>, and I<-P> options more than "
10616 "once; the last one specified determines the command's behavior.  This is "
10617 "intended to permit you to alias commands to behave one way or the other, and "
10618 "then override that behavior on the command line."
10619 msgstr ""
10620
10621 #. type: Plain text
10622 #: build/C/man7/symlink.7:437
10623 msgid "The B<ls>(1)  and B<rm>(1)  commands have exceptions to these rules:"
10624 msgstr ""
10625
10626 #. type: Plain text
10627 #: build/C/man7/symlink.7:450
10628 msgid ""
10629 "The B<rm>(1)  command operates on the symbolic link, and not the file it "
10630 "references, and therefore never follows a symbolic link.  The B<rm>(1)  "
10631 "command does not support the I<-H>, I<-L>, or I<-P> options."
10632 msgstr ""
10633
10634 #. type: Plain text
10635 #: build/C/man7/symlink.7:470
10636 msgid ""
10637 "To maintain compatibility with historic systems, the B<ls>(1)  command acts "
10638 "a little differently.  If you do not specify the I<-F>, I<-d> or I<-l> "
10639 "options, B<ls>(1)  will follow symbolic links specified on the command "
10640 "line.  If the I<-L> flag is specified, B<ls>(1)  follows all symbolic links, "
10641 "regardless of their type, whether specified on the command line or "
10642 "encountered in the tree walk."
10643 msgstr ""
10644
10645 #. type: Plain text
10646 #: build/C/man7/symlink.7:488
10647 msgid ""
10648 "B<chgrp>(1), B<chmod>(1), B<find>(1), B<ln>(1), B<ls>(1), B<mv>(1), "
10649 "B<rm>(1), B<lchown>(2), B<link>(2), B<lstat>(2), B<readlink>(2), "
10650 "B<rename>(2), B<symlink>(2), B<unlink>(2), B<utimensat>(2), B<lutimes>(3), "
10651 "B<path_resolution>(7)"
10652 msgstr ""
10653
10654 #. type: TH
10655 #: build/C/man3/tempnam.3:23
10656 #, no-wrap
10657 msgid "TEMPNAM"
10658 msgstr ""
10659
10660 #. type: TH
10661 #: build/C/man3/tempnam.3:23
10662 #, no-wrap
10663 msgid "2008-08-06"
10664 msgstr ""
10665
10666 #. type: Plain text
10667 #: build/C/man3/tempnam.3:26
10668 msgid "tempnam - create a name for a temporary file"
10669 msgstr ""
10670
10671 #. type: Plain text
10672 #: build/C/man3/tempnam.3:31
10673 #, no-wrap
10674 msgid "B<char *tempnam(const char *>I<dir>B<, const char *>I<pfx>B<);>\n"
10675 msgstr ""
10676
10677 #. type: Plain text
10678 #: build/C/man3/tempnam.3:40
10679 msgid "B<tempnam>(): _BSD_SOURCE || _SVID_SOURCE"
10680 msgstr ""
10681
10682 #. type: Plain text
10683 #: build/C/man3/tempnam.3:54
10684 msgid ""
10685 "The B<tempnam>()  function returns a pointer to a string that is a valid "
10686 "filename, and such that a file with this name did not exist when "
10687 "B<tempnam>()  checked.  The filename suffix of the pathname generated will "
10688 "start with I<pfx> in case I<pfx> is a non-NULL string of at most five "
10689 "bytes.  The directory prefix part of the pathname generated is required to "
10690 "be \"appropriate\" (often that at least implies writable)."
10691 msgstr ""
10692
10693 #. type: Plain text
10694 #: build/C/man3/tempnam.3:57
10695 msgid "Attempts to find an appropriate directory go through the following steps:"
10696 msgstr ""
10697
10698 #. type: TP
10699 #: build/C/man3/tempnam.3:57
10700 #, no-wrap
10701 msgid "a)"
10702 msgstr ""
10703
10704 #. type: Plain text
10705 #: build/C/man3/tempnam.3:63
10706 msgid ""
10707 "In case the environment variable B<TMPDIR> exists and contains the name of "
10708 "an appropriate directory, that is used."
10709 msgstr ""
10710
10711 #. type: TP
10712 #: build/C/man3/tempnam.3:63
10713 #, no-wrap
10714 msgid "b)"
10715 msgstr ""
10716
10717 #. type: Plain text
10718 #: build/C/man3/tempnam.3:68
10719 msgid "Otherwise, if the I<dir> argument is non-NULL and appropriate, it is used."
10720 msgstr ""
10721
10722 #. type: TP
10723 #: build/C/man3/tempnam.3:68
10724 #, no-wrap
10725 msgid "c)"
10726 msgstr ""
10727
10728 #. type: Plain text
10729 #: build/C/man3/tempnam.3:75
10730 msgid ""
10731 "Otherwise, I<P_tmpdir> (as defined in I<E<lt>stdio.hE<gt>>)  is used when "
10732 "appropriate."
10733 msgstr ""
10734
10735 #. type: TP
10736 #: build/C/man3/tempnam.3:75
10737 #, no-wrap
10738 msgid "d)"
10739 msgstr ""
10740
10741 #. type: Plain text
10742 #: build/C/man3/tempnam.3:78
10743 msgid "Finally an implementation-defined directory may be used."
10744 msgstr ""
10745
10746 #. type: Plain text
10747 #: build/C/man3/tempnam.3:85
10748 msgid ""
10749 "The string returned by B<tempnam>()  is allocated using B<malloc>(3)  and "
10750 "hence should be freed by B<free>(3)."
10751 msgstr ""
10752
10753 #. type: Plain text
10754 #: build/C/man3/tempnam.3:90
10755 msgid ""
10756 "The B<tempnam>()  function returns a pointer to a unique temporary filename, "
10757 "or NULL if a unique name cannot be generated."
10758 msgstr ""
10759
10760 #. type: Plain text
10761 #: build/C/man3/tempnam.3:94
10762 msgid "Allocation of storage failed."
10763 msgstr ""
10764
10765 #. type: Plain text
10766 #: build/C/man3/tempnam.3:99
10767 msgid "SVr4, 4.3BSD, POSIX.1-2001.  POSIX.1-2008 marks B<tempnam>()  as obsolete."
10768 msgstr ""
10769
10770 #. type: Plain text
10771 #: build/C/man3/tempnam.3:118
10772 msgid ""
10773 "Although B<tempnam>()  generates names that are difficult to guess, it is "
10774 "nevertheless possible that between the time that B<tempnam>()  returns a "
10775 "pathname, and the time that the program opens it, another program might "
10776 "create that pathname using B<open>(2), or create it as a symbolic link.  "
10777 "This can lead to security holes.  To avoid such possibilities, use the "
10778 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
10779 "B<mkstemp>(3)  or B<tmpfile>(3)."
10780 msgstr ""
10781
10782 #. type: Plain text
10783 #: build/C/man3/tempnam.3:126
10784 msgid ""
10785 "SUSv2 does not mention the use of B<TMPDIR>; glibc will use it only when the "
10786 "program is not set-user-ID.  On SVr4, the directory used under B<d)> is "
10787 "I</tmp> (and this is what glibc does)."
10788 msgstr ""
10789
10790 #. type: Plain text
10791 #: build/C/man3/tempnam.3:131
10792 msgid ""
10793 "Because it dynamically allocates memory used to return the pathname, "
10794 "B<tempnam>()  is reentrant, and thus thread safe, unlike B<tmpnam>(3)."
10795 msgstr ""
10796
10797 #. type: Plain text
10798 #: build/C/man3/tempnam.3:144
10799 msgid ""
10800 "The B<tempnam>()  function generates a different string each time it is "
10801 "called, up to B<TMP_MAX> (defined in I<E<lt>stdio.hE<gt>>)  times.  If it is "
10802 "called more than B<TMP_MAX> times, the behavior is implementation defined."
10803 msgstr ""
10804
10805 #. type: Plain text
10806 #: build/C/man3/tempnam.3:148
10807 msgid "B<tempnam>()  uses at most the first five bytes from I<pfx>."
10808 msgstr ""
10809
10810 #. type: Plain text
10811 #: build/C/man3/tempnam.3:154
10812 msgid ""
10813 "The glibc implementation of B<tempnam>()  will fail with the error B<EEXIST> "
10814 "upon failure to find a unique name."
10815 msgstr ""
10816
10817 #. type: Plain text
10818 #: build/C/man3/tempnam.3:157
10819 msgid ""
10820 "The precise meaning of \"appropriate\" is undefined; it is unspecified how "
10821 "accessibility of a directory is determined."
10822 msgstr ""
10823
10824 #. type: Plain text
10825 #: build/C/man3/tempnam.3:164 build/C/man3/tmpnam.3:151
10826 msgid "Never use this function.  Use B<mkstemp>(3)  or B<tmpfile>(3)  instead."
10827 msgstr ""
10828
10829 #. type: Plain text
10830 #: build/C/man3/tempnam.3:169
10831 msgid "B<mkstemp>(3), B<mktemp>(3), B<tmpfile>(3), B<tmpnam>(3)"
10832 msgstr ""
10833
10834 #. type: TH
10835 #: build/C/man3/tmpfile.3:29
10836 #, no-wrap
10837 msgid "TMPFILE"
10838 msgstr ""
10839
10840 #. type: Plain text
10841 #: build/C/man3/tmpfile.3:32
10842 msgid "tmpfile - create a temporary file"
10843 msgstr ""
10844
10845 #. type: Plain text
10846 #: build/C/man3/tmpfile.3:37
10847 #, no-wrap
10848 msgid "B<FILE *tmpfile(void);>\n"
10849 msgstr ""
10850
10851 #. type: Plain text
10852 #: build/C/man3/tmpfile.3:45
10853 msgid ""
10854 "The B<tmpfile>()  function opens a unique temporary file in binary "
10855 "read/write (w+b) mode.  The file will be automatically deleted when it is "
10856 "closed or the program terminates."
10857 msgstr ""
10858
10859 #. type: Plain text
10860 #: build/C/man3/tmpfile.3:52
10861 msgid ""
10862 "The B<tmpfile>()  function returns a stream descriptor, or NULL if a unique "
10863 "filename cannot be generated or the unique file cannot be opened.  In the "
10864 "latter case, I<errno> is set to indicate the error."
10865 msgstr ""
10866
10867 #. type: Plain text
10868 #: build/C/man3/tmpfile.3:56
10869 msgid "Search permission denied for directory in file's path prefix."
10870 msgstr ""
10871
10872 #. type: Plain text
10873 #: build/C/man3/tmpfile.3:59
10874 msgid "Unable to generate a unique filename."
10875 msgstr ""
10876
10877 #. type: Plain text
10878 #: build/C/man3/tmpfile.3:62
10879 msgid "The call was interrupted by a signal."
10880 msgstr ""
10881
10882 #. type: Plain text
10883 #: build/C/man3/tmpfile.3:65
10884 msgid "Too many file descriptors in use by the process."
10885 msgstr ""
10886
10887 #. type: Plain text
10888 #: build/C/man3/tmpfile.3:68
10889 msgid "Too many files open in the system."
10890 msgstr ""
10891
10892 #. type: Plain text
10893 #: build/C/man3/tmpfile.3:71
10894 msgid "There was no room in the directory to add the new filename."
10895 msgstr ""
10896
10897 #. type: Plain text
10898 #: build/C/man3/tmpfile.3:74
10899 msgid "Read-only file system."
10900 msgstr ""
10901
10902 #. type: Plain text
10903 #: build/C/man3/tmpfile.3:76
10904 msgid "SVr4, 4.3BSD, C89, C99, SUSv2, POSIX.1-2001."
10905 msgstr ""
10906
10907 #. type: Plain text
10908 #: build/C/man3/tmpfile.3:80
10909 msgid ""
10910 "POSIX.1-2001 specifies: an error message may be written to I<stdout> if the "
10911 "stream cannot be opened."
10912 msgstr ""
10913
10914 #. type: Plain text
10915 #: build/C/man3/tmpfile.3:86
10916 msgid ""
10917 "The standard does not specify the directory that B<tmpfile>()  will use.  "
10918 "Glibc will try the path prefix I<P_tmpdir> defined in I<E<lt>stdio.hE<gt>>, "
10919 "and if that fails the directory I</tmp>."
10920 msgstr ""
10921
10922 #. type: Plain text
10923 #: build/C/man3/tmpfile.3:92
10924 msgid "B<exit>(3), B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpnam>(3)"
10925 msgstr ""
10926
10927 #. type: TH
10928 #: build/C/man3/tmpnam.3:25
10929 #, no-wrap
10930 msgid "TMPNAM"
10931 msgstr ""
10932
10933 #. type: TH
10934 #: build/C/man3/tmpnam.3:25
10935 #, no-wrap
10936 msgid "2010-09-10"
10937 msgstr ""
10938
10939 #. type: Plain text
10940 #: build/C/man3/tmpnam.3:28
10941 msgid "tmpnam, tmpnam_r - create a name for a temporary file"
10942 msgstr ""
10943
10944 #. type: Plain text
10945 #: build/C/man3/tmpnam.3:33
10946 #, no-wrap
10947 msgid "B<char *tmpnam(char *>I<s>B<);>\n"
10948 msgstr ""
10949
10950 #. type: Plain text
10951 #: build/C/man3/tmpnam.3:56
10952 msgid ""
10953 "The B<tmpnam>()  function returns a pointer to a string that is a valid "
10954 "filename, and such that a file with this name did not exist at some point in "
10955 "time, so that naive programmers may think it a suitable name for a temporary "
10956 "file.  If the argument I<s> is NULL this name is generated in an internal "
10957 "static buffer and may be overwritten by the next call to B<tmpnam>().  If "
10958 "I<s> is not NULL, the name is copied to the character array (of length at "
10959 "least I<L_tmpnam>)  pointed to by I<s> and the value I<s> is returned in "
10960 "case of success."
10961 msgstr ""
10962
10963 #. type: Plain text
10964 #: build/C/man3/tmpnam.3:68
10965 msgid ""
10966 "The pathname that is created, has a directory prefix I<P_tmpdir>.  (Both "
10967 "I<L_tmpnam> and I<P_tmpdir> are defined in I<E<lt>stdio.hE<gt>>, just like "
10968 "the B<TMP_MAX> mentioned below.)"
10969 msgstr ""
10970
10971 #. type: Plain text
10972 #: build/C/man3/tmpnam.3:73
10973 msgid ""
10974 "The B<tmpnam>()  function returns a pointer to a unique temporary filename, "
10975 "or NULL if a unique name cannot be generated."
10976 msgstr ""
10977
10978 #. type: Plain text
10979 #: build/C/man3/tmpnam.3:75
10980 msgid "No errors are defined."
10981 msgstr ""
10982
10983 #. type: Plain text
10984 #: build/C/man3/tmpnam.3:80
10985 msgid ""
10986 "SVr4, 4.3BSD, C89, C99, POSIX.1-2001.  POSIX.1-2008 marks B<tmpnam>()  as "
10987 "obsolete."
10988 msgstr ""
10989
10990 #. type: Plain text
10991 #: build/C/man3/tmpnam.3:91
10992 msgid ""
10993 "The B<tmpnam>()  function generates a different string each time it is "
10994 "called, up to B<TMP_MAX> times.  If it is called more than B<TMP_MAX> times, "
10995 "the behavior is implementation defined."
10996 msgstr ""
10997
10998 #. type: Plain text
10999 #: build/C/man3/tmpnam.3:110
11000 msgid ""
11001 "Although B<tmpnam>()  generates names that are difficult to guess, it is "
11002 "nevertheless possible that between the time that B<tmpnam>()  returns a "
11003 "pathname, and the time that the program opens it, another program might "
11004 "create that pathname using B<open>(2), or create it as a symbolic link.  "
11005 "This can lead to security holes.  To avoid such possibilities, use the "
11006 "B<open>(2)  B<O_EXCL> flag to open the pathname.  Or better yet, use "
11007 "B<mkstemp>(3)  or B<tmpfile>(3)."
11008 msgstr ""
11009
11010 #. type: Plain text
11011 #: build/C/man3/tmpnam.3:118
11012 msgid ""
11013 "Portable applications that use threads cannot call B<tmpnam>()  with a NULL "
11014 "argument if either B<_POSIX_THREADS> or B<_POSIX_THREAD_SAFE_FUNCTIONS> is "
11015 "defined."
11016 msgstr ""
11017
11018 #. type: Plain text
11019 #: build/C/man3/tmpnam.3:122
11020 msgid "A POSIX draft proposed to use a function B<tmpnam_r>()  defined by"
11021 msgstr ""
11022
11023 #. type: Plain text
11024 #: build/C/man3/tmpnam.3:130
11025 #, no-wrap
11026 msgid ""
11027 "char *\n"
11028 "tmpnam_r(char *s)\n"
11029 "{\n"
11030 "    return s ? tmpnam(s) : NULL;\n"
11031 "}\n"
11032 msgstr ""
11033
11034 #. type: Plain text
11035 #: build/C/man3/tmpnam.3:144
11036 msgid ""
11037 "apparently as a warning not to use NULL.  A few systems implement it.  To "
11038 "get a glibc prototype for this function from I<E<lt>stdio.hE<gt>>, define "
11039 "B<_SVID_SOURCE> or B<_BSD_SOURCE> (before including I<any> header file)."
11040 msgstr ""
11041
11042 #. type: Plain text
11043 #: build/C/man3/tmpnam.3:156
11044 msgid "B<mkstemp>(3), B<mktemp>(3), B<tempnam>(3), B<tmpfile>(3)"
11045 msgstr ""
11046
11047 #. type: TH
11048 #: build/C/man2/unlink.2:32
11049 #, no-wrap
11050 msgid "UNLINK"
11051 msgstr ""
11052
11053 #. type: TH
11054 #: build/C/man2/unlink.2:32
11055 #, no-wrap
11056 msgid "2011-09-15"
11057 msgstr ""
11058
11059 #. type: Plain text
11060 #: build/C/man2/unlink.2:35
11061 msgid "unlink - delete a name and possibly the file it refers to"
11062 msgstr ""
11063
11064 #. type: Plain text
11065 #: build/C/man2/unlink.2:39
11066 msgid "B<int unlink(const char *>I<pathname>B<);>"
11067 msgstr ""
11068
11069 #. type: Plain text
11070 #: build/C/man2/unlink.2:45
11071 msgid ""
11072 "B<unlink>()  deletes a name from the file system.  If that name was the last "
11073 "link to a file and no processes have the file open the file is deleted and "
11074 "the space it was using is made available for reuse."
11075 msgstr ""
11076
11077 #. type: Plain text
11078 #: build/C/man2/unlink.2:49
11079 msgid ""
11080 "If the name was the last link to a file but any processes still have the "
11081 "file open the file will remain in existence until the last file descriptor "
11082 "referring to it is closed."
11083 msgstr ""
11084
11085 #. type: Plain text
11086 #: build/C/man2/unlink.2:51
11087 msgid "If the name referred to a symbolic link the link is removed."
11088 msgstr ""
11089
11090 #. type: Plain text
11091 #: build/C/man2/unlink.2:55
11092 msgid ""
11093 "If the name referred to a socket, fifo or device the name for it is removed "
11094 "but processes which have the object open may continue to use it."
11095 msgstr ""
11096
11097 #. type: Plain text
11098 #: build/C/man2/unlink.2:71
11099 msgid ""
11100 "Write access to the directory containing I<pathname> is not allowed for the "
11101 "process's effective UID, or one of the directories in I<pathname> did not "
11102 "allow search permission.  (See also B<path_resolution>(7).)"
11103 msgstr ""
11104
11105 #. type: Plain text
11106 #: build/C/man2/unlink.2:80
11107 msgid ""
11108 "The file I<pathname> cannot be unlinked because it is being used by the "
11109 "system or another process; for example, it is a mount point or the NFS "
11110 "client software created it to represent an active but otherwise nameless "
11111 "inode (\"NFS silly renamed\")."
11112 msgstr ""
11113
11114 #. type: Plain text
11115 #: build/C/man2/unlink.2:92
11116 msgid ""
11117 "I<pathname> refers to a directory.  (This is the non-POSIX value returned by "
11118 "Linux since 2.1.132.)"
11119 msgstr ""
11120
11121 #. type: Plain text
11122 #: build/C/man2/unlink.2:96
11123 msgid "Too many symbolic links were encountered in translating I<pathname>."
11124 msgstr ""
11125
11126 #. type: Plain text
11127 #: build/C/man2/unlink.2:106
11128 msgid ""
11129 "A component in I<pathname> does not exist or is a dangling symbolic link, or "
11130 "I<pathname> is empty."
11131 msgstr ""
11132
11133 #. type: Plain text
11134 #: build/C/man2/unlink.2:114
11135 msgid "A component used as a directory in I<pathname> is not, in fact, a directory."
11136 msgstr ""
11137
11138 #. type: Plain text
11139 #: build/C/man2/unlink.2:123
11140 msgid ""
11141 "The system does not allow unlinking of directories, or unlinking of "
11142 "directories requires privileges that the calling process doesn't have.  "
11143 "(This is the POSIX prescribed error return; as noted above, Linux returns "
11144 "B<EISDIR> for this case.)"
11145 msgstr ""
11146
11147 #. type: TP
11148 #: build/C/man2/unlink.2:123
11149 #, no-wrap
11150 msgid "B<EPERM> (Linux only)"
11151 msgstr ""
11152
11153 #. type: Plain text
11154 #: build/C/man2/unlink.2:126
11155 msgid "The file system does not allow unlinking of files."
11156 msgstr ""
11157
11158 #. type: Plain text
11159 #: build/C/man2/unlink.2:137
11160 msgid ""
11161 "The directory containing I<pathname> has the sticky bit (B<S_ISVTX>)  set "
11162 "and the process's effective UID is neither the UID of the file to be deleted "
11163 "nor that of the directory containing it, and the process is not privileged "
11164 "(Linux: does not have the B<CAP_FOWNER> capability)."
11165 msgstr ""
11166
11167 #. type: Plain text
11168 #: build/C/man2/unlink.2:141
11169 msgid "I<pathname> refers to a file on a read-only file system."
11170 msgstr ""
11171
11172 #. type: Plain text
11173 #: build/C/man2/unlink.2:161
11174 msgid ""
11175 "B<rm>(1), B<chmod>(2), B<link>(2), B<mknod>(2), B<open>(2), B<rename>(2), "
11176 "B<rmdir>(2), B<unlinkat>(2), B<mkfifo>(3), B<remove>(3), "
11177 "B<path_resolution>(7), B<symlink>(7)"
11178 msgstr ""
11179
11180 #. type: TH
11181 #: build/C/man3/unlocked_stdio.3:23
11182 #, no-wrap
11183 msgid "UNLOCKED_STDIO"
11184 msgstr ""
11185
11186 #. type: Plain text
11187 #: build/C/man3/unlocked_stdio.3:27
11188 msgid ""
11189 "getc_unlocked, getchar_unlocked, putc_unlocked, putchar_unlocked - "
11190 "nonlocking stdio functions"
11191 msgstr ""
11192
11193 #. type: Plain text
11194 #: build/C/man3/unlocked_stdio.3:35
11195 #, no-wrap
11196 msgid ""
11197 "B<int getc_unlocked(FILE *>I<stream>B<);>\n"
11198 "B<int getchar_unlocked(void);>\n"
11199 "B<int putc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11200 "B<int putchar_unlocked(int >I<c>B<);>\n"
11201 msgstr ""
11202
11203 #. type: Plain text
11204 #: build/C/man3/unlocked_stdio.3:47
11205 #, no-wrap
11206 msgid ""
11207 "B<void clearerr_unlocked(FILE *>I<stream>B<);>\n"
11208 "B<int feof_unlocked(FILE *>I<stream>B<);>\n"
11209 "B<int ferror_unlocked(FILE *>I<stream>B<);>\n"
11210 "B<int fileno_unlocked(FILE *>I<stream>B<);>\n"
11211 "B<int fflush_unlocked(FILE *>I<stream>B<);>\n"
11212 "B<int fgetc_unlocked(FILE *>I<stream>B<);>\n"
11213 "B<int fputc_unlocked(int >I<c>B<, FILE *>I<stream>B<);>\n"
11214 "B<size_t fread_unlocked(void *>I<ptr>B<, size_t >I<size>B<, size_t "
11215 ">I<n>B<,>\n"
11216 "B<                      FILE *>I<stream>B<);>\n"
11217 "B<size_t fwrite_unlocked(const void *>I<ptr>B<, size_t >I<size>B<, size_t "
11218 ">I<n>B<,>\n"
11219 "B<                      FILE *>I<stream>B<);>\n"
11220 msgstr ""
11221
11222 #. type: Plain text
11223 #: build/C/man3/unlocked_stdio.3:50
11224 #, no-wrap
11225 msgid ""
11226 "B<char *fgets_unlocked(char *>I<s>B<, int >I<n>B<, FILE *>I<stream>B<);>\n"
11227 "B<int fputs_unlocked(const char *>I<s>B<, FILE *>I<stream>B<);>\n"
11228 msgstr ""
11229
11230 #. type: Plain text
11231 #: build/C/man3/unlocked_stdio.3:61
11232 #, no-wrap
11233 msgid ""
11234 "B<wint_t getwc_unlocked(FILE *>I<stream>B<);>\n"
11235 "B<wint_t getwchar_unlocked(void);>\n"
11236 "B<wint_t fgetwc_unlocked(FILE *>I<stream>B<);>\n"
11237 "B<wint_t fputwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11238 "B<wint_t putwc_unlocked(wchar_t >I<wc>B<, FILE *>I<stream>B<);>\n"
11239 "B<wint_t putwchar_unlocked(wchar_t >I<wc>B<);>\n"
11240 "B<wchar_t *fgetws_unlocked(wchar_t *>I<ws>B<, int >I<n>B<, FILE "
11241 "*>I<stream>B<);>\n"
11242 "B<int fputws_unlocked(const wchar_t *>I<ws>B<, FILE *>I<stream>B<);>\n"
11243 msgstr ""
11244
11245 #. type: Plain text
11246 #: build/C/man3/unlocked_stdio.3:73
11247 msgid ""
11248 "B<getc_unlocked>(), B<getchar_unlocked>(), B<putc_unlocked>(), "
11249 "B<putchar_unlocked>():"
11250 msgstr ""
11251
11252 #. type: Plain text
11253 #: build/C/man3/unlocked_stdio.3:76
11254 msgid ""
11255 "_POSIX_C_SOURCE\\ E<gt>=\\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE || "
11256 "_BSD_SOURCE || _SVID_SOURCE"
11257 msgstr ""
11258
11259 #. type: Plain text
11260 #: build/C/man3/unlocked_stdio.3:87
11261 msgid ""
11262 "B<clearerr_unlocked>(), B<feof_unlocked>(), B<ferror_unlocked>(), "
11263 "B<fileno_unlocked>(), B<fflush_unlocked>(), B<fgetc_unlocked>(), "
11264 "B<fputc_unlocked>(), B<fread_unlocked>(), B<fwrite_unlocked>():"
11265 msgstr ""
11266
11267 #. type: Plain text
11268 #: build/C/man3/unlocked_stdio.3:89
11269 msgid "_BSD_SOURCE || _SVID_SOURCE"
11270 msgstr ""
11271
11272 #. type: Plain text
11273 #: build/C/man3/unlocked_stdio.3:100
11274 msgid ""
11275 "B<fgets_unlocked>(), B<fputs_unlocked>(), B<getwc_unlocked>(), "
11276 "B<getwchar_unlocked>(), B<fgetwc_unlocked>(), B<fputwc_unlocked>(), "
11277 "B<putwchar_unlocked>(), B<fgetws_unlocked>(), B<fputws_unlocked>():"
11278 msgstr ""
11279
11280 #. type: Plain text
11281 #: build/C/man3/unlocked_stdio.3:111
11282 msgid ""
11283 "Each of these functions has the same behavior as its counterpart without the "
11284 "\"_unlocked\" suffix, except that they do not use locking (they do not set "
11285 "locks themselves, and do not test for the presence of locks set by others) "
11286 "and hence are thread-unsafe.  See B<flockfile>(3)."
11287 msgstr ""
11288
11289 #. type: Plain text
11290 #: build/C/man3/unlocked_stdio.3:118
11291 msgid ""
11292 "The four functions B<getc_unlocked>(), B<getchar_unlocked>(), "
11293 "B<putc_unlocked>(), B<putchar_unlocked>()  are in POSIX.1-2001."
11294 msgstr ""
11295
11296 #.  E.g., in HP-UX 10.0. In HP-UX 10.30 they are called obsolescent, and
11297 #.  moved to a compatibility library.
11298 #.  Available in HP-UX 10.0: clearerr_unlocked, fclose_unlocked,
11299 #.  feof_unlocked, ferror_unlocked, fflush_unlocked, fgets_unlocked,
11300 #.  fgetwc_unlocked, fgetws_unlocked, fileno_unlocked, fputs_unlocked,
11301 #.  fputwc_unlocked, fputws_unlocked, fread_unlocked, fseek_unlocked,
11302 #.  ftell_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
11303 #.  getw_unlocked, getwc_unlocked, getwchar_unlocked, putc_unlocked,
11304 #.  putchar_unlocked, puts_unlocked, putws_unlocked, putw_unlocked,
11305 #.  putwc_unlocked, putwchar_unlocked, rewind_unlocked, setvbuf_unlocked,
11306 #.  ungetc_unlocked, ungetwc_unlocked.
11307 #. type: Plain text
11308 #: build/C/man3/unlocked_stdio.3:134
11309 msgid ""
11310 "The nonstandard B<*_unlocked>()  variants occur on a few UNIX systems, and "
11311 "are available in recent glibc.  They should probably not be used."
11312 msgstr ""
11313
11314 #. type: Plain text
11315 #: build/C/man3/unlocked_stdio.3:137
11316 msgid "B<flockfile>(3), B<stdio>(3)"
11317 msgstr ""
11318
11319 #. type: TH
11320 #: build/C/man3/wprintf.3:14
11321 #, no-wrap
11322 msgid "WPRINTF"
11323 msgstr ""
11324
11325 #. type: TH
11326 #: build/C/man3/wprintf.3:14
11327 #, no-wrap
11328 msgid "2011-09-17"
11329 msgstr ""
11330
11331 #. type: Plain text
11332 #: build/C/man3/wprintf.3:18
11333 msgid ""
11334 "wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf - formatted "
11335 "wide-character output conversion"
11336 msgstr ""
11337
11338 #. type: Plain text
11339 #: build/C/man3/wprintf.3:22
11340 #, no-wrap
11341 msgid ""
11342 "B<#include E<lt>stdio.hE<gt>>\n"
11343 "B<#include E<lt>wchar.hE<gt>>\n"
11344 msgstr ""
11345
11346 #. type: Plain text
11347 #: build/C/man3/wprintf.3:27
11348 #, no-wrap
11349 msgid ""
11350 "B<int wprintf(const wchar_t *>I<format>B<, ...);>\n"
11351 "B<int fwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, ...);>\n"
11352 "B<int swprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11353 "B<             const wchar_t *>I<format>B<, ...);>\n"
11354 msgstr ""
11355
11356 #. type: Plain text
11357 #: build/C/man3/wprintf.3:32
11358 #, no-wrap
11359 msgid ""
11360 "B<int vwprintf(const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11361 "B<int vfwprintf(FILE *>I<stream>B<, const wchar_t *>I<format>B<, va_list "
11362 ">I<args>B<);>\n"
11363 "B<int vswprintf(wchar_t *>I<wcs>B<, size_t >I<maxlen>B<,>\n"
11364 "B<              const wchar_t *>I<format>B<, va_list >I<args>B<);>\n"
11365 msgstr ""
11366
11367 #.  .BR wprintf (),
11368 #.  .BR fwprintf (),
11369 #.  .BR swprintf (),
11370 #.  .BR vwprintf (),
11371 #.  .BR vfwprintf (),
11372 #.  .BR vswprintf ():
11373 #. type: Plain text
11374 #: build/C/man3/wprintf.3:49
11375 msgid "_XOPEN_SOURCE\\ E<gt>=\\ 500 || _ISOC99_SOURCE ||"
11376 msgstr ""
11377
11378 #. type: Plain text
11379 #: build/C/man3/wprintf.3:51
11380 msgid "_ISOC95_SOURCE /* Since glibc 2.12 */ ||"
11381 msgstr ""
11382
11383 #. type: Plain text
11384 #: build/C/man3/wprintf.3:53
11385 msgid "_POSIX_C_SOURCE\\ E<gt>=\\ 200112L;"
11386 msgstr ""
11387
11388 #. type: Plain text
11389 #: build/C/man3/wprintf.3:56
11390 msgid "or I<cc\\ -std=c99>"
11391 msgstr ""
11392
11393 #. type: Plain text
11394 #: build/C/man3/wprintf.3:67
11395 msgid ""
11396 "The B<wprintf>()  family of functions is the wide-character equivalent of "
11397 "the B<printf>(3)  family of functions.  It performs formatted output of wide "
11398 "characters."
11399 msgstr ""
11400
11401 #. type: Plain text
11402 #: build/C/man3/wprintf.3:77
11403 msgid ""
11404 "The B<wprintf>()  and B<vwprintf>()  functions perform wide-character output "
11405 "to I<stdout>.  I<stdout> must not be byte oriented; see B<fwide>(3)  for "
11406 "more information."
11407 msgstr ""
11408
11409 #. type: Plain text
11410 #: build/C/man3/wprintf.3:87
11411 msgid ""
11412 "The B<fwprintf>()  and B<vfwprintf>()  functions perform wide-character "
11413 "output to I<stream>.  I<stream> must not be byte oriented; see B<fwide>(3)  "
11414 "for more information."
11415 msgstr ""
11416
11417 #. type: Plain text
11418 #: build/C/man3/wprintf.3:98
11419 msgid ""
11420 "The B<swprintf>()  and B<vswprintf>()  functions perform wide-character "
11421 "output to an array of wide characters.  The programmer must ensure that "
11422 "there is room for at least I<maxlen> wide characters at I<wcs>."
11423 msgstr ""
11424
11425 #. type: Plain text
11426 #: build/C/man3/wprintf.3:109
11427 msgid ""
11428 "These functions are like the B<printf>(3), B<vprintf>(3), B<fprintf>(3), "
11429 "B<vfprintf>(3), B<sprintf>(3), B<vsprintf>(3)  functions except for the "
11430 "following differences:"
11431 msgstr ""
11432
11433 #. type: TP
11434 #: build/C/man3/wprintf.3:109 build/C/man3/wprintf.3:112 build/C/man3/wprintf.3:115
11435 #, no-wrap
11436 msgid "B<\\(bu>"
11437 msgstr ""
11438
11439 #. type: Plain text
11440 #: build/C/man3/wprintf.3:112
11441 msgid "The I<format> string is a wide-character string."
11442 msgstr ""
11443
11444 #. type: Plain text
11445 #: build/C/man3/wprintf.3:115
11446 msgid "The output consists of wide characters, not bytes."
11447 msgstr ""
11448
11449 #. type: Plain text
11450 #: build/C/man3/wprintf.3:130
11451 msgid ""
11452 "B<swprintf>()  and B<vswprintf>()  take a I<maxlen> argument, B<sprintf>(3)  "
11453 "and B<vsprintf>(3)  do not.  (B<snprintf>(3)  and B<vsnprintf>(3)  take a "
11454 "I<maxlen> argument, but these functions do not return -1 upon buffer "
11455 "overflow on Linux.)"
11456 msgstr ""
11457
11458 #. type: Plain text
11459 #: build/C/man3/wprintf.3:132
11460 msgid "The treatment of the conversion characters B<c> and B<s> is different:"
11461 msgstr ""
11462
11463 #. type: Plain text
11464 #: build/C/man3/wprintf.3:146
11465 msgid ""
11466 "If no B<l> modifier is present, the I<int> argument is converted to a wide "
11467 "character by a call to the B<btowc>(3)  function, and the resulting wide "
11468 "character is written.  If an B<l> modifier is present, the I<wint_t> (wide "
11469 "character) argument is written."
11470 msgstr ""
11471
11472 #. type: Plain text
11473 #: build/C/man3/wprintf.3:185
11474 msgid ""
11475 "If no B<l> modifier is present: The I<const\\ char\\ *> argument is expected "
11476 "to be a pointer to an array of character type (pointer to a string) "
11477 "containing a multibyte character sequence beginning in the initial shift "
11478 "state.  Characters from the array are converted to wide characters (each by "
11479 "a call to the B<mbrtowc>(3)  function with a conversion state starting in "
11480 "the initial state before the first byte).  The resulting wide characters are "
11481 "written up to (but not including) the terminating null wide character.  If a "
11482 "precision is specified, no more wide characters than the number specified "
11483 "are written.  Note that the precision determines the number of I<wide "
11484 "characters> written, not the number of I<bytes> or I<screen positions>.  The "
11485 "array must contain a terminating null byte, unless a precision is given and "
11486 "it is so small that the number of converted wide characters reaches it "
11487 "before the end of the array is reached.  If an B<l> modifier is present: The "
11488 "I<const\\ wchar_t\\ *> argument is expected to be a pointer to an array of "
11489 "wide characters.  Wide characters from the array are written up to (but not "
11490 "including) a terminating null wide character.  If a precision is specified, "
11491 "no more than the number specified are written.  The array must contain a "
11492 "terminating null wide character, unless a precision is given and it is "
11493 "smaller than or equal to the number of wide characters in the array."
11494 msgstr ""
11495
11496 #. type: Plain text
11497 #: build/C/man3/wprintf.3:193
11498 msgid ""
11499 "The functions return the number of wide characters written, excluding the "
11500 "terminating null wide character in case of the functions B<swprintf>()  and "
11501 "B<vswprintf>().  They return -1 when an error occurs."
11502 msgstr ""
11503
11504 #. type: Plain text
11505 #: build/C/man3/wprintf.3:195
11506 msgid "C99."
11507 msgstr ""
11508
11509 #. type: Plain text
11510 #: build/C/man3/wprintf.3:203
11511 msgid ""
11512 "The behavior of B<wprintf>()  et al. depends on the B<LC_CTYPE> category of "
11513 "the current locale."
11514 msgstr ""
11515
11516 #. type: Plain text
11517 #: build/C/man3/wprintf.3:229
11518 msgid ""
11519 "If the I<format> string contains non-ASCII wide characters, the program will "
11520 "only work correctly if the B<LC_CTYPE> category of the current locale at run "
11521 "time is the same as the B<LC_CTYPE> category of the current locale at "
11522 "compile time.  This is because the I<wchar_t> representation is platform- "
11523 "and locale-dependent.  (The glibc represents wide characters using their "
11524 "Unicode (ISO-10646) code point, but other platforms don't do this.  Also, "
11525 "the use of C99 universal character names of the form \\eunnnn does not solve "
11526 "this problem.)  Therefore, in internationalized programs, the I<format> "
11527 "string should consist of ASCII wide characters only, or should be "
11528 "constructed at run time in an internationalized way (e.g., using "
11529 "B<gettext>(3)  or B<iconv>(3), followed by B<mbstowcs>(3))."
11530 msgstr ""
11531
11532 #.  .BR wscanf (3)
11533 #. type: Plain text
11534 #: build/C/man3/wprintf.3:236
11535 msgid "B<fprintf>(3), B<fputwc>(3), B<fwide>(3), B<printf>(3), B<snprintf>(3)"
11536 msgstr ""
11537
11538 #. type: TH
11539 #: build/C/man2/write.2:39
11540 #, no-wrap
11541 msgid "WRITE"
11542 msgstr ""
11543
11544 #. type: TH
11545 #: build/C/man2/write.2:39
11546 #, no-wrap
11547 msgid "2010-08-29"
11548 msgstr ""
11549
11550 #. type: Plain text
11551 #: build/C/man2/write.2:42
11552 msgid "write - write to a file descriptor"
11553 msgstr ""
11554
11555 #. type: Plain text
11556 #: build/C/man2/write.2:46
11557 msgid "B<ssize_t write(int >I<fd>B<, const void *>I<buf>B<, size_t >I<count>B<);>"
11558 msgstr ""
11559
11560 #. type: Plain text
11561 #: build/C/man2/write.2:54
11562 msgid ""
11563 "B<write>()  writes up to I<count> bytes from the buffer pointed I<buf> to "
11564 "the file referred to by the file descriptor I<fd>."
11565 msgstr ""
11566
11567 #. type: Plain text
11568 #: build/C/man2/write.2:68
11569 msgid ""
11570 "The number of bytes written may be less than I<count> if, for example, there "
11571 "is insufficient space on the underlying physical medium, or the "
11572 "B<RLIMIT_FSIZE> resource limit is encountered (see B<setrlimit>(2)), or the "
11573 "call was interrupted by a signal handler after having written less than "
11574 "I<count> bytes.  (See also B<pipe>(7).)"
11575 msgstr ""
11576
11577 #. type: Plain text
11578 #: build/C/man2/write.2:82
11579 msgid ""
11580 "For a seekable file (i.e., one to which B<lseek>(2)  may be applied, for "
11581 "example, a regular file)  writing takes place at the current file offset, "
11582 "and the file offset is incremented by the number of bytes actually written.  "
11583 "If the file was B<open>(2)ed with B<O_APPEND>, the file offset is first set "
11584 "to the end of the file before writing.  The adjustment of the file offset "
11585 "and the write operation are performed as an atomic step."
11586 msgstr ""
11587
11588 #. type: Plain text
11589 #: build/C/man2/write.2:89
11590 msgid ""
11591 "POSIX requires that a B<read>(2)  which can be proved to occur after a "
11592 "B<write>()  has returned returns the new data.  Note that not all file "
11593 "systems are POSIX conforming."
11594 msgstr ""
11595
11596 #. type: Plain text
11597 #: build/C/man2/write.2:94
11598 msgid ""
11599 "On success, the number of bytes written is returned (zero indicates nothing "
11600 "was written).  On error, -1 is returned, and I<errno> is set appropriately."
11601 msgstr ""
11602
11603 #. type: Plain text
11604 #: build/C/man2/write.2:107
11605 msgid ""
11606 "If I<count> is zero and I<fd> refers to a regular file, then B<write>()  may "
11607 "return a failure status if one of the errors below is detected.  If no "
11608 "errors are detected, 0 will be returned without causing any other effect.  "
11609 "If I<count> is zero and I<fd> refers to a file other than a regular file, "
11610 "the results are not specified."
11611 msgstr ""
11612
11613 #. type: Plain text
11614 #: build/C/man2/write.2:115
11615 msgid ""
11616 "The file descriptor I<fd> refers to a file other than a socket and has been "
11617 "marked nonblocking (B<O_NONBLOCK>), and the write would block."
11618 msgstr ""
11619
11620 #.  Actually EAGAIN on Linux
11621 #. type: Plain text
11622 #: build/C/man2/write.2:126
11623 msgid ""
11624 "The file descriptor I<fd> refers to a socket and has been marked nonblocking "
11625 "(B<O_NONBLOCK>), and the write would block.  POSIX.1-2001 allows either "
11626 "error to be returned for this case, and does not require these constants to "
11627 "have the same value, so a portable application should check for both "
11628 "possibilities."
11629 msgstr ""
11630
11631 #. type: Plain text
11632 #: build/C/man2/write.2:130
11633 msgid "I<fd> is not a valid file descriptor or is not open for writing."
11634 msgstr ""
11635
11636 #. type: TP
11637 #: build/C/man2/write.2:130
11638 #, no-wrap
11639 msgid "B<EDESTADDRREQ>"
11640 msgstr ""
11641
11642 #. type: Plain text
11643 #: build/C/man2/write.2:135
11644 msgid ""
11645 "I<fd> refers to a datagram socket for which a peer address has not been set "
11646 "using B<connect>(2)."
11647 msgstr ""
11648
11649 #. type: Plain text
11650 #: build/C/man2/write.2:144
11651 msgid ""
11652 "An attempt was made to write a file that exceeds the implementation-defined "
11653 "maximum file size or the process's file size limit, or to write at a "
11654 "position past the maximum allowed offset."
11655 msgstr ""
11656
11657 #. type: Plain text
11658 #: build/C/man2/write.2:148
11659 msgid ""
11660 "The call was interrupted by a signal before any data was written; see "
11661 "B<signal>(7)."
11662 msgstr ""
11663
11664 #. type: Plain text
11665 #: build/C/man2/write.2:159
11666 msgid ""
11667 "I<fd> is attached to an object which is unsuitable for writing; or the file "
11668 "was opened with the B<O_DIRECT> flag, and either the address specified in "
11669 "I<buf>, the value specified in I<count>, or the current file offset is not "
11670 "suitably aligned."
11671 msgstr ""
11672
11673 #. type: Plain text
11674 #: build/C/man2/write.2:162
11675 msgid "A low-level I/O error occurred while modifying the inode."
11676 msgstr ""
11677
11678 #. type: Plain text
11679 #: build/C/man2/write.2:167
11680 msgid ""
11681 "The device containing the file referred to by I<fd> has no room for the "
11682 "data."
11683 msgstr ""
11684
11685 #. type: TP
11686 #: build/C/man2/write.2:167
11687 #, no-wrap
11688 msgid "B<EPIPE>"
11689 msgstr ""
11690
11691 #. type: Plain text
11692 #: build/C/man2/write.2:176
11693 msgid ""
11694 "I<fd> is connected to a pipe or socket whose reading end is closed.  When "
11695 "this happens the writing process will also receive a B<SIGPIPE> signal.  "
11696 "(Thus, the write return value is seen only if the program catches, blocks or "
11697 "ignores this signal.)"
11698 msgstr ""
11699
11700 #. type: Plain text
11701 #: build/C/man2/write.2:179
11702 msgid "Other errors may occur, depending on the object connected to I<fd>."
11703 msgstr ""
11704
11705 #. type: Plain text
11706 #: build/C/man2/write.2:188
11707 msgid ""
11708 "Under SVr4 a write may be interrupted and return B<EINTR> at any point, not "
11709 "just before any data is written."
11710 msgstr ""
11711
11712 #. type: Plain text
11713 #: build/C/man2/write.2:197
11714 msgid ""
11715 "A successful return from B<write>()  does not make any guarantee that data "
11716 "has been committed to disk.  In fact, on some buggy implementations, it does "
11717 "not even guarantee that space has successfully been reserved for the data.  "
11718 "The only way to be sure is to call B<fsync>(2)  after you are done writing "
11719 "all your data."
11720 msgstr ""
11721
11722 #. type: Plain text
11723 #: build/C/man2/write.2:205
11724 msgid ""
11725 "If a B<write>()  is interrupted by a signal handler before any bytes are "
11726 "written, then the call fails with the error B<EINTR>; if it is interrupted "
11727 "after at least one byte has been written, the call succeeds, and returns the "
11728 "number of bytes written."
11729 msgstr ""
11730
11731 #. type: Plain text
11732 #: build/C/man2/write.2:217
11733 msgid ""
11734 "B<close>(2), B<fcntl>(2), B<fsync>(2), B<ioctl>(2), B<lseek>(2), B<open>(2), "
11735 "B<pwrite>(2), B<read>(2), B<select>(2), B<writev>(2), B<fwrite>(3)"
11736 msgstr ""